* { box-sizing: border-box; }
:root {
    --bg: #0b1220;
    --bg-soft: #101a2d;
    --panel: rgba(20, 29, 49, 0.9);
    --line: rgba(255,255,255,0.08);
    --text: #eef2ff;
    --muted: #94a3b8;
    --accent: #4f46e5;
    --accent-2: #06b6d4;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow: 0 20px 50px rgba(0,0,0,.25);
    --radius: 22px;
}
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(79,70,229,.25), transparent 30%),
        radial-gradient(circle at top right, rgba(6,182,212,.15), transparent 20%),
        linear-gradient(180deg, #070d18 0%, #0b1220 100%);
    font-family: Inter, Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
h1,h2,h3,p { margin-top: 0; }
code {
    background: rgba(255,255,255,.06);
    padding: 2px 8px;
    border-radius: 8px;
}
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.login-shell {
    width: min(100%, 460px);
}
.login-card {
    background: rgba(13, 21, 37, .92);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 32px;
    box-shadow: var(--shadow);
}
.brand-badge {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(79,70,229,.16);
    color: #c7d2fe;
    font-size: 13px;
    margin-bottom: 18px;
}
.login-form {
    display: grid;
    gap: 10px;
    margin-top: 22px;
}
.login-hint {
    margin-top: 20px;
    color: var(--muted);
    font-size: 14px;
}
.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px;
    background: rgba(7, 13, 24, .75);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    font-size: 20px;
}
.sidebar-nav {
    display: grid;
    gap: 8px;
}
.sidebar-nav a {
    padding: 12px 14px;
    border-radius: 14px;
    color: #dbeafe;
    transition: .2s ease;
}
.sidebar-nav a:hover {
    background: rgba(255,255,255,.06);
    transform: translateX(4px);
}
.sidebar-card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--line);
}
.main-content {
    padding: 28px;
}
.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 22px;
}
.cards-grid {
    display: grid;
    gap: 20px;
}
.summary-grid {
    grid-template-columns: repeat(4, minmax(0,1fr));
    margin-bottom: 22px;
}
.two-col {
    grid-template-columns: repeat(2, minmax(0,1fr));
    margin-bottom: 22px;
}
.panel, .stat-card, .sub-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.panel {
    padding: 22px;
}
.panel.wide { margin-bottom: 22px; }
.sub-panel {
    padding: 20px;
}
.stat-card {
    padding: 18px;
}
.stat-label {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}
.panel-header, .item-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}
.stack {
    display: grid;
    gap: 12px;
}
.form-row, .inline-form, .admin-actions, .topbar-actions, .item-actions, .tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.list {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}
.item-card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
}
.note-card .note-content {
    margin-top: 12px;
    color: #dbeafe;
    line-height: 1.6;
}
.empty {
    border: 1px dashed rgba(255,255,255,.12);
    border-radius: 16px;
    padding: 18px;
    color: var(--muted);
    text-align: center;
}
input, textarea, select {
    width: 100%;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(255,255,255,.04);
    color: var(--text);
    outline: none;
}
textarea { min-height: 110px; resize: vertical; }
.quick-textarea { min-height: 150px; }
input:focus, textarea:focus, select:focus, .rich-editor:focus {
    border-color: rgba(79,70,229,.75);
    box-shadow: 0 0 0 4px rgba(79,70,229,.12);
}
.btn {
    border: none;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 14px;
    font-weight: 700;
    transition: .18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #6366f1); color: white; }
.btn.ghost { background: rgba(255,255,255,.05); color: white; border: 1px solid rgba(255,255,255,.08); }
.btn.danger { background: rgba(239,68,68,.16); color: #fecaca; border: 1px solid rgba(239,68,68,.25); }
.btn.success { background: rgba(34,197,94,.16); color: #dcfce7; border: 1px solid rgba(34,197,94,.25); }
.btn.full { width: 100%; }
.btn.tiny { padding: 8px 10px; border-radius: 10px; font-size: 12px; }
.alert {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,.08);
}
.alert.success { background: rgba(34,197,94,.12); color: #dcfce7; }
.alert.error { background: rgba(239,68,68,.12); color: #fee2e2; }
.muted { color: var(--muted); font-size: 14px; }
.chip {
    display: inline-flex;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
}
.progress {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    overflow: hidden;
    margin: 10px 0;
}
.progress > div {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.tag {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.tag.alta { background: rgba(239,68,68,.16); color: #fecaca; }
.tag.media, .tag.warning { background: rgba(245,158,11,.16); color: #fde68a; }
.tag.baixa { background: rgba(34,197,94,.16); color: #dcfce7; }
.tag.neutral { background: rgba(255,255,255,.06); color: #e2e8f0; }
.tag.success { background: rgba(34,197,94,.16); color: #dcfce7; }
.checkbox-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}
.checkbox-line input {
    width: auto;
    margin: 0;
}
.editor-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.editor-toolbar button {
    background: rgba(255,255,255,.05);
    color: white;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    padding: 8px 12px;
    cursor: pointer;
}
.rich-editor {
    min-height: 220px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.09);
    background: rgba(255,255,255,.04);
    overflow: auto;
}
.rich-editor:empty:before {
    content: attr(data-placeholder);
    color: #64748b;
}
.admin-actions {
    margin-top: 18px;
}
@media (max-width: 1080px) {
    .summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: relative;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }
    .two-col, .summary-grid { grid-template-columns: 1fr; }
    .main-content { padding: 18px; }
    .topbar { flex-direction: column; }
}
