@font-face {
    font-family: 'Estedad';
    src: url('../fonts/Estedad-FD-Thin.woff2') format('woff2');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Estedad';
    src: url('../fonts/Estedad-FD-ExtraLight.woff2') format('woff2');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Estedad';
    src: url('../fonts/Estedad-FD-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Estedad';
    src: url('../fonts/Estedad-FD-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Estedad';
    src: url('../fonts/Estedad-FD-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Estedad';
    src: url('../fonts/Estedad-FD-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Estedad';
    src: url('../fonts/Estedad-FD-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Estedad';
    src: url('../fonts/Estedad-FD-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --text: #1f2933;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --radius: 12px;
    --sidebar-w: 230px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Estedad', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

a { color: inherit; text-decoration: none; }

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

.sidebar {
    width: var(--sidebar-w);
    background: #111827;
    color: #e5e7eb;
    padding: 20px 14px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar .brand {
    font-weight: 800;
    font-size: 16px;
    margin-bottom: 24px;
    padding: 0 8px;
    color: #fff;
}
.sidebar .brand small { display:block; font-weight:400; font-size:11px; color:#9ca3af; margin-top:3px;}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #cbd5e1;
    margin-bottom: 4px;
    font-size: 13.5px;
    transition: background .15s;
}

.sidebar nav a:hover, .sidebar nav a.active {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.sidebar .logout-link {
    margin-top: 20px;
    display: block;
    color: #f87171;
    font-size: 13px;
    padding: 10px 12px;
}

.main {
    flex: 1;
    padding: 22px 26px 60px;
    min-width: 0;
}

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

.topbar h1 { font-size: 19px; margin: 0; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.btn:hover { background: var(--primary-dark); }
.btn.btn-secondary { background: #6b7280; }
.btn.btn-secondary:hover { background: #4b5563; }
.btn.btn-danger { background: var(--danger); }
.btn.btn-danger:hover { background: #b91c1c; }
.btn.btn-success { background: var(--success); }
.btn.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn:disabled { opacity:.6; cursor:not-allowed; }

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

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

.stat-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
}
.stat-box .num { font-size: 24px; font-weight: 800; color: var(--primary); }
.stat-box .lbl { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
table.data-table th, table.data-table td {
    padding: 10px 12px;
    text-align: right;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
table.data-table th {
    background: var(--bg);
    font-weight: 700;
    font-size: 12px;
    color: var(--text-muted);
}
table.data-table tbody tr:hover { background: #fafafa; }
.table-scroll { overflow-x: auto; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.badge.active { background: #dcfce7; color: #166534; }
.badge.inactive { background: #fee2e2; color: #991b1b; }
.badge.upcoming { background: #fef9c3; color: #854d0e; }
.badge.ended { background: #e5e7eb; color: #4b5563; }
.badge.winner { background: #fef3c7; color: #92400e; }

.form-row { margin-bottom: 16px; }
.form-row label { display:block; font-size:13px; font-weight:600; margin-bottom:6px; }
.form-row input[type=text], .form-row input[type=date], .form-row input[type=datetime-local],
.form-row input[type=number], .form-row input[type=password], .form-row select, .form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 13.5px;
    background: #fff;
}
.form-row .hint { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-2 @media { }

.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.color-swatches label {
    display: flex; align-items:center; gap:6px;
    border: 1.5px solid var(--border);
    padding: 6px 10px; border-radius: 20px;
    cursor: pointer; font-size: 12.5px;
    font-weight: 500;
}
.color-swatches input { display:none; }
.color-swatches label.selected { border-color: #111827; background:#111827; color:#fff; }
.swatch-dot { width:14px; height:14px; border-radius:50%; display:inline-block; }

.alert { padding: 11px 15px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }

.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg,#1e293b,#0f172a);
}
.login-card {
    background: #fff; border-radius: 16px; padding: 34px 30px; width: 100%; max-width: 360px;
    box-shadow: 0 20px 50px rgba(0,0,0,.3);
}
.login-card h2 { text-align:center; margin: 0 0 22px; }

.filter-bar { display:flex; gap:10px; flex-wrap:wrap; margin-bottom: 16px; align-items:center;}
.filter-bar input, .filter-bar select {
    padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 9px; font-family:inherit; font-size:13px;
}

.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 8px; margin: 12px 0; }
.checkbox-grid label { display:flex; align-items:center; gap:7px; font-size:13px; }

.event-thumb { width: 60px; height: 24px; object-fit: cover; border-radius: 4px; border:1px solid var(--border); }

.pagination { display:flex; gap:6px; margin-top: 14px; flex-wrap: wrap; }
.pagination a, .pagination span {
    padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); font-size: 12.5px;
}
.pagination a.active { background: var(--primary); color:#fff; border-color: var(--primary); }

/* ===================== تقویم شمسی ===================== */
.jdp-date-time-row { display: flex; gap: 8px; }
.jdp-date-time-row .jdp-input { flex: 1.4; direction: ltr; text-align: left; }
.jdp-date-time-row .jdp-time { flex: 1; }

.jdp-popup {
    z-index: 9999;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(15,23,42,.18);
    padding: 12px;
    width: 268px;
    direction: rtl;
    font-family: 'Estedad', Tahoma, sans-serif;
}

.jdp-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.jdp-title { font-weight: 800; font-size: 13.5px; }
.jdp-nav {
    width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border);
    background: #fff; cursor: pointer; font-size: 15px; color: var(--primary); line-height: 1;
}
.jdp-nav:hover { background: var(--bg); }

.jdp-week-row { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px; }
.jdp-weekday { text-align: center; font-size: 11px; color: var(--text-muted); font-weight: 700; padding: 4px 0; }

.jdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.jdp-day {
    aspect-ratio: 1; border: none; background: transparent; border-radius: 8px;
    font-size: 12.5px; cursor: pointer; font-family: inherit; color: var(--text);
}
.jdp-day:hover { background: var(--bg); }
.jdp-day-empty { cursor: default; }
.jdp-day-empty:hover { background: transparent; }
.jdp-today { border: 1.5px solid var(--primary); font-weight: 800; }

.jdp-footer { margin-top: 8px; display: flex; justify-content: center; }
.jdp-today-btn {
    border: none; background: var(--bg); color: var(--primary); font-weight: 700;
    padding: 6px 16px; border-radius: 8px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.jdp-today-btn:hover { background: #e0e7ff; }

@media (max-width: 860px) {
    .admin-wrap { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; padding: 12px; }
    .sidebar nav { display:flex; flex-wrap:wrap; gap:4px; }
    .main { padding: 16px; }
    .form-grid-2 { grid-template-columns: 1fr; }
}
