/* ══════════════════════════════════════════════════════════════
   Alphanso VAST Ads — Global Stylesheet
   ══════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #0f172a;
    --surface: #1e293b;
    --surface2: #162032;
    --border: #334155;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --radius: 10px;
}

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

/* ── Base ───────────────────────────────────────────────────── */
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 12px #00000030;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: left;
    box-shadow: 0 0 0 1px #6366f133, 0 4px 12px #6366f140;
    flex-shrink: 0;
}

.brand-logo svg {
    display: block;
}

.brand-name {
    font-size: 14px;
    font-weight: 800;
    color: #e2e8f0;
    letter-spacing: -.01em;
    white-space: nowrap;
}

.nav-divider {
    width: 1px;
    height: 22px;
    background: var(--border);
    margin: 0 8px;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all .15s;
    white-space: nowrap;
}

.nav-link svg {
    opacity: .6;
    transition: opacity .15s;
    flex-shrink: 0;
}

.nav-link:hover {
    color: var(--text);
    background: #ffffff0a;
}

.nav-link:hover svg {
    opacity: 1;
}

.nav-link.active {
    color: var(--text);
    background: #6366f118;
    font-weight: 600;
}

.nav-link.active svg {
    opacity: 1;
    color: #818cf8;
}

/* ── Ad Player nav button (right-side, highlighted) ──────────── */
.nav-player-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    /* color: #818cf8;
    background: #6366f115; */
    background: #ffffff;
    color: #2c40f3;
    border: 1px solid #6366f130;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 8px;
    transition: all .15s;
    white-space: nowrap;
    flex-shrink: 0;
    margin-right: 8px;
}

.nav-player-btn svg {
    opacity: .8;
    transition: opacity .15s;
    flex-shrink: 0;
}

.nav-player-btn:hover {
    background: #6366f125;
    border-color: #6366f155;
    color: #a5b4fc;
}

.nav-player-btn:hover svg {
    opacity: 1;
}

.nav-player-btn.active {
    background: #6366f122;
    border-color: #6366f150;
    color: #a5b4fc;
    box-shadow: 0 0 0 3px #6366f112;
}

.nav-link-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #6366f1;
    margin-left: 2px;
    display: none;
}

.nav-link.active .nav-link-dot {
    display: inline-block;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    border: 2px solid #6366f133;
}

.user-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.user-role {
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.role-pill {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}

.pill-master_admin {
    background: #f59e0b22;
    color: #fbbf24;
    border: 1px solid #f59e0b33;
}

.pill-admin {
    background: #6366f122;
    color: #818cf8;
    border: 1px solid #6366f133;
}

.pill-organizer {
    background: #10b98122;
    color: #34d399;
    border: 1px solid #10b98133;
}

.btn-signout {
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
    white-space: nowrap;
}

.btn-signout:hover {
    border-color: #ef444488;
    color: #ef4444;
    background: #ef444410;
}

.btn-signout svg {
    opacity: .7;
    transition: opacity .15s;
}

.btn-signout:hover svg {
    opacity: 1;
}

/* ── Page container ─────────────────────────────────────────── */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 28px;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all .15s;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

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

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 7px;
}

.btn-save {
    padding: 10px 24px;
    border-radius: 9px;
    background: var(--primary);
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
    font-family: inherit;
}

.btn-save:hover {
    background: var(--primary-dark);
}

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
}

.alert-success {
    background: #064e3b22;
    border: 1px solid #10b98155;
    color: var(--success);
}

.alert-error {
    background: #7f1d1d22;
    border: 1px solid #ef444455;
    color: var(--danger);
}

.alert-warning {
    background: #451a0322;
    border: 1px solid #f59e0b55;
    color: var(--warning);
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.card-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-header h2 {
    font-size: 13px;
    font-weight: 700;
}

.card-header p {
    font-size: 11px;
    color: var(--muted);
    margin-top: 1px;
}

.card-body {
    padding: 22px;
}

/* ── Form fields ────────────────────────────────────────────── */
.field {
    margin-bottom: 14px;
}

.field:last-child {
    margin-bottom: 0;
}

.field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px #6366f122;
}

.field input:disabled,
.field select:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.field select option {
    background: #1e293b;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.field-row:last-child {
    margin-bottom: 0;
}

.hint {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
}

.error-msg {
    font-size: 11px;
    color: var(--danger);
    margin-top: 4px;
}

/* ── Tables ─────────────────────────────────────────────────── */
.table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

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

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

.table-card-header h2 {
    font-size: 15px;
    font-weight: 700;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead tr {
    background: #0d1626;
}

th {
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    text-align: left;
}

td {
    padding: 13px 16px;
    font-size: 14px;
    border-bottom: 1px solid #1e293b;
    vertical-align: middle;
}

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

tbody tr:hover {
    background: #ffffff05;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-master_admin {
    background: #f59e0b22;
    color: #fbbf24;
    border: 1px solid #f59e0b33;
}

.badge-master_admin .badge-dot {
    background: #fbbf24;
    box-shadow: 0 0 5px #fbbf2488;
}

.badge-admin {
    background: #6366f122;
    color: #818cf8;
    border: 1px solid #6366f133;
}

.badge-admin .badge-dot {
    background: #818cf8;
}

.badge-organizer {
    background: #10b98122;
    color: #34d399;
    border: 1px solid #10b98133;
}

.badge-organizer .badge-dot {
    background: #34d399;
}

.badge-active {
    background: #10b98122;
    color: #34d399;
    border: 1px solid #10b98133;
}

.badge-inactive {
    background: #37415133;
    color: #94a3b8;
    border: 1px solid #37415188;
}

.badge-pending {
    background: #f59e0b22;
    color: #fbbf24;
    border: 1px solid #f59e0b33;
}

/* ── Form inline (replaces style="display:contents") ─────────── */
.form-inline {
    display: contents;
}

/* ── Action buttons ─────────────────────────────────────────── */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all .15s;
    font-family: inherit;
    white-space: nowrap;
}

.action-view {
    background: #6366f118;
    color: #818cf8;
    border-color: #6366f130;
}

.action-view:hover {
    background: #6366f128;
    border-color: #6366f155;
    color: #a5b4fc;
}

.action-edit {
    background: #1e293b;
    color: var(--text);
    border-color: var(--border);
}

.action-edit:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.action-toggle {
    background: #1e293b;
    color: var(--muted);
    border-color: var(--border);
    font-size: 11px;
}

.action-toggle:hover {
    background: #f59e0b18;
    border-color: #f59e0b55;
    color: #fbbf24;
}

.action-delete {
    background: #7f1d1d22;
    color: var(--danger);
    border-color: #7f1d1d55;
    padding: 6px 10px;
}

.action-delete:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
}

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
    padding: 60px 24px;
    text-align: center;
    color: var(--muted);
}

.empty-state-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

/* ── Footer ─────────────────────────────────────────────────── */
.app-footer {
    border-top: 1px solid var(--border);
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
    margin-top: 40px;
}

.app-footer a {
    color: var(--muted);
    text-decoration: none;
}

.app-footer a:hover {
    color: var(--text);
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
    }

    .container {
        padding: 20px 16px;
    }

    .field-row {
        grid-template-columns: 1fr;
    }

    .brand-name {
        display: none;
    }
}