/* ============================================================
   Mitra — Main Stylesheet
   Colors inspired by Persis Indian Grill & Brundhavan websites
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:wght@400;500;600&display=swap');

:root {
  /* Persis-inspired: deep red, dark backgrounds */
  --spice:       #c3102f;   /* Persis red */
  --spice-dark:  #9a0c24;
  --spice-light: #fce8ec;
  --saffron:     #c2ad6e;   /* Persis golden brown */
  --turmeric:    #f1592a;   /* Persis orange accent */
  --leaf:        #263e2a;   /* Brundhavan deep green */
  --leaf-light:  #92a881;   /* Brundhavan sage */
  --cream:       #f4f3ca;   /* Brundhavan cream */
  --midnight:    #1a1c1e;   /* Persis dark */
  --slate:       #4a4a5a;
  --mist:        #f7f5f2;   /* warm off-white bg */
  --white:       #ffffff;
  --border:      #e2d9d0;
  --shadow:      0 2px 12px rgba(0,0,0,0.08);
  --radius:      10px;
  --font-head:   'Playfair Display', serif;
  --font-body:   'DM Sans', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--mist);
  color: var(--midnight);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-head); color: var(--midnight); }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
a  { color: var(--spice); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────── */
.wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: #1a1c1e;
  color: #ccc;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo h2 {
  font-family: var(--font-head);
  color: #c2ad6e;
  font-size: 1.1rem;
  line-height: 1.3;
}
.sidebar-logo span {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  display: block;
  font-family: var(--font-body);
}

.sidebar-nav { padding: 12px 0; flex: 1; }

.nav-section {
  padding: 8px 20px 4px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}
.nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
.nav-link.active {
  background: rgba(195,16,47,0.15);
  color: #c2ad6e;
  border-left-color: #c2ad6e;
}
.nav-link .icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
}
.sidebar-footer strong { color: rgba(255,255,255,0.75); display: block; }

