﻿* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #f15a38;
    --primary-hover: #d94827;
    --primary-soft: #fff0eb;
    --bg: #f4f6fa;
    --surface: #ffffff;
    --text: #182230;
    --muted: #758095;
    --border: #e4e8ee;
    --success: #159b66;
    --success-soft: #eaf8f1;
    --danger: #d54444;
    --danger-soft: #fff0f0;
    --shadow: 0 5px 20px rgba(25, 35, 50, .04);
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

button,
input,
select {
    font: inherit;
}


.app-shell {
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 24px 14px;
    background: #fff;
    border-right: 1px solid var(--border);
}

.main {
    margin-left: 240px;
    min-height: 100vh;
    padding: 30px 34px;
    overflow-x: hidden;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
    margin-bottom: 34px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: white;
    font-weight: 800;
    background: linear-gradient( 135deg, #ff7657, var(--primary) );
    box-shadow: 0 8px 20px rgba(241, 90, 56, .2);
}

.brand h2 {
    font-size: 17px;
    line-height: 1.2;
}

.brand span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.menu-title {
    padding: 0 12px;
    margin-bottom: 10px;
    color: #a2a9b5;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #626d80;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    transition: .2s;
}

    .menu-item:hover {
        background: #f8f9fb;
        color: var(--text);
    }

    .menu-item.active {
        background: var(--primary-soft);
        color: var(--primary);
        font-weight: 600;
    }

.menu-icon {
    width: 19px;
    text-align: center;
    font-size: 16px;
}

.sidebar-footer {
    margin-top: auto;
}

.connection-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fafbfc;
}

.online-dot {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(21, 155, 102, .1);
}

.connection-card strong {
    display: block;
    font-size: 11px;
}

.connection-card small {
    display: block;
    margin-top: 3px;
    font-size: 9px;
    color: var(--muted);
}

.version {
    margin-top: 14px;
    text-align: center;
    color: #a3abb8;
    font-size: 9px;
}

.page {
    display: none;
}

    .page.active-page {
        display: block;
    }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}

.page-header h1 {
    font-size: 25px;
    line-height: 1.25;
}

.page-header p {
    max-width: 650px;
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}


.btn {
    border: none;
    padding: 10px 15px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: .2s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 6px 16px rgba(241, 90, 56, .18);
}

    .btn-primary:hover {
        background: var(--primary-hover);
    }

    .btn-primary:disabled {
        opacity: .55;
        cursor: wait;
    }

.btn-secondary {
    border: 1px solid var(--border);
    background: white;
    color: #4d5768;
}

    .btn-secondary:hover {
        background: #f7f8fa;
    }


.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    padding: 18px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    font-weight: 800;
    font-size: 13px;
}

.orange {
    background: #fff0eb;
    color: #f15a38;
}

.blue {
    background: #edf5ff;
    color: #3977c9;
}

.green {
    background: #eaf8f1;
    color: #159b66;
}

.purple {
    background: #f4efff;
    color: #7654c9;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 10px;
}

.stat-card strong {
    display: block;
    margin: 3px 0;
    font-size: 21px;
}

.stat-card small {
    display: block;
    color: #a0a8b5;
    font-size: 9px;
}

.status-value {
    font-size: 14px !important;
}

.card {
    width: 100%;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

    .card-header h2 {
        font-size: 15px;
    }

    .card-header p {
        margin-top: 4px;
        color: var(--muted);
        font-size: 11px;
    }

.card-actions {
    display: flex;
    gap: 8px;
}

.environment {
    padding: 5px 8px;
    border-radius: 6px;
    color: #6b7483;
    background: #f2f4f7;
    font-size: 9px;
    font-weight: 700;
}


.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.pipeline {
    display: flex;
    align-items: center;
    margin-top: 24px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.pipeline-item {
    min-width: 125px;
    flex-shrink: 0;
}

    .pipeline-item span {
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 8px;
        border-radius: 50%;
        color: var(--primary);
        background: var(--primary-soft);
        font-size: 9px;
        font-weight: 700;
    }

    .pipeline-item strong {
        display: block;
        font-size: 11px;
    }

    .pipeline-item small {
        display: block;
        margin-top: 3px;
        color: var(--muted);
        font-size: 9px;
    }

.pipeline-line {
    min-width: 30px;
    height: 1px;
    flex: 1;
    margin: 0 10px;
    background: #dfe3e9;
}


.health-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 13px 0;
    border-bottom: 1px solid #edf0f3;
    font-size: 11px;
}

    .health-row:last-child {
        border-bottom: none;
    }

    .health-row span {
        color: var(--muted);
    }

    .health-row strong {
        font-size: 10px;
    }

.health-ok {
    color: var(--success);
}

.batch-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

    .batch-grid div {
        padding: 14px;
        border-radius: 10px;
        background: #f8f9fb;
    }

    .batch-grid span {
        display: block;
        color: var(--muted);
        font-size: 9px;
    }

    .batch-grid strong {
        display: block;
        margin-top: 5px;
        font-size: 12px;
    }

.file-card {
    display: flex;
    align-items: center;
    gap: 14px;
}

.file-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #eaf8f1;
    color: #159b66;
    font-size: 10px;
    font-weight: 800;
}

