/* ============================================================
   Notary — Design System
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* ── Brand ── */
    --navy:           #0f2040;
    --navy-mid:       #1a3560;
    --navy-light:     #1e4480;
    --gold:           #c9a84c;
    --gold-dark:      #a8883c;
    --gold-light:     #f5e9c8;
    --gold-subtle:    rgba(201,168,76,0.12);

    /* ── Surfaces ── */
    --bg-page:        #f4f6fb;
    --bg-surface:     #ffffff;
    --bg-surface-2:   #f8faff;
    --bg-sidebar:     #0a1628;
    --bg-sidebar-2:   #0f1e35;

    /* ── Text ── */
    --text-1:         #0f172a;
    --text-2:         #4b5563;
    --text-3:         #9ca3af;
    --text-inv:       #ffffff;

    /* ── Borders ── */
    --border:         #e2e8f0;
    --border-light:   #f1f5f9;

    /* ── Semantic ── */
    --clr-ok:         #059669;
    --clr-ok-bg:      #ecfdf5;
    --clr-ok-border:  #6ee7b7;
    --clr-err:        #dc2626;
    --clr-err-bg:     #fef2f2;
    --clr-err-border: #fca5a5;
    --clr-warn:       #d97706;
    --clr-warn-bg:    #fffbeb;
    --clr-warn-border:#fcd34d;
    --clr-info-bg:    #eff6ff;
    --clr-info-border:#bfdbfe;

    /* ── Layout ── */
    --sidebar-w:      240px;
    --topbar-h:       56px;

    /* ── Radii ── */
    --r-sm:  6px;
    --r:     8px;
    --r-lg: 12px;
    --r-xl: 16px;

    /* ── Shadows ── */
    --sh-xs: 0 1px 2px rgba(0,0,0,.05);
    --sh-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --sh:    0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);
    --sh-md: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
    --sh-lg: 0 20px 25px -5px rgba(0,0,0,.12), 0 10px 10px -5px rgba(0,0,0,.06);

    /* ── Compat aliases (used in Razor views) ── */
    --cor-primaria:     var(--navy);
    --cor-accent:       var(--gold);
    --cor-fundo:        var(--bg-page);
    --cor-branco:       var(--bg-surface);
    --cor-texto:        var(--text-1);
    --cor-texto-suave:  var(--text-2);
    --cor-borda:        var(--border);
    --cor-sucesso:      var(--clr-ok);
    --cor-alerta:       var(--clr-err);
    --cor-aviso:        var(--clr-warn);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-page);
    color: var(--text-1);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--navy-mid); text-decoration: none; transition: color .15s; }
a:hover { color: var(--navy); }

/* ── LAYOUT ─────────────────────────────────────────────────── */
.layout-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
}

.sidebar-logo {
    padding: 20px 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    border-radius: var(--r);
    display: flex; align-items: center; justify-content: center;
    font-family: Georgia, serif;
    font-size: 17px; font-weight: bold; color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(201,168,76,.35);
}

.sidebar-logo-text { line-height: 1.3; }
.sidebar-logo-text strong {
    display: block;
    font-size: 13.5px; font-weight: 600; color: #fff;
    letter-spacing: -.01em;
}
.sidebar-logo-text small {
    font-size: 11px; color: rgba(255,255,255,.38);
    letter-spacing: .02em;
}

.sidebar-nav { flex: 1; padding: 10px 10px; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }

.nav-secao {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: rgba(255,255,255,.28);
    padding: 14px 10px 6px;
    font-weight: 600;
}

.sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border-radius: var(--r-sm);
    color: rgba(255,255,255,.6);
    font-size: 13.5px; font-weight: 500;
    transition: background .15s, color .15s;
    margin-bottom: 2px;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); text-decoration: none; }
.sidebar-nav a.ativo  { background: var(--gold-subtle); color: var(--gold); text-decoration: none; }

.nav-icon { width: 17px; height: 17px; flex-shrink: 0; opacity: .75; }
.sidebar-nav a.ativo .nav-icon { opacity: 1; }

.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid rgba(255,255,255,.07);
}
.sidebar-footer-user {
    display: flex; align-items: center; gap: 10px;
}
.sidebar-footer-avatar {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, var(--navy-mid), var(--navy-light));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.85); font-size: 11px; font-weight: 600;
    flex-shrink: 0;
    border: 1.5px solid rgba(255,255,255,.12);
}
.sidebar-footer-info { flex: 1; min-width: 0; }
.sidebar-footer-info span {
    display: block; font-size: 12px; font-weight: 500;
    color: rgba(255,255,255,.75);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-footer-logout {
    background: none; border: none;
    color: rgba(255,255,255,.28);
    cursor: pointer; font-size: 11px; font-family: inherit;
    padding: 0; display: flex; align-items: center; gap: 4px;
    transition: color .15s; margin-top: 1px;
}
.sidebar-footer-logout:hover { color: rgba(255,255,255,.65); }

/* Main */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1; display: flex; flex-direction: column; min-height: 100vh;
}

