:root {
    --primary: #0F172A;
    --secondary: #1E293B;
    --accent: #2563EB;
    --success: #22C55E;
    --background: #F8FAFC;
    --card: #FFFFFF;
    --border: #E2E8F0;
    --text: #0F172A;
    --muted: #64748B;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 80% -10%, rgba(37, 99, 235, .08), transparent 32%),
        var(--background);
    color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #1D4ED8; }

.landing-body {
    background: radial-gradient(circle at top left, rgba(37, 99, 235, .12), transparent 32%), var(--background);
}

.landing-nav {
    padding: 22px 0;
}

.brand, .landing-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}

.landing-brand { color: var(--primary); }

.brand:hover, .landing-brand:hover { color: inherit; }

.brand-mark {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #EFF6FF, #2563EB);
    border: 2px solid rgba(37, 99, 235, .35);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0;
    flex: 0 0 auto;
}

.brand strong, .landing-brand strong { display: block; line-height: 1.1; }
.brand small, .landing-brand small { display: block; color: #94A3B8; font-size: 12px; margin-top: 3px; }
.landing-brand small { color: var(--muted); }

.hero {
    padding: 70px 0 34px;
}

.hero h1 {
    font-size: clamp(42px, 7vw, 76px);
    line-height: 1.02;
    letter-spacing: 0;
    font-weight: 800;
    color: var(--primary);
}

.hero p {
    max-width: 730px;
    color: var(--muted);
    font-size: 20px;
    line-height: 1.65;
}

.feature-band {
    padding: 34px 0 70px;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 282px;
    background: linear-gradient(180deg, #020B1F 0%, #062047 100%);
    color: #fff;
    padding: 22px 18px;
    position: fixed;
    inset: 0 auto 0 0;
    overflow-y: auto;
    z-index: 20;
}

.sidebar .brand {
    margin-bottom: 28px;
    padding: 0 6px;
}

.sidebar .nav-link {
    color: #CBD5E1;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 6px;
    font-weight: 600;
    transition: all .18s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(37, 99, 235, .45), rgba(37, 99, 235, .18));
    transform: translateX(2px);
}

.main {
    margin-left: 282px;
    min-height: 100vh;
    width: calc(100% - 282px);
}

.topbar {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 34px;
    background: linear-gradient(90deg, #020B1F, #08275A);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,.08);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar h1 { font-size: 24px; margin: 0; font-weight: 800; letter-spacing: 0; color: #fff; }
.topbar p { margin: 4px 0 0; color: #C9D6EA; }

.content {
    padding: 30px 34px 48px;
}

.menu-toggle {
    display: none;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 8px;
    padding: 9px 12px;
    font-weight: 700;
}

.account-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    padding: 8px 11px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
}

.account-chip span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #DBEAFE;
    color: var(--accent);
    font-weight: 800;
}

.account-chip strong, .account-chip small { display: block; color: #fff; }
.account-chip small { color: #C9D6EA; }

.cardx {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
    transition: transform .18s ease, box-shadow .18s ease;
}

.cardx:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 50px rgba(15, 23, 42, .10);
}

.metric-card { padding: 22px; min-height: 132px; }
.metric-card span { display: block; color: var(--muted); font-weight: 700; font-size: 13px; text-transform: uppercase; }
.metric-card strong { display: block; margin-top: 12px; font-size: 25px; line-height: 1.2; }
.metric-card small { color: var(--muted); }

.section-card { padding: 26px; }
.section-title { font-size: 18px; font-weight: 800; margin: 0 0 16px; }
.muted { color: var(--muted); }

.btn-primary {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: #1D4ED8;
    --bs-btn-hover-border-color: #1D4ED8;
}

.btn, .form-control, .form-select { border-radius: 8px; }
.btn { font-weight: 700; transition: all .18s ease; }
.btn:hover { transform: translateY(-1px); }

.table {
    --bs-table-bg: transparent;
}

.table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.invoice-paper {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 34px;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .08);
}

.paper-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: -34px -34px 30px;
    padding: 22px 34px;
    border-bottom: 1px solid var(--border);
}

.detail-table {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.detail-table .row-line {
    display: grid;
    grid-template-columns: 180px 1fr;
    border-bottom: 1px solid var(--border);
}

.detail-table .row-line:last-child { border-bottom: 0; }
.detail-table .row-line span,
.detail-table .row-line strong {
    padding: 14px 16px;
}
.detail-table .row-line span {
    background: #F8FAFC;
    font-weight: 700;
}

.paid-stamp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--success);
    color: #15803D;
    background: #DCFCE7;
    border-radius: 8px;
    padding: 12px 18px;
    font-size: 24px;
    font-weight: 800;
    text-transform: uppercase;
}

.doc-card {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.conversation {
    display: grid;
    gap: 14px;
}

.message {
    border-radius: 8px;
    padding: 14px 16px;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
}

.message.client {
    background: #F8FAFC;
    border-color: var(--border);
}

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(circle at top, rgba(37, 99, 235, .16), transparent 30%), var(--background);
}

.auth-card {
    width: 100%;
    max-width: 460px;
    padding: 30px;
}

.loading-bar {
    height: 4px;
    width: 100%;
    overflow: hidden;
    border-radius: 999px;
    background: #E2E8F0;
}

.loading-bar::before {
    content: "";
    display: block;
    width: 38%;
    height: 100%;
    background: var(--accent);
    animation: load 1.2s ease-in-out infinite;
}

@keyframes load {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(270%); }
}

@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .22s ease;
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .main {
        margin-left: 0;
        width: 100%;
    }
    .menu-toggle { display: inline-flex; }
    .topbar {
        align-items: flex-start;
        padding: 18px;
        flex-wrap: wrap;
    }
    .content { padding: 22px 18px 36px; }
}

@media (max-width: 575px) {
    .hero { padding-top: 34px; }
    .hero p { font-size: 17px; }
    .account-chip { width: 100%; }
    .invoice-paper { padding: 20px; }
    .topbar h1 { font-size: 23px; }
}
