:root {
    --bg: #0a0a0b;
    --surface: #131315;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --gold: #d4af37;
    --gold-strong: #f4d77a;
    --gold-deep: #8f6f15;
    --gold-pale: rgba(212, 175, 55, 0.09);
    --red: #ef4444;
    --green: #22c55e;
    --green-soft: #86efac;
    --text: #f1f1f2;
    --muted: #93939b;
    --radius-sm: 8px;
    --radius: 10px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
    --shadow-gold: 0 1px 2px rgba(0, 0, 0, 0.25);
    --content-pad-y: 34px;
    --content-pad-x: 40px;
    --sidebar-width: 240px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background:
        radial-gradient(ellipse 70% 45% at 50% 0%, rgba(212, 175, 55, 0.035), transparent),
        var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--gold-strong); text-decoration: none; }
a:not([class]) { transition: color 0.15s ease; }
a:not([class]):hover { color: var(--gold); text-decoration: underline; }

h1, h2, h3 { font-weight: 700; letter-spacing: -0.3px; }

.top-accent {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.7;
    margin: calc(-1 * var(--content-pad-y)) calc(-1 * var(--content-pad-x)) var(--content-pad-y) calc(-1 * var(--content-pad-x));
}

/* ---------- BADGE ---------- */
.page-badge, .login-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gold-pale);
    border: 1px solid rgba(212, 175, 55, 0.18);
    border-radius: 100px;
    padding: 6px 14px 6px 10px;
    margin-bottom: 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.8px;
    color: var(--gold);
    text-transform: uppercase;
}
.page-badge::before, .login-badge::before {
    content: '';
    width: 7px;
    height: 7px;
    background: var(--gold);
    border-radius: 50%;
}

/* ---------- LOGIN ---------- */
.login-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 32px 16px;
}
.login-box {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 40px 36px 36px;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: containerEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.login-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.8;
}
@keyframes containerEntrance {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.login-brand {
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}
.brand-logo { display: block; height: auto; }
.login-brand .brand-logo { width: 220px; max-width: 80%; margin: 0 auto; }
.login-box h1 {
    font-size: 28px;
    line-height: 1.1;
    margin: 4px 0 8px;
    position: relative;
    z-index: 1;
}
.login-sub {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 26px;
    letter-spacing: 0.3px;
    position: relative;
    z-index: 1;
}
.login-form { display: flex; flex-direction: column; gap: 4px; position: relative; z-index: 1; }
.login-footer {
    text-align: center;
    color: var(--muted);
    font-size: 11.5px;
    letter-spacing: 0.3px;
    margin-top: 22px;
    position: relative;
    z-index: 1;
}
.login-form label { font-size: 13px; color: #d0d0d0; margin-top: 12px; letter-spacing: 0.3px; }
.login-form input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 13px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.login-form input:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}
.login-form .btn-block { width: 100%; margin-top: 22px; padding: 13px 16px; font-size: 14px; }

.alert { padding: 13px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14px; position: relative; z-index: 1; border: 1px solid transparent; }
.alert-error { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.22); color: #ffcbcb; }
.alert-success { background: rgba(212, 175, 55, 0.07); border-color: rgba(212, 175, 55, 0.2); color: #f4e2a3; }

/* ---------- SHELL / LAYOUT ---------- */
.app-shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    overflow-y: auto;
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    flex-shrink: 0;
    z-index: 200;
}
.brand {
    padding: 0 20px 22px 20px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 22px;
}
.brand .brand-logo { width: 100%; max-width: 190px; }
.nav-menu { display: flex; flex-direction: column; gap: 3px; padding: 0 12px; flex: 1; }
.nav-menu a {
    position: relative;
    color: var(--muted);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 11px;
    transition: background 0.15s ease, color 0.15s ease;
}
.nav-menu a:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.nav-menu a:hover .nav-ico { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.nav-menu a:focus-visible,
.logout-link:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-delete:focus-visible,
.new-contract-card summary:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}
.nav-menu a.active {
    background: var(--gold-pale);
    color: var(--gold-strong);
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--gold);
}
.nav-menu a.active .nav-ico { background: rgba(212, 175, 55, 0.16); color: var(--gold-strong); }
.nav-ico {
    width: 26px;
    height: 26px;
    padding: 5px;
    border-radius: 7px;
    box-sizing: border-box;
    color: inherit;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}
