/* ─── Admin panel styles ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:       #1a56db;
  --blue-dark:  #1240a8;
  --blue-light: #e8f0fe;
  --sidebar-bg: #0f172a;
  --sidebar-w:  220px;
  --green:      #1a7a35;
  --green-bg:   #e6f4ea;
  --red:        #c0392b;
  --red-bg:     #fdecea;
  --orange:     #d97706;
  --orange-bg:  #fef3c7;
  --border:     #e0e4ef;
  --text:       #111827;
  --gray:       #6b7280;
  --gray-light: #f3f4f6;
  --radius:     10px;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: #f0f2f8;
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar-brand {
  padding: 20px 18px;
  font-weight: 800;
  font-size: .95rem;
  border-bottom: 1px solid #1e293b;
  display: flex; align-items: center; gap: 8px;
  color: #fff;
}
.sidebar-ico { font-size: 1.3rem; }
.nav-list { flex: 1; padding: 10px 0; list-style: none; }
.nav-list li { margin: 2px 0; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px;
  color: #94a3b8;
  text-decoration: none;
  border-radius: 0;
  transition: background .15s, color .15s;
  font-weight: 500;
}
.nav-link:hover  { background: #1e293b; color: #fff; }
.nav-link.active { background: var(--blue); color: #fff; font-weight: 700; }
.nav-ico { width: 20px; text-align: center; }
.sidebar-footer {
  padding: 12px 0;
  border-top: 1px solid #1e293b;
}

/* ─── Main content ───────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
}
.page-title { font-size: 1.2rem; font-weight: 700; }
.page-body  { padding: 24px 28px; flex: 1; }

/* ─── Cards ──────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.card-header {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}

/* ─── Stats row ──────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-align: center;
}
.stat-num  { font-size: 2rem; font-weight: 800; color: var(--blue); }
.stat-lbl  { font-size: .8rem; color: var(--gray); margin-top: 4px; }

/* ─── Table ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th {
  text-align: left;
  padding: 10px 14px;
  background: var(--gray-light);
  color: var(--gray);
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafbff; }

/* ─── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
}
.badge-ok     { background: var(--green-bg);  color: var(--green); }
.badge-cancel { background: var(--red-bg);    color: var(--red);   }
.badge-warn   { background: var(--orange-bg); color: var(--orange);}

/* ─── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: .85rem;
  margin-bottom: 6px;
  color: #374151;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  color: var(--text);
  background: #fff;
  transition: border-color .15s;
}
.form-control:focus { outline: none; border-color: var(--blue); }
.form-hint { font-size: .78rem; color: var(--gray); margin-top: 4px; }

/* ─── Schedule day toggles ──────────────────────────────────── */
.day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
}
.day-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  transition: border-color .15s;
}
.day-card.active-day { border-color: var(--blue); background: var(--blue-light); }
.day-name { font-weight: 700; width: 90px; font-size: .95rem; }
.day-times { display: flex; align-items: center; gap: 6px; flex: 1; }
.day-times input[type=time] {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .9rem;
}
.day-times span { color: var(--gray); font-size: .85rem; }

/* ─── Toggle switch ────────────────────────────────────────────── */
.toggle { position: relative; display: inline-block; width: 42px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  border-radius: 24px;
  transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 4px #0003;
}
.toggle input:checked + .toggle-slider { background: var(--blue); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: 8px; border: none;
  font-size: .9rem; font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  text-decoration: none;
}
.btn-primary { background: var(--blue);  color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-danger  { background: var(--red);   color: #fff; }
.btn-danger:hover  { opacity: .85; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--gray-light); }
.btn-sm { padding: 5px 12px; font-size: .82rem; }

/* ─── Alerts ──────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: .9rem; }
.alert-success { background: var(--green-bg); color: var(--green); }
.alert-error   { background: var(--red-bg);   color: var(--red);   }
.alert-info    { background: var(--blue-light); color: var(--blue); }

/* ─── Exceptions ──────────────────────────────────────────────── */
.exc-list { list-style: none; }
.exc-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.exc-item:last-child { border-bottom: none; }
.exc-date { font-weight: 700; width: 110px; }
.exc-info { flex: 1; color: var(--gray); font-size: .9rem; }

/* ─── Filter bar ─────────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar select, .filter-bar input[type=date] {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  background: #fff;
}

/* ─── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .sidebar { width: 60px; }
  .sidebar-brand span, .nav-link > span:last-child { display: none; }
  .main-content { margin-left: 60px; }
  .page-body { padding: 16px; }
}
