@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #f4efe8;
    --surface: rgba(255, 255, 255, 0.86);
    --surface-strong: #ffffff;
    --surface-muted: #f7f3ed;
    --text: #1f2937;
    --muted: #6b7280;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --accent: #c97f2d;
    --danger: #b45309;
    --danger-strong: #9a3412;
    --success: #15803d;
    --warning: #b45309;
    --border: rgba(31, 41, 55, 0.1);
    --shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(201, 127, 45, 0.18), transparent 30%),
        radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.2), transparent 26%),
        linear-gradient(180deg, #f7f3ed 0%, #f1ece4 100%);
    color: var(--text);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

p,
h1,
h2,
h3 {
    margin-top: 0;
}

.auth-body {
    padding: 32px;
}

.auth-shell {
    max-width: 1180px;
    margin: 0 auto;
    min-height: calc(100vh - 64px);
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 440px);
    gap: 32px;
    align-items: stretch;
}

.auth-shell-simple {
    grid-template-columns: minmax(360px, 440px);
    justify-content: center;
}

.auth-showcase,
.auth-card,
.panel,
.stat-card,
.sidebar,
.mobile-topbar {
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.auth-showcase {
    padding: 56px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.92), rgba(17, 94, 89, 0.84));
    color: #effcf9;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.auth-showcase::after {
    content: '';
    position: absolute;
    inset: auto -80px -120px auto;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent 64%);
    border-radius: 50%;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.auth-showcase h1 {
    font-size: clamp(36px, 5vw, 58px);
    line-height: 1.08;
    margin-bottom: 18px;
}

.auth-showcase p {
    max-width: 640px;
    font-size: 17px;
    line-height: 1.8;
    color: rgba(239, 252, 249, 0.88);
}

.showcase-points {
    display: grid;
    gap: 18px;
    margin-top: 36px;
}

.showcase-point {
    padding: 18px 20px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.showcase-point strong,
.showcase-point span {
    display: block;
}

.showcase-point span {
    margin-top: 6px;
    color: rgba(239, 252, 249, 0.82);
    line-height: 1.6;
}

.auth-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 42px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
}

.auth-brand,
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), #f7c38b);
    color: #39220c;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.brand-mark-large {
    width: 58px;
    height: 58px;
}

.brand-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
}

.brand-subtitle,
.auth-footnote p,
.topbar-subtitle,
.table-subtitle,
.page-header p,
.panel-header p,
.stat-card p,
.empty-state,
.table-note {
    color: var(--muted);
}

.brand-subtitle,
.topbar-subtitle,
.page-header p,
.panel-header p,
.table-subtitle,
.table-note {
    font-size: 14px;
}

.auth-copy {
    margin: 32px 0 24px;
}

.auth-copy h2 {
    font-size: 34px;
    margin-bottom: 10px;
}

.auth-copy p {
    line-height: 1.7;
    color: var(--muted);
}

.auth-form,
.form-grid {
    display: grid;
    gap: 18px;
}

.compact-form {
    gap: 16px;
}

.input-group {
    display: grid;
    gap: 8px;
}

.full-width {
    grid-column: 1 / -1;
}

label {
    font-size: 14px;
    font-weight: 700;
    color: #243341;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(15, 118, 110, 0.7);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

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

.checkbox-row {
    align-items: center;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 18px;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    font-weight: 700;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #f8fffd;
    box-shadow: 0 16px 28px rgba(15, 118, 110, 0.18);
}

.btn-secondary {
    background: rgba(15, 23, 42, 0.06);
    color: var(--text);
}

.btn-danger {
    background: linear-gradient(135deg, #d97706, var(--danger-strong));
    color: #fff8f0;
}

.btn-success {
    background: linear-gradient(135deg, #16a34a, var(--success));
    color: #f0fff4;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, var(--warning));
    color: #fff7ed;
}

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

.flash-stack {
    display: grid;
    gap: 12px;
    margin-bottom: 24px;
}

.flash {
    padding: 14px 16px;
    border-radius: 14px;
    font-weight: 600;
    border: 1px solid transparent;
}

.flash-success {
    background: rgba(22, 163, 74, 0.1);
    color: #166534;
    border-color: rgba(22, 163, 74, 0.16);
}

.flash-error {
    background: rgba(185, 28, 28, 0.1);
    color: #991b1b;
    border-color: rgba(185, 28, 28, 0.16);
}

.flash-warning {
    background: rgba(217, 119, 6, 0.1);
    color: #9a3412;
    border-color: rgba(217, 119, 6, 0.16);
}

.error-text {
    color: #b91c1c;
    font-size: 13px;
}

.app-body {
    color: var(--text);
}

.mobile-topbar {
    display: none;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    margin: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow);
}

.topbar-title {
    margin: 0;
    font-weight: 800;
}

.menu-toggle {
    min-width: 84px;
    padding: 12px 14px;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    background: rgba(15, 118, 110, 0.12);
    color: var(--primary-dark);
    font-weight: 700;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    min-height: 100vh;
    padding: 24px;
}

.sidebar {
    position: sticky;
    top: 24px;
    height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 24px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow);
}

.sidebar-user {
    display: grid;
    gap: 6px;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(201, 127, 45, 0.08));
}

