/* =====================================================
   StableOSX – Admin CSS
===================================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body.admin-body {
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 14px;
    display: flex;
    min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
    width: 220px;
    background: var(--sidebar, var(--bg-card));
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 50;
    transition: width 0.2s;
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font);
    font-size: 17px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-logo em { font-style: normal; color: var(--gold); }
.sidebar-nav { padding: 10px 8px; flex: 1; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: var(--radius);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
}
.nav-item:hover { background: var(--bg-card-2); color: var(--text-primary); }
.nav-item.active { background: rgba(201,168,76,0.12); color: var(--gold); }
.nav-item svg { flex-shrink: 0; }
.sidebar-bottom { padding: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.admin-info { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.admin-avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(201,168,76,0.12); border: 1px solid var(--border-mid); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: var(--gold); flex-shrink: 0; }
.admin-name { font-size: 13px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-logout { font-size: 11px; color: var(--text-dim); text-decoration: none; display: block; }
.admin-logout:hover { color: var(--red); }
.view-public-btn { display: block; text-align: center; font-size: 12px; color: var(--text-dim); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; text-decoration: none; transition: background 0.12s, color 0.12s; white-space: nowrap; }
.view-public-btn:hover { background: var(--bg-card-2); color: var(--text-muted); }

/* ── MAIN ── */
.admin-main { margin-left: 220px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid var(--border); background: var(--bg-2); position: sticky; top: 0; z-index: 40; gap: 12px; flex-wrap: wrap; }
.page-title { font-family: var(--font); font-size: 20px; font-weight: 400; margin: 0; color: var(--text-primary); }

/* ── BUTTONS ── */
.btn-gold { background: var(--gold); color: var(--bg); border: none; border-radius: var(--radius); padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; transition: background 0.15s; white-space: nowrap; }
.btn-gold:hover { background: var(--gold-light); }
.btn-outline { background: transparent; color: var(--text-muted); border: 1px solid var(--border-mid); border-radius: var(--radius); padding: 7px 14px; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-block; transition: background 0.12s, color 0.12s; white-space: nowrap; }
.btn-outline:hover { background: var(--bg-card-2); color: var(--text-primary); }
.btn-primary { background: var(--gold); color: var(--bg); border: none; border-radius: var(--radius); padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.15s; width: 100%; }
.btn-primary:hover { background: var(--gold-light); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-danger { background: transparent; color: var(--red); border: 1px solid var(--red-border); border-radius: var(--radius); padding: 7px 14px; font-size: 13px; cursor: pointer; transition: background 0.12s; white-space: nowrap; }
.btn-danger:hover { background: var(--red-bg); }
.btn-secondary { background: transparent; color: var(--text-muted); border: 1px solid var(--border-mid); border-radius: var(--radius); padding: 10px 18px; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-block; text-align: center; transition: background 0.12s; }
.btn-secondary:hover { background: var(--bg-card-2); }

/* ── STATS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; padding: 20px 24px 0; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; }
.stat-card.stat-green  { border-color: var(--green-border); }
.stat-card.stat-yellow { border-color: var(--yellow-border); }
.stat-card.stat-purple { border-color: var(--purple-border); }
.stat-card.stat-gold   { border-color: rgba(201,168,76,0.4); }
.stat-icon { margin-bottom: 8px; color: var(--text-dim); }
.stat-card.stat-green  .stat-icon { color: var(--green); }
.stat-card.stat-yellow .stat-icon { color: var(--yellow); }
.stat-card.stat-purple .stat-icon { color: var(--purple); }
.stat-card.stat-gold   .stat-icon { color: var(--gold); }
.stat-num { font-size: 26px; font-weight: 700; color: var(--text-primary); line-height: 1; font-family: var(--font); }
.stat-card.stat-green  .stat-num { color: var(--green); }
.stat-card.stat-yellow .stat-num { color: var(--yellow); }
.stat-card.stat-purple .stat-num { color: var(--purple); }
.stat-card.stat-gold   .stat-num { color: var(--gold); }
.stat-label { font-size: 10px; color: var(--text-dim); letter-spacing: 0.5px; margin-top: 4px; text-transform: uppercase; }

/* ── DASHBOARD GRID ── */
.dashboard-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; padding: 16px 24px 40px; }
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.panel-header h2 { font-size: 14px; font-weight: 500; margin: 0; color: var(--text-primary); }
.panel-link { font-size: 12px; color: var(--text-muted); text-decoration: none; }
.panel-link:hover { color: var(--gold); }
.panel-empty { font-size: 13px; color: var(--text-dim); }

