/* Keltion - Modern Flat Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
    /* Semantic Colors - Emerald Green (Core Identity) */
    --brand: #10b981;
    --brand-low: rgba(16, 185, 129, 0.1);
    --error: #f43f5e;
    --warning: #f59e0b;

    /* Fonts */
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-data: 'Geist Mono', 'Fira Mono', monospace;

    /* Spacing & Radii */
    --radius: 8px;
    --gap: 24px;
}

/* Default: Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-main: #000000;
        --bg-card: #0f0f12;
        --bg-sidebar: #050505;
        --bg-hover: #161619;
        --border-subtle: #1f1f23;
        --border-active: #3f3f46;
        --text-high: #fafafa;
        --text-med: #a1a1aa;
        --text-low: #52525b;
        --card-shadow: none;
    }
}

/* Light Mode Support */
@media (prefers-color-scheme: light) {
    :root {
        --bg-main: #f8fafc;
        --bg-card: #ffffff;
        --bg-sidebar: #f1f5f9;
        --bg-hover: #e2e8f0;
        --border-subtle: #e2e8f0;
        --border-active: #cbd5e1;
        --text-high: #0f172a;
        --text-med: #475569;
        --text-low: #94a3b8;
        --brand-low: rgba(16, 185, 129, 0.08);
        --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    font-family: var(--font-ui);
    background: var(--bg-main);
    color: var(--text-high);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* --- Mobile Header (Hidden on Desktop) --- */
.mobile-header {
    display: none;
    height: 60px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 900;
}

.hamburger {
    font-size: 24px;
    color: var(--text-high);
    cursor: pointer;
}

/* --- Layout --- */
.layout {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.main-content {
    flex: 1;
    padding: 40px 48px;
    overflow-y: auto;
    background: var(--bg-main);
}

/* --- Sidebar (Clean & Flat) --- */
.sidebar {
    width: 250px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 32px 16px;
    flex-shrink: 0;
}

.sidebar .brand {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-high);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
}

.sidebar .brand .icon {
    color: var(--brand);
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-low);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 20px 12px 10px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text-med);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s ease;
    text-decoration: none;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-high);
}

.nav-item.active {
    background: var(--brand-low);
    color: var(--brand);
    font-weight: 500;
}

.nav-item .icon {
    font-size: 18px;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
}

/* --- Components --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--card-shadow);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    font-family: inherit;
}

.btn-primary {
    background: var(--brand);
    color: white;
}

@media (prefers-color-scheme: light) {
    .btn-primary {
        background: var(--brand);
        color: white;
    }
}

.btn-primary:hover {
    filter: brightness(1.1);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-med);
}

.btn-outline:hover {
    border-color: var(--border-active);
    color: var(--text-high);
}

.stat-value {
    font-family: var(--font-data);
    font-size: 32px;
    font-weight: 500;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-low);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge {
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    font-family: var(--font-data);
    display: inline-block;
}

.badge-2xx {
    background: var(--brand-low);
    color: var(--brand);
}

.badge-4xx,
.badge-5xx {
    background: rgba(244, 63, 94, 0.1);
    color: var(--error);
}

/* --- Tables --- */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-low);
    text-transform: uppercase;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

td {
    padding: 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-subtle);
}

tr:hover td {
    background: var(--bg-hover);
}

/* --- Modals --- */
.modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inspection-modal {
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.inspection-header {
    padding: 20px 32px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.inspection-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.inspection-side {
    width: 400px;
    border-right: 1px solid var(--border-subtle);
    padding: 32px;
    overflow-y: auto;
}

.inspection-main {
    flex: 1;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

#toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: var(--bg-card);
    color: var(--text-high);
    border: 1px solid var(--brand);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 9999;
}

.mobile-header {
    display: none;
}

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

    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 1001;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 1000;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        padding: 24px;
    }

    .inspection-body {
        flex-direction: column-reverse;
    }

    .inspection-side {
        width: 100%;
        border-right: none;
    }
}

.breadcrumbs {
    display: flex;
    gap: 8px;
    font-size: 13px;
    color: var(--text-low);
    margin-bottom: 32px;
}

.breadcrumbs span {
    color: var(--text-med);
}

.breadcrumbs a {
    color: var(--text-low);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--text-high);
}