/* =====================================================================
   AutoPoster - Admin Panel Styles
   ===================================================================== */

:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --success: #16A34A;
    --error: #DC2626;
    --bg: #F3F4F6;
    --card-bg: #FFFFFF;
    --text: #1F2937;
    --text-muted: #6B7280;
    --border: #E5E7EB;
}

* {
    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);
}

/* ---------- Auth Pages (login / setup) ---------- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-box {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 400px;
}

.auth-box h1 {
    margin: 0 0 4px;
    font-size: 24px;
}

.subtitle {
    color: var(--text-muted);
    margin: 0 0 24px;
    font-size: 14px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin: 14px 0 6px;
    color: var(--text-muted);
}

input[type="text"],
input[type="password"],
input[type="time"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

textarea {
    resize: vertical;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 11px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 18px;
    width: 100%;
}

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

.btn-secondary {
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-danger {
    background: var(--error);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-success {
    background: #DCFCE7;
    color: #166534;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
}

.warning-box {
    margin-top: 20px;
    padding: 12px 14px;
    background: #FEF3C7;
    color: #92400E;
    border-radius: 8px;
    font-size: 12px;
}

/* ---------- Admin Layout ---------- */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: #111827;
    color: white;
    padding: 24px 0;
    flex-shrink: 0;
}

.sidebar h2 {
    padding: 0 20px;
    font-size: 18px;
    margin: 0 0 24px;
}

.sidebar a {
    display: block;
    padding: 12px 20px;
    color: #D1D5DB;
    text-decoration: none;
    font-size: 14px;
}

.sidebar a:hover,
.sidebar a.active {
    background: #1F2937;
    color: white;
}

.sidebar .logout-link {
    margin-top: 30px;
    border-top: 1px solid #374151;
    padding-top: 16px;
}

.main-content {
    flex: 1;
    padding: 30px 40px;
    max-width: 1100px;
}

.main-content h1 {
    margin-top: 0;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}

.card h2 {
    margin-top: 0;
    font-size: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table th, table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #DCFCE7;
    color: #166534;
}

.badge-error {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-muted {
    background: #F3F4F6;
    color: var(--text-muted);
}

.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.stat-box {
    flex: 1;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.stat-box .stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.stat-box .stat-label {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row > div {
    flex: 1;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.checkbox-row input {
    width: auto;
}

.help-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 16px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
