:root {
    --bg-dark: #0f0f0f;
    --bg-card: #1a1a1a;
    --bg-hover: #252525;
    --border: #2a2a2a;
    --text: #e8e8e8;
    --text-muted: #888;
    --accent: #c0392b;
    --accent-hover: #e74c3c;
    --success: #27ae60;
    --warning: #f39c12;
    --sidebar-width: 240px;
    --radius: 8px;
    --shadow: 0 4px 20px rgba(0,0,0,.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at top, #1a0808 0%, var(--bg-dark) 60%);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow);
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-brand h1 {
    color: var(--accent);
    font-size: 2rem;
    letter-spacing: 2px;
}

.login-brand p { color: var(--text-muted); font-size: .9rem; }

/* App shell */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
}

.brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.brand-name {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1px;
}

.brand-sub { font-size: .75rem; color: var(--text-muted); }

.sidebar-nav { padding: 1rem 0; flex: 1; }

.nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1.25rem;
    color: var(--text-muted);
    transition: all .15s;
    border-left: 3px solid transparent;
}

.nav-link:hover { background: var(--bg-hover); color: var(--text); }
.nav-link.active {
    background: rgba(192,57,43,.12);
    color: var(--accent);
    border-left-color: var(--accent);
}

.nav-icon { width: 1.2rem; text-align: center; font-size: .9rem; }

.main-area {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-heading { font-size: 1.25rem; font-weight: 600; }

.content { padding: 2rem; flex: 1; }

/* Profile menu */
.profile-menu { position: relative; }

.profile-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text);
    padding: .5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.profile-btn:hover { border-color: var(--accent); }

.profile-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + .5rem);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 200px;
    box-shadow: var(--shadow);
    overflow: hidden;
    z-index: 200;
}

.profile-dropdown.open { display: block; }

.profile-info {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.profile-info strong { display: block; }
.profile-info small { color: var(--text-muted); }

.dropdown-item {
    display: block;
    width: 100%;
    padding: .65rem 1rem;
    background: none;
    border: none;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    font-size: .9rem;
}

.dropdown-item:hover { background: var(--bg-hover); }
.logout-link { color: var(--accent); }

/* Forms */
label {
    display: block;
    margin-bottom: 1rem;
    font-size: .85rem;
    color: var(--text-muted);
}

label input, label select, label textarea {
    display: block;
    width: 100%;
    margin-top: .35rem;
    padding: .65rem .85rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: .95rem;
}

label input:focus, label select:focus, label textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-error { color: var(--accent-hover); font-size: .85rem; margin-bottom: .5rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.1rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: .9rem;
    font-weight: 500;
    transition: background .15s;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-hover); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--text-muted); }
.btn-danger { background: #922b21; color: #fff; }
.btn-danger:hover { background: var(--accent); }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
}

.stat-card .stat-label {
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: .25rem;
}

.value-banner {
    background: linear-gradient(135deg, #2a0808, #1a0505);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.value-banner .banner-label {
    font-size: .85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.value-banner .banner-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    margin-top: .25rem;
}

/* Tables */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

thead th {
    text-align: left;
    padding: .75rem 1rem;
    background: var(--bg-hover);
    color: var(--text-muted);
    font-weight: 600;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--border);
}

tbody td {
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--border);
}

tbody tr:hover { background: rgba(255,255,255,.02); }

/* Category sections */
.category-section { margin-bottom: 2rem; }

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--accent);
}

.category-header h2 { font-size: 1.1rem; color: var(--accent); }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: .75rem;
}

/* Vault */
.vault-row { margin-bottom: 2rem; }

.vault-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.vault-row-header h3 { font-size: 1rem; color: var(--text-muted); }

.vault-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.vault-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

.vault-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}

.vault-card-header h4 { font-size: .95rem; }

.vault-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .35rem 0;
    font-size: .85rem;
}

