@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600&family=Lora:ital@0;1&display=swap');

/* ─── RESET ──────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
    --teal-900: #0d3d3a;
    --teal-700: #165c57;
    --teal-500: #1e8c84;
    --teal-300: #7fe3c8;
    --teal-100: #c8f0e8;
    --teal-50:  #f0faf8;

    --slate-800: #1e2e2d;
    --slate-500: #4a6b68;
    --slate-400: #6b8a87;
    --slate-300: #9ab5b2;
    --slate-200: #b5ceca;
    --slate-100: #dcecea;
    --slate-50:  #f3f7f6;

    --coral-500: #e07a5f;
    --coral-100: #fff0ee;
    --coral-900: #7a2e1a;

    --font-head: 'Sora', sans-serif;
    --font-serif: 'Lora', serif;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 14px;

    --sidebar-w: 260px;
}

/* ─── BASE ───────────────────────────────────────────────── */
body {
    font-family: var(--font-head);
    background: var(--slate-50);
    color: var(--slate-800);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ─── LOGIN PAGE ─────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--slate-50);
    padding: 16px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 0.5px solid var(--slate-100);
    padding: 40px 36px;
}

.login-card .brand {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 28px;
    color: var(--teal-900);
    margin-bottom: 4px;
}

.login-card .tagline {
    font-size: 13px;
    color: var(--slate-400);
    margin-bottom: 32px;
    font-weight: 300;
}

/* replace the plain <h1> and <p> defaults */
.login-card h1 {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 28px;
    font-weight: 400;
    color: var(--teal-900);
    margin-bottom: 4px;
}

.login-card > p {
    font-size: 13px;
    color: var(--slate-400);
    margin-bottom: 32px;
    font-weight: 300;
}

/* ─── PASSWORD TOGGLE ───────────────────────────────────── */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--slate-400);
    font-size: 18px;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

.password-toggle:hover {
    color: var(--teal-700);
}

/* ─── FORM ───────────────────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--teal-900);
    margin-bottom: 7px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    background: #fff;
    border: 0.5px solid var(--slate-200);
    border-radius: var(--radius-md);
    font-family: var(--font-head);
    font-size: 14px;
    color: var(--slate-800);
    outline: none;
    transition: border-color 0.15s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--slate-300);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--teal-500);
    box-shadow: 0 0 0 3px rgba(30, 140, 132, 0.08);
}

/* ─── BUTTON ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    background: var(--teal-900);
    color: var(--teal-300);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.btn:hover {
    background: var(--teal-700);
}

.btn:active {
    opacity: 0.9;
}

.btn-secondary {
    background: transparent;
    color: var(--teal-700);
    border: 0.5px solid var(--slate-200);
}

.btn-secondary:hover {
    background: var(--slate-50);
    border-color: var(--slate-300);
}

.btn-sm {
    width: auto;
    padding: 8px 16px;
    font-size: 13px;
}
.module-add-btn {
    padding: 13px 22px;
}
/* ─── ALERTS ─────────────────────────────────────────────── */
.alert-error {
    background: var(--coral-100);
    color: var(--coral-900);
    border-left: 2px solid var(--coral-500);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 11px 14px;
    font-size: 13px;
    margin-bottom: 20px;
}

.alert-success {
    background: #edfaf5;
    color: #0a4731;
    border-left: 2px solid var(--teal-500);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 11px 14px;
    font-size: 13px;
    margin-bottom: 20px;
}

/* ─── LAYOUT ─────────────────────────────────────────────── */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ─── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--teal-900);
    display: flex;
    flex-direction: column;
    padding: 24px 14px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 0 10px 20px;
    border-bottom: 0.5px solid rgba(255,255,255,0.08);
    margin-bottom: 10px;
}

.sidebar-brand .name {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 20px;
    color: var(--teal-300);
    line-height: 1.2;
}

.sidebar-brand .sub {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    margin-top: 3px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: rgba(255,255,255,0.55);
    font-size: 13.5px;
    font-weight: 400;
    transition: background 0.15s, color 0.15s;
}

.sidebar-nav a .nav-icon {
    font-size: 17px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.9);
}

.sidebar-nav a:hover .nav-icon {
    opacity: 1;
}