/* ── BOX MINI ── */
.section-group { margin-bottom: 14px; }
.section-label { font-size: 10px; color: var(--text-dim); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px; }
.box-mini-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.box-mini { width: 60px; height: 44px; border-radius: var(--radius); border: 1px solid; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; text-decoration: none; transition: transform 0.12s; cursor: pointer; }
.box-mini:hover { transform: scale(1.06); }
.box-mini-available   { background: var(--green-bg);  border-color: var(--green-border); }
.box-mini-soon        { background: var(--yellow-bg); border-color: var(--yellow-border); }
.box-mini-unavailable { background: var(--red-bg);    border-color: var(--red-border); }
.box-mini-reserved    { background: var(--purple-bg); border-color: var(--purple-border); }
.box-mini-add { background: var(--bg); border-color: var(--border); border-style: dashed; color: var(--text-dim); font-size: 16px; }
.box-mini-add:hover { border-color: var(--border-mid); color: var(--text-muted); }
.box-mini-num { font-size: 9px; font-weight: 600; }
.box-mini-available   .box-mini-num { color: var(--green); }
.box-mini-soon        .box-mini-num { color: var(--yellow); }
.box-mini-unavailable .box-mini-num { color: var(--red); }
.box-mini-reserved    .box-mini-num { color: var(--purple); }
.box-mini-price { font-size: 9px; color: var(--text-muted); }

/* ── ANFRAGEN ── */
.request-list { display: flex; flex-direction: column; gap: 2px; }
.request-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius); transition: background 0.1s; }
.request-item:hover { background: rgba(255,255,255,0.03); }
.request-item.unread { background: rgba(201,168,76,0.06); }
.request-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border-mid); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--gold); flex-shrink: 0; }
.request-info { flex: 1; min-width: 0; }
.request-name { font-size: 13px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.request-meta { font-size: 11px; color: var(--text-dim); margin-top: 1px; }

/* ── BADGE ── */
.badge { background: var(--gold); color: var(--bg); font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px; flex-shrink: 0; }

/* ── FORMS ── */
.admin-form-wrap { padding: 24px; max-width: 660px; }
.form-section { margin-bottom: 24px; }
.form-section-title { font-size: 10px; color: var(--text-dim); letter-spacing: 2px; text-transform: uppercase; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
label { font-size: 12px; color: var(--text-muted); }
.required { color: var(--red); }
.form-hint { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="tel"],
select, textarea {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 14px;
    padding: 8px 12px;
    outline: none;
    width: 100%;
    transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
select { cursor: pointer; }
textarea { resize: vertical; min-height: 80px; }

/* ── ALERTS ── */
.alert { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; }
.alert-error   { background: var(--red-bg);   color: var(--red);   border: 1px solid var(--red-border); }
.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }

/* ── EXTRAS ── */
.extras-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.extra-row { display: flex; gap: 8px; align-items: center; background: rgba(0,0,0,0.15); padding: 7px 10px; border-radius: var(--radius); }
.extra-row input { margin: 0; }
.extra-name  { flex: 1; }
.extra-price { width: 110px; }
.btn-remove-extra { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 16px; padding: 2px 6px; border-radius: 3px; line-height: 1; transition: color 0.12s; }
.btn-remove-extra:hover { color: var(--red); }
.btn-add-extra { background: transparent; border: 1px dashed var(--border-mid); color: var(--text-muted); border-radius: var(--radius); padding: 7px 14px; font-size: 13px; cursor: pointer; width: 100%; font-family: var(--font-ui); transition: background 0.12s, color 0.12s; }
.btn-add-extra:hover { background: var(--bg-card-2); color: var(--text-primary); }

/* ── TABLE ── */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { font-size: 10px; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); font-weight: 500; }
.admin-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: 13px; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }
.admin-table td:first-child { color: var(--text-primary); }

