﻿:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #1b2432;
    --muted: #6f7a8d;
    --line: #dfe5ef;
    --primary: #0e8aa8;
    --primary-strong: #0a6f87;
    --success: #1d9b61;
    --danger: #d64545;
    --sidebar-start: #09243a;
    --sidebar-end: #0f4364;
    --radius: 16px;
    --shadow: 0 18px 35px rgba(15, 36, 59, 0.09);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    background:
        radial-gradient(circle at 10% 10%, rgba(14, 138, 168, 0.08), transparent 35%),
        radial-gradient(circle at 90% 90%, rgba(18, 84, 123, 0.08), transparent 30%),
        var(--bg);
    color: var(--text);
}

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

.sidebar {
    background: linear-gradient(170deg, var(--sidebar-start), var(--sidebar-end));
    color: #e7f2fa;
    padding: 1.25rem;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.15);
    font-size: 1.25rem;
}

.sidebar-brand small {
    display: block;
    opacity: 0.8;
}

.sidebar-nav {
    display: grid;
    gap: 0.4rem;
}

.sidebar-link {
    text-decoration: none;
    color: #e5edf6;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(2px);
}

.sidebar-link.active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding-top: 1rem;
}

.sidebar-footer .text-muted,
.sidebar-footer .small.text-muted {
    color: rgba(231, 242, 250, 0.78) !important;
}

.sidebar-footer strong {
    color: #ffffff;
}

.sidebar-footer .small {
    color: rgba(231, 242, 250, 0.9);
}

.main-content {
    padding: 1.5rem;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.page-title {
    font-size: 1.1rem;
    margin: 0;
}

.page-subtitle {
    color: var(--muted);
    font-size: 0.93rem;
}

.metric-card {
    background: linear-gradient(160deg, #fff, #f6f9fd);
    border-radius: var(--radius);
    padding: 1.1rem;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.metric-card span {
    font-size: 0.85rem;
    color: var(--muted);
}

.metric-card h2 {
    margin: 0.35rem 0;
    font-size: 1.45rem;
}

.metric-card small {
    color: var(--muted);
}

.metric-danger h2 {
    color: var(--danger);
}

.metric-success h2 {
    color: var(--success);
}

.panel-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
}

.chart-wrap {
    position: relative;
    width: 100%;
    height: 320px;
}

.chart-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.panel-card .table {
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    padding: 0.65rem 0.55rem;
}

.badge.status-pending {
    background: rgba(214, 69, 69, 0.12);
    color: #a23131;
}

.badge.status-paid {
    background: rgba(29, 155, 97, 0.14);
    color: #177549;
}

.badge.status-overdue {
    background: rgba(255, 172, 62, 0.2);
    color: #946112;
}

.auth-body {
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 12% 18%, rgba(34, 130, 166, 0.22), transparent 35%),
        radial-gradient(circle at 90% 85%, rgba(16, 86, 127, 0.18), transparent 40%),
        linear-gradient(145deg, #ecf7ff, #f6fbff 55%, #ecf2f8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 2.2vw, 2rem);
    overflow-x: hidden;
}

.auth-scene {
    position: relative;
    width: 100%;
    max-width: 1040px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-scene::before {
    content: '';
    position: absolute;
    inset: -12px;
    border-radius: 30px;
    background: linear-gradient(125deg, rgba(14, 138, 168, 0.18), rgba(10, 48, 77, 0.08), rgba(210, 127, 47, 0.14));
    filter: blur(16px);
    opacity: 0.9;
    z-index: 0;
    pointer-events: none;
    animation: auth-glow 8s ease-in-out infinite;
}

.auth-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(1px);
    z-index: 0;
    pointer-events: none;
    animation: auth-float 8s ease-in-out infinite;
}

.auth-orb-a {
    width: 150px;
    height: 150px;
    top: -35px;
    left: -25px;
    background: radial-gradient(circle, rgba(14, 138, 168, 0.28), rgba(14, 138, 168, 0.02));
}

.auth-orb-b {
    width: 190px;
    height: 190px;
    right: -35px;
    top: 45px;
    background: radial-gradient(circle, rgba(210, 127, 47, 0.24), rgba(210, 127, 47, 0.02));
    animation-delay: 1.1s;
}

.auth-orb-c {
    width: 120px;
    height: 120px;
    bottom: -20px;
    left: 52%;
    background: radial-gradient(circle, rgba(12, 57, 88, 0.22), rgba(12, 57, 88, 0.01));
    animation-delay: 2.2s;
}

.auth-shell {
    width: 100%;
    max-width: 1040px;
    display: grid;
    grid-template-columns: 1.22fr 1fr;
    gap: 1.1rem;
    align-items: stretch;
    position: relative;
    z-index: 1;
    padding: 0.35rem;
    border-radius: 28px;
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.2));
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(6px);
    margin-inline: auto;
}