.sidebar-nav a.active {
    background: rgba(127,227,200,0.12);
    color: #fff;
    border-left: 2px solid var(--teal-300);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding-left: 10px;
}

.sidebar-nav a.active .nav-icon {
    color: var(--teal-300);
    opacity: 1;
}

.sidebar-divider {
    height: 0.5px;
    background: rgba(255,255,255,0.08);
    margin: 10px 0;
}

.sidebar-nav a.logout {
    color: rgba(255,255,255,0.65);
    margin-top: auto;
}

.sidebar-nav a.logout:hover {
    color: #fff;
    background: rgba(255,255,255,0.07);
}

/* ─── MAIN CONTENT ───────────────────────────────────────── */
.main-content {
    flex: 1;
    padding: 32px 36px;
    min-width: 0;
}

/* ─── PAGE HEADER ────────────────────────────────────────── */
.page-header {
    margin-bottom: 28px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.page-header h1 {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 26px;
    font-weight: 400;
    color: var(--teal-900);
    line-height: 1.2;
    margin-bottom: 4px;
}

.page-header p {
    font-size: 13px;
    color: var(--slate-400);
}

/* ─── CARD ───────────────────────────────────────────────── */
.card {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 0.5px solid var(--slate-100);
    padding: 24px 28px;
}

.card h2 {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 19px;
    font-weight: 400;
    color: var(--teal-900);
    margin-bottom: 16px;
}

/* ─── STAT CARD ──────────────────────────────────────────── */
.stat-card {
    background: var(--slate-50);
    border-radius: var(--radius-md);
    padding: 18px 20px;
}

.stat-card .label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--slate-400);
    margin-bottom: 6px;
}

.stat-card .value {
    font-size: 26px;
    font-weight: 600;
    color: var(--teal-900);
    line-height: 1;
}

.stat-card .delta {
    font-size: 12px;
    color: var(--teal-500);
    margin-top: 4px;
}

/* ─── TABLE ──────────────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead th {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--slate-400);
    padding: 0 14px 10px;
    text-align: left;
    border-bottom: 0.5px solid var(--slate-100);
}

tbody tr {
    border-bottom: 0.5px solid var(--slate-100);
    transition: background 0.1s;
}

tbody tr:hover {
    background: var(--teal-50);
}

tbody td {
    padding: 13px 14px;
    color: var(--slate-800);
}

/* ─── BADGE ──────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.badge-teal {
    background: var(--teal-100);
    color: var(--teal-700);
}

.badge-coral {
    background: var(--coral-100);
    color: var(--coral-900);
}

.badge-slate {
    background: var(--slate-100);
    color: var(--slate-500);
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 960px) {
    :root { --sidebar-w: 72px; }

    .sidebar-brand .name,
    .sidebar-brand .sub,
    .sidebar-nav a span {
        display: none;
    }

    .sidebar-brand {
        text-align: center;
        padding-bottom: 16px;
    }

    .sidebar-nav a {
        justify-content: center;
        padding: 10px;
    }

    .sidebar-nav a.active {
        border-left: none;
        border-bottom: 2px solid var(--teal-300);
        border-radius: var(--radius-md);
        padding-left: 10px;
    }

    .main-content {
        padding: 24px 20px;
    }
}


.mobile-topbar,
.sidebar-close,
.sidebar-overlay {
    display: none;
}

@media (max-width: 680px) {
    .login-card {
        padding: 28px 20px;
        max-width: 100%;
    }

    .login-page {
        align-items: center;
        padding-top: 16px;
    }
    .mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 58px;
        padding: 0 16px;
        background: #fff;
        border-bottom: 0.5px solid var(--slate-100);
        position: sticky;
        top: 0;
        z-index: 50;
    }

    .mobile-menu-btn,
    .sidebar-close {
        border: none;
        background: transparent;
        color: var(--teal-900);
        font-size: 24px;
        cursor: pointer;
    }

    .mobile-brand {
        font-family: var(--font-serif);
        font-style: italic;
        font-size: 20px;
        color: var(--teal-900);
    }

    .layout {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 260px;
        height: 100vh;
        z-index: 100;
        transition: left 0.25s ease;
        padding: 22px 14px;
    }

    body.sidebar-open .sidebar {
        left: 0;
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.35);
        z-index: 90;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    body.sidebar-open .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--teal-300);
        margin-left: auto;
        margin-bottom: 12px;
    }

    .sidebar-brand {
        display: block;
    }

    .sidebar-brand .name,
    .sidebar-brand .sub,
    .sidebar-nav a span {
        display: block;
    }

    .sidebar-nav {
        flex-direction: column;
        overflow: visible;
    }

    .sidebar-nav a {
        justify-content: flex-start;
    }

    .main-content {
        padding: 20px 16px;
    }
}
/* ─── DASHBOARD ─────────────────────────────────────────── */

