:root {
    --bg: #0b1120;
    --bg-soft: #111827;
    --panel: rgba(255,255,255,0.92);
    --panel-strong: #ffffff;
    --line: rgba(148, 163, 184, 0.18);
    --text: #0f172a;
    --muted: #64748b;
    --primary: #4f46e5;
    --primary-2: #7c3aed;
    --success-bg: #dcfce7;
    --success-tx: #166534;
    --danger-bg: #fee2e2;
    --danger-tx: #991b1b;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
    --radius: 24px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    font-family: 'Inter', Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, 0.20), transparent 26%),
        radial-gradient(circle at top right, rgba(124, 58, 237, 0.18), transparent 24%),
        linear-gradient(180deg, #eef2ff 0%, #f8fafc 52%, #eef2ff 100%);
    color: var(--text);
}

a { color: inherit; }

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

.sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    color: #fff;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid rgba(255,255,255,0.06);
}

.brand-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding: 16px;
    border-radius: 22px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
}

.brand-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    font-weight: 800;
    font-size: 22px;
}

.brand-card h2, .brand-card p { margin: 0; }
.brand-card h2 { font-size: 18px; }
.brand-card p { color: #cbd5e1; font-size: 13px; margin-top: 3px; }

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-menu a {
    text-decoration: none;
    color: #dbeafe;
    padding: 13px 16px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    font-weight: 600;
    transition: 0.2s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    transform: translateX(3px);
    background: linear-gradient(135deg, rgba(79,70,229,0.32), rgba(124,58,237,0.24));
    color: #fff;
}

.content {
    padding: 26px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 22px;
}

.eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--primary);
    margin-bottom: 8px;
}

.page-title {
    margin: 0;
    font-size: 32px;
    font-weight: 800;
}

.page-subtitle {
    margin: 8px 0 0;
    color: var(--muted);
    max-width: 760px;
}

.topbar-chip,
.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary);
    border: 1px solid rgba(79, 70, 229, 0.12);
}

.pill.secure { color: #166534; background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.18); }

.hero-card,
.card,
.login-box,
.login-side-card {
    background: var(--panel);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 24px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}
.hero-card h2 { margin: 10px 0 8px; font-size: 28px; }
.hero-card p { margin: 0; color: var(--muted); max-width: 700px; }

.hero-metrics {
    display: grid;
    gap: 14px;
    min-width: 230px;
}
.hero-metrics div {
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(79,70,229,0.10), rgba(124,58,237,0.10));
    border: 1px solid rgba(79,70,229,0.12);
}
.hero-metrics small { display: block; color: var(--muted); margin-bottom: 8px; }
.hero-metrics strong { font-size: 22px; }

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

.stat-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.88));
    border-radius: var(--radius);
    padding: 22px;
    border: 1px solid rgba(255,255,255,0.6);
    box-shadow: var(--shadow);
}

.stat-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat-value { margin-top: 10px; font-size: 34px; font-weight: 800; line-height: 1.1; }
.stat-value.money { font-size: 28px; }
.stat-card p { color: var(--muted); font-size: 13px; margin-bottom: 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.compact-grid { gap: 12px; }
.detail-grid { display: grid; gap: 18px; grid-template-columns: 1.2fr 0.8fr; margin-top: 18px; }

.card { padding: 22px; margin-bottom: 18px; }
.surface-card { background: rgba(255,255,255,0.82); }
.card h2, .card h3 { margin-top: 0; }

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}
.section-head p { margin: 6px 0 0; }

.muted { color: var(--muted); font-size: 14px; }

label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

input, select, textarea {
    width: 100%;
    padding: 13px 14px;
    border-radius: 16px;
    border: 1px solid #dbe1ea;
    outline: none;
    margin-bottom: 14px;
    background: rgba(255,255,255,0.95);
    color: var(--text);
    transition: 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: rgba(79,70,229,0.45);
    box-shadow: 0 0 0 4px rgba(79,70,229,0.08);
}

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

