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

:root {
    --bg: #f3ede2;
    --panel: #030405;
    --panel-soft: #0d5f6f;
    --card: #fff9f0;
    --line: rgba(3, 4, 5, 0.08);
    --text: #0d5f6f;
    --text-strong: #0a4855;
    --muted: #5d6c71;
    --teal: #12b5af;
    --deep-teal: #0d6675;
    --teal-dark: #165f67;
    --gold: #ffe11a;
    --orange: #df9647;
    --sand: #d8ccb8;
    --success: #1d8f72;
    --warning: #f0b13d;
    --danger: #d05145;
    --shadow: 0 24px 70px rgba(8, 26, 31, 0.14);
    --radius: 24px;
    --radius-lg: 32px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(18, 181, 175, 0.16), transparent 24%),
        radial-gradient(circle at top right, rgba(223, 150, 71, 0.15), transparent 22%),
        linear-gradient(180deg, #f8f2e8 0%, #efe6d6 100%);
}

img {
    display: block;
    max-width: 100%;
}

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

code {
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    background: rgba(12, 16, 18, 0.08);
    font-size: 0.92em;
}

.eyebrow {
    display: inline-block;
    margin: 0 0 0.45rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.72rem;
    color: var(--muted);
}

.alert {
    border-radius: 18px;
    padding: 0.95rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-detail {
    display: block;
    margin-top: 0.35rem;
    color: inherit;
}

.alert-danger {
    background: rgba(208, 81, 69, 0.12);
    border-color: rgba(208, 81, 69, 0.3);
    color: #772a22;
}

.alert-success {
    background: rgba(29, 143, 114, 0.12);
    border-color: rgba(29, 143, 114, 0.28);
    color: #165d4b;
}

.alert-warning {
    background: rgba(240, 177, 61, 0.16);
    border-color: rgba(240, 177, 61, 0.28);
    color: #6b4a06;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 0;
    border-radius: 999px;
    padding: 0.9rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

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

.button-primary {
    color: #11110a;
    background: linear-gradient(135deg, var(--gold), #fff07d);
    box-shadow: 0 16px 34px rgba(255, 225, 26, 0.3);
}

.button-secondary {
    color: #f7f2ea;
    background: rgba(255, 255, 255, 0.1);
}

.button-ghost {
    color: var(--deep-teal);
    background: rgba(18, 181, 175, 0.1);
}

.button-block {
    width: 100%;
}

.field {
    display: grid;
    gap: 0.55rem;
}

.field span {
    font-size: 0.9rem;
    color: var(--muted);
}

.field input,
.field select {
    width: 100%;
    border: 1px solid rgba(13, 95, 111, 0.14);
    border-radius: 18px;
    padding: 0.95rem 1rem;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    font: inherit;
    outline: none;
}

.field input:focus,
.field select:focus {
    border-color: rgba(18, 181, 175, 0.55);
    box-shadow: 0 0 0 4px rgba(18, 181, 175, 0.12);
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
}

.login-shell {
    width: min(1180px, 100%);
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    background: rgba(255, 251, 244, 0.72);
    border: 1px solid rgba(3, 4, 5, 0.08);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.brand-panel {
    position: relative;
    padding: 3rem;
    background:
        radial-gradient(circle at top left, rgba(255, 225, 26, 0.16), transparent 26%),
        radial-gradient(circle at bottom right, rgba(18, 181, 175, 0.16), transparent 24%),
        linear-gradient(180deg, #040505 0%, #0c1f23 100%);
    color: #f6f1e7;
    min-height: 720px;
}

.brand-panel::before,
.brand-panel::after {
    content: '';
    position: absolute;
    border-radius: 18px;
    pointer-events: none;
}

.brand-panel::before {
    width: 220px;
    height: 220px;
    top: 24px;
    left: 24px;
    border-left: 18px solid var(--teal);
    border-bottom: 18px solid var(--teal-dark);
    border-top: 0;
    border-right: 0;
    border-bottom-left-radius: 42px;
}

.brand-panel::after {
    width: 210px;
    height: 210px;
    right: 26px;
    bottom: 26px;
    border-right: 18px solid var(--teal-dark);
    border-top: 0;
    border-left: 0;
    border-bottom: 18px solid var(--teal-dark);
    border-bottom-right-radius: 42px;
}

.brand-panel__backdrop {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.04) 100%),
        linear-gradient(90deg, transparent 0%, rgba(255, 225, 26, 0.1) 46%, transparent 100%);
}

.brand-panel__content,
.brand-panel__logo {
    position: relative;
    z-index: 1;
}

.brand-panel__content {
    max-width: 520px;
}

.brand-panel h1 {
    margin: 0;
    font-family: 'Space Grotesk', 'Outfit', sans-serif;
    font-size: clamp(2.3rem, 4vw, 4.5rem);
    line-height: 0.95;
    max-width: 8ch;
}

.brand-panel p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: rgba(246, 241, 231, 0.82);
}

.brand-features {
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.9rem;
}

.brand-features li {
    padding-left: 1.1rem;
    position: relative;
    color: rgba(246, 241, 231, 0.88);
}

.brand-features li::before {
    content: '';
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: var(--gold);
    position: absolute;
    left: 0;
    top: 0.45rem;
}

.brand-panel__logo {
    position: absolute;
    left: 3rem;
    right: 3rem;
    bottom: 3rem;
    padding: 1.1rem;
    border-radius: 30px;
    background:
        linear-gradient(135deg, rgba(255, 225, 26, 0.08), transparent 40%),
        rgba(255, 255, 255, 0.05);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        0 18px 42px rgba(0, 0, 0, 0.22);
}

.brand-panel__logo img {
    width: min(100%, 420px);
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.24));
}