.auth-info {
    padding: 2.1rem;
    border-radius: 24px;
    background: linear-gradient(160deg, #0a304d, #0f4f76 55%, #0d6f95);
    color: #f1f6fa;
    box-shadow: 0 20px 42px rgba(13, 57, 88, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    animation: auth-rise 0.75s ease both;
}

.auth-info h2 {
    margin-top: 0.8rem;
    margin-bottom: 1rem;
    font-size: clamp(1.45rem, 2vw, 1.9rem);
    line-height: 1.2;
}

.auth-info p {
    opacity: 0.94;
    margin-bottom: 1rem;
}

.auth-info ul {
    margin: 1rem 0 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.45rem;
}

.auth-badge {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    letter-spacing: 0.01em;
}

.auth-credit {
    margin-top: auto;
    padding-top: 1rem;
    display: grid;
    gap: 0.4rem;
    font-size: 0.94rem;
}

.auth-credit span {
    color: rgba(240, 248, 255, 0.9);
}

.auth-credit a {
    color: #8ef2bd;
    text-decoration: none;
    width: fit-content;
    font-weight: 600;
}

.auth-credit a:hover {
    color: #b3ffd7;
}

.auth-card {
    border: 0;
    border-radius: 24px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    animation: auth-rise 0.75s ease both;
    animation-delay: 0.08s;
}

.auth-info,
.auth-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.auth-info:hover,
.auth-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 45px rgba(15, 36, 59, 0.2);
}

.auth-card .form-control {
    border-radius: 12px;
    border-color: #cad8ea;
    min-height: 46px;
}

.auth-card .form-control:focus {
    border-color: #6cb8cc;
    box-shadow: 0 0 0 0.24rem rgba(14, 138, 168, 0.16);
}

.auth-login-btn {
    min-height: 48px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.auth-login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(10, 111, 135, 0.22);
}

@keyframes auth-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes auth-rise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes auth-glow {
    0%, 100% {
        opacity: 0.78;
    }
    50% {
        opacity: 1;
    }
}

.form-control,
.form-select {
    border-radius: 10px;
    border-color: #ccd7e5;
}

.form-control:focus,
.form-select:focus {
    border-color: #7dbfd0;
    box-shadow: 0 0 0 0.2rem rgba(14, 138, 168, 0.15);
}

.btn-primary {
    background: linear-gradient(120deg, var(--primary), var(--primary-strong));
    border: none;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(120deg, var(--primary-strong), #075d73);
}

@media (max-width: 1024px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 1040;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        padding: 1rem;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        padding: 0.2rem;
    }
}

@media (max-width: 640px) {
    .panel-card,
    .metric-card {
        border-radius: 12px;
    }

    .auth-info h2 {
        font-size: 1.4rem;
    }

    .auth-info {
        padding: 1.5rem;
    }

    .auth-orb {
        opacity: 0.6;
    }

    .chart-wrap {
        height: 260px;
    }
}