.nav-badge {
    margin-left: auto;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-footer { padding: 14px 12px 0; border-top: 1px solid var(--line); margin-top: 14px; }
.logout-link {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #e69b9b;
    font-size: 13.5px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: background 0.15s ease, color 0.15s ease;
}
.logout-link:hover { background: rgba(239, 68, 68, 0.08); color: #ffb3b3; }

.main-content { flex: 1; margin-left: var(--sidebar-width); padding: var(--content-pad-y) var(--content-pad-x); min-width: 0; position: relative; }

.app-footer {
    margin-top: 40px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    text-align: center;
}
.app-footer p { margin: 0; color: var(--muted); font-size: 11.5px; letter-spacing: 0.3px; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 150;
}

.mobile-topbar {
    display: none;
    align-items: center;
    gap: 14px;
    margin: calc(-1 * var(--content-pad-y)) calc(-1 * var(--content-pad-x)) 20px;
    padding: 14px var(--content-pad-x);
    background: rgba(10, 10, 11, 0.92);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
}
.mobile-topbar-logo { height: 26px; width: auto; }
.sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--gold-pale);
    border: 1px solid rgba(212, 175, 55, 0.25);
    color: var(--gold-strong);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.sidebar-toggle:hover { background: rgba(212, 175, 55, 0.16); border-color: rgba(212, 175, 55, 0.4); }
.sidebar-toggle svg { width: 20px; height: 20px; }

.page-header { margin-bottom: 28px; }
.page-header h1 { margin: 0 0 8px 0; font-size: 28px; }
.page-sub { color: var(--muted); margin: 0; font-size: 13px; letter-spacing: 0.2px; }

.page-header-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.page-header-row .page-header { margin-bottom: 0; }

.login-box h1, .page-header h1 {
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text);
}

/* Separador visual entre grandes seções de uma página (ex: colaborador_detalhe.php) */
.section-divider {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin: 36px 0 20px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}
.section-divider svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--gold);
    margin-top: 2px;
}
.section-divider h2 {
    margin: 0 0 4px;
    font-size: 17px;
    color: var(--gold-strong);
}
.section-divider p { margin: 0; color: var(--muted); font-size: 13px; }

/* Duas colunas lado a lado (ex: Bonificações | Premiações) */
.split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.split-col { display: flex; flex-direction: column; gap: 20px; }

/* ---------- CARDS ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease;
    position: relative;
}
.card:hover { border-color: var(--line-strong); }

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.stat-card::before {
    content: '';
    display: block;
    width: 28px;
    height: 3px;
    border-radius: 3px;
    background: var(--gold);
    margin-bottom: 4px;
}
.stat-positivo::before { background: var(--green); }
.stat-negativo::before { background: var(--red); }
.stat-action { display: flex; flex-direction: column; justify-content: space-between; }
.stat-action .btn-secondary { text-align: center; }
.stat-total::before { background: #7a7a82; }
.stat-pct::before { background: var(--gold-strong); }
.stat-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.stat-value { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; color: var(--text); }

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.chart-wide { grid-column: 1 / -1; }
.chart-card h3 { margin-top: 0; font-size: 12.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; }
.chart-canvas-wrap { position: relative; height: 280px; }

.empty-state-card { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-state-card p { margin: 0; font-size: 14px; line-height: 1.6; }

/* ---------- FILTROS ---------- */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 24px;
}
.filters-bar-title {
    width: 100%;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
}
.filter-group { display: flex; flex-direction: column; gap: 7px; }
.filter-group label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; }
.filter-group select, .filter-group input[type="text"], .filter-group input[type="date"] {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 10px 14px;
    border-radius: var(--radius);
    min-width: 160px;
    font-size: 13.5px;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.filter-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
.filter-group select option { background: #1a1a1c; color: var(--text); }
.filter-group input[type="date"] { padding-right: 38px; }
.filter-group select:hover, .filter-group input[type="text"]:hover, .filter-group input[type="date"]:hover { border-color: var(--line-strong); }
.filter-group select:focus, .filter-group input[type="text"]:focus, .filter-group input[type="date"]:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.45);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}
.filter-search input { min-width: 220px; }
.filter-actions { flex-direction: row; gap: 10px; }

