@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Variable.woff2') format('woff2 supports variations'),
         url('../fonts/Vazirmatn-Variable.woff2') format('woff2-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --bg: #f3f4f6;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
}

* { box-sizing: border-box; }

body {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    direction: rtl;
}

/* بهبود کیفیت نمایش عدد فارسی و لیگاچرها */
body, input, textarea, select, button {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
}

.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 230px;
    background: #111827;
    color: #f9fafb;
    padding: 20px 0;
    flex-shrink: 0;
}

.sidebar h2 {
    font-size: 16px;
    padding: 0 20px 16px;
    border-bottom: 1px solid #374151;
    margin: 0 0 16px;
}

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

.sidebar a:hover, .sidebar a.active {
    background: var(--primary);
    color: #fff;
}

.main { flex: 1; padding: 24px; max-width: 1200px; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    text-align: center;
}

.stat-box .num { font-size: 28px; font-weight: bold; color: var(--primary); }
.stat-box .label { color: var(--muted); font-size: 13px; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; text-align: right; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 600; }

.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}
.btn:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.badge { padding: 3px 10px; border-radius: 12px; font-size: 12px; }
.badge-draft { background: #e5e7eb; color: #374151; }
.badge-scheduled, .badge-pending { background: #fef3c7; color: var(--warning); }
.badge-sent, .badge-posted, .badge-active { background: #dcfce7; color: var(--success); }
.badge-failed { background: #fee2e2; color: var(--danger); }

.form-group { margin-bottom: 14px; }
label { display: block; margin-bottom: 5px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local], select, textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
}
textarea { min-height: 120px; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }

.login-wrap { display:flex; align-items:center; justify-content:center; min-height:100vh; }
.login-box { background:#fff; padding:34px; border-radius:12px; width:340px; box-shadow:0 4px 20px rgba(0,0,0,.08); }
.login-box h1 { font-size:18px; text-align:center; margin-bottom:20px; }

.calendar-grid { display:grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendar-day { background:#fff; border:1px solid var(--border); border-radius:8px; min-height:100px; padding:6px; font-size:12px; }
.calendar-day .day-num { font-weight:bold; color:var(--muted); margin-bottom:4px; }
.calendar-day .ev { display:block; background:#eef2ff; color:var(--primary-dark); border-radius:4px; padding:2px 5px; margin-bottom:2px; font-size:11px; }
.calendar-day .ev.social { background:#fdf2f8; color:#be185d; }
.calendar-day .ev.note { background:#f0fdf4; color:#15803d; }

.flex-between { display:flex; justify-content:space-between; align-items:center; }
