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

:root {
    --bg-primary: #1e1e1e;
    --bg-secondary: #2d2b2b;
    --bg-panel: #252525;
    --bg-input: #3c3c3c;
    --bg-hover: #404040;
    --bg-active: #505050;
    --border-color: #555;
    --border-light: #444;
    --text-primary: #e0e0e0;
    --text-secondary: #aaa;
    --text-muted: #777;
    --accent: #1e699b;
    --accent-hover: #2580bb;
    --error: #e74c3c;
    --error-bg: #3c1f1f;
    --warning: #f39c12;
    --warning-bg: #3c3020;
    --info: #3498db;
    --info-bg: #1f2f3c;
    --success: #2ecc71;
}

/* Mobile gate — hidden on desktop */
#mobile-gate {
    display: none;
}

@media (max-width: 768px) {
    #mobile-gate {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        padding: 32px;
        background: var(--bg-primary);
        text-align: center;
    }

    .mobile-gate-content {
        max-width: 360px;
    }

    .mobile-gate-icon {
        width: 64px;
        height: 64px;
        color: var(--accent);
        margin: 0 auto 24px;
        display: block;
    }

    .mobile-gate-title {
        font-size: 22px;
        font-weight: 700;
        color: var(--text-primary);
        margin-bottom: 12px;
    }

    .mobile-gate-description {
        font-size: 14px;
        line-height: 1.5;
        color: var(--text-secondary);
        margin-bottom: 24px;
    }

    .mobile-gate-divider {
        width: 48px;
        height: 2px;
        background: var(--border-color);
        margin: 0 auto 24px;
        border-radius: 1px;
    }

    .mobile-gate-message {
        font-size: 16px;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 8px;
    }

    .mobile-gate-subtext {
        font-size: 13px;
        color: var(--text-muted);
        line-height: 1.4;
    }

    #toolbar,
    #app-layout,
    #drop-overlay {
        display: none !important;
    }
}

html, body {
    height: 100%;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
}

body {
    display: flex;
    flex-direction: column;
}

/* Toolbar */
#toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

#toolbar .separator {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 4px;
}

#toolbar label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    margin-left: auto;
}

#version-display {
    font-size: 12px;
    color: var(--text-muted);
    padding-left: 12px;
    border-left: 1px solid var(--border-light);
}

/* Main layout */
#app-layout {
    display: grid;
    grid-template-columns: 220px 1fr 320px;
    flex: 1;
    overflow: hidden;
}

/* Panels */
.panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border-color);
}

.panel:last-child {
    border-right: none;
}

.panel-header {
    padding: 12px 14px 8px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* Scrollbar styling */
.panel-body::-webkit-scrollbar {
    width: 8px;
}

.panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.panel-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* License panel specifics */
#license-panel {
    background: var(--bg-panel);
}

#license-products .product-entry {
    padding: 6px 8px;
    margin-bottom: 4px;
    border-radius: 4px;
    background: var(--bg-secondary);
    font-size: 13px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#license-products .product-entry .product-name {
    font-weight: 600;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#license-products .product-entry .product-detail {
    color: var(--text-secondary);
    font-size: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Seat summary */
#seat-summary .seat-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    margin-bottom: 2px;
    font-size: 13px;
    gap: 6px;
    flex-wrap: wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#seat-summary .seat-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
    margin-top: 3px;
    overflow: hidden;
}

#seat-summary .seat-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--accent);
    transition: width 0.2s;
}

#seat-summary .seat-bar-fill.overdraft {
    background: var(--error);
}

#license-products .product-entry.spotlighted {
    background: rgba(52, 152, 219, 0.15);
    box-shadow: inset 0 0 0 1px rgba(52, 152, 219, 0.3);
}

#seat-summary .seat-summary-wrapper.spotlighted {
    background: rgba(52, 152, 219, 0.1);
    box-shadow: inset 0 0 0 1px rgba(52, 152, 219, 0.3);
    border-radius: 4px;
}

/* Center panel (directive list) */
#directive-list-panel {
    background: var(--bg-primary);
}

#directive-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Editor panel */
#editor-panel {
    background: var(--bg-panel);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.drag-drop-hint {
    display: inline-block;
    margin-top: 8px;
    color: var(--accent);
    font-size: 12px;
}

/* Drag-and-drop overlay */
.drop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    pointer-events: none;
}

.drop-overlay.hidden {
    display: none;
}

.drop-overlay-content {
    border: 3px dashed var(--accent);
    border-radius: 16px;
    padding: 60px 80px;
    text-align: center;
    background: rgba(30, 105, 155, 0.08);
}

.drop-overlay-icon {
    width: 56px;
    height: 56px;
    color: var(--accent);
    margin: 0 auto 16px;
    display: block;
}

.drop-overlay-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.drop-overlay-subtext {
    font-size: 14px;
    color: var(--text-secondary);
}
