/* ============================================================
   JurisAlert - Stylesheet
   Tema: Jurídico Refinado / Dark Slate & Gold
   ============================================================ */

:root {
    --bg-base:       #0e1117;
    --bg-surface:    #161b27;
    --bg-card:       #1c2333;
    --bg-input:      #222940;
    --border:        #2a3450;
    --border-light:  #3a4a6a;

    --gold:          #c9a84c;
    --gold-light:    #e2c06e;
    --gold-dim:      rgba(201, 168, 76, 0.15);

    --text-primary:  #e8eaf2;
    --text-secondary:#8a94b0;
    --text-muted:    #5a6480;

    --green:         #34c77b;
    --green-dim:     rgba(52, 199, 123, 0.15);
    --red:           #e05252;
    --red-dim:       rgba(224, 82, 82, 0.15);
    --blue:          #4d9ef5;
    --blue-dim:      rgba(77, 158, 245, 0.15);

    --radius:        10px;
    --radius-lg:     16px;
    --shadow:        0 4px 24px rgba(0,0,0,0.4);

    --sidebar-w:     260px;
    --font-serif:    'DM Serif Display', Georgia, serif;
    --font-sans:     'Inter', system-ui, sans-serif;
    --font-mono:     'DM Mono', monospace;
}

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

html { font-size: 15px; }

body {
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    line-height: 1.6;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

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

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 28px 24px 20px;
    border-bottom: 1px solid var(--border);
}

.brand-icon {
    font-size: 28px;
    filter: drop-shadow(0 0 8px var(--gold));
}

.brand-name {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: var(--gold-light);
    letter-spacing: 0.03em;
}

.brand-tagline {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover {
    background: var(--gold-dim);
    color: var(--gold-light);
}

.nav-item.active {
    background: var(--gold-dim);
    color: var(--gold);
    border-left: 3px solid var(--gold);
    padding-left: 11px;
}

.nav-icon { font-size: 1rem; }

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px; height: 36px;
    background: var(--gold-dim);
    border: 1px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--gold);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.user-name { font-size: 0.85rem; font-weight: 500; }

.logout-link {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.logout-link:hover { color: var(--red); }

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

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    color: var(--text-primary);
    font-weight: 400;
    letter-spacing: 0.02em;
}

.page-body {
    padding: 28px 32px;
    flex: 1;
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.card-title {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    color: var(--gold-light);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}

.stat-card.gold::before  { background: var(--gold); }
.stat-card.green::before { background: var(--green); }
.stat-card.blue::before  { background: var(--blue); }
.stat-card.red::before   { background: var(--red); }

.stat-card:hover { border-color: var(--border-light); }

.stat-icon { font-size: 1.5rem; margin-bottom: 8px; }
.stat-value {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1;
}
.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
}

/* ── Tables ── */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

th {
    background: var(--bg-input);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-size: 0.72rem;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-green  { background: var(--green-dim);  color: var(--green); }
.badge-red    { background: var(--red-dim);    color: var(--red); }
.badge-gold   { background: var(--gold-dim);   color: var(--gold); }
.badge-blue   { background: var(--blue-dim);   color: var(--blue); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    font-family: var(--font-sans);
}

.btn-primary {
    background: var(--gold);
    color: #0e1117;
}
.btn-primary:hover { background: var(--gold-light); transform: translateY(-1px); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.btn-danger {
    background: var(--red-dim);
    border: 1px solid var(--red);
    color: var(--red);
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

/* ── Forms ── */
.form-grid { display: grid; gap: 18px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

input, select, textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    padding: 10px 14px;
    font-size: 0.88rem;
    font-family: var(--font-sans);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-dim);
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

textarea { resize: vertical; min-height: 90px; }

select option { background: var(--bg-card); }

.input-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ── Alerts ── */
.alert {
    padding: 13px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.88rem;
    border-left: 4px solid;
}
.alert-success { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.alert-error   { background: var(--red-dim);   border-color: var(--red);   color: var(--red); }
.alert-info    { background: var(--blue-dim);   border-color: var(--blue);  color: var(--blue); }

/* ── Processo number ── */
.numero-processo {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--gold);
    background: var(--gold-dim);
    padding: 2px 8px;
    border-radius: 4px;
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state-title { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 6px; }

/* ── Pagination ── */
.pagination {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 20px;
    justify-content: flex-end;
}
.page-btn {
    padding: 6px 12px;
    border-radius: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.82rem;
    transition: all 0.2s;
}
.page-btn:hover, .page-btn.active {
    background: var(--gold-dim);
    border-color: var(--gold);
    color: var(--gold);
}

/* ── Login Page ── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-base);
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-icon {
    font-size: 3rem;
    display: block;
    filter: drop-shadow(0 0 12px var(--gold));
    margin-bottom: 8px;
}

.login-logo-text {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--gold-light);
    letter-spacing: 0.04em;
}

.login-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ── Utilities ── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-4 { margin-top: 16px; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); font-size: 0.82rem; }
.w-full { width: 100%; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .sidebar { width: 220px; }
    .main-content { margin-left: 220px; }
    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .sidebar { transform: translateX(-100%); }
    .main-content { margin-left: 0; }
    .page-body { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
