/* Anand Clinic Admin - style.css */
/* Green Ayurvedic theme matching the main clinic site */

:root {
  --green-dark:   #1a5c38;
  --green:        #2e7d52;
  --green-light:  #4caf7d;
  --green-pale:   #e8f5ee;
  --gold:         #c8952a;
  --gold-light:   #f0c96b;
  --cream:        #faf8f3;
  --white:        #ffffff;
  --gray-100:     #f4f5f7;
  --gray-200:     #e5e7eb;
  --gray-400:     #9ca3af;
  --gray-600:     #4b5563;
  --gray-800:     #1f2937;
  --red:          #dc2626;
  --red-pale:     #fef2f2;
  --blue:         #2563eb;
  --blue-pale:    #eff6ff;
  --sidebar-w:    260px;
  --radius:       10px;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:    0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: var(--gray-100); color: var(--gray-800); font-size: 14px; }
a { text-decoration: none; color: inherit; }

/* ===== LAYOUT ===== */
.layout { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--green-dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .25s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.brand-icon {
  width: 40px; height: 40px;
  background: var(--gold);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px;
  flex-shrink: 0;
}
.brand-name { color: white; font-weight: 700; font-size: 15px; font-family: 'Playfair Display', serif; }
.brand-sub  { color: rgba(255,255,255,.5); font-size: 11px; margin-top: 1px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.nav-section-label {
  color: rgba(255,255,255,.35);
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  padding: 16px 8px 6px;
  font-weight: 600;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,.75);
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 2px;
  font-size: 13.5px;
  transition: all .18s;
}
.nav-link i { width: 18px; text-align: center; font-size: 14px; }
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,.12);
  color: white;
}
.nav-link.active { background: var(--green); color: white; font-weight: 600; }

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 16px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.user-avatar {
  width: 36px; height: 36px;
  background: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white; font-size: 15px;
  flex-shrink: 0;
}
.user-name  { color: white; font-size: 13px; font-weight: 600; }
.user-role  { color: rgba(255,255,255,.45); font-size: 11px; text-transform: capitalize; }
.logout-btn {
  margin-left: auto;
  color: rgba(255,255,255,.4);
  padding: 6px;
  border-radius: 6px;
  transition: .15s;
}
.logout-btn:hover { color: #ff8a8a; background: rgba(255,255,255,.08); }

/* ===== MAIN ===== */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 24px;
  height: 56px;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}
.menu-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: var(--gray-600); padding: 4px;
}
.page-title-bar { font-weight: 600; font-size: 15px; color: var(--gray-800); }
.topbar-date { margin-left: auto; color: var(--gray-400); font-size: 13px; }

.content-area { padding: 24px; flex: 1; }

/* ===== FLASH MESSAGES ===== */
.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin: 16px 24px -8px;
  font-size: 14px;
  font-weight: 500;
}
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-error   { background: var(--red-pale); color: var(--red); border: 1px solid #fecaca; }
.flash-close   { background: none; border: none; cursor: pointer; margin-left: auto; font-size: 18px; color: inherit; opacity: .6; }

/* ===== CARDS ===== */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.card-title { font-weight: 700; font-size: 15px; color: var(--gray-800); }
.card-body { padding: 20px; }

/* ===== STAT CARDS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px;
  border-left: 4px solid transparent;
}
.stat-card.green  { border-color: var(--green); }
.stat-card.gold   { border-color: var(--gold); }
.stat-card.blue   { border-color: var(--blue); }
.stat-card.red    { border-color: var(--red); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.stat-card.green .stat-icon  { background: var(--green-pale); color: var(--green); }
.stat-card.gold  .stat-icon  { background: #fff8e6; color: var(--gold); }
.stat-card.blue  .stat-icon  { background: var(--blue-pale); color: var(--blue); }
.stat-card.red   .stat-icon  { background: var(--red-pale); color: var(--red); }

.stat-value { font-size: 24px; font-weight: 700; color: var(--gray-800); }
.stat-label { font-size: 12px; color: var(--gray-400); margin-top: 2px; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-800);
  font-size: 13.5px;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--gray-100); }

/* ===== FORMS ===== */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 12.5px; font-weight: 600; color: var(--gray-600); }
input, select, textarea {
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--gray-800);
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
  background: white;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46,125,82,.1);
}
textarea { resize: vertical; min-height: 80px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: none;
  transition: all .15s;
  font-family: inherit;
  white-space: nowrap;
}
.btn-primary   { background: var(--green); color: white; }
.btn-primary:hover { background: var(--green-dark); }
.btn-gold      { background: var(--gold); color: white; }
.btn-gold:hover { background: #b07d1f; }
.btn-danger    { background: var(--red); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-outline   { background: white; border: 1.5px solid var(--gray-200); color: var(--gray-600); }
.btn-outline:hover { border-color: var(--green); color: var(--green); }
.btn-sm        { padding: 6px 11px; font-size: 12px; }

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600; text-transform: capitalize;
}
.badge-green  { background: #dcfce7; color: #166534; }
.badge-gold   { background: #fef3c7; color: #92400e; }
.badge-red    { background: var(--red-pale); color: var(--red); }
.badge-blue   { background: var(--blue-pale); color: #1e40af; }
.badge-gray   { background: var(--gray-200); color: var(--gray-600); }

/* ===== UTILS ===== */
.flex        { display: flex; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.mb-4        { margin-bottom: 4px; }
.mb-16       { margin-bottom: 16px; }
.mb-24       { margin-bottom: 24px; }
.text-muted  { color: var(--gray-400); font-size: 12.5px; }
.text-green  { color: var(--green); }
.text-gold   { color: var(--gold); }
.text-red    { color: var(--red); }
.text-right  { text-align: right; }
.fw-700      { font-weight: 700; }
.mt-auto     { margin-top: auto; }

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 60%, var(--green-light) 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .icon { font-size: 42px; color: var(--gold); margin-bottom: 8px; }
.login-logo h1 { font-family: 'Playfair Display', serif; color: var(--green-dark); font-size: 22px; }
.login-logo p  { color: var(--gray-400); font-size: 13px; margin-top: 4px; }
.login-btn { width: 100%; padding: 12px; font-size: 15px; margin-top: 8px; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray-400); }
.empty-state i { font-size: 48px; margin-bottom: 12px; display: block; opacity: .4; }
.empty-state p { font-size: 14px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .content-area { padding: 16px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .form-grid  { grid-template-columns: 1fr; }
}