.topbar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    height: var(--topbar-h);
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
    box-shadow: var(--sh-xs);
}
.topbar-titulo {
    font-size: 15px; font-weight: 600; color: var(--text-1);
    letter-spacing: -.015em;
}
.topbar-usuario {
    font-size: 12.5px; color: var(--text-2);
    display: flex; align-items: center; gap: 10px;
}
.topbar-badge {
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 12px 3px 8px;
    display: flex; align-items: center; gap: 7px;
    font-size: 12px; font-weight: 500; color: var(--text-2);
}
.topbar-badge-avatar {
    width: 22px; height: 22px;
    background: linear-gradient(135deg, var(--navy-mid), var(--navy-light));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 10px; font-weight: 600;
}

.content-area { padding: 32px; flex: 1; }

/* ── TIPOGRAFIA ─────────────────────────────────────────────── */
h1 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 22px; font-weight: normal;
    color: var(--text-1);
    letter-spacing: -.025em;
    margin-bottom: 24px;
}
h2 { font-size: 17px; font-weight: 600; color: var(--text-1); letter-spacing: -.015em; margin-bottom: 16px; }
h3 { font-size: 14px; font-weight: 600; color: var(--text-1); margin-bottom: 12px; }

/* ── CARDS ──────────────────────────────────────────────────── */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--sh-sm);
}
.card-titulo {
    font-size: 11px; font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase; letter-spacing: .08em;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 12px; margin-bottom: 18px;
}

.cards-resumo {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px; margin-bottom: 28px;
}

.card-num {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px 22px 18px;
    box-shadow: var(--sh-sm);
    position: relative; overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
.card-num:hover { box-shadow: var(--sh); transform: translateY(-1px); }

.card-num::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: var(--navy);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.card-num.accent::after { background: linear-gradient(90deg, var(--gold) 0%, var(--gold-dark) 100%); }
.card-num.sucesso::after { background: var(--clr-ok); }
.card-num.alerta::after  { background: var(--clr-err); }

.card-num .numero {
    font-size: 30px; font-weight: 700;
    color: var(--text-1);
    display: block; letter-spacing: -.04em; line-height: 1.1;
    margin-top: 4px; margin-bottom: 5px;
}
.card-num .rotulo {
    font-size: 11.5px; font-weight: 500;
    color: var(--text-2);
    text-transform: uppercase; letter-spacing: .04em;
}

/* ── TABELAS ────────────────────────────────────────────────── */
.tabela-container { overflow-x: auto; }

table.tabela {
    width: 100%; border-collapse: collapse; font-size: 13.5px;
}
table.tabela th {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 11px 16px;
    text-align: left;
    font-size: 11px; font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase; letter-spacing: .07em;
    white-space: nowrap;
}
table.tabela td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle; color: var(--text-1);
}
table.tabela tr:last-child td { border-bottom: none; }
table.tabela tr:hover td { background: var(--bg-surface-2); }

/* ── BADGES ─────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 999px;
    font-size: 11px; font-weight: 600; letter-spacing: .02em; line-height: 1.4;
}
.badge-triagem    { background: #eef2ff; color: #4338ca; }
.badge-documentos { background: #fffbeb; color: #92400e; }
.badge-analise    { background: #ecfdf5; color: #065f46; }
.badge-revisao    { background: #eff6ff; color: #1e40af; }
.badge-itcmd      { background: #fdf4ff; color: #7c3aed; }
.badge-minuta     { background: #f0fdf4; color: #166534; }
.badge-concluido  { background: #ecfdf5; color: #065f46; }
.badge-escalado   { background: #fef2f2; color: #991b1b; }

/* ── FORMULÁRIOS ────────────────────────────────────────────── */
.form-grupo { margin-bottom: 18px; }

.form-grupo label {
    display: block;
    font-size: 12px; font-weight: 600;
    color: var(--text-2); letter-spacing: .02em; margin-bottom: 6px;
}

