:root {
    --fs-sidebar: #0b1220;
    --fs-sidebar-2: #111827;
    --fs-accent: #0d9488;
    --fs-accent-hover: #0f766e;
    --fs-bg: #eef2f6;
    --fs-surface: #ffffff;
    --fs-border: #e2e8f0;
    --fs-text: #0f172a;
    --fs-muted: #64748b;
    --fs-danger: #dc2626;
    --fs-success: #059669;
    --fs-radius: 12px;
    --fs-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

body.admin-body {
    margin: 0;
    font-family: "DM Sans", system-ui, -apple-system, sans-serif;
    color: var(--fs-text);
    background: var(--fs-bg);
    min-height: 100vh;
}

.admin-shell {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--fs-sidebar) 0%, var(--fs-sidebar-2) 100%);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    text-decoration: none;
    color: #fff;
}

.admin-brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #14b8a6, #0ea5e9);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}

.admin-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.admin-brand-text strong {
    font-size: 16px;
    letter-spacing: -0.02em;
}

.admin-brand-text span {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

.admin-nav {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.admin-nav-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 12px 12px 8px;
    font-weight: 600;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 10px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
    position: relative;
}

.nav-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #f59e0b;
    color: #111827;
    font-size: 11px;
    font-weight: 700;
    align-items: center;
    justify-content: center;
}

.topbar-msg {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--fs-border);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #334155;
    text-decoration: none;
}

.topbar-msg:hover { background: #f8fafc; color: #0f172a; }

.topbar-sound-btn {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.topbar-sound-btn.is-muted {
    color: #94a3b8;
    background: #f8fafc;
}

.topbar-msg-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    align-items: center;
    justify-content: center;
}

.admin-nav a:hover {
    background: rgba(255,255,255,0.05);
    color: #e2e8f0;
}

.admin-nav a.active {
    background: rgba(13, 148, 136, 0.18);
    color: #5eead4;
}

.admin-nav a svg {
    width: 18px;
    height: 18px;
    opacity: 0.9;
}

.admin-sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
}

.admin-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #1e293b;
    color: #5eead4;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
}

.admin-user-meta {
    min-width: 0;
    flex: 1;
}

.admin-user-meta strong {
    display: block;
    color: #f8fafc;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-meta span {
    font-size: 11px;
    color: #64748b;
}

.admin-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    height: 64px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--fs-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-topbar-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--fs-text);
}

.admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-content {
    padding: 28px;
}

.admin-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.admin-page-header h1,
.admin-page-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--fs-text);
}

.admin-page-header p {
    margin: 6px 0 0;
    color: var(--fs-muted);
    font-size: 14px;
}

.admin-card {
    background: var(--fs-surface);
    border: 1px solid var(--fs-border);
    border-radius: var(--fs-radius);
    box-shadow: var(--fs-shadow);
    overflow: hidden;
}

.admin-card-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--fs-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fafbfc;
}

.admin-card-header h2,
.admin-card-header h5,
.admin-card-header .card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 650;
}

.admin-card-body {
    padding: 18px;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.admin-table thead th {
    background: #f8fafc;
    color: var(--fs-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 650;
    padding: 12px 16px;
    border-bottom: 1px solid var(--fs-border);
    white-space: nowrap;
}

.admin-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background: #f8fafc;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.btn-admin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
}

.btn-admin:active { transform: translateY(1px); }

.btn-admin-primary {
    background: var(--fs-accent);
    color: #fff;
    box-shadow: 0 8px 18px rgba(13, 148, 136, 0.25);
}

.btn-admin-primary:hover {
    background: var(--fs-accent-hover);
    color: #fff;
}

.btn-admin-secondary {
    background: #fff;
    color: var(--fs-text);
    border: 1px solid var(--fs-border);
}

.btn-admin-secondary:hover {
    background: #f8fafc;
    color: var(--fs-text);
}

.btn-admin-danger {
    background: #fef2f2;
    color: var(--fs-danger);
    border: 1px solid #fecaca;
}

.btn-admin-success {
    background: #ecfdf5;
    color: var(--fs-success);
    border: 1px solid #a7f3d0;
}

.btn-admin-sm {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 8px;
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-soft-teal { background: #ccfbf1; color: #0f766e; }
.badge-soft-slate { background: #e2e8f0; color: #334155; }
.badge-soft-green { background: #d1fae5; color: #047857; }
.badge-soft-amber { background: #fef3c7; color: #b45309; }
.badge-soft-red { background: #fee2e2; color: #b91c1c; }
.badge-soft-blue { background: #dbeafe; color: #1d4ed8; }

.admin-alert {
    border-radius: 10px;
    border: 1px solid transparent;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 14px;
}

.admin-alert-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.admin-alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.admin-alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* Bootstrap overrides inside admin */
.admin-content .form-control,
.admin-content .form-select,
.modal .form-control,
.modal .form-select {
    border-radius: 10px;
    border-color: var(--fs-border);
    padding: 10px 12px;
    font-size: 14px;
}

.admin-content .form-control:focus,
.admin-content .form-select:focus,
.modal .form-control:focus,
.modal .form-select:focus {
    border-color: #5eead4;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.admin-content .form-label,
.modal .form-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.modal-content {
    border: 1px solid var(--fs-border);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.modal-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--fs-border);
    padding: 16px 20px;
}

.modal-title {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.modal-footer {
    background: #fff;
    border-top: 1px solid var(--fs-border);
    padding: 14px 20px;
}

.modal-body {
    padding: 20px;
}

.stream-row {
    background: #f8fafc !important;
    border: 1px solid var(--fs-border) !important;
    border-radius: 12px !important;
}

.guest-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top right, rgba(13,148,136,0.12), transparent 40%),
        radial-gradient(circle at bottom left, rgba(14,165,233,0.10), transparent 35%),
        var(--fs-bg);
}

.guest-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border: 1px solid var(--fs-border);
    border-radius: 18px;
    box-shadow: var(--fs-shadow);
    padding: 28px;
}

.guest-card h1 {
    font-size: 22px;
    margin: 0 0 6px;
    letter-spacing: -0.03em;
}

.guest-card p {
    margin: 0 0 22px;
    color: var(--fs-muted);
    font-size: 14px;
}

.admin-mobile-toggle {
    display: none;
    border: 1px solid var(--fs-border);
    background: #fff;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
}

@media (max-width: 992px) {
    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: transform .2s ease;
    }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-mobile-toggle { display: inline-flex; }
    .admin-content { padding: 18px; }
    .admin-topbar { padding: 0 16px; }
}

.admin-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 90;
}

.admin-backdrop.show { display: block; }
