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

:root {
    --bg-1: #070b12;
    --bg-2: #0c1424;
    --panel: rgba(12, 19, 32, 0.82);
    --panel-strong: rgba(18, 28, 46, 0.9);
    --border: rgba(255, 255, 255, 0.08);
    --muted: #9aa8c1;
    --text: #e9eef7;
    --accent: #38d8c4;
    --accent-2: #7dd3fc;
    --danger: #ff7b7b;
    --radius: 16px;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 100%);
    color: var(--text);
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(125, 211, 252, 0.08), transparent 30%),
        radial-gradient(circle at 82% -10%, rgba(56, 216, 196, 0.08), transparent 26%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 120px 120px;
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--accent-2);
    text-decoration: none;
}

a:hover {
    color: #a7e8ff;
}

.app-shell {
    max-width: 1620px;
    margin: 0 auto;
    padding: 16px;
    position: relative;
    z-index: 1;
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px;
    border-radius: var(--radius);
    background: linear-gradient(125deg, rgba(15, 33, 55, 0.9), rgba(20, 26, 46, 0.9));
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.hero::after {
    content: '';
    position: absolute;
    inset: -30%;
    background: radial-gradient(circle at 80% 10%, rgba(56, 216, 196, 0.15), transparent 35%);
    z-index: 0;
    pointer-events: none;
}

.hero-status {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--accent), #5fe9ff);
    box-shadow: 0 12px 32px rgba(56, 216, 196, 0.35);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.hero-lead {
    color: var(--muted);
    margin: 0 0 10px;
}

.hero-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    align-self: stretch;
    position: relative;
    z-index: 1;
}

.hero-card {
    background: var(--panel-strong);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.meta-label {
    color: var(--muted);
    font-size: 13px;
    margin: 0 0 4px;
    letter-spacing: 0.2px;
}

.meta-value {
    font-weight: 700;
    margin: 0 0 4px;
}

.control-strip {
    margin-top: 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: space-between;
    color: var(--muted);
    box-shadow: var(--shadow);
}

.control-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    background: var(--muted);
}

.dot.live {
    background: #4ade80;
    box-shadow: 0 0 0 6px rgba(74, 222, 128, 0.18);
}

.dot.offline {
    background: #f87171;
    box-shadow: 0 0 0 6px rgba(248, 113, 113, 0.18);
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-weight: 700;
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.main-container {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 18px;
    margin-top: 18px;
    height: calc(100vh - 190px);
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    backdrop-filter: blur(10px);
}

.panel-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.panel-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.panel-subtitle {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 12px;
}

.search-box {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 8px;
}

.search-box input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 12px;
    padding: 12px 14px;
}

.search-box input::placeholder {
    color: #7f8ca1;
}

.search-box .btn {
    border-radius: 12px;
    font-weight: 700;
    padding-inline: 18px;
}

.quick-actions {
    display: flex;
    gap: 10px;
    margin: 10px 0 2px;
}

.chip-btn {
    flex: 1;
    border: none;
    padding: 11px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-weight: 700;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    letter-spacing: 0.2px;
}

.chip-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

.chip-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.left-pane {
    position: sticky;
    top: 18px;
    align-self: flex-start;
    max-height: calc(100vh - 200px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tree-surface {
    flex: 1;
    overflow: auto;
    width: 100%;
    padding-right: 4px;
}

.tree-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.tree-item {
    background: var(--panel-strong);
    border: 1px solid var(--border);
    padding: 9px 10px 9px 26px;
    border-radius: 12px;
    color: var(--text);
    font-size: 13px;
    display: block;
    width: 100%;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.3;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.tree-item::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-2);
    box-shadow: 0 0 0 6px rgba(125, 211, 252, 0.12);
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.tree-item.folder::before {
    content: '>';
    color: var(--accent);
    background: transparent;
    box-shadow: none;
    font-weight: 800;
    left: 14px;
}

.tree-item.folder.open::before {
    content: 'v';
}

.tree-item:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(56, 216, 196, 0.1);
}

.tree-item.selected {
    border-color: var(--accent);
    box-shadow: 0 12px 30px rgba(56, 216, 196, 0.15);
}

.tree-list .tree-list {
    padding-left: 10px;
    border-left: 1px dashed rgba(255, 255, 255, 0.08);
    margin-left: 6px;
}

.tree-item > ul {
    margin-top: 8px;
}

.viewer-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 520px;
}

.viewer-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.viewer-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.viewer-pane {
    flex: 1;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.04));
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 14px;
    overflow: auto;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overscroll-behavior: contain;
}

.viewer-pane img,
.viewer-pane iframe,
.viewer-pane canvas.pdf-page {
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 12px 38px rgba(0, 0, 0, 0.4);
    background: #0b1327;
}

.pdf-shell {
    position: relative;
    padding-top: 48px;
    overflow: auto;
}

