/* media.melrosenetworks.com - simple, professional UI */
:root {
    --bg: #0f1419;
    --panel: #1a212b;
    --panel-2: #222c38;
    --border: #2d3a48;
    --text: #e6edf3;
    --muted: #9aa7b4;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

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

.container { max-width: 1080px; margin: 0 auto; padding: 24px; }
.container-narrow { max-width: 480px; margin: 0 auto; padding: 24px; }

/* Top bar */
.topbar {
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.topbar .brand { font-weight: 600; font-size: 1.05rem; }
.topbar nav a { margin-left: 18px; color: var(--muted); }
.topbar nav a:hover { color: var(--text); }

/* Cards & panels */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}
.card h1, .card h2 { margin-top: 0; }

/* Centered auth screens */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}
.auth-card h1 { margin: 0 0 4px; font-size: 1.4rem; }
.auth-card .sub { color: var(--muted); margin: 0 0 24px; font-size: 0.95rem; }

/* Forms */
label { display: block; font-size: 0.85rem; color: var(--muted); margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=email], input[type=date],
input[type=datetime-local], input[type=number], textarea, select {
    width: 100%;
    padding: 10px 12px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }

.code-input {
    text-align: center;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-size: 1.3rem;
    font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 18px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn-block { display: block; width: 100%; }
.btn-secondary { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 5px 10px; font-size: 0.82rem; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 0.92rem; }
.alert-error { background: rgba(239,68,68,0.12); border: 1px solid var(--danger); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.12); border: 1px solid var(--success); color: #86efac; }
.alert-info { background: rgba(59,130,246,0.12); border: 1px solid var(--accent); color: #93c5fd; }

/* Video list */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.video-tile {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.video-tile .thumb {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #243042, #161d27);
    display: flex; align-items: center; justify-content: center;
    color: var(--muted); font-size: 2.4rem;
}
.video-tile .meta { padding: 14px 16px; }
.video-tile .meta h3 { margin: 0 0 4px; font-size: 1rem; }
.video-tile .meta p { margin: 0 0 12px; color: var(--muted); font-size: 0.85rem; }

/* Player */
.player-wrap { background: #000; border-radius: var(--radius); overflow: hidden; }
video { width: 100%; display: block; background: #000; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:hover td { background: rgba(255,255,255,0.02); }
.table-wrap { overflow-x: auto; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-active { background: rgba(34,197,94,0.15); color: #86efac; }
.badge-inactive { background: rgba(148,163,184,0.15); color: var(--muted); }
.badge-expired { background: rgba(245,158,11,0.15); color: #fcd34d; }

/* Stats cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat .n { font-size: 1.8rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }

/* Layout helpers */
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.mono { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; }
.mt { margin-top: 18px; }
.mb { margin-bottom: 18px; }
.text-right { text-align: right; }
.small { font-size: 0.85rem; }
.inline-form { display: inline; }

/* Admin nav tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 22px; }
.tabs a {
    padding: 8px 14px; border-radius: 8px; color: var(--muted);
    background: var(--panel); border: 1px solid var(--border);
}
.tabs a.active, .tabs a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