.input,
input.input,
select.input,
.form-grupo input[type="text"],
.form-grupo input[type="email"],
.form-grupo input[type="date"],
.form-grupo input[type="password"],
.form-grupo input[type="number"],
.form-grupo select,
.form-grupo textarea {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 13.5px; font-family: inherit;
    color: var(--text-1); background: var(--bg-surface);
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none; appearance: none;
}
.input:focus,
input.input:focus,
select.input:focus,
.form-grupo input:focus,
.form-grupo select:focus,
.form-grupo textarea:focus {
    outline: none;
    border-color: var(--navy-mid);
    box-shadow: 0 0 0 3px rgba(26,53,96,.1);
}
.form-grupo textarea { resize: vertical; min-height: 80px; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.campo-erro  { color: var(--clr-err); font-size: 12px; margin-top: 4px; }

/* ── BOTÕES ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 18px;
    border: none; border-radius: var(--r-sm);
    font-size: 13.5px; font-weight: 500; font-family: inherit;
    cursor: pointer; text-decoration: none;
    transition: background .15s, box-shadow .15s, transform .1s;
    letter-spacing: -.01em; white-space: nowrap; line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primario {
    background: var(--navy); color: #fff;
    box-shadow: var(--sh-xs);
}
.btn-primario:hover { background: var(--navy-mid); }

.btn-accent {
    background: var(--gold); color: #fff;
    box-shadow: var(--sh-xs);
}
.btn-accent:hover { background: var(--gold-dark); }

.btn-secundario {
    background: var(--bg-surface); color: var(--text-1);
    border: 1.5px solid var(--border);
}
.btn-secundario:hover { background: var(--bg-surface-2); border-color: #d0d8e4; }

.btn-perigo { background: var(--clr-err); color: #fff; box-shadow: var(--sh-xs); }
.btn-perigo:hover { background: #b91c1c; }

.btn-sm { padding: 6px 13px; font-size: 12px; }
.btn-xs { padding: 3px 9px;  font-size: 11px; }

.acoes-topo {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px; flex-wrap: wrap; gap: 10px;
}

/* ── ALERTAS ────────────────────────────────────────────────── */
.alerta {
    display: flex; gap: 10px;
    padding: 13px 16px;
    border-radius: var(--r);
    margin-bottom: 16px;
    font-size: 13.5px;
    border: 1px solid transparent;
}
.alerta-erro    { background: var(--clr-err-bg);  border-color: var(--clr-err-border);  color: #7f1d1d; }
.alerta-aviso   { background: var(--clr-warn-bg); border-color: var(--clr-warn-border); color: #78350f; }
.alerta-sucesso { background: var(--clr-ok-bg);   border-color: var(--clr-ok-border);   color: #14532d; }
.alerta-info    { background: var(--clr-info-bg); border-color: var(--clr-info-border); color: #1e3a8a; }

/* ── ABAS ───────────────────────────────────────────────────── */
.abas-nav {
    display: flex; gap: 2px;
    border-bottom: 1.5px solid var(--border);
    margin-bottom: 24px; overflow-x: auto;
}
.aba-link {
    padding: 10px 18px;
    font-size: 13px; font-weight: 500; color: var(--text-2);
    border-bottom: 2.5px solid transparent;
    margin-bottom: -1.5px; cursor: pointer; white-space: nowrap;
    transition: color .15s, border-color .15s;
    border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.aba-link:hover { color: var(--text-1); text-decoration: none; background: var(--bg-surface-2); }
.aba-link.ativa { color: var(--navy); border-bottom-color: var(--gold); font-weight: 600; }
.aba-conteudo { display: none; }
.aba-conteudo.ativa { display: block; }

/* ── CHECKLIST ──────────────────────────────────────────────── */
.checklist-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 13.5px;
}
.checklist-item:last-child { border-bottom: none; }

/* ── LOGIN ──────────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-sidebar);
    position: relative; overflow: hidden;
}
/* decorative background pattern */
.login-page::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 70% 30%, rgba(201,168,76,.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 20% 80%, rgba(26,53,96,.6) 0%, transparent 60%);
}
.login-page::after {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    border: 1px solid rgba(201,168,76,.06);
    top: -100px; right: -100px;
}

.login-box {
    background: var(--bg-surface);
    padding: 44px 40px;
    border-radius: var(--r-xl);
    width: 100%; max-width: 400px;
    box-shadow: var(--sh-lg), 0 0 0 1px rgba(255,255,255,.04);
    position: relative; z-index: 1;
}
.login-logo {
    text-align: center; margin-bottom: 28px;
}
.login-logo-icon {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    border-radius: var(--r-lg);
    display: inline-flex; align-items: center; justify-content: center;
    font-family: Georgia, serif; font-size: 24px; color: #fff; font-weight: bold;
    margin-bottom: 14px;
    box-shadow: 0 4px 14px rgba(201,168,76,.4);
}
.login-box h1 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 20px; font-weight: normal;
    color: var(--text-1); text-align: center; margin-bottom: 4px;
}
.login-box .subtitulo {
    text-align: center; font-size: 13px; color: var(--text-2); margin-bottom: 30px;
}
.login-divider {
    height: 1px; background: var(--border); margin: 20px 0;
}

/* ── UTILITÁRIOS ────────────────────────────────────────────── */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--text-2); }
.mt-10  { margin-top: 10px; }
.mt-20  { margin-top: 20px; }
.mb-10  { margin-bottom: 10px; }
.mb-20  { margin-bottom: 20px; }
.d-flex { display: flex; }
.gap-10 { gap: 10px; }
.align-center { align-items: center; }
.flex-wrap    { flex-wrap: wrap; }