.btn-primary, .btn-secondary {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    letter-spacing: 0.2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-primary { background: var(--gold-strong); color: #1a1406; box-shadow: var(--shadow-gold); }
.btn-primary:hover { background: var(--gold); }
.btn-secondary { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-secondary:hover { border-color: rgba(212, 175, 55, 0.4); color: var(--gold-strong); background: var(--gold-pale); }
.btn-primary:disabled, .btn-secondary:disabled { opacity: 0.55; cursor: wait; transform: none; }

/* ---------- TABELA ---------- */
.table-card { padding: 0; overflow-x: auto; }
.table-card-title { margin: 0; padding: 18px 20px 14px; font-size: 12.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; border-bottom: 1px solid var(--line); }
.tbl-contratos { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl-contratos th {
    text-align: left;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--line-strong);
    white-space: nowrap;
}
.tbl-contratos th .th-sort {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
    padding: 0;
    transition: color 0.2s;
}
.tbl-contratos th .th-sort:hover {
    color: var(--gold-strong);
}
.tbl-contratos th .th-sort-ativo {
    color: var(--gold-strong);
}
.tbl-contratos td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.tbl-contratos tr:last-child td { border-bottom: none; }
.tbl-contratos tr:hover td { background: rgba(255, 255, 255, 0.02); }
.muted { color: var(--muted); font-size: 12px; }
.empty-state { text-align: center; color: var(--muted); padding: 44px !important; }

/* ---------- ETIQUETAS ---------- */
.tag-pill {
    display: inline-block;
    background: var(--gold-pale);
    border: 1px solid rgba(212, 175, 55, 0.2);
    color: var(--gold-strong);
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    margin: 2px 4px 2px 0;
    white-space: nowrap;
}
.tag-empty { color: var(--muted); }

/* ---------- STATUS SELECT ---------- */
.status-select {
    appearance: none;
    -webkit-appearance: none;
    border-radius: var(--radius-sm);
    padding: 7px 32px 7px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid transparent;
    font-family: inherit;
    transition: border-color 0.15s ease;
    background-repeat: no-repeat;
    background-position: right 11px center;
    background-size: 10px 7px;
}
.status-select:hover { border-color: currentColor; }
.status-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}
.status-select:disabled { opacity: 0.55; cursor: wait; }
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    white-space: nowrap;
    border: 1px solid transparent;
}
.status-select.status-positivo, .status-badge.status-positivo {
    background-color: rgba(34, 197, 94, 0.12);
    color: var(--green-soft);
    border-color: rgba(34, 197, 94, 0.3);
}
.status-select.status-positivo {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3e%3cpath fill='%2386efac' d='M6 8 0 0h12z'/%3e%3c/svg%3e");
}
.status-select.status-negativo, .status-badge.status-negativo {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ffb3b3;
    border-color: rgba(239, 68, 68, 0.25);
}
.status-select.status-negativo {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3e%3cpath fill='%23ffb3b3' d='M6 8 0 0h12z'/%3e%3c/svg%3e");
}
.status-select.status-indefinido, .status-badge.status-indefinido {
    background-color: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    border-color: rgba(255, 255, 255, 0.16);
    border-style: dashed;
}
.status-select.status-indefinido {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3e%3cpath fill='%23a0a0a0' d='M6 8 0 0h12z'/%3e%3c/svg%3e");
}
.status-select.status-neutro, .status-badge.status-neutro {
    background-color: rgba(255, 255, 255, 0.06);
    color: #d8d8d8;
    border-color: rgba(255, 255, 255, 0.18);
}
.status-select.status-neutro {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3e%3cpath fill='%23d8d8d8' d='M6 8 0 0h12z'/%3e%3c/svg%3e");
}
.status-select option { background: #1a1a1c; color: var(--text); }
.status-meta { margin-top: 8px; font-size: 11px; color: var(--muted); min-height: 14px; }

/* Caixa de tamanho padrão para o status do contrato (EM FLUXO / PENDENTE / CADASTRADO),
   pra não mudar de largura conforme a opção escolhida. */
.status-box { width: 136px; }
.status-box-lg { width: 190px; }
.status-badge.status-box, .status-badge.status-box-lg { justify-content: center; }

/* ---------- TOOLTIP (ícone de informação com dica ao passar o mouse) ---------- */
.status-cell-row { display: flex; align-items: center; gap: 8px; }
.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: help;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}
.info-tooltip:hover, .info-tooltip:focus { transform: scale(1.08); outline: none; }
.info-tooltip svg { width: 13px; height: 13px; }
.info-tooltip-alert { background: rgba(239, 68, 68, 0.14); color: #ffb3b3; border: 1px solid rgba(239, 68, 68, 0.3); }
.info-tooltip-empty { background: rgba(255, 255, 255, 0.05); color: var(--muted); border: 1px solid var(--line); }
.info-tooltip-content {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1c;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.6;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text);
    white-space: nowrap;
    text-align: left;
    box-shadow: var(--shadow-md);
    z-index: 60;
}
.info-tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1a1a1c;
}
.info-tooltip:hover .info-tooltip-content,
.info-tooltip:focus .info-tooltip-content { display: block; }

/* ---------- REVISÃO DE CONTRATOS ---------- */
.btn-ico { width: 14px; height: 14px; flex-shrink: 0; }

.guia-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 190px; }
.guia-cell .status-meta { margin-top: -4px; }
.guia-status-row { display: flex; align-items: center; gap: 8px; }

/* Botão de ação circular e compacto (ex: marcar guia como emitida), no lugar de um
   botão largo com texto — ocupa bem menos espaço ao lado do badge de status. */
.action-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid transparent;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.action-icon-btn svg { width: 13px; height: 13px; }
.action-icon-btn:hover { transform: scale(1.1); }
.action-icon-btn.action-positivo { background: rgba(34, 197, 94, 0.14); color: var(--green-soft); border-color: rgba(34, 197, 94, 0.3); }
.action-icon-btn.action-positivo:hover { background: rgba(34, 197, 94, 0.24); }
.action-icon-btn.action-neutro { background: rgba(255, 255, 255, 0.06); color: var(--muted); border-color: var(--line); }
.action-icon-btn.action-neutro:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }

