/* ==========================================================
   V-Fin — Design System
   Paleta derivada da logo: azul-marinho profundo + gradiente azul
   Tipografia: Outfit (única família, variando peso/tamanho)
   ========================================================== */

:root {
    /* Paleta */
    --navy-950: #0a0f1e;
    --navy-900: #0e1526;
    --navy-800: #141c33;
    --navy-700: #1b2540;
    --navy-600: #26325a;
    --blue-500: #2f7ef2;
    --blue-400: #4f9dff;
    --blue-300: #7fbaff;
    --ink-900: #10182b;
    --ink-600: #4c5670;
    --ink-400: #8892a8;
    --line: #e6e9f2;
    --bg-app: #f4f6fb;
    --white: #ffffff;

    --pago-bg: #e4f7ec;
    --pago-fg: #1a8f52;
    --pendente-bg: #fdecec;
    --pendente-fg: #d13b3b;
    --parcial-bg: #fff4e0;
    --parcial-fg: #b5760a;

    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow-card: 0 1px 2px rgba(16, 24, 43, 0.04), 0 8px 24px rgba(16, 24, 43, 0.06);
    --shadow-pop: 0 20px 60px rgba(10, 15, 30, 0.25);
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    background: var(--bg-app);
    color: var(--ink-900);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }

/* ---------- Scrollbar sutil ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cfd6e6; border-radius: 8px; }

/* ==========================================================
   TELAS DE AUTENTICAÇÃO (login / cadastro de usuário)
   ========================================================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 15% 20%, rgba(79, 157, 255, 0.18), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(47, 126, 242, 0.15), transparent 45%),
        var(--navy-950);
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--navy-900);
    border: 1px solid var(--navy-700);
    border-radius: var(--radius-lg);
    padding: 40px 32px 32px;
    box-shadow: var(--shadow-pop);
}

.auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.auth-logo img {
    width: 68px;
    height: 68px;
    border-radius: 18px;
}

.auth-logo .tagline {
    color: var(--blue-300);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.02em;
    text-align: center;
}

.auth-title {
    color: var(--white);
    font-size: 20px;
    text-align: center;
    margin-bottom: 4px;
}

.auth-sub {
    color: #8896b8;
    font-size: 14px;
    text-align: center;
    margin-bottom: 28px;
}

.field { margin-bottom: 18px; }

.field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #b7c1db;
    margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--navy-800);
    border: 1px solid var(--navy-600);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-family: inherit;
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.field input::placeholder { color: #5c6685; }

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(47, 126, 242, 0.25);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .1s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: linear-gradient(135deg, var(--blue-400), var(--blue-500));
    color: var(--white);
    box-shadow: 0 8px 20px rgba(47, 126, 242, 0.35);
}
.btn-primary:hover { opacity: 0.94; }

.btn-block { width: 100%; }

.btn-ghost {
    background: transparent;
    color: var(--ink-600);
    border: 1px solid var(--line);
}
.btn-ghost:hover { background: #f0f2f8; }

.btn-danger-ghost {
    background: transparent;
    color: var(--pendente-fg);
    border: 1px solid #f3c9c9;
}
.btn-danger-ghost:hover { background: var(--pendente-bg); }

.btn-sm { padding: 8px 14px; font-size: 13px; }

.auth-footer-link {
    text-align: center;
    margin-top: 22px;
    font-size: 13px;
    color: #8896b8;
}
.auth-footer-link a { color: var(--blue-300); font-weight: 600; }

.alert {
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 13px;
    margin-bottom: 18px;
    font-weight: 500;
}
.alert-erro { background: rgba(209, 59, 59, 0.12); color: #ff9b9b; border: 1px solid rgba(209, 59, 59, 0.3); }
.alert-sucesso { background: rgba(26, 143, 82, 0.12); color: #6fe3a8; border: 1px solid rgba(26, 143, 82, 0.3); }

/* Flash alerts dentro do app (fundo claro) */
.flash {
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.flash-sucesso { background: var(--pago-bg); color: var(--pago-fg); }
.flash-erro { background: var(--pendente-bg); color: var(--pendente-fg); }

/* ==========================================================
   LAYOUT DO APP (sidebar + conteúdo)
   ========================================================== */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--navy-950);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand img { width: 38px; height: 38px; border-radius: 10px; }
.sidebar-brand .name { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.sidebar-brand .sub { font-size: 11px; color: var(--blue-300); font-weight: 400; }

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: #a8b3cf;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.9; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.nav-item.active {
    background: linear-gradient(135deg, rgba(47,126,242,0.25), rgba(79,157,255,0.12));
    color: var(--white);
    box-shadow: inset 0 0 0 1px rgba(79,157,255,0.35);
}

