@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-base:      #0a0a0f;
    --bg-surface:   #111118;
    --bg-elevated:  #18181f;
    --bg-hover:     #1e1e28;
    --border:       rgba(255,255,255,0.07);
    --border-strong:rgba(255,255,255,0.14);
    --accent:       #6c63ff;
    --accent-glow:  rgba(108,99,255,0.25);
    --accent-soft:  rgba(108,99,255,0.12);
    --green:        #22c997;
    --green-soft:   rgba(34,201,151,0.12);
    --amber:        #f59e0b;
    --amber-soft:   rgba(245,158,11,0.12);
    --red:          #f04747;
    --red-soft:     rgba(240,71,71,0.12);
    --blue:         #3b9eff;
    --blue-soft:    rgba(59,158,255,0.12);
    --text-primary: #f0f0f8;
    --text-secondary:#9494b0;
    --text-muted:   #55556a;
    --sidebar-w:    240px;
    --radius:       10px;
    --radius-lg:    14px;
    --font:         'Syne', sans-serif;
    --font-mono:    'DM Mono', monospace;
}

html, body { height: 100%; background: var(--bg-base); color: var(--text-primary); font-family: var(--font); font-size: 14px; line-height: 1.6; }

/* ── LAYOUT ── */
.admin-layout { display: flex; min-height: 100vh; }
.main-content { flex: 1; margin-left: var(--sidebar-w); padding: 32px; max-width: calc(100vw - var(--sidebar-w)); overflow-x: hidden; }

/* ── SIDEBAR ── */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    z-index: 100;
}

.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--border);
}
.brand-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px;
    box-shadow: 0 0 20px var(--accent-glow);
}
.brand-name { display: block; font-weight: 600; font-size: 15px; letter-spacing: 0.02em; }
.brand-version { display: block; font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }

/* ── Versículo ─────────────────────────────────────────────── */
.sidebar-verse {
    margin: 14px 14px 6px;
    padding: 11px 13px;
    border-radius: var(--radius-lg);
    background: rgba(180,107,78,.09);
    border: 1px solid rgba(180,107,78,.2);
    border-left: 3px solid var(--terracota);
}
.verse-icon {
    font-size: 11px;
    color: var(--terracota);
    opacity: .65;
    display: block;
    margin-bottom: 6px;
    letter-spacing: .15em;
}
.verse-text {
    display: block;
    font-size: 10.5px;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.6;
    margin: 0 0 6px;
}
.verse-ref {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--ouro);
    letter-spacing: .05em;
    text-align: right;
}

/* ── Nav ───────────────────────────────────────────────────── */
.sidebar-nav { flex: 1; padding: 10px 12px 16px; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }

.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: var(--radius);
    color: var(--text-secondary); text-decoration: none;
    font-size: 13.5px; font-weight: 500;
    transition: all 0.15s ease;
    position: relative;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; transition: all 0.15s; }
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
    background: var(--accent-soft);
    color: #a8a3ff;
}
.nav-item.active::before {
    content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
    width: 3px; border-radius: 0 3px 3px 0;
    background: var(--accent);
}
.nav-item.active svg { color: var(--accent); }

/* ── Submenu "+ Novo" ──────────────────────────────────────── */
.nav-group { display: flex; flex-direction: column; }
.nav-sub {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 10px 5px 40px;
    border-radius: var(--radius);
    color: var(--text-muted); text-decoration: none;
    font-size: 12px; font-weight: 400;
    transition: all 0.15s ease;
    position: relative;
}
.nav-sub::before {
    content: '';
    position: absolute;
    left: 20px; top: 0; bottom: 0;
    width: 1px;
    background: var(--border);
}
.nav-sub:last-child::before { bottom: 50%; }
.nav-sub::after {
    content: '';
    position: absolute;
    left: 20px; top: 50%;
    width: 8px; height: 1px;
    background: var(--border);
}
.nav-sub:hover { color: var(--text-primary); }
.nav-sub:hover::before, .nav-sub:hover::after { background: var(--terracota); }
.nav-sub-label {
    display: flex; align-items: center; gap: 5px;
}
.nav-sub-label .plus {
    font-size: 14px; line-height: 1;
    color: var(--text-muted);
    transition: color .15s;
}
.nav-sub:hover .plus { color: var(--terracota); }

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 8px;
}
.user-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.user-avatar {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--accent-soft); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 13px; flex-shrink: 0;
}
.user-email { display: block; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { display: block; font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.logout-btn {
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); text-decoration: none;
    transition: all 0.15s;
}
.logout-btn:hover { background: var(--red-soft); color: var(--red); }
.logout-btn svg { width: 16px; height: 16px; }

/* ── PAGE HEADER ── */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.page-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ── STAT CARDS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat-card {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px;
    position: relative; overflow: hidden;
    transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--border-strong); }
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
}
.stat-card.purple::before { background: var(--accent); }
.stat-card.green::before  { background: var(--green); }
.stat-card.amber::before  { background: var(--amber); }
.stat-card.blue::before   { background: var(--blue); }
.stat-card.red::before    { background: var(--red); }
.stat-icon { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.stat-icon svg { width: 18px; height: 18px; }
.stat-card.purple .stat-icon { background: var(--accent-soft); color: var(--accent); }
.stat-card.green  .stat-icon { background: var(--green-soft);  color: var(--green);  }
.stat-card.amber  .stat-icon { background: var(--amber-soft);  color: var(--amber);  }
.stat-card.blue   .stat-icon { background: var(--blue-soft);   color: var(--blue);   }
.stat-card.red    .stat-icon { background: var(--red-soft);    color: var(--red);    }
.stat-number { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; font-family: var(--font-mono); line-height: 1; margin-bottom: 4px; }
.stat-label  { font-size: 12px; color: var(--text-secondary); font-weight: 500; }

/* ── CARDS / PANELS ── */
.card {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
    margin-bottom: 20px;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 14px; font-weight: 600; }
.card-body  { padding: 20px; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
    text-align: left; padding: 10px 16px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--text-muted); border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-hover); }