/* Toggle discreto (lápis) para editar o prazo de um documento pendente sem poluir a pill. */
.doc-pill-edit summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 10px;
    cursor: pointer;
    list-style: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.doc-pill-edit summary::-webkit-details-marker { display: none; }
.doc-pill-edit summary:hover { background: var(--gold-pale); color: var(--gold-strong); border-color: rgba(212, 175, 55, 0.3); }
.doc-pill-edit[open] summary { background: var(--gold-pale); color: var(--gold-strong); border-color: rgba(212, 175, 55, 0.3); }
.doc-pill-edit .inline-mini-form { margin-top: 6px; }

/* Toggle discreto (texto + lápis) para revelar um mini-formulário só quando necessário,
   evitando deixar vários botões sempre visíveis na mesma célula. */
.date-edit-toggle summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    list-style: none;
    font-size: 12px;
    color: var(--muted);
    transition: color 0.15s ease;
}
.date-edit-toggle summary::-webkit-details-marker { display: none; }
.date-edit-toggle summary:hover { color: var(--gold-strong); }
.date-edit-toggle[open] summary { color: var(--gold-strong); margin-bottom: 8px; }
.date-edit-toggle .inline-mini-form { margin-top: 2px; }

.inline-mini-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.inline-mini-form input[type="date"],
.doc-add-form select,
.doc-add-form input[type="date"] {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: var(--radius);
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.inline-mini-form input[type="date"]:hover,
.doc-add-form select:hover,
.doc-add-form input[type="date"]:hover { border-color: var(--line-strong); }
.inline-mini-form input[type="date"]:focus,
.doc-add-form select:focus,
.doc-add-form input[type="date"]:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.45);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.inline-mini-form input[type="date"] {
    padding: 9px 32px 9px 12px;
    font-size: 12.5px;
    min-width: 0;
}

.doc-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.doc-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 7px 5px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}
.doc-pill form { display: inline-flex; margin: 0; }
.doc-pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    opacity: 0.55;
    transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}
.doc-pill:hover .doc-pill-btn { opacity: 1; }
.doc-pill-btn:hover { background: rgba(255, 255, 255, 0.28); transform: scale(1.1); opacity: 1; }

.doc-add-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 6px 20px 20px;
}
.doc-add-form select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding: 10px 36px 10px 14px;
}
.doc-add-form select option { background: #1a1a1c; color: var(--text); }
.doc-add-form input[type="date"] { padding: 10px 36px 10px 14px; }
.doc-add-form select, .doc-add-form input[type="date"] { min-width: 190px; font-size: 13px; }

.doc-add-toggle summary { display: inline-flex; justify-content: center; width: auto; padding: 0; margin-top: 2px; }
.doc-add-toggle .add-toggle-icon { width: 22px; height: 22px; }
.doc-add-toggle .doc-add-form { padding: 8px 0 4px; }

/* ---------- AVATAR ---------- */
.colaborador-nome-link { display: inline-flex; align-items: center; gap: 10px; }
.avatar-mini {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--line);
    flex-shrink: 0;
}
.avatar-mini-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gold-pale);
    color: var(--gold-strong);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
}
/* Foto estilo 3x4 (retrato) */
.avatar-lg {
    width: 96px;
    height: 128px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--line);
    flex-shrink: 0;
}
.avatar-lg-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gold-pale);
    color: var(--gold-strong);
    font-weight: 700;
    font-size: 32px;
    text-transform: uppercase;
}

.profile-card { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 24px; }
.profile-info { flex: 1; min-width: 0; }
.profile-info-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.profile-info-header h2 { margin: 0 0 4px; font-size: 19px; }
.profile-info-header .muted { font-size: 13px; }

.btn-table-action {
    padding: 8px 16px;
    font-size: 12px;
    margin-right: 10px;
}

.form-group-foto { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.form-group-foto input[type="file"] { flex: 1; min-width: 200px; }
.form-section-title {
    margin: 6px 0 16px;
    font-size: 12.5px;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.btn-delete, .btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #ffb3b3;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.3px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-delete:hover, .btn-danger:hover { background: rgba(239, 68, 68, 0.16); border-color: rgba(239, 68, 68, 0.4); }
.btn-delete:disabled, .btn-danger:disabled { opacity: 0.5; cursor: default; }

/* ---------- NOVO CONTRATO ---------- */
.new-contract-card { margin-bottom: 20px; }
.new-contract-card summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--gold-strong);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.3px;
    list-style: none;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    background: var(--gold-pale);
    border: 1px solid rgba(212, 175, 55, 0.18);
    transition: background 0.15s ease, border-color 0.15s ease;
}
.new-contract-card summary:hover { background: rgba(212, 175, 55, 0.14); border-color: rgba(212, 175, 55, 0.3); }
.new-contract-card summary::-webkit-details-marker { display: none; }
.new-contract-card summary::before {
    content: '+';
    font-size: 16px;
    line-height: 1;
    transition: transform 0.2s ease;
}
.new-contract-card[open] summary::before { transform: rotate(45deg); }
.new-contract-card[open] summary { margin-bottom: 20px; }

