:root {
    --app-bg: #f4f7fb;
    --app-surface: rgba(255, 255, 255, 0.88);
    --app-border: rgba(15, 23, 42, 0.08);
    --app-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
    --app-text: #0f172a;
    --app-muted: #64748b;
    --app-primary: #0f766e;
    --app-primary-dark: #115e59;
    --app-accent: #f59e0b;
}

body {
    font-family: 'Manrope', sans-serif;
    color: var(--app-text);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 28%),
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 20%),
        linear-gradient(180deg, #f8fafc 0%, var(--app-bg) 100%);
}

.auth-body {
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.26), transparent 32%),
        radial-gradient(circle at bottom right, rgba(245, 158, 11, 0.16), transparent 25%),
        #0f172a;
}

.app-navbar {
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.85);
}

.lang-select {
    min-width: 130px;
}

.auth-lang-select {
    max-width: 170px;
}

.brand-badge {
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, var(--app-primary), #14b8a6);
    color: #fff;
}

.hero-panel,
.app-card,
.metric-card,
.stat-tile {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow);
    border-radius: 1.5rem;
}

.hero-panel {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: end;
    padding: 1.5rem;
}

.app-card .card-body {
    padding: 1.5rem;
}

.metric-card,
.stat-tile {
    padding: 1.2rem 1.25rem;
}

.metric-card span,
.stat-tile span,
.eyebrow,
.auth-kicker {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    color: var(--app-muted);
    font-weight: 700;
}

.metric-card strong,
.stat-tile strong {
    display: block;
    margin-top: 0.55rem;
    font-size: 1.7rem;
    line-height: 1;
}

.metric-subtext {
    display: block;
    margin-top: 0.65rem;
    color: var(--app-muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.metric-card-accent,
.stat-tile-profit {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(20, 184, 166, 0.18));
}

.auth-shell {
    width: min(1120px, 100%);
    background: rgba(255, 255, 255, 0.94);
    border-radius: 2rem;
}

.auth-panel-brand {
    color: #fff;
    background:
        linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(15, 118, 110, 0.92)),
        url('https://images.unsplash.com/photo-1556740749-887f6717d7e4?auto=format&fit=crop&w=1200&q=80') center/cover;
}

.auth-stat-grid {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.auth-stat-card,
.demo-callout {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 1rem;
}

.demo-callout {
    border-color: rgba(15, 23, 42, 0.08);
    background: #f8fafc;
}

.thumb {
    width: 72px;
    height: 72px;
    border-radius: 1rem;
    object-fit: cover;
    background: #e5e7eb;
}

.gallery-image {
    width: 100%;
    height: 210px;
    object-fit: cover;
    border-radius: 1rem;
}

.image-card {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 1.25rem;
    padding: 0.75rem;
}

.timeline {
    display: grid;
    gap: 1rem;
}

.timeline-item {
    position: relative;
    padding-left: 1rem;
    border-left: 2px solid rgba(15, 118, 110, 0.18);
}

.table-link {
    color: var(--app-text);
    text-decoration: none;
}

.table-link:hover {
    color: var(--app-primary);
}

.sort-link {
    color: var(--app-text);
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
}

.sort-link:hover {
    color: var(--app-primary);
}

.table-responsive {
    overflow-x: auto;
}

.chart-shell {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.chart-card .card-body {
    display: flex;
    flex-direction: column;
}

.chart-shell-lg {
    height: clamp(220px, 28vw, 300px);
}

.chart-shell-sm {
    height: clamp(220px, 24vw, 280px);
    max-width: 320px;
    margin-inline: auto;
}

.chart-shell canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.nav-link.active,
.nav-link:hover {
    color: var(--app-primary) !important;
}

.btn-primary {
    background: var(--app-primary);
    border-color: var(--app-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--app-primary-dark);
    border-color: var(--app-primary-dark);
}

@media (max-width: 991.98px) {
    .hero-panel {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 767.98px) {
    .app-card .card-body,
    .hero-panel {
        padding: 1rem;
    }

    .gallery-image {
        height: 160px;
    }

    .table-responsive .table thead {
        display: none;
    }

    .table-responsive .table,
    .table-responsive .table tbody,
    .table-responsive .table tr,
    .table-responsive .table td {
        display: block;
        width: 100%;
    }

    .table-responsive .table tr {
        padding: 0.9rem;
        margin-bottom: 0.85rem;
        background: rgba(255, 255, 255, 0.9);
        border: 1px solid var(--app-border);
        border-radius: 1rem;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    }

    .table-responsive .table td {
        border: 0;
        padding: 0.45rem 0;
        text-align: start !important;
    }

    .table-responsive .table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.2rem;
        font-size: 0.72rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--app-muted);
    }

    .table-responsive .table td[data-label=""],
    .table-responsive .table td[colspan]::before {
        content: none;
    }

    .table-responsive .table td.text-end {
        text-align: start !important;
    }

    .table-responsive .table td.text-end .d-flex {
        justify-content: flex-start !important;
    }

    .thumb {
        width: 100%;
        max-width: 110px;
        height: 110px;
    }

    .chart-shell-lg,
    .chart-shell-sm {
        height: 240px;
    }
}

[dir="rtl"] body {
    text-align: right;
}

[dir="rtl"] .timeline-item {
    padding-left: 0;
    padding-right: 1rem;
    border-left: 0;
    border-right: 2px solid rgba(15, 118, 110, 0.18);
}

[dir="rtl"] .table-responsive .table td {
    text-align: right !important;
}