/* ── STATUS PILLS ── */
.status-pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; letter-spacing: 0.5px; }
.status-available   { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green-border); }
.status-soon        { background: var(--yellow-bg); color: var(--yellow); border: 1px solid var(--yellow-border); }
.status-unavailable { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red-border); }
.status-reserved    { background: var(--purple-bg); color: var(--purple); border: 1px solid var(--purple-border); }

/* ── MOBILE ── */
@media (max-width: 768px) {
    .sidebar { width: 52px; }
    .sidebar-logo span, .sidebar-logo em { display: none; }
    .sidebar-logo { justify-content: center; padding: 14px 8px; }
    .nav-item span { display: none; }
    .nav-item { justify-content: center; padding: 12px 8px; }
    .admin-name, .admin-logout, .view-public-btn { display: none; }
    .admin-info { justify-content: center; }
    .admin-main { margin-left: 52px; }
    .admin-topbar { padding: 12px 14px; }
    .page-title { font-size: 16px; }
    .admin-form-wrap { padding: 14px; }
    .form-row { flex-direction: column; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .admin-table th, .admin-table td { padding: 7px 8px; font-size: 11px; }
}

/* ── SETUP PAGES (login, install) ── */
body.setup-page {
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 16px;
    font-family: var(--font-ui);
}
.setup-wrap { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 20px; }
.setup-logo { display: flex; align-items: center; gap: 12px; justify-content: center; }
.setup-logo-text { font-family: var(--font); font-size: 24px; color: var(--text-primary); }
.setup-logo-text span { color: var(--gold); }
.setup-card { background: var(--bg-card); border: 1px solid var(--border-mid); border-radius: var(--radius-lg); padding: 28px; }
.setup-step-badge { font-size: 11px; color: var(--text-dim); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 10px; }
.setup-card h1 { font-size: 22px; color: var(--text-primary); margin: 0 0 8px; }
.setup-lead { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin: 0 0 20px; }
.setup-form { display: flex; flex-direction: column; gap: 14px; }
.input-mono { font-family: 'Courier New', Courier, monospace; letter-spacing: 2px; }
.setup-footer { text-align: center; font-size: 12px; color: var(--text-dim); }
.setup-footer a { color: var(--gold); text-decoration: none; }
.setup-info-box { margin-top: 16px; padding: 12px 14px; background: rgba(201,168,76,0.07); border: 1px solid rgba(201,168,76,0.25); border-radius: var(--radius); font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.setup-info-box code { background: rgba(0,0,0,0.3); padding: 1px 5px; border-radius: 3px; font-size: 11px; }
.success-icon { text-align: center; padding: 10px 0 0; }
.success-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.pw-strength { display: flex; align-items: center; gap: 10px; }
.pw-bar { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.pw-bar-fill { height: 100%; width: 0; border-radius: 2px; transition: width 0.3s, background 0.3s; }
.progress-bar { display: flex; align-items: center; justify-content: center; gap: 0; }
.progress-step { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.progress-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border-mid); background: var(--bg-card); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--text-dim); }
.progress-step.active .progress-dot { border-color: var(--gold); color: var(--gold); }
.progress-step.done .progress-dot { border-color: var(--green); background: var(--green-bg); color: var(--green); }
.progress-label { font-size: 10px; color: var(--text-dim); letter-spacing: 0.5px; white-space: nowrap; }
.progress-step.active .progress-label { color: var(--gold); }
.progress-step.done .progress-label { color: var(--green); }
.progress-line { height: 2px; width: 50px; background: var(--border); margin: 0 4px; margin-bottom: 16px; border-radius: 1px; }
.progress-line.done { background: var(--green); }
