/* ── Admin panel & login styles ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-card2: #f1f5f9;
    --blue: #3b82f6;
    --blue-hover: #2563eb;
    --red: #ef4444;
    --green: #16a34a;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: rgba(0,0,0,0.1);
    --radius: 16px;
    --transition: 0.22s ease;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.admin-logo .logo-badge {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 700;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--text-muted);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(239,68,68,0.12);
    color: var(--red);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}
.btn-logout:hover {
    background: rgba(239,68,68,0.22);
    border-color: rgba(239,68,68,0.45);
}

/* ── Main layout ──────────────────────────────────────────────────────────── */
.admin-main {
    max-width: 780px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.admin-main h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}
.admin-main .subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 36px;
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 20px;
    transition: border-color var(--transition);
}
.admin-card:hover { border-color: rgba(0,0,0,0.18); }

.admin-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.card-icon.blue { background: rgba(59,130,246,0.15); }
.card-icon.green { background: rgba(34,197,94,0.15); }
.card-icon.orange { background: rgba(249,115,22,0.15); }

.admin-card-header h3 {
    font-size: 17px;
    font-weight: 600;
}
.admin-card-header p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.admin-input {
    flex: 1;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 16px;
    font-size: 15px;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.admin-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}
.admin-input::placeholder { color: var(--text-muted); }

.btn-save {
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition), transform 0.1s;
    font-family: 'Inter', sans-serif;
}
.btn-save:hover { background: var(--blue-hover); }
.btn-save:active { transform: scale(0.97); }

.current-value {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
}
.current-value span {
    color: var(--text);
    font-weight: 500;
    background: var(--bg-card2);
    padding: 2px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    word-break: break-all;
}

/* ── Toggle switch (maintenance) ─────────────────────────────────────────── */
.maintenance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.maintenance-info { flex: 1; }
.maintenance-info p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.5;
}

.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}
.toggle-label {
    font-size: 14px;
    font-weight: 500;
    min-width: 70px;
    text-align: center;
}
.toggle-label.on { color: var(--red); }
.toggle-label.off { color: var(--text-muted); }

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    cursor: pointer;
}
.switch input { display: none; }
.switch-track {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.1);
    border-radius: 99px;
    transition: background var(--transition);
    border: 1px solid var(--border);
}
.switch-thumb {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition), background var(--transition);
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.switch input:checked + .switch-track { background: rgba(239,68,68,0.7); border-color: rgba(239,68,68,0.5); }
.switch input:checked ~ .switch-thumb { transform: translateX(24px); }

.maintenance-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    align-items: center;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot.active { background: var(--red); box-shadow: 0 0 6px var(--red); }
.status-dot.inactive { background: var(--green); box-shadow: 0 0 6px var(--green); }

.status-text { font-size: 14px; color: var(--text-muted); }
.status-text strong { color: var(--text); }

/* ── Toast ────────────────────────────────────────────────────────────────── */
#toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 22px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    transform: translateY(80px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 999;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.success { border-color: rgba(34,197,94,0.35); }
#toast.error { border-color: rgba(239,68,68,0.35); }
#toast .toast-icon { font-size: 18px; }

/* ── Login page ───────────────────────────────────────────────────────────── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px 40px;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}
.login-logo .logo-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
}
.login-logo h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-logo p { font-size: 14px; color: var(--text-muted); }

.login-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.login-input {
    width: 100%;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 13px 16px;
    font-size: 15px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    margin-bottom: 20px;
}
.login-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}

.btn-login {
    width: 100%;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: background var(--transition), transform 0.1s;
}
.btn-login:hover { background: var(--blue-hover); }
.btn-login:active { transform: scale(0.98); }

.login-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    color: #fca5a5;
    margin-bottom: 16px;
}

/* ── Maintenance page ─────────────────────────────────────────────────────── */
.maint-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

.maint-bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.maint-gear {
    font-size: 72px;
    margin-bottom: 28px;
    animation: spin 6s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.maint-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(249,115,22,0.12);
    border: 1px solid rgba(249,115,22,0.3);
    color: #fb923c;
    border-radius: 99px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: 0.4px;
}

.maint-wrap h1 {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 14px;
    background: linear-gradient(135deg, #f1f5f9 40%, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.maint-wrap .maint-desc {
    font-size: 17px;
    color: var(--text-muted);
    max-width: 460px;
    line-height: 1.7;
    margin-bottom: 36px;
}

.maint-hotline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 24px;
    font-size: 16px;
    text-decoration: none;
    color: var(--text);
    transition: border-color var(--transition), background var(--transition);
}
.maint-hotline:hover {
    border-color: rgba(255,255,255,0.15);
    background: var(--bg-card2);
}
.maint-hotline span { color: var(--blue); font-weight: 700; font-size: 17px; }

.maint-logo {
    position: absolute;
    top: 24px;
    left: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
}
.maint-logo .lbadge {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    border-radius: 7px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 700;
}

.maint-dots {
    display: flex;
    gap: 8px;
    margin-top: 28px;
}
.maint-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--blue);
    animation: bounce 1.4s ease-in-out infinite;
}
.maint-dots span:nth-child(2) { animation-delay: 0.18s; }
.maint-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}
