/* ============================================================================
   GeradorDocumentos v2 — Design System
   Direcao: "documento como interface"
   Paleta ink (azul-tinta) + teal sobrio, fundo frio claro.
   Substitui o tema navy/gold da v1.
   ============================================================================ */

:root {
    /* ── Paleta ──────────────────────────────────────────────────────────── */
    --ink-900: #0f1b2d;   /* azul-tinta profundo — texto forte, headers */
    --ink-800: #1a2b45;   /* superficies escuras (sidebar, navbar) */
    --ink-700: #263a5c;   /* hover em superficies escuras */
    --ink-600: #35507a;   /* acentos secundarios */

    --teal-600: #0d9488;  /* acento primario — acoes, foco */
    --teal-500: #14b8a6;  /* hover do acento */
    --teal-50:  #f0fdfa;  /* fundo sutil do acento */

    --slate-900: #0f172a; /* texto principal */
    --slate-700: #334155; /* texto secundario */
    --slate-500: #64748b; /* texto muted */
    --slate-400: #94a3b8; /* placeholders, icones inativos */
    --slate-300: #cbd5e1; /* bordas */
    --slate-200: #e2e8f0; /* bordas suaves, divisores */
    --slate-100: #f1f5f9; /* fundo de zebra, hover de linha */
    --slate-50:  #f8fafc; /* fundo de superficies */

    --canvas: #f6f8fb;    /* fundo frio da pagina */
    --surface: #ffffff;   /* cartoes, formularios */

    --success: #059669;
    --danger:  #dc2626;
    --warning: #d97706;
    --info:    #0284c7;

    /* ── Tipografia ──────────────────────────────────────────────────────── */
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;

    /* ── Forma e profundidade ────────────────────────────────────────────── */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(15, 27, 45, .06), 0 1px 3px rgba(15, 27, 45, .08);
    --shadow: 0 4px 12px rgba(15, 27, 45, .08), 0 2px 4px rgba(15, 27, 45, .06);
    --shadow-lg: 0 12px 32px rgba(15, 27, 45, .12), 0 4px 8px rgba(15, 27, 45, .06);

    --transition: 160ms cubic-bezier(.4, 0, .2, 1);
}

/* ── Base ────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background-color: var(--canvas);
    color: var(--slate-900);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--ink-900);
    font-weight: 600;
    letter-spacing: -.01em;
}

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.app-navbar {
    background: var(--ink-900);
    border-bottom: 1px solid var(--ink-700);
    box-shadow: var(--shadow-sm);
}
.app-navbar .navbar-brand {
    font-family: var(--font-display);
    font-weight: 600;
    color: #fff;
    font-size: 1.15rem;
    letter-spacing: -.01em;
    display: flex;
    align-items: center;
    gap: .55rem;
}
.app-navbar .navbar-brand .brand-mark {
    color: var(--teal-500);
    font-size: 1.35rem;
}
.app-navbar .nav-link {
    color: rgba(255, 255, 255, .72);
    font-weight: 500;
    font-size: .9rem;
    padding: .5rem .9rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.app-navbar .nav-link:hover { color: #fff; background: var(--ink-700); }
.app-navbar .nav-link.active { color: #fff; background: var(--ink-800); }
.app-navbar .nav-link .bi { color: var(--teal-500); margin-right: .35rem; }

/* ── Dropdown do usuario ─────────────────────────────────────────────────── */
.user-menu-toggle {
    display: flex; align-items: center; gap: .5rem;
    color: rgba(255,255,255,.85); cursor: pointer;
    padding: .35rem .6rem; border-radius: var(--radius-sm);
    transition: var(--transition); background: transparent; border: none;
}
.user-menu-toggle:hover { background: var(--ink-700); color: #fff; }
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--teal-600); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: .8rem; flex-shrink: 0;
}

/* ── Cartoes ─────────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--slate-200);
    padding: 1rem 1.25rem;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ink-900);
}

/* ── Botoes ──────────────────────────────────────────────────────────────── */
.btn { font-weight: 500; border-radius: var(--radius-sm); transition: var(--transition); }
.btn-primary {
    background: var(--teal-600); border-color: var(--teal-600); color: #fff;
}
.btn-primary:hover { background: var(--teal-500); border-color: var(--teal-500); }
.btn-ink {
    background: var(--ink-900); border-color: var(--ink-900); color: #fff;
}
.btn-ink:hover { background: var(--ink-700); border-color: var(--ink-700); color: #fff; }
.btn-outline-secondary { color: var(--slate-700); border-color: var(--slate-300); }
.btn-outline-secondary:hover { background: var(--slate-100); border-color: var(--slate-400); color: var(--slate-900); }

/* ── Formularios ─────────────────────────────────────────────────────────── */
.form-label { font-weight: 500; color: var(--slate-700); font-size: .875rem; margin-bottom: .35rem; }
.form-control, .form-select {
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-sm);
    padding: .55rem .8rem;
    font-size: .925rem;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--teal-600);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, .12);
}
.input-group-text { background: var(--slate-50); border-color: var(--slate-300); color: var(--slate-500); }

/* ── Tabelas ─────────────────────────────────────────────────────────────── */
.table { color: var(--slate-700); }
.table thead th {
    background: var(--slate-50);
    color: var(--slate-500);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--slate-200);
    padding: .7rem 1rem;
}
.table tbody td { padding: .8rem 1rem; border-bottom: 1px solid var(--slate-100); vertical-align: middle; }
.table tbody tr:hover { background: var(--slate-50); }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge-role {
    font-size: .7rem; font-weight: 600; padding: .3rem .6rem;
    border-radius: 20px; text-transform: uppercase; letter-spacing: .03em;
}
.badge-superadmin { background: var(--ink-900); color: #fff; }
.badge-admin { background: var(--teal-50); color: var(--teal-600); border: 1px solid var(--teal-600); }
.badge-padrao { background: var(--slate-100); color: var(--slate-700); }
.badge-active { background: #ecfdf5; color: var(--success); }
.badge-inactive { background: #fef2f2; color: var(--danger); }

/* ── Page header ─────────────────────────────────────────────────────────── */
.page-header { margin-bottom: 1.75rem; }
.page-header .page-title {
    font-size: 1.6rem; font-weight: 600; color: var(--ink-900);
    display: flex; align-items: center; gap: .6rem; margin-bottom: .2rem;
}
.page-header .page-title .bi { color: var(--teal-600); }
.page-header .page-subtitle { color: var(--slate-500); font-size: .95rem; margin: 0; }

/* ── Eyebrow / label estrutural (numeracao de documento) ─────────────────── */
.doc-eyebrow {
    font-family: var(--font-mono);
    font-size: .7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--teal-600);
    font-weight: 500;
}

/* ── Acessibilidade ──────────────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