/* Adicionar compacto, embutido no título de uma tabela (ex: Bonificações, Premiações, Banco de Horas) */
.inline-add summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 18px 20px;
    cursor: pointer;
    list-style: none;
    font-size: 12.5px;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}
.inline-add summary::-webkit-details-marker { display: none; }
.add-toggle-icon {
    position: relative;
    display: inline-flex;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gold-pale);
    border: 1px solid rgba(212, 175, 55, 0.25);
    color: transparent;
    font-size: 0;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.2s ease;
}
.add-toggle-icon::before,
.add-toggle-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    background: var(--gold-strong);
    border-radius: 1px;
}
.add-toggle-icon::before { width: 10px; height: 2px; transform: translate(-50%, -50%); }
.add-toggle-icon::after { width: 2px; height: 10px; transform: translate(-50%, -50%); }
.inline-add summary:hover .add-toggle-icon { background: rgba(212, 175, 55, 0.16); border-color: rgba(212, 175, 55, 0.4); }
.inline-add[open] .add-toggle-icon { transform: rotate(45deg); }
.inline-add-form { padding: 0 20px 22px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px 22px;
    margin-bottom: 20px;
}

/* ---------- UPLOAD ---------- */
.upload-card { max-width: 640px; }
.upload-form { display: flex; flex-direction: column; gap: 18px; margin-bottom: 24px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group label { font-size: 13px; color: #d0d0d0; letter-spacing: 0.3px; }
.form-group input, .form-group select {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 11px 14px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13.5px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-group input:hover, .form-group select:hover { border-color: var(--line-strong); }
.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.45);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}
.form-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}
.form-group select option { background: #1a1a1c; color: var(--text); }

/* ---------- DATA E ARQUIVO (estilizados p/ combinar com o tema escuro) ---------- */
input[type="date"] {
    color-scheme: dark;
    position: relative;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3crect x='3' y='4' width='18' height='18' rx='2'%3e%3c/rect%3e%3cline x1='16' y1='2' x2='16' y2='6'%3e%3c/line%3e%3cline x1='8' y1='2' x2='8' y2='6'%3e%3c/line%3e%3cline x1='3' y1='10' x2='21' y2='10'%3e%3c/line%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 38px;
}
input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
input[type="file"] {
    color: var(--muted);
    font-size: 13px;
    font-family: inherit;
}
input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
    background: var(--gold-pale);
    border: 1px solid rgba(212, 175, 55, 0.25);
    color: var(--gold-strong);
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.3px;
    cursor: pointer;
    font-family: inherit;
    margin-right: 12px;
    transition: background 0.15s ease, border-color 0.15s ease;
}
input[type="file"]:hover::file-selector-button,
input[type="file"]:hover::-webkit-file-upload-button {
    background: rgba(212, 175, 55, 0.16);
    border-color: rgba(212, 175, 55, 0.4);
}

.upload-help { border-top: 1px solid var(--line); padding-top: 18px; }
.upload-help h3 { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: 1px; margin-top: 0; }
.upload-help ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.upload-help li strong { color: var(--text); }