.login-card {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        radial-gradient(circle at top right, rgba(216, 204, 184, 0.22), transparent 28%),
        linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(255, 247, 236, 0.88));
}

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

.login-card__header img {
    width: 82px;
    border-radius: 24px;
    box-shadow: 0 18px 42px rgba(13, 95, 111, 0.18);
}

.login-card__header h2 {
    margin: 0;
    font-family: 'Space Grotesk', 'Outfit', sans-serif;
    font-size: 2rem;
}

.auth-form {
    display: grid;
    gap: 1rem;
}

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

.sidebar {
    position: sticky;
    top: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem 1.5rem;
    background:
        radial-gradient(circle at top left, rgba(255, 225, 26, 0.12), transparent 22%),
        radial-gradient(circle at top right, rgba(216, 204, 184, 0.08), transparent 18%),
        linear-gradient(180deg, #040505 0%, #0d1d22 100%);
    color: #f6f1e7;
}

.sidebar__logo {
    position: relative;
    padding: 0.95rem;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.sidebar__logo::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255, 225, 26, 0.1), transparent 38%),
        linear-gradient(315deg, rgba(223, 150, 71, 0.08), transparent 42%);
    pointer-events: none;
}

.sidebar__content {
    display: grid;
    gap: 1.4rem;
}

.sidebar h1 {
    margin: 0;
    font-family: 'Space Grotesk', 'Outfit', sans-serif;
    font-size: 2.4rem;
    color: var(--teal);
}

.sidebar__text {
    margin: 0.75rem 0 0;
    color: rgba(246, 241, 231, 0.74);
    line-height: 1.65;
}

.sidebar__panel {
    display: grid;
    gap: 0.25rem;
    padding: 1rem;
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(255, 225, 26, 0.07), transparent 45%),
        rgba(255, 255, 255, 0.08);
}

.panel-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(246, 241, 231, 0.62);
}

.sidebar__logout {
    width: 100%;
}

.sidebar__nav {
    display: grid;
    gap: 0.55rem;
}

