/* =====================================================================
   DRMS - Deworming Reminder & Management System
   Web Admin Panel Custom Styles
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary:     #0d6efd;
  --primary-dark:#0a58ca;
  --teal:        #0dcaf0;
  --sidebar-bg:  #0f1b2d;
  --sidebar-hover: #1a2d48;
  --sidebar-active: #0d6efd;
  --sidebar-text: #a8b9cc;
  --sidebar-w:   260px;
  --topbar-h:    64px;
  --card-shadow: 0 2px 16px rgba(0,0,0,.08);
  --border-radius: 12px;
  --transition: .2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: #f0f4f8;
  color: #1e293b;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  z-index: 1000; transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand img { width: 40px; height: 40px; border-radius: 8px; object-fit: contain; background: #fff; padding: 4px; }
.sidebar-brand-text { color: #fff; }
.sidebar-brand-text .clinic-name { font-size: 13px; font-weight: 700; letter-spacing: .5px; color: #e2e8f0; }
.sidebar-brand-text .app-name  { font-size: 10px; color: var(--sidebar-text); letter-spacing: 1px; text-transform: uppercase; }

.nav-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: 1.5px;
  color: #4a6075; text-transform: uppercase;
  padding: 18px 20px 6px;
}

.sidebar .nav-link {
  display: flex; align-items: center; gap: 12px;
  color: var(--sidebar-text); padding: 10px 20px;
  border-radius: 0; transition: all var(--transition);
  font-size: 13.5px; font-weight: 500; text-decoration: none;
  position: relative;
}
.sidebar .nav-link i { font-size: 16px; width: 20px; text-align: center; }
.sidebar .nav-link:hover  { color: #fff; background: var(--sidebar-hover); }
.sidebar .nav-link.active { color: #fff; background: var(--sidebar-active); }
.sidebar .nav-link.active::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--teal); border-radius: 0 2px 2px 0;
}
.badge-notif {
  margin-left: auto; background: #dc3545;
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px; min-width: 18px; text-align: center;
}

/* ── Topbar ──────────────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h); background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; z-index: 900; box-shadow: 0 1px 8px rgba(0,0,0,.05);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.page-title  { font-size: 18px; font-weight: 700; color: #0f172a; }
.topbar-search input {
  border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 7px 14px 7px 36px; font-size: 13px;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.868-3.834zm-5.242 1.156a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11z'/%3E%3C/svg%3E") no-repeat 12px center;
  width: 220px; outline: none; transition: border-color var(--transition);
}
.topbar-search input:focus { border-color: var(--primary); }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.topbar-notif { position: relative; cursor: pointer; }
.topbar-notif i { font-size: 20px; color: #64748b; }
.notif-dot {
  position: absolute; top: -2px; right: -4px;
  width: 8px; height: 8px; background: #dc3545; border-radius: 50%;
  border: 2px solid #fff;
}
.user-menu { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
}
.user-info .user-name { font-size: 13px; font-weight: 600; color: #0f172a; }
.user-info .user-role { font-size: 11px; color: #64748b; text-transform: capitalize; }

/* ── Main Content ────────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 28px;
  min-height: calc(100vh - var(--topbar-h));
}

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: #fff; border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
}
.card-header {
  background: transparent; border-bottom: 1px solid #f1f5f9;
  padding: 18px 20px; font-weight: 700; font-size: 15px;
}

/* ── Stat Cards ──────────────────────────────────────────────────── */
.stat-card {
  background: #fff; border-radius: var(--border-radius);
  box-shadow: var(--card-shadow); padding: 22px;
  display: flex; align-items: center; gap: 16px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,.12); }
.stat-icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.stat-icon.blue  { background: #dbeafe; color: #1d4ed8; }
.stat-icon.green { background: #dcfce7; color: #15803d; }
.stat-icon.amber { background: #fef3c7; color: #b45309; }
.stat-icon.red   { background: #fee2e2; color: #b91c1c; }
.stat-icon.teal  { background: #cffafe; color: #0e7490; }
.stat-icon.purple{ background: #ede9fe; color: #6d28d9; }
.stat-number { font-size: 28px; font-weight: 700; color: #0f172a; line-height: 1; }
.stat-label  { font-size: 13px; color: #64748b; margin-top: 4px; }

/* ── Tables ──────────────────────────────────────────────────────── */
.table { font-size: 13.5px; }
.table thead th {
  background: #f8fafc; color: #64748b;
  font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid #e2e8f0; padding: 12px 14px;
}
.table tbody td { padding: 13px 14px; vertical-align: middle; border-color: #f1f5f9; }
.table tbody tr:hover { background: #f8fafc; }

/* ── Badges ──────────────────────────────────────────────────────── */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-completed { background: #dcfce7; color: #15803d; }
.badge-overdue   { background: #fee2e2; color: #b91c1c; }
.badge-pending   { background: #fef3c7; color: #b45309; }
.badge-scheduled { background: #dbeafe; color: #1d4ed8; }
.badge-active    { background: #dcfce7; color: #15803d; }
.badge-inactive  { background: #f1f5f9; color: #64748b; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn { border-radius: 8px; font-size: 13.5px; font-weight: 500; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }

/* ── Auth Page ───────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f1b2d 0%, #1a3a5c 50%, #0f1b2d 100%);
}
.auth-card {
  background: #fff; border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,.3);
  padding: 48px 40px; width: 100%; max-width: 420px;
}
.auth-card .auth-logo { text-align: center; margin-bottom: 28px; }
.auth-card .auth-logo img { width: 64px; border-radius: 12px; }
.auth-card .auth-title { font-size: 24px; font-weight: 700; color: #0f172a; text-align: center; }
.auth-card .auth-subtitle { font-size: 14px; color: #64748b; text-align: center; margin-top: 6px; margin-bottom: 32px; }
.form-control, .form-select {
  border: 1.5px solid #e2e8f0; border-radius: 10px;
  padding: 11px 14px; font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,110,253,.12);
}
.form-label { font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.btn-login {
  width: 100%; padding: 12px;
  background: linear-gradient(135deg, #0d6efd, #0dcaf0);
  border: none; border-radius: 10px;
  color: #fff; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: opacity var(--transition), transform var(--transition);
}
.btn-login:hover { opacity: .92; transform: translateY(-1px); }

/* ── Modals ──────────────────────────────────────────────────────── */
.modal-content { border-radius: var(--border-radius); border: none; }
.modal-header  { border-bottom: 1px solid #f1f5f9; padding: 18px 24px; }
.modal-footer  { border-top: 1px solid #f1f5f9; padding: 16px 24px; }

/* ── Loading spinner ─────────────────────────────────────────────── */
.page-loader {
  position: fixed; inset: 0; background: rgba(15,27,45,.7);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.page-loader.hidden { display: none; }

/* ── Toast container ─────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; }

/* ── Empty state ─────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: #94a3b8; }
.empty-state i { font-size: 48px; margin-bottom: 16px; display: block; }
.empty-state h6 { font-size: 16px; color: #64748b; margin-bottom: 8px; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar { left: 0; }
}

/* ── Animations ──────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp .3s ease forwards; }

/* ── Reminder timeline ───────────────────────────────────────────── */
.reminder-timeline { list-style: none; padding: 0; }
.reminder-timeline li {
  display: flex; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
}
.reminder-timeline li:last-child { border-bottom: none; }
.reminder-dot {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