.vault-item-name {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.vault-item-controls {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-shrink: 0;
}

.qty-input {
    min-width: 6rem;
    width: auto;
    max-width: 10rem;
    padding: .25rem .5rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: .85rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.qty-input-lg {
    min-width: 8rem;
}

.vault-item .qty { color: var(--accent); font-weight: 600; white-space: nowrap; }

.row-on-hold { background: rgba(192,57,43,.06); }

.status-badge {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-ok { background: rgba(39,174,96,.15); color: #2ecc71; }
.status-hold { background: rgba(192,57,43,.2); color: var(--accent-hover); }
.status-open { background: rgba(243,156,18,.15); color: var(--warning); }
.status-completed { background: rgba(39,174,96,.15); color: #2ecc71; }
.status-cancelled { background: rgba(255,255,255,.08); color: var(--text-muted); }

/* Orders */
.orders-list { display: flex; flex-direction: column; gap: 1rem; }

.order-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: .5rem;
    gap: 1rem;
}

.order-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1.25rem;
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: .75rem;
}

.order-total { color: var(--accent); font-size: 1.1rem; }

.modal-wide { max-width: 720px; max-height: 90vh; overflow-y: auto; }

.modal-order {
    width: min(98vw, 1200px);
    max-width: min(98vw, 1200px);
    max-height: 94vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.modal-order .order-detail-header {
    padding: 1.25rem 1.5rem;
    margin: 0;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.order-detail-body {
    padding: 1.25rem 1.5rem 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-overlay-order,
.modal-overlay-picker {
    padding: 0.75rem;
}

.modal-overlay-picker {
    z-index: 1100;
}

.modal-picker {
    width: min(98vw, 1400px);
    max-width: min(98vw, 1400px);
    max-height: 94vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.picker-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.picker-header h2 { font-size: 1.15rem; margin: 0; }

.picker-sub {
    font-size: .85rem;
    color: var(--text-muted);
    margin-top: .25rem;
}

.picker-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.picker-categories {
    width: 200px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    padding: .75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.picker-cat-btn {
    text-align: left;
    padding: .65rem .85rem;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    font-size: .9rem;
    transition: all .15s;
}

.picker-cat-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.picker-cat-btn.active {
    background: rgba(192,57,43,.15);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.picker-main {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}

.picker-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.picker-item-card {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 0.75rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    overflow: hidden;
    transition: border-color .15s;
    min-width: 0;
}

.picker-item-image {
    width: calc(100% + 1.5rem);
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    min-height: 100px;
    padding: .75rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.picker-item-image img {
    width: auto;
    height: auto;
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
}

.item-no-image {
    color: var(--text-muted);
    font-size: .75rem;
    text-align: center;
    padding: .5rem;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-image-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.item-image-preview {
    width: 100px;
    height: 100px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .75rem;
    padding: .35rem;
}

.item-image-preview img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.item-image-preview .item-no-image {
    min-height: 0;
    font-size: .7rem;
    padding: .25rem;
}

.item-image-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.picker-item-qty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    margin-top: .25rem;
    max-width: 100%;
}

.picker-add-btn {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: .25rem;
}

.picker-item-card:not(.disabled):hover {
    border-color: var(--accent);
}

.picker-item-card.on-hold:not(.disabled) {
    border-color: rgba(192,57,43,.45);
    background: rgba(192,57,43,.04);
}

.picker-item-card.disabled {
    opacity: .55;
    pointer-events: none;
}

.picker-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .5rem;
    min-width: 0;
    margin-top: .5rem;
}

.picker-item-top h4 {
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.3;
    word-break: break-word;
}

.picker-item-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
}

.picker-item-stock {
    font-size: .8rem;
    color: var(--text-muted);
}

.qty-btn {
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border);
    background: var(--bg-hover);
    color: var(--text);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

.qty-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

.picker-qty-input {
    width: 3.5rem;
    text-align: center;
    padding: .4rem .3rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: .9rem;
}

.order-add-bar {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-dark);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    text-align: center;
}

.order-lines {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.status-price-type {
    background: rgba(255,255,255,.08);
    color: var(--text-muted);
}

.customer-autocomplete {
    position: relative;
}

.customer-autocomplete-label { width: 100%; }

.customer-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-height: 240px;
    overflow-y: auto;
    z-index: 1200;
}

.customer-suggestion {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: .65rem .85rem;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    font-size: .9rem;
}

.customer-suggestion:last-child { border-bottom: none; }

.customer-suggestion:hover,
.customer-suggestion.active {
    background: var(--bg-hover);
}

.customer-suggestion-meta {
    font-size: .75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.customer-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}

.customer-link:hover { color: var(--accent-hover); }

.customer-lookup { margin-bottom: 1rem; }

.customer-profile {
    margin-bottom: 1.5rem;
}

.customer-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.customer-stat {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}

.customer-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent);
}

.customer-stat-label {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: .25rem;
}

.customer-order-items {
    font-size: .85rem;
    color: var(--text-muted);
    margin-top: .35rem;
}

.price-type-fieldset {
    border: none;
    margin: 0 0 1rem;
    padding: 0;
}

.price-type-fieldset legend {
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: .5rem;
}

.radio-card {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 1rem;
    margin-bottom: .5rem;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color .15s;
}

.radio-card:has(input:checked) {
    border-color: var(--accent);
    background: rgba(192,57,43,.08);
}

.radio-card input { margin-top: .2rem; flex-shrink: 0; width: auto; }

.radio-card-body { display: flex; flex-direction: column; gap: .15rem; }
.radio-card-body strong { color: var(--text); font-size: .95rem; }
.radio-card-body small { color: var(--text-muted); font-size: .8rem; }

@media (max-width: 768px) {
    .picker-layout { flex-direction: column; }
    .picker-categories {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .modal-order, .modal-picker { width: 100%; max-height: 95vh; }
}

.order-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.order-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .75rem;
    font-size: .9rem;
    margin-bottom: 1rem;
}

.order-info-grid .label,
.order-locations .label {
    display: block;
    font-size: .75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: .15rem;
}

.order-total-banner {
    background: linear-gradient(135deg, #2a0808, #1a0505);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    text-align: center;
    font-size: 1.1rem;
    margin: 1rem 0;
}

.order-total-banner strong { color: var(--accent); font-size: 1.35rem; }

.order-line { margin-bottom: .75rem; }
.order-line-done { opacity: .85; border-color: rgba(39,174,96,.3); }

.order-line-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}

.order-line-price { font-size: .85rem; color: var(--text-muted); text-align: right; }

.check-done {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    background: var(--success);
    color: #fff;
    border-radius: 50%;
    font-size: .7rem;
    margin-right: .35rem;
}

.order-locations { margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--border); }

.location-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .4rem 0;
    font-size: .85rem;
}

.order-actions { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }

.completed-note { font-size: .8rem; color: var(--success); margin-top: .35rem; }

.empty-hint { color: var(--text-muted); font-size: .9rem; }

.order-notes { grid-column: 1 / -1; }

.vault-empty { color: var(--text-muted); font-size: .85rem; font-style: italic; }

/* Search */
.search-bar {
    display: flex;
    gap: .75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-bar select, .search-bar input {
    padding: .55rem .85rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: .9rem;
    min-width: 200px;
}

.search-results { margin-top: 1rem; }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay[hidden] { display: none; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow);
}

/* Override base .modal max-width for large order/picker dialogs */
.modal.modal-order {
    width: min(98vw, 1200px);
    max-width: min(98vw, 1200px);
    padding: 0;
}

.modal.modal-picker {
    width: min(98vw, 1400px);
    max-width: min(98vw, 1400px);
    padding: 0;
}

.modal h2 { margin-bottom: 1rem; font-size: 1.15rem; }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    margin-top: 1rem;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--success);
    color: var(--text);
    padding: .85rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: slideIn .3s ease;
    font-size: .9rem;
}

.toast.error { border-color: var(--accent); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Admin tabs */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    padding: .75rem 1.25rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: .9rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-panel[hidden] { display: none; }

/* Permissions grid */
.perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .5rem;
    margin: 1rem 0;
}

.perm-grid label {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    padding: .4rem;
    font-size: .85rem;
    color: var(--text);
    cursor: pointer;
}

.perm-grid input[type="checkbox"] { width: auto; margin: 0; }

.perm-group-title {
    grid-column: 1 / -1;
    font-size: .75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: .5px;
    margin-top: .5rem;
    padding-bottom: .25rem;
    border-bottom: 1px solid var(--border);
}

/* Edit page */
.edit-form { max-width: 600px; }

.save-status {
    font-size: .85rem;
    color: var(--text-muted);
    margin-left: 1rem;
}

.save-status.saving { color: var(--warning); }
.save-status.saved { color: var(--success); }

.edit-actions {
    display: flex;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state h2 { margin-bottom: .5rem; color: var(--text); }

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .9rem;
}

.alert-error { background: rgba(192,57,43,.15); border: 1px solid var(--accent); color: var(--accent-hover); }
.alert-info { background: rgba(255,255,255,.05); border: 1px solid var(--border); }

.inline-form {
    display: flex;
    gap: .5rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.inline-form label { margin: 0; flex: 1; min-width: 140px; }

.badge {
    display: inline-block;
    padding: .15rem .5rem;
    background: rgba(192,57,43,.2);
    color: var(--accent);
    border-radius: 4px;
    font-size: .75rem;
    margin-right: .25rem;
}

@media (max-width: 768px) {
    .sidebar { width: 100%; position: relative; height: auto; }
    .main-area { margin-left: 0; }
    .app-shell { flex-direction: column; }
    .sidebar-nav { display: flex; overflow-x: auto; padding: 0; }
    .nav-link { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
    .nav-link.active { border-left: none; border-bottom-color: var(--accent); }
    .content { padding: 1rem; }
}