.nav-link {
    display: block;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    color: rgba(246, 241, 231, 0.82);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.nav-link:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.is-active {
    color: #081012;
    background: linear-gradient(135deg, var(--gold), #fff07d);
    border-color: transparent;
    box-shadow: 0 12px 28px rgba(255, 225, 26, 0.22);
}

.dashboard {
    padding: 2rem;
    display: grid;
    gap: 1.5rem;
    background:
        radial-gradient(circle at top right, rgba(18, 181, 175, 0.08), transparent 22%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.topbar h2 {
    margin: 0;
    font-family: 'Space Grotesk', 'Outfit', sans-serif;
    font-size: clamp(1.8rem, 2vw, 2.8rem);
    color: var(--text-strong);
}

.sync-pill {
    align-self: center;
    padding: 0.9rem 1.1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #f7f2ea;
}

.sync-pill--success {
    background: linear-gradient(135deg, var(--success), #2aac8a);
}

.sync-pill--partial_success {
    background: linear-gradient(135deg, var(--warning), #f6c96f);
    color: #372604;
}

.sync-pill--failed {
    background: linear-gradient(135deg, var(--danger), #e37c72);
}

.filters-card,
.panel,
.empty-state {
    background: rgba(255, 251, 245, 0.84);
    border: 1px solid rgba(13, 95, 111, 0.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.filters-card,
.panel,
.empty-state {
    padding: 1.5rem;
}

.filters-card h3,
.panel h3,
.empty-state h3 {
    margin: 0;
    font-family: 'Space Grotesk', 'Outfit', sans-serif;
    color: var(--text-strong);
}

.filters-card,
.panel {
    position: relative;
    overflow: hidden;
}

.filters-card::before,
.panel::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 160px;
    height: 4px;
    background: linear-gradient(90deg, var(--teal), var(--gold), var(--orange));
}

.filters-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    align-items: end;
}

.filters-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

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

.metric-card {
    position: relative;
    overflow: hidden;
    min-height: 180px;
    padding: 1.5rem;
    border-radius: var(--radius);
    color: #081012;
    box-shadow: var(--shadow);
}

.metric-card::after {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 999px;
    right: -42px;
    bottom: -72px;
    background: rgba(255, 255, 255, 0.16);
}

.metric-card strong {
    display: block;
    margin: 0.6rem 0 0.35rem;
    font-family: 'Space Grotesk', 'Outfit', sans-serif;
    font-size: clamp(2rem, 2vw, 3rem);
}

.metric-card--teal {
    background: linear-gradient(135deg, #49d5cd, var(--teal), var(--deep-teal));
}

.metric-card--gold {
    background: linear-gradient(135deg, #fff0a0, var(--gold));
}

.metric-card--orange {
    background: linear-gradient(135deg, #efc08b, var(--orange));
}

.metric-card--ink {
    color: #f7f2ea;
    background: linear-gradient(135deg, #14444d, #040505);
}

.content-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1rem;
}

.panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

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

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

.data-table th,
.data-table td {
    text-align: left;
    padding: 0.95rem 0.8rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.data-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.data-table tbody tr:hover {
    background: rgba(22, 184, 178, 0.06);
}

.compact {
    min-width: 0;
}

.alert-list {
    display: grid;
    gap: 0.85rem;
}

.alert-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.05rem;
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(18, 181, 175, 0.09), rgba(18, 181, 175, 0.02)),
        linear-gradient(90deg, rgba(255, 225, 26, 0.06), transparent 40%);
}

.alert-item span {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.alert-item__values {
    text-align: right;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 700;
}

.badge-teal,
.badge-success {
    color: #0a4b45;
    background: rgba(18, 181, 175, 0.16);
}

.badge-warning {
    color: #6f4e10;
    background: rgba(255, 225, 26, 0.24);
}

.badge-danger {
    color: #7a281e;
    background: rgba(208, 81, 69, 0.18);
}

.badge-ink {
    color: #f7f2ea;
    background: rgba(3, 4, 5, 0.9);
}

@media (max-width: 1180px) {
    .login-shell,
    .app-shell,
    .metrics-grid,
    .content-grid,
    .filters-form {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        min-height: auto;
    }

    .brand-panel {
        min-height: 560px;
    }
}

@media (max-width: 720px) {
    .login-page,
    .dashboard {
        padding: 1rem;
    }

    .brand-panel,
    .login-card,
    .sidebar,
    .panel,
    .filters-card {
        padding: 1.2rem;
    }

    .brand-panel__logo {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        margin-top: 2rem;
    }

    .topbar {
        flex-direction: column;
    }

    .filters-actions {
        justify-content: stretch;
        flex-direction: column;
    }
}