.role-pill {
    display: inline-flex;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.12);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
    width: fit-content;
}

.sidebar-nav {
    display: grid;
    gap: 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 16px;
    border-radius: 14px;
    font-weight: 700;
    color: #304150;
    background: transparent;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(201, 127, 45, 0.12));
    color: var(--primary-dark);
}

.nav-link-button {
    width: 100%;
    border: 0;
    cursor: pointer;
}

.sidebar-footer {
    margin-top: auto;
}

.sidebar-overlay {
    display: none;
}

.content {
    display: grid;
    align-content: start;
    gap: 24px;
}

.page-header,
.panel,
.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow);
}

.page-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    padding: 28px 30px;
}

.page-header h1 {
    font-size: clamp(28px, 4vw, 42px);
    margin-bottom: 12px;
}

.page-header-note,
.page-header-actions {
    display: grid;
    gap: 8px;
    justify-items: end;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.stat-card {
    padding: 24px;
}

.stat-label {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stat-card strong {
    display: block;
    font-size: clamp(26px, 3vw, 38px);
    margin-bottom: 8px;
}

.dashboard-grid,
.content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.panel {
    padding: 24px;
}

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

.panel-header h2 {
    margin-bottom: 6px;
    font-size: 22px;
}

.form-actions,
.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.list-stack,
.timeline {
    display: grid;
    gap: 14px;
}

.list-item,
.timeline-item,
.summary-card {
    padding: 16px 18px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.list-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.list-item strong,
.timeline-item strong,
.summary-card strong {
    display: block;
}

.list-item p,
.timeline-item p,
.summary-card p {
    margin: 6px 0 0;
    line-height: 1.6;
}

.list-meta {
    display: grid;
    justify-items: end;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.summary-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-bottom: 12px;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 16px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.data-table thead th {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.table-empty {
    text-align: center;
    color: var(--muted);
    padding: 32px 16px;
}

.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(15, 118, 110, 0.1);
    color: var(--primary-dark);
}

.chip-success {
    background: rgba(21, 128, 61, 0.12);
    color: #166534;
}

.chip-muted {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

.empty-state {
    padding: 22px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.62);
    border: 1px dashed rgba(148, 163, 184, 0.3);
}

[data-amount-group][hidden] {
    display: none;
}

@media (max-width: 1180px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 960px) {
    .mobile-topbar {
        display: flex;
    }

    .app-shell {
        grid-template-columns: 1fr;
        padding: 0 18px 24px;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(320px, calc(100vw - 32px));
        height: 100vh;
        border-radius: 0 26px 26px 0;
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        z-index: 40;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        display: none;
        background: rgba(15, 23, 42, 0.35);
        z-index: 20;
    }

    body.sidebar-open .sidebar-overlay {
        display: block;
    }

    .content {
        padding-bottom: 24px;
    }
}

@media (max-width: 720px) {
    .auth-body {
        padding: 18px;
    }

    .auth-showcase,
    .auth-card,
    .page-header,
    .panel,
    .stat-card {
        padding: 22px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-header,
    .panel-header,
    .list-item {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header-note,
    .page-header-actions,
    .list-meta {
        justify-items: start;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }
}