.pdf-container {
    display: inline-block;
    width: max-content;
}

.viewer-pane canvas.pdf-page {
    display: block;
    margin: 0 0 12px 0;
}

.pdf-canvas-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    outline: none;
}

.pdf-page-canvas {
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 12px 38px rgba(0, 0, 0, 0.4);
    background: #0b1327;
}

.pdf-toolbar {
    top: 6px;
    right: 10px;
    left: 10px;
    justify-content: flex-end;
    position: sticky;
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.35));
    padding: 6px 8px;
    border-radius: 12px;
}

.pdf-toolbar .btn {
    background: rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.14);
}

.pdf-zoom-value {
    color: var(--text);
    font-weight: 700;
    align-self: center;
}

.viewer-pane iframe {
    min-height: 70vh;
}

.viewer-card {
    background: var(--panel-strong);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.zoom-wrapper {
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
}

.zoom-target {
    display: block;
    transition: transform 0.05s ease-out;
    transform-origin: center center;
}

.action-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.viewer-toolbar {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 2;
}

.viewer-toolbar .btn {
    padding: 6px 12px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.18);
}

.table-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 6px;
    box-shadow: var(--shadow);
}

.table {
    color: var(--text);
    margin: 0;
}

.table thead {
    background: rgba(255, 255, 255, 0.04);
}

.table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 70px 30px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
    position: relative;
}

.empty-state::before {
    content: '⟲';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--accent);
    margin-bottom: 10px;
}

.empty-state h4 {
    color: var(--text);
    margin-bottom: 8px;
}

#carousel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 15, 0.86);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

#carousel-container {
    width: min(1200px, 95vw);
    height: min(85vh, 760px);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

#close-carousel {
    position: absolute;
    top: 26px;
    right: 26px;
    border: none;
    border-radius: 50%;
    width: 46px;
    height: 46px;
    background: linear-gradient(145deg, #ff8c8c, #ff5f5f);
    color: #0b1327;
    font-weight: 700;
    font-size: 20px;
    box-shadow: 0 15px 40px rgba(255, 95, 95, 0.35);
    transition: transform 0.2s ease;
}

#close-carousel:hover {
    transform: translateY(-1px);
}

.badge-legend {
    display: flex;
    gap: 12px;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
}

.badge-legend .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.auth-card {
    width: min(480px, 100%);
}

.form-control {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text);
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem rgba(56, 216, 196, 0.25);
}

.carousel-page {
    background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
    min-height: 100vh;
    padding: 12px;
}

.carousel-shell {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.carousel-header {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
}

.carousel-stage {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 12px;
    height: 100%;
}

.carousel-stage img {
    height: 80vh;
    max-height: 560px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #0b1327;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.carousel-stage img:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.btn {
    border-radius: 12px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #6ce7ff);
    border: none;
    color: #041025;
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary.ghost {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border);
}

.btn-danger {
    border: none;
    background: linear-gradient(145deg, #ff8c8c, #ff5f5f);
    color: #0b1327;
}

#guide-overlay {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1200;
}

.guide-dim {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 16, 0.55);
}

.guide-highlight {
    position: absolute;
    border: 2px solid var(--accent);
    border-radius: 14px;
    box-shadow: 0 0 0 10px rgba(56, 216, 196, 0.18);
    pointer-events: none;
    transition: all 0.2s ease;
}

.guide-card {
    position: absolute;
    max-width: 320px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 12px;
    z-index: 1;
}

.guide-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.guide-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-close {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-weight: 800;
    cursor: pointer;
}

.guide-card h4 {
    margin: 0;
}

.guide-card p {
    margin: 0;
}

body.guide-active {
    overflow: hidden;
}

@media (max-width: 1100px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .main-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .left-pane {
        position: static;
        max-height: none;
    }

    .viewer-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .viewer-badges {
        justify-content: flex-start;
    }

    .viewer-pane iframe {
        min-height: 60vh;
    }
}

.pill-soft {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-weight: 700;
}

.pill-soft.ghost {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.eyebrow {
    letter-spacing: 0.24em;
    color: var(--muted);
}

.text-uppercase {
    text-transform: uppercase;
}

.text-white {
    color: var(--text);
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.h5 {
    font-size: 1.25rem;
    margin: 0;
}

.gaart-code {
    color: var(--accent);
    cursor: pointer;
    font-weight: 700;
}

.gaart-code:hover {
    color: #7de3d7;
}

.email-button {
    cursor: pointer;
    color: var(--accent);
    font-weight: 700;
}

.email-button:hover {
    color: #7de3d7;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

@media (max-width: 1100px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .main-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .left-pane {
        position: static;
        max-height: none;
    }

    .viewer-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .viewer-badges {
        justify-content: flex-start;
    }

    .viewer-pane iframe {
        min-height: 60vh;
    }
}