.dropzone {
    position: relative;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    padding: 22px 16px;
    text-align: center;
    background: rgba(255, 255, 255, 0.015);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover, .dropzone.dragover { border-color: rgba(212, 175, 55, 0.4); background: rgba(212, 175, 55, 0.04); }
.dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.dropzone-label { color: var(--muted); font-size: 13.5px; pointer-events: none; }
.dropzone-label strong { color: var(--gold-strong); }
.dropzone-filename { color: var(--text); font-weight: 600; }

/* ---------- MODAL (pop-up de notificações) ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(2px);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 28px;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    animation: containerEntrance 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.12);
    color: #ffb3b3;
    margin-bottom: 14px;
}
.modal-icon svg { width: 20px; height: 20px; }
.modal h3 { margin: 0 0 8px; font-size: 19px; color: var(--gold-strong); }
.modal-list { margin: 16px 0; padding-left: 20px; font-size: 13.5px; line-height: 1.8; color: var(--text); }
.modal-list li::marker { color: var(--gold); }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* ---------- TOASTS ---------- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
    max-width: calc(100vw - 32px);
}
.toast {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius);
    padding: 13px 16px;
    box-shadow: var(--shadow-md);
    font-size: 13px;
    line-height: 1.4;
    color: var(--text);
    max-width: 340px;
    animation: toastIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast-error { border-left-color: var(--red); }
.toast-success { border-left-color: var(--green); }
.toast.hide { animation: toastOut 0.2s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

@media (max-width: 900px) {
    :root { --content-pad-y: 22px; --content-pad-x: 22px; }
    .sidebar {
        width: 260px;
        max-width: 82vw;
        transform: translateX(-100%);
        box-shadow: 16px 0 40px rgba(0, 0, 0, 0.5);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .app-shell.sidebar-open .sidebar { transform: translateX(0); }
    .app-shell.sidebar-open .sidebar-overlay { display: block; }
    .main-content { margin-left: 0; }
    .mobile-topbar { display: flex; }
    .charts-grid { grid-template-columns: 1fr; }
    .chart-canvas-wrap { height: 240px; }
    .split-grid { grid-template-columns: 1fr; }
    .profile-card { flex-direction: column; }
}

@media (max-width: 480px) {
    :root { --content-pad-y: 16px; --content-pad-x: 16px; }
    .page-header h1 { font-size: 21px; }
    .stat-value { font-size: 23px; }
    .login-box { padding: 32px 22px 26px; }
    .filter-group select, .filter-group input[type="text"], .filter-group input[type="date"] { min-width: 0; width: 100%; }
    .filter-search input { min-width: 0; }
    .chart-canvas-wrap { height: 200px; }
    .toast-container { left: 16px; right: 16px; bottom: 16px; }
    .toast { max-width: none; }
}

/* Tabela de contratos vira lista de cartões em telas pequenas */
@media (max-width: 640px) {
    .table-card { overflow-x: visible; }
    .tbl-contratos thead { display: none; }
    .tbl-contratos, .tbl-contratos tbody, .tbl-contratos tr, .tbl-contratos td { display: block; width: 100%; }
    .tbl-contratos tr {
        border: 1px solid var(--line);
        border-radius: var(--radius);
        margin: 14px;
        padding: 4px 14px;
    }
    .tbl-contratos tr:hover td { background: transparent; }
    .tbl-contratos td {
        padding: 10px 0;
        border-bottom: 1px solid var(--line);
    }
    .tbl-contratos td:last-child { border-bottom: none; }
    .tbl-contratos td::before {
        content: attr(data-label);
        display: block;
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.6px;
        color: var(--muted);
        margin-bottom: 5px;
    }
    .status-select { width: 100%; }
    .btn-delete, .btn-danger { width: 100%; text-align: center; }
}

/* ---------- MODERN REFRESH ---------- */
:root {
    --bg: #05070d;
    --surface: rgba(10, 14, 22, 0.92);
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --gold: #d7b45a;
    --gold-strong: #f4d98a;
    --gold-deep: #8c6a14;
    --gold-pale: rgba(215, 180, 90, 0.12);
    --red: #e06a6a;
    --green: #2d9b5f;
    --green-soft: #a5e6bb;
    --text: #f4f7fb;
    --muted: #9aa7ba;
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 18px 50px rgba(0, 0, 0, 0.28);
    --shadow-lg: 0 32px 72px rgba(0, 0, 0, 0.38);
    --shadow-gold: 0 10px 30px rgba(215, 180, 90, 0.16);
    --content-pad-y: 28px;
    --content-pad-x: 28px;
    --sidebar-width: 268px;
}

html {
    background: var(--bg);
}

body {
    position: relative;
    background:
        radial-gradient(circle at top left, rgba(215, 180, 90, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(215, 180, 90, 0.06), transparent 28%),
        linear-gradient(180deg, #090d16 0%, #05070d 42%, #03050a 100%);
    color: var(--text);
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

body::before {
    background:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.5), rgba(0,0,0,0.08));
    opacity: 0.16;
}

body::after {
    background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.06), transparent 52%);
    opacity: 0.42;
}

a {
    transition: color 0.18s ease, opacity 0.18s ease;
}

a:hover {
    opacity: 0.95;
}

.app-shell {
    isolation: isolate;
}