.sidebar-footer {
    padding: 16px 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 12px;
}
.sidebar-user .avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-400), var(--blue-500));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; color: white; flex-shrink: 0;
}
.sidebar-user .info { min-width: 0; }
.sidebar-user .info .nome { font-size: 13px; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .info .email { font-size: 11px; color: #7b869f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 32px;
    border-bottom: 1px solid var(--line);
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar .page-title { font-size: 20px; }
.topbar .page-desc { font-size: 13px; color: var(--ink-400); margin-top: 2px; }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.menu-toggle svg { width: 24px; height: 24px; color: var(--ink-900); }

.content {
    padding: 28px 32px 60px;
    flex: 1;
}

/* ==========================================================
   COMPONENTES DE APP
   ========================================================== */

.cards-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--line);
}
.stat-card .label { font-size: 12px; color: var(--ink-400); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card .value { font-size: 24px; font-weight: 700; margin-top: 6px; }
.stat-card.accent { background: linear-gradient(135deg, var(--navy-900), var(--navy-700)); border: none; }
.stat-card.accent .label { color: var(--blue-300); }
.stat-card.accent .value { color: var(--white); }

.panel {
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}
.panel-header h3 { font-size: 16px; }
.panel-body { padding: 22px; }
.panel-body.no-pad { padding: 0; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.form-grid .span-2 { grid-column: span 2; }

.field-inline-btn { display: flex; gap: 8px; align-items: stretch; }
.field-inline-btn select { flex: 1; }
.icon-btn {
    flex-shrink: 0;
    width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-app);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--blue-500);
    transition: background .15s ease;
}
.icon-btn:hover { background: #e9edf7; }
.icon-btn svg { width: 20px; height: 20px; }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

/* App inputs (fundo claro) */
.field-light label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-600); margin-bottom: 6px; }
.field-light input,
.field-light select,
.field-light textarea {
    width: 100%;
    padding: 11px 13px;
    background: var(--white);
    border: 1px solid #d7dcea;
    border-radius: var(--radius-sm);
    color: var(--ink-900);
    font-family: inherit;
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field-light textarea { resize: vertical; min-height: 70px; }
.field-light input:focus,
.field-light select:focus,
.field-light textarea:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(47, 126, 242, 0.15);
}

/* Tabela */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-400);
    font-weight: 600;
    padding: 12px 22px;
    background: #fafbfe;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.data-table td {
    padding: 14px 22px;
    border-bottom: 1px solid #f0f2f8;
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafbfe; }
.data-table .cell-obs { color: var(--ink-400); font-size: 13px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table .cell-cache { font-weight: 600; }
.data-table .row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
}
.badge-pago { background: var(--pago-bg); color: var(--pago-fg); }
.badge-pendente { background: var(--pendente-bg); color: var(--pendente-fg); }
.badge-parcial { background: var(--parcial-bg); color: var(--parcial-fg); }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--ink-400);
}
.empty-state svg { width: 46px; height: 46px; margin-bottom: 14px; opacity: 0.5; }
.empty-state .title { font-size: 15px; font-weight: 600; color: var(--ink-600); margin-bottom: 4px; }
.empty-state .sub { font-size: 13px; }

.icon-action {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--white);
    cursor: pointer;
    color: var(--ink-600);
    transition: background .15s ease, color .15s ease;
}
.icon-action svg { width: 16px; height: 16px; }
.icon-action:hover { background: var(--bg-app); }
.icon-action.danger:hover { background: var(--pendente-bg); color: var(--pendente-fg); border-color: #f3c9c9; }

/* Filtros */
.filter-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    align-items: end;
}
.filter-bar .btn { height: 44px; }

/* ==========================================================
   MODAL (pop-up de nova banda)
   ========================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 30, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}
.modal-overlay.aberto { display: flex; }
.modal-box {
    width: 100%;
    max-width: 380px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
    padding: 26px;
}
.modal-box h3 { font-size: 17px; margin-bottom: 4px; }
.modal-box .modal-sub { font-size: 13px; color: var(--ink-400); margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* Toast simples */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--navy-900);
    color: white;
    padding: 13px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-pop);
    z-index: 200;
    display: none;
    align-items: center;
    gap: 10px;
}
.toast.mostrar { display: flex; }
.toast.erro { background: #7a2323; }

/* ==========================================================
   RESPONSIVO
   ========================================================== */
@media (max-width: 1024px) {
    .cards-row { grid-template-columns: repeat(2, 1fr); }
    .filter-bar { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: span 1; }
}

@media (max-width: 860px) {
    .sidebar {
        position: fixed;
        left: 0; top: 0;
        transform: translateX(-100%);
        transition: transform .2s ease;
        z-index: 90;
        box-shadow: var(--shadow-pop);
    }
    .sidebar.aberta { transform: translateX(0); }
    .menu-toggle { display: inline-flex; }
    .sidebar-scrim {
        display: none;
        position: fixed; inset: 0; background: rgba(10,15,30,0.5); z-index: 80;
    }
    .sidebar-scrim.aberta { display: block; }
    .topbar { padding: 16px 18px; }
    .content { padding: 20px 18px 50px; }
}

@media (max-width: 640px) {
    .cards-row { grid-template-columns: 1fr; }
    .data-table th, .data-table td { padding: 12px 14px; }
    .panel-header { padding: 16px; }
    .panel-body { padding: 16px; }
    .modal-box { padding: 20px; }
}