/* ── BADGES ── */
.badge {
    display: inline-flex; align-items: center;
    padding: 3px 9px; border-radius: 6px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
    font-family: var(--font-mono);
}
.badge-green  { background: var(--green-soft);  color: var(--green);  }
.badge-amber  { background: var(--amber-soft);  color: var(--amber);  }
.badge-red    { background: var(--red-soft);    color: var(--red);    }
.badge-purple { background: var(--accent-soft); color: #a8a3ff;       }
.badge-blue   { background: var(--blue-soft);   color: var(--blue);   }
.badge-gray   { background: var(--bg-hover);    color: var(--text-secondary); }

/* ── BUTTONS ── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius);
    font-family: var(--font); font-size: 13px; font-weight: 500;
    cursor: pointer; border: none; text-decoration: none;
    transition: all 0.15s;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 0 16px var(--accent-glow); }
.btn-primary:hover { opacity: 0.88; }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-strong); }
.btn-danger { background: var(--red-soft); color: var(--red); border: 1px solid rgba(240,71,71,0.2); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 12px; }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; letter-spacing: 0.04em; text-transform: uppercase; }
.form-control {
    width: 100%; padding: 9px 12px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text-primary);
    font-family: var(--font); font-size: 13.5px;
    transition: border-color 0.15s;
    outline: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control option { background: var(--bg-elevated); }
textarea.form-control { resize: vertical; min-height: 100px; }

/* ── ALERTS ── */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; margin-bottom: 18px; border-left: 3px solid; }
.alert-success { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.alert-error   { background: var(--red-soft);   color: var(--red);   border-color: var(--red);   }
.alert-info    { background: var(--blue-soft);  color: var(--blue);  border-color: var(--blue);  }

/* ── PAGINATION ── */
.pagination { display: flex; align-items: center; gap: 4px; padding: 16px 20px; border-top: 1px solid var(--border); }
.page-btn {
    min-width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 500; cursor: pointer;
    border: 1px solid var(--border); background: transparent; color: var(--text-secondary);
    text-decoration: none; transition: all 0.15s;
}
.page-btn:hover   { background: var(--bg-hover); color: var(--text-primary); }
.page-btn.active  { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── AVATAR ── */
.avatar { width: 32px; height: 32px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; }

/* ── LOGIN PAGE ── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-base); }
.login-card  { width: 380px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px; }
.login-logo  { text-align: center; margin-bottom: 32px; }
.login-logo .brand-icon { margin: 0 auto 12px; width: 48px; height: 48px; font-size: 20px; }
.login-logo h1 { font-size: 20px; font-weight: 600; }
.login-logo p  { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* ── UTILITIES ── */
.flex         { display: flex; }
.items-center { align-items: center; }
.gap-2        { gap: 8px; }
.gap-3        { gap: 12px; }
.ml-auto      { margin-left: auto; }
.text-muted   { color: var(--text-secondary); }
.text-sm      { font-size: 12px; }
.text-mono    { font-family: var(--font-mono); }
.w-full       { width: 100%; }
.mt-4         { margin-top: 16px; }
.truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── ANIMATIONS ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.main-content { animation: fadeIn 0.2s ease; }