.sidebar {
    top: 16px;
    left: 16px;
    bottom: 16px;
    height: auto;
    width: var(--sidebar-width);
    border-right: 1px solid var(--line);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(16, 23, 36, 0.96), rgba(11, 15, 25, 0.88)),
        var(--surface);
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.brand {
    padding: 0 22px 22px;
    margin-bottom: 18px;
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.brand .brand-logo {
    max-width: 180px;
}

.nav-menu {
    padding: 0 12px;
    gap: 6px;
}

.nav-menu a {
    padding: 12px 14px;
    border-radius: 14px;
    color: rgba(244, 247, 251, 0.72);
}

.nav-menu a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.nav-menu a.active {
    background: linear-gradient(135deg, rgba(215, 180, 90, 0.18), rgba(215, 180, 90, 0.08));
    box-shadow: inset 0 0 0 1px rgba(215, 180, 90, 0.16);
}

.nav-ico {
    width: 28px;
    height: 28px;
    padding: 5px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.nav-menu a.active .nav-ico {
    background: rgba(215, 180, 90, 0.18);
}

.sidebar-footer {
    margin-top: 18px;
    padding-top: 16px;
}

.logout-link {
    padding: 12px 14px;
    border-radius: 14px;
    color: #f29a9a;
}

.main-content {
    margin-left: calc(var(--sidebar-width) + 16px);
    padding: 28px 30px 30px 28px;
}

.top-accent {
    height: 1px;
    opacity: 0.9;
    background: linear-gradient(90deg, transparent, rgba(215, 180, 90, 0.85), transparent);
    margin: 0 0 24px;
}

.page-header,
.page-header-row,
.card,
.filters-bar,
.table-card,
.login-box,
.modal,
.toast,
.alert {
    backdrop-filter: blur(18px);
}

.page-header,
.page-header-row {
    margin-bottom: 24px;
    padding: 22px 24px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(18, 25, 38, 0.88), rgba(12, 16, 26, 0.74));
    box-shadow: var(--shadow-sm);
}

.page-header-row {
    align-items: center;
}

.page-header {
    position: relative;
    overflow: hidden;
}

.page-header::after,
.card::after,
.login-box::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.04), transparent 34%);
    pointer-events: none;
    border-radius: inherit;
}

.page-header h1 {
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1.05;
}

.page-sub {
    color: rgba(154, 167, 186, 0.92);
    font-size: 14px;
}

.page-badge,
.login-badge {
    background: rgba(215, 180, 90, 0.13);
    border-color: rgba(215, 180, 90, 0.22);
    letter-spacing: 0.14em;
}

.cards-grid,
.charts-grid,
.split-grid {
    gap: 18px;
}

.card {
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(17, 24, 36, 0.92), rgba(10, 14, 24, 0.84));
    border-color: rgba(255, 255, 255, 0.07);
    box-shadow: var(--shadow-sm);
}

.card:hover {
    border-color: rgba(215, 180, 90, 0.18);
    transform: translateY(-1px);
}

.dashboard-notifications {
    margin-top: 18px;
    padding: 22px;
}

.dashboard-notifications-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.dashboard-notifications-head h2 {
    margin: 8px 0 6px;
    font-size: 20px;
    letter-spacing: -0.03em;
}

.dashboard-notifications-list {
    display: grid;
    gap: 10px;
}

.dashboard-notification-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.dashboard-notification-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(215, 180, 90, 0.14);
    border: 1px solid rgba(215, 180, 90, 0.20);
    color: var(--gold-strong);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.dashboard-notification-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.dashboard-notification-body strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.dashboard-notification-body span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.dashboard-notification-date {
    color: rgba(244, 217, 138, 0.92);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.dashboard-notifications-more {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: flex-end;
}

.dashboard-notifications-more a {
    color: var(--gold-strong);
    font-size: 13px;
    font-weight: 700;
}

.dashboard-notifications-empty {
    margin: 0;
}

.stat-card {
    min-height: 118px;
    padding: 24px 22px;
}

.stat-card::before {
    width: 34px;
    height: 4px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.stat-label {
    color: rgba(154, 167, 186, 0.9);
    font-size: 11px;
    letter-spacing: 0.14em;
}

.stat-value {
    font-size: clamp(24px, 3vw, 34px);
}

.filters-bar {
    padding: 20px 22px;
    align-items: end;
}

.filters-bar-title,
.table-card-title,
.section-divider h2,
.chart-card h3,
.form-section-title,
.upload-help h3 {
    letter-spacing: 0.14em;
}

.filter-group label,
.form-group label {
    color: rgba(215, 220, 230, 0.92);
    letter-spacing: 0.08em;
}

.filter-group select,
.filter-group input[type="text"],
.filter-group input[type="date"],
.form-group input,
.form-group select,
.inline-mini-form input[type="date"],
.doc-add-form select,
.doc-add-form input[type="date"] {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    color: var(--text);
}

.filter-group select:hover,
.filter-group input[type="text"]:hover,
.filter-group input[type="date"]:hover,
.form-group input:hover,
.form-group select:hover {
    border-color: rgba(215, 180, 90, 0.30);
}

.filter-group select:focus,
.filter-group input[type="text"]:focus,
.filter-group input[type="date"]:focus,
.form-group input:focus,
.form-group select:focus,
.inline-mini-form input[type="date"]:focus,
.doc-add-form select:focus,
.doc-add-form input[type="date"]:focus {
    border-color: rgba(215, 180, 90, 0.55);
    box-shadow: 0 0 0 4px rgba(215, 180, 90, 0.12);
}

.btn-primary,
.btn-secondary,
.btn-delete,
.btn-danger,
.action-icon-btn,
.sidebar-toggle,
.new-contract-card summary,
.inline-add summary,
.doc-pill-edit summary,
.date-edit-toggle summary {
    border-radius: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-strong), var(--gold));
    color: #1b1607;
    box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #f7e39d, #dfb95a);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.12);
}