/* ── Main content ───────────────────────────────────────── */
.main {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title { font-family: var(--font-head); font-size: 1.25rem; }

.topbar-actions { display: flex; align-items: center; gap: 16px; }

.notif-bell {
  position: relative;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--slate);
}
.notif-badge {
  position: absolute;
  top: -6px; right: -6px;
  background: var(--spice);
  color: #fff;
  font-size: 0.65rem;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.content { padding: 28px; flex: 1; }

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-family: var(--font-head); font-size: 1.1rem; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 7px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-primary   { background: var(--spice); color: #fff; }
.btn-primary:hover { background: var(--spice-dark); color: #fff; text-decoration: none; }
.btn-secondary { background: var(--spice-light); color: var(--spice); border: 1px solid #d9b8ac; }
.btn-secondary:hover { background: #e8d0c6; text-decoration: none; }
.btn-danger    { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #b02a37; color: #fff; text-decoration: none; }
.btn-success   { background: #3a7d44; color: #fff; }
.btn-sm        { padding: 5px 12px; font-size: 0.8rem; }
.btn-block     { display: flex; width: 100%; justify-content: center; }

/* ── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.form-row-3 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr 1fr; }

label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 6px; color: var(--slate); }
label .required { color: var(--spice); }

input[type=text],
input[type=email],
input[type=tel],
input[type=date],
input[type=password],
input[type=number],
select,
textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--midnight);
  background: #fff;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--spice);
  box-shadow: 0 0 0 3px rgba(181,69,27,0.1);
}
textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 0.78rem; color: #888; margin-top: 4px; }

/* ── Skill checkboxes ───────────────────────────────────── */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.skill-item {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.skill-item.checked { border-color: var(--spice); background: var(--spice-light); }

.skill-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
}
.skill-check-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--spice); cursor: pointer; }

.star-select { display: flex; gap: 4px; }
.star-select label {
  cursor: pointer;
  font-size: 1.2rem;
  color: #ddd;
  margin: 0;
  font-weight: normal;
}
.star-select input[type=radio] { display: none; }
.star-select input[type=radio]:checked ~ label,
.star-select label:hover,
.star-select label:hover ~ label { color: var(--saffron); }

/* ── Tables ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: #f5f2ef; }
th { padding: 10px 14px; text-align: left; font-size: 0.82rem; font-weight: 700; color: var(--slate); text-transform: uppercase; letter-spacing: 0.05em; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 0.88rem; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fdf8f5; }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-active   { background: #d4edda; color: #155724; }
.badge-inactive { background: #f8d7da; color: #721c24; }
.badge-owner    { background: #fff3cd; color: #856404; }
.badge-manager  { background: #cce5ff; color: #004085; }
.badge-staff    { background: #e2e3e5; color: #383d41; }
.badge-persis   { background: #fce8ec; color: #c3102f; }
.badge-brundhavan { background: #e8f0e4; color: #263e2a; }
.badge-both     { background: #f4f3ca; color: #5a5327; }

/* ── Alerts / Flash messages ────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-success { background: #d4edda; color: #155724; border-left: 4px solid var(--leaf); }
.alert-error   { background: #f8d7da; color: #721c24; border-left: 4px solid #dc3545; }
.alert-info    { background: #cce5ff; color: #004085; border-left: 4px solid #007bff; }
.alert-warning { background: #fff3cd; color: #856404; border-left: 4px solid var(--saffron); }

/* ── Login page ─────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1c1e 0%, #263e2a 100%);
  padding: 24px;
}
.login-card {
  background: var(--white);
  border-radius: 14px;
  padding: 44px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo h1 {
  font-family: var(--font-head);
  font-size: 1.8rem;
  color: #c2ad6e;
  margin-bottom: 4px;
}
.login-logo p { color: var(--slate); font-size: 0.88rem; }

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 16px 0 24px;
}
.pin-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #fff;
  transition: all 0.15s;
}
.pin-dot.filled { background: var(--spice); border-color: var(--spice); }

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.pin-key {
  background: var(--mist);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.1s;
  color: var(--midnight);
  user-select: none;
}
.pin-key:hover { background: var(--spice-light); border-color: var(--spice); }
.pin-key:active { transform: scale(0.96); }
.pin-key.clear  { color: var(--spice); }
.pin-key.submit { background: var(--spice); color: #fff; border-color: var(--spice); }
.pin-key.submit:hover { background: var(--spice-dark); }

/* ── Stats / Dashboard ──────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--spice);
}
.stat-number { font-size: 2rem; font-weight: 700; color: #c3102f; line-height: 1; }
.stat-label  { font-size: 0.82rem; color: var(--slate); margin-top: 4px; }

/* ── Notification dropdown ──────────────────────────────── */
.notif-dropdown {
  position: absolute;
  right: 0; top: calc(100% + 8px);
  width: 320px;
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  border: 1px solid var(--border);
  overflow: hidden;
  display: none;
  z-index: 200;
}
.notif-dropdown.open { display: block; }
.notif-header { padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 0.88rem; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid #f0f0f0; font-size: 0.85rem; }
.notif-item.unread { background: var(--spice-light); }
.notif-item-title { font-weight: 600; margin-bottom: 2px; }
.notif-item-time  { font-size: 0.75rem; color: #999; }

/* ── Section divider ────────────────────────────────────── */
.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--spice);
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--spice-light);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 100%; height: auto; position: relative; }
  .main { margin-left: 0; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Availability Grid ──────────────────────────────────── */
.avail-table { border-collapse: separate; border-spacing: 0; }
.avail-table th { text-align: center; padding: 10px 8px; }
.avail-table td { padding: 10px 8px; }

.avail-cell {
  transition: background 0.15s;
  border-radius: 4px;
}
.avail-cell.avail-yes { background: #d4edda; }
.avail-cell.avail-no  { background: #fce4e4; }
.loc-persis .avail-cell.avail-yes { background: #fde8ec; }
.loc-persis .avail-cell.avail-no  { background: #e8e8ea; }
.loc-brundhavan .avail-cell.avail-yes { background: #e8f0e4; }
.loc-brundhavan .avail-cell.avail-no  { background: #eae8e0; }

.avail-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0;
  font-weight: normal;
}
.avail-toggle input[type=checkbox] {
  display: none;
}
.avail-check {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-size: 0.9rem;
}
.avail-check::after {
  content: '';
}
.avail-toggle input:checked + .avail-check {
  background: #3a7d44;
  border-color: #3a7d44;
}
.loc-persis .avail-toggle input:checked + .avail-check {
  background: #c3102f;
  border-color: #c3102f;
}
.loc-brundhavan .avail-toggle input:checked + .avail-check {
  background: #263e2a;
  border-color: #263e2a;
}
.avail-toggle input:checked + .avail-check::after {
  content: '✓';
  color: #fff;
  font-weight: 700;
}
.avail-toggle input:not(:checked) + .avail-check::after {
  content: '✕';
  color: #ccc;
  font-size: 0.8rem;
}
.loc-persis .avail-toggle input:not(:checked) + .avail-check {
  border-color: rgba(195, 16, 47, 0.3);
}
.loc-persis .avail-toggle input:not(:checked) + .avail-check::after {
  color: rgba(195, 16, 47, 0.35);
}
.loc-brundhavan .avail-toggle input:not(:checked) + .avail-check {
  border-color: rgba(38, 62, 42, 0.3);
}
.loc-brundhavan .avail-toggle input:not(:checked) + .avail-check::after {
  color: rgba(38, 62, 42, 0.35);
}
.avail-toggle input:disabled + .avail-check {
  opacity: 0.6;
  cursor: not-allowed;
}
