* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #0f1117;
    color: #e0e0e0;
}

/* ── Navbar ── */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 56px;
    background: #1a1d29;
    border-bottom: 1px solid #2a2d3a;
}

.nav-brand {
    font-size: 18px;
    font-weight: 700;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-links a {
    color: #8b8fa3;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.nav-links a:hover { color: #fff; }
.nav-user { color: #4a9eff; font-weight: 600; }
.nav-logout { color: #ff4a4a !important; }

/* ── Container ── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

h1 { margin-bottom: 24px; font-size: 24px; }
h2 { margin: 24px 0 12px; font-size: 18px; }

/* ── Login ── */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-form {
    background: #1a1d29;
    padding: 40px;
    border-radius: 12px;
    width: 360px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-form h1 { text-align: center; margin-bottom: 12px; }

.login-form input {
    padding: 12px 16px;
    border: 1px solid #2a2d3a;
    border-radius: 8px;
    background: #0f1117;
    color: #fff;
    font-size: 14px;
}

.login-form button {
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #4a9eff;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.login-form button:hover { background: #3a8eef; }

/* ── Buttons ── */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.2s;
    text-align: center;
}

.btn:hover { opacity: 0.85; }
.btn-primary   { background: #4a9eff; color: #fff; }
.btn-secondary { background: #2a2d3a; color: #e0e0e0; }
.btn-danger    { background: #e74c3c; color: #fff; }
.btn-warning   { background: #e6a817; color: #000; }
.btn-sm        { padding: 4px 10px; font-size: 12px; }
.btn-block     { width: 100%; display: block; box-sizing: border-box; }

/* ── Alerts ── */
.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
}

.alert-info  { background: rgba(74,158,255,0.1); border: 1px solid rgba(74,158,255,0.3); color: #4a9eff; }
.alert-error { background: rgba(244,67,54,0.1);  border: 1px solid rgba(244,67,54,0.3);  color: #f44336; }

/* ── Badge ── */
.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    background: #2a2d3a;
    color: #8b8fa3;
}

.badge-success { background: #1a3a1a; color: #2ecc71; }
.badge-error   { background: #3a1a1a; color: #e74c3c; }
.badge-admin   { background: #2a2a1a; color: #f1c40f; }

/* ── Status badge ── */
.status-badge {
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    background: rgba(255,255,255,0.06);
    width: 100%;
    box-sizing: border-box;
}

/* ── Slots Grid ── */
.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

/* ── Slot Card ── */
.slot-card {
    background: #1a1d29;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
    min-width: 0;
}

.slot-ready      { border-color: #2ecc71; }
.slot-processing { border-color: #f39c12; }
.slot-error      { border-color: #e74c3c; }
.slot-empty      { border-color: #2a2d3a; border-style: dashed; }

/* ── Card Header ── */
.card-header {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.card-title {
    font-weight: 700;
    font-size: 16px;
    word-break: break-word;
}

.card-meta {
    font-size: 12px;
    color: #888;
    word-break: break-all;
}

.card-updated { color: #aaa; }

/* ── Card Actions ── */
.card-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-actions .btn,
.card-actions form {
    width: 100%;
}

.card-actions form .btn {
    width: 100%;
    box-sizing: border-box;
}

/* ── Card Section ── */
.card-section {
    border-top: 1px solid rgba(255,255,255,0.07);
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.section-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Slug ── */
.slug-form { width: 100%; min-width: 0; }

.slug-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
}

.slug-prefix {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    flex-shrink: 0;
}

.slug-input {
    flex: 1;
    min-width: 0;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: inherit;
    padding: 5px 8px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
}

.slug-input:focus { outline: none; border-color: rgba(255,255,255,0.3); }

.slug-link-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.slug-link {
    font-size: 12px;
    color: #4a9eff;
    word-break: break-all;
    flex: 1;
    min-width: 0;
}

/* ── Note ── */
.note-textarea {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: inherit;
    padding: 8px;
    font-size: 13px;
    resize: vertical;
    font-family: inherit;
}

.note-textarea:focus { outline: none; border-color: rgba(255,255,255,0.3); }

/* ── Empty slot ── */
.slot-empty-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 0;
    color: #555;
    text-align: center;
}

.slot-empty-content input[type="file"] {
    font-size: 12px;
    color: #8b8fa3;
}

/* ── Table ── */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    background: #1a1d29;
    border-radius: 8px;
    overflow: hidden;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #2a2d3a;
    font-size: 14px;
}

.table th {
    background: #15171f;
    font-weight: 600;
    color: #8b8fa3;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.table tr:hover { background: #1f2230; }

/* ── Card (admin) ── */
.card {
    background: #1a1d29;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

/* ── Stats ── */
.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #1a1d29;
    border-radius: 12px;
    padding: 20px 32px;
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #4a9eff;
}

.stat-label {
    font-size: 12px;
    color: #8b8fa3;
    text-transform: uppercase;
}

/* ── Form inline ── */
.form-inline {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.form-inline input,
.form-inline select {
    padding: 8px 12px;
    border: 1px solid #2a2d3a;
    border-radius: 6px;
    background: #0f1117;
    color: #fff;
    font-size: 14px;
}

/* ── Misc ── */
.text-muted { color: #555; font-size: 12px; }

code {
    background: #0f1117;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
}