.btn-secondary:hover {
    background: rgba(215, 180, 90, 0.10);
    border-color: rgba(215, 180, 90, 0.30);
    color: var(--gold-strong);
}

.btn-delete,
.btn-danger {
    background: rgba(239, 91, 91, 0.10);
    border-color: rgba(239, 91, 91, 0.24);
    color: #ffc0c0;
}

.btn-delete:hover,
.btn-danger:hover {
    background: rgba(239, 91, 91, 0.18);
    border-color: rgba(239, 91, 91, 0.38);
}

.table-card {
    padding: 0;
    overflow: hidden;
}

.table-card-title {
    padding: 20px 22px 16px;
}

.tbl-contratos {
    font-size: 14px;
}

.tbl-contratos th {
    background: rgba(255, 255, 255, 0.025);
    color: rgba(154, 167, 186, 0.92);
}

.tbl-contratos td {
    padding: 16px 22px;
}

.tbl-contratos tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.status-select,
.status-badge {
    box-shadow: none;
}

.status-select.status-positivo,
.status-badge.status-positivo {
    background-color: rgba(39, 194, 109, 0.12);
    color: var(--green-soft);
    border-color: rgba(39, 194, 109, 0.28);
}

.status-select.status-negativo,
.status-badge.status-negativo {
    background-color: rgba(239, 91, 91, 0.12);
    color: #ffc3c3;
    border-color: rgba(239, 91, 91, 0.26);
}

.status-select.status-indefinido,
.status-badge.status-indefinido,
.status-select.status-neutro,
.status-badge.status-neutro {
    background-color: rgba(255, 255, 255, 0.045);
}

.tag-pill {
    background: rgba(215, 180, 90, 0.12);
    border-color: rgba(215, 180, 90, 0.18);
    color: var(--gold-strong);
}

.tag-empty {
    color: rgba(154, 167, 186, 0.78);
}

.new-contract-card summary,
.inline-add summary {
    background: rgba(215, 180, 90, 0.12);
    border-color: rgba(215, 180, 90, 0.20);
    color: var(--gold-strong);
}

.new-contract-card summary:hover,
.inline-add summary:hover {
    background: rgba(215, 180, 90, 0.18);
    border-color: rgba(215, 180, 90, 0.30);
}

.app-footer {
    margin-top: 28px;
    padding: 18px 6px 2px;
    border-top-color: rgba(255, 255, 255, 0.08);
}

.app-footer p {
    font-size: 12px;
    color: rgba(154, 167, 186, 0.88);
}

.section-divider {
    padding-top: 22px;
    margin-top: 34px;
}

.section-divider h2 {
    font-size: 18px;
}

.section-divider p {
    color: rgba(154, 167, 186, 0.9);
}

.login-body {
    background:
        radial-gradient(circle at top, rgba(215, 180, 90, 0.22), transparent 32%),
        radial-gradient(circle at bottom right, rgba(215, 180, 90, 0.08), transparent 26%),
        linear-gradient(180deg, #090d16 0%, #04060b 100%);
}

.login-box {
    max-width: 500px;
    padding: 44px 40px 36px;
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(18, 25, 38, 0.94), rgba(10, 14, 22, 0.90));
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-lg);
}

.login-box h1 {
    font-size: clamp(28px, 5vw, 38px);
    margin-top: 10px;
}

.login-sub {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(154, 167, 186, 0.92);
}

.login-form {
    gap: 8px;
}

.login-form label {
    margin-top: 10px;
    color: rgba(215, 220, 230, 0.92);
}

.login-form input {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.10);
    border-radius: 14px;
}

.login-footer {
    margin-top: 20px;
    color: rgba(154, 167, 186, 0.82);
}

.alert {
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.modal {
    border-radius: 24px;
}

.toast {
    border-radius: 16px;
}

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar-thumb {
    background: rgba(215, 180, 90, 0.28);
    border: 3px solid rgba(7, 11, 20, 0.65);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(215, 180, 90, 0.42);
}

@media (max-width: 900px) {
    :root {
        --content-pad-y: 20px;
        --content-pad-x: 18px;
        --sidebar-width: 260px;
    }

    .sidebar {
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        border-radius: 0 24px 24px 0;
    }

    .main-content {
        margin-left: 0;
        padding: 20px 18px 24px;
    }

    .page-header,
    .page-header-row,
    .card,
    .filters-bar {
        border-radius: 20px;
    }
}

@media (max-width: 480px) {
    :root {
        --content-pad-y: 14px;
        --content-pad-x: 14px;
    }

    .page-header,
    .page-header-row,
    .card,
    .filters-bar {
        padding: 18px 16px;
    }

    .login-box {
        padding: 32px 20px 26px;
        border-radius: 22px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-delete,
    .btn-danger {
        width: 100%;
    }
}