.dashboard-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dashboard-hero {
    background: linear-gradient(135deg, var(--teal-900), var(--teal-700));
    border-radius: var(--radius-lg);
    padding: 28px;
    color: #fff;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.dashboard-eyebrow {
    display: inline-flex;
    color: var(--teal-300);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 6px;
}

.dashboard-hero h1 {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 32px;
    font-weight: 400;
    margin-bottom: 4px;
}

.dashboard-hero p {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
}

.dashboard-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-hero .btn {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 0.5px solid rgba(255,255,255,0.18);
}

.dashboard-hero .btn-secondary {
    background: #fff;
    color: var(--teal-900);
}

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-kpi-card {
    background: #fff;
    border: 0.5px solid var(--slate-100);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 96px;
}

.dashboard-kpi-card.highlight {
    background: var(--teal-50);
    border-color: var(--teal-100);
}

.kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--slate-50);
    color: var(--teal-700);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.dashboard-kpi-card.highlight .kpi-icon {
    background: #fff;
    color: var(--teal-900);
}

.dashboard-kpi-card span {
    display: block;
    font-size: 11px;
    color: var(--slate-400);
    margin-bottom: 4px;
}

.dashboard-kpi-card strong {
    display: block;
    font-size: 20px;
    color: var(--teal-900);
    line-height: 1.15;
}

.dashboard-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-tabs a {
    background: #fff;
    border: 0.5px solid var(--slate-100);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--slate-700);
    font-size: 13px;
    font-weight: 600;
    transition: 0.15s;
}

.dashboard-tabs a:hover {
    background: var(--teal-50);
    color: var(--teal-900);
    transform: translateY(-1px);
}

.dashboard-tabs i {
    font-size: 20px;
    color: var(--teal-700);
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.dashboard-panel.wide {
    grid-column: 1 / -1;
}

.dashboard-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.dashboard-panel-header h2 {
    margin-bottom: 3px;
}

.dashboard-panel-header p {
    font-size: 12px;
    color: var(--slate-400);
}

.dashboard-panel-header a {
    color: var(--teal-700);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.dashboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dashboard-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border: 0.5px solid var(--slate-100);
    border-radius: var(--radius-md);
    background: var(--slate-50);
}

.dashboard-time {
    font-size: 12px;
    font-weight: 700;
    color: var(--teal-700);
    background: #fff;
    border: 0.5px solid var(--slate-100);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    white-space: nowrap;
}

.dashboard-row-main strong,
.dashboard-amount strong {
    display: block;
    font-size: 13px;
    color: var(--slate-800);
}

.dashboard-row-main small,
.dashboard-amount small {
    display: block;
    font-size: 11px;
    color: var(--slate-400);
    margin-top: 2px;
}

.dashboard-amount {
    text-align: right;
    white-space: nowrap;
}

.dashboard-amount strong {
    color: var(--teal-900);
}

.dashboard-amount.danger strong {
    color: var(--coral-900);
}

.dashboard-empty {
    font-size: 13px;
    color: var(--slate-400);
    background: var(--slate-50);
    border-radius: var(--radius-md);
    padding: 14px;
}

@media (max-width: 1200px) {
    .dashboard-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .dashboard-main-grid,
    .dashboard-tabs {
        grid-template-columns: 1fr;
    }

    .dashboard-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .dashboard-hero {
        padding: 22px;
    }

    .dashboard-hero-actions,
    .dashboard-hero-actions a {
        width: 100%;
    }

    .dashboard-kpis {
        grid-template-columns: 1fr;
    }

    .dashboard-row {
        align-items: flex-start;
    }
}

.hidden {
    display: none !important;
}