.file-content {
    flex: 1;
}

    .file-content h3 {
        font-size: 14px;
    }

    .file-content p {
        margin-top: 4px;
        color: var(--muted);
        font-size: 10px;
    }

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

    .metadata-grid div {
        padding: 13px;
        background: #f8f9fb;
        border-radius: 9px;
    }

    .metadata-grid span {
        display: block;
        color: var(--muted);
        font-size: 9px;
    }

    .metadata-grid strong {
        display: block;
        margin-top: 4px;
        font-size: 11px;
    }


.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f0f2f5;
    color: #616b7c;
    font-size: 9px;
    font-weight: 600;
}

.badge-success {
    background: var(--success-soft);
    color: var(--success);
}

.sync-card {
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sync-state {
    width: 100%;
    max-width: 520px;
    text-align: center;
    padding: 45px 20px;
}

.sync-circle {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 24px;
}

    .sync-circle.success {
        background: var(--success-soft);
        color: var(--success);
    }

.sync-state h2 {
    font-size: 18px;
}

.sync-state p {
    max-width: 460px;
    margin: 9px auto 18px;
    color: var(--muted);
    line-height: 1.6;
    font-size: 12px;
}

.loader {
    width: 42px;
    height: 42px;
    margin: 0 auto 18px;
    border: 4px solid #ffe0d8;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .75s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-panel {
    width: 100%;
    max-height: 350px;
    overflow: auto;
    padding: 15px;
    border-radius: 10px;
    background: var(--danger-soft);
    color: var(--danger);
    white-space: pre-wrap;
    font-size: 11px;
    line-height: 1.5;
}


.toolbar {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 18px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 420px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
}

    .search-box span {
        color: #969ead;
    }

    .search-box input {
        width: 100%;
        padding: 10px 0;
        border: none;
        outline: none;
        color: var(--text);
        font-size: 11px;
    }

.toolbar select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
    background: white;
    color: #566071;
    font-size: 11px;
}


.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 850px;
}

th {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    background: #f8f9fb;
    color: #8992a1;
    text-align: left;
    font-size: 9px;
    letter-spacing: .3px;
}

td {
    padding: 12px;
    border-bottom: 1px solid #edf0f3;
    color: #465061;
    font-size: 10px;
}

tbody tr:hover {
    background: #fcfcfd;
}

.table-footer {
    padding-top: 13px;
    color: var(--muted);
    font-size: 10px;
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
}

    .empty-state > div {
        margin-bottom: 8px;
        color: #a0a8b5;
        font-size: 25px;
    }

    .empty-state strong {
        display: block;
        color: #566071;
        font-size: 12px;
    }

    .empty-state p {
        margin-top: 5px;
        color: var(--muted);
        font-size: 10px;
    }

pre {
    max-height: 450px;
    margin-top: 17px;
    overflow: auto;
    padding: 18px;
    border-radius: 11px;
    background: #151a23;
    color: #dfe5ed;
    font-family: Consolas, "Courier New", monospace;
    font-size: 10px;
    line-height: 1.55;
}

.coming-soon {
    max-width: 500px;
    margin: auto;
    padding: 55px 20px;
    text-align: center;
}

.coming-icon {
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto;
    border-radius: 50%;
    background: #f2f4f7;
    color: #748092;
    font-size: 22px;
}

.coming-soon h2 {
    margin: 13px 0 7px;
    font-size: 17px;
}

.coming-soon p {
    max-width: 430px;
    margin: 0 auto 15px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
}

.toast {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 999;
    padding: 11px 15px;
    border-radius: 9px;
    background: #222b39;
    color: white;
    font-size: 11px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(80px);
    transition: .25s;
}

    .toast.show {
        opacity: 1;
        transform: translateY(0);
    }


.hidden {
    display: none !important;
}


@media (max-width: 1100px) {

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .metadata-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 760px) {

    .sidebar {
        display: none;
    }

    .main {
        margin-left: 0;
        padding: 20px;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .stats-grid,
    .batch-grid,
    .metadata-grid {
        grid-template-columns: 1fr;
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .search-box {
        max-width: none;
    }
}