button, .btn {
    border: 0;
    border-radius: 16px;
    padding: 12px 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    font-weight: 700;
    box-shadow: 0 12px 24px rgba(79,70,229,0.18);
}

.btn-danger { background: linear-gradient(135deg, #dc2626, #b91c1c); box-shadow: none; }
.btn-secondary { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.btn-light { background: #e2e8f0; color: var(--text); box-shadow: none; }

.table-wrap {
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.table-wrap table { margin: 0; }

table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255,255,255,0.74);
}

th, td {
    padding: 14px 14px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    text-align: left;
    font-size: 14px;
    vertical-align: middle;
}

th {
    background: rgba(248, 250, 252, 0.9);
    color: #334155;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}
.badge-ativo { background: #dcfce7; color: #166534; }
.badge-quitado { background: #e2e8f0; color: #334155; }
.badge-owner { background: rgba(79,70,229,0.12); color: var(--primary); }

.user-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.07);
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
}
.user-box span { display: block; margin-top: 4px; color: #cbd5e1; font-size: 13px; }
.avatar {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    background: linear-gradient(135deg, rgba(79,70,229,0.95), rgba(124,58,237,0.95));
}

.alert {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 18px;
    font-weight: 600;
}
.alert.success { background: var(--success-bg); color: var(--success-tx); }
.alert.error { background: var(--danger-bg); color: var(--danger-tx); }

.flex { display: flex; gap: 10px; flex-wrap: wrap; }

.progress {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    margin-bottom: 6px;
}
.progress.large { height: 14px; margin-top: 12px; }
.progress > div {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    border-radius: inherit;
}

.insight-list,
.mini-stats-grid {
    display: grid;
    gap: 12px;
}

.insight-item,
.mini-stat {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(79,70,229,0.05);
    border: 1px solid rgba(79,70,229,0.08);
}

.mini-stat {
    flex-direction: column;
    background: rgba(15,23,42,0.03);
    border-color: rgba(148,163,184,0.14);
}
.mini-stat span, .insight-item span { color: var(--muted); font-size: 13px; }
.mini-stat strong, .insight-item strong { font-size: 16px; }

.footer-note {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
    margin-top: 8px;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.login-hero {
    width: 100%;
    max-width: 1080px;
    display: grid;
    grid-template-columns: 1fr 0.8fr;
    gap: 20px;
    align-items: stretch;
}

.pro-box {
    width: 100%;
    padding: 30px;
}
.pro-box h1 { margin: 14px 0 8px; font-size: 34px; }
.login-owner-box {
    margin-top: 18px;
    padding: 18px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(79,70,229,0.08), rgba(124,58,237,0.08));
    border: 1px solid rgba(79,70,229,0.12);
}
.login-owner-box p { margin: 8px 0 0; }
.login-owner-box span { color: var(--muted); }

.login-side-card {
    padding: 30px;
    background: linear-gradient(160deg, #0f172a, #312e81);
    color: #fff;
}
.login-side-card h2 { margin-top: 0; font-size: 30px; }
.login-side-card ul { margin: 20px 0 0; padding-left: 20px; color: #dbeafe; }
.login-side-card li { margin-bottom: 14px; }

@media (max-width: 1080px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { gap: 18px; }
    .detail-grid, .login-hero { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .content { padding: 18px; }
    .topbar, .hero-card, .footer-note { flex-direction: column; }
    .page-title { font-size: 26px; }
    .hero-card h2 { font-size: 24px; }
    .stat-value { font-size: 28px; }
}


.dashboard-grid-pro2 {
    display: grid;
    grid-template-columns: 1.3fr 0.85fr 0.85fr;
    gap: 18px;
    margin-bottom: 18px;
}

.chart-card { min-height: 360px; }
.chart-card-wide { min-height: 360px; }
.chart-wrap {
    position: relative;
    height: 280px;
}
.chart-lg {
    height: 340px;
}
.hero-card-pro2 {
    background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(238,242,255,0.96));
}

@media (max-width: 1180px) {
    .dashboard-grid-pro2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .chart-wrap { height: 250px; }
    .chart-lg { height: 300px; }
}
