/* ============================================================
   ROOT VARIABLES
============================================================ */
:root {
  --cream: #FDF6EA;
  --cream-2: #FBF0DC;
  --orange: #E67E22;
  --orange-dark: #C8641A;
  --orange-light: #FCE9D3;        /* added for new dashboards */
  --green: #1E5631;
  --green-dark: #123B21;
  --green-light: #E8F6EF;         /* added for new dashboards */
  --text-dark: #3A2A1A;
  --card-border: #F0DCB8;
  --error: #C0392B;
  --success: #1E5631;
  --info: #3b82f6;                /* added */
  --info-bg: #eff6ff;             /* added */
  --danger: #C0392B;
  --danger-bg: #FDEDEC;
  --surface: #FFFDF8;
  --text-secondary: #7a6a52;
  --bg: var(--cream-2);           /* alias for consistency */
}

/* ============================================================
   GLOBAL RESET & BASE
============================================================ */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  color: var(--text-dark);
  background: var(--cream);
}

/* ============================================================
   LOADER
============================================================ */
body.app-loading #loginPage,
body.app-loading #signupPage,
body.app-loading #customerSignupPage,
body.app-loading #subVendorSignupPage,
body.app-loading #signupOtpPage,
body.app-loading #signupPasswordPage,
body.app-loading #signupProfilePage,
body.app-loading #dashboardPage {
  visibility: hidden;
}
body.app-loading {
  background: var(--cream-2);
}
#appLoader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream-2);
}
body:not(.app-loading) #appLoader {
  display: none;
}
#appLoader .spinner-border {
  width: 3rem;
  height: 3rem;
  border-width: 0.25rem;
  color: var(--green) !important;
}

/* ============================================================
   AUTH PAGES (Login, Signup, OTP, etc.)
============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 12% 20%, rgba(255,255,255,0.55), rgba(255,255,255,0) 30%),
    radial-gradient(circle at 88% 78%, rgba(255,255,255,0.5), rgba(255,255,255,0) 32%),
    linear-gradient(180deg, #FBF3DF 0%, #F7E9C9 100%);
}

.auth-card {
  background: #FFFDF8;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 32px 28px 28px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 10px 40px rgba(120, 90, 40, 0.12);
}
.auth-card.wide {
  max-width: 560px;
}

/* ---- Brand ---- */
.brand {
  text-align: center;
  margin-bottom: 24px;
}
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 4px;
}
.leaf {
  width: 48px;
  opacity: 0.9;
}
.leaf.left {
  transform: scaleX(-1);
}
.cloche {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-name {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: 1px;
  color: var(--orange);
  line-height: 1;
  margin-top: 4px;
}
.brand-sub {
  font-size: 11px;
  letter-spacing: 3px;
  font-weight: 600;
  color: var(--green);
  margin-top: 4px;
}
.brand-ribbon {
  display: inline-block;
  margin-top: 8px;
  background: var(--green);
  color: #fff;
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 11px;
  padding: 4px 14px;
  border-radius: 12px;
}

/* ---- Form Elements ---- */
.form-control,
.form-select {
  padding: 11px 14px;
  border: 1.5px solid var(--card-border);
  border-radius: 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  background: #fff;
  color: var(--text-dark);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(30, 86, 49, 0.08);
  background: #fff;
  color: var(--text-dark);
}
.form-control::placeholder {
  color: #b8a88a;
}
.form-label {
  font-size: 12px;
  font-weight: 600;
  color: #5b4a36;
  margin-bottom: 5px;
}
.form-label .req {
  color: var(--error);
}

.btn-primary {
  background: var(--green) !important;
  border-color: var(--green) !important;
  border-radius: 24px !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  padding: 12px 24px !important;
  box-shadow: 0 6px 18px rgba(30, 86, 49, 0.25) !important;
  transition: all 0.2s ease !important;
}
.btn-primary:hover {
  background: var(--green-dark) !important;
  border-color: var(--green-dark) !important;
  transform: translateY(-1px) !important;
}
.btn-primary:disabled {
  opacity: 0.7 !important;
  transform: none !important;
}

.btn-outline-primary {
  border: 1.5px solid var(--green) !important;
  color: var(--green) !important;
  border-radius: 14px !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
}
.btn-outline-primary:hover {
  background: var(--green) !important;
  color: #fff !important;
}

.btn-link {
  color: var(--orange-dark) !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}
.btn-link:hover {
  text-decoration: underline !important;
}

.alert-danger {
  background: #FDEDEC !important;
  color: var(--error) !important;
  border: 1px solid #F5B7B1 !important;
  border-radius: 10px !important;
  font-size: 13px !important;
}
.alert-success {
  background: #E8F6EF !important;
  color: var(--green-dark) !important;
  border: 1px solid #A9DFBF !important;
  border-radius: 10px !important;
  font-size: 13px !important;
}

/* ---- Role Selection Cards ---- */
.role-card {
  background: #fff;
  border: 1.5px solid var(--card-border);
  border-radius: 16px;
  padding: 18px 20px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 14px;
}
.role-card:hover {
  border-color: var(--green);
  box-shadow: 0 4px 16px rgba(30, 86, 49, 0.1);
  transform: translateY(-2px);
}
.role-card .icon-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--cream-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  font-size: 22px;
}

/* ---- Password Toggle ---- */
.pass-wrap {
  position: relative;
}
.toggle-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #9a8a72;
  padding: 4px;
}

/* ---- Checkbox ---- */
.form-check-input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
  border-color: var(--card-border);
}
.form-check-input:checked {
  background-color: var(--green);
  border-color: var(--green);
}
.form-check-label {
  font-size: 12px;
  color: #5b4a36;
}
.form-check-label a {
  color: var(--orange-dark);
  text-decoration: none;
  font-weight: 500;
}

/* ---- Divider ---- */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #a89880;
  font-size: 12px;
  font-family: 'Noto Sans Devanagari', sans-serif;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

/* ---- Back Link ---- */
.back-link {
  font-size: 13px;
  color: var(--green);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
}
.back-link:hover {
  text-decoration: underline;
}

/* ---- OTP Inputs ---- */
.otp-input {
  letter-spacing: 8px;
  font-size: 20px !important;
  font-weight: 700 !important;
  text-align: center !important;
  padding: 14px !important;
}

/* ---- Success Tick ---- */
.success-tick {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
}

/* ============================================================
   DASHBOARD LAYOUT (Sidebar, Topbar, Main)
============================================================ */
.dashboard-page {
  display: none;
  min-height: 100vh;
}
.dashboard-page.show {
  display: flex;
}

.sidebar {
  width: 260px;
  background: var(--green-dark);
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform 0.3s ease;
}
.sidebar-brand {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
}
.sidebar-brand h5 {
  color: #fff;
  font-size: 16px;
}
.sidebar-brand small {
  color: rgba(255, 255, 255, 0.6);
}

.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.75);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: all 0.15s;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.sidebar .nav-link.active {
  border-left: 3px solid var(--orange);
}
.sidebar .nav-link i {
  font-size: 17px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.plan-card {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px;
}
.plan-card .avatar,
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}
.plan-card #sidebarUserName {
  color: #fff;
  font-size: 13px;
}
.plan-card .text-muted {
  color: rgba(255, 255, 255, 0.5) !important;
  font-size: 11px;
}

.main-content {
  margin-left: 260px;
  flex: 1;
  background: var(--cream);
  min-height: 100vh;
}

.topbar {
  background: #FFFDF8;
  border-bottom: 1px solid var(--card-border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar h5 {
  color: var(--green-dark);
  font-size: 17px;
}
.topbar small {
  color: #7a6a52;
  font-size: 12px;
}
.topbar .btn-light {
  background: #fff;
  border: 1px solid var(--card-border);
  color: var(--text-dark);
}
.topbar .btn-light:hover {
  background: var(--cream-2);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
  display: none;
}
.overlay.show {
  display: block;
}

/* ============================================================
   DASHBOARD COMPONENTS (Stat Cards, Content Cards, etc.)
============================================================ */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 1.5rem;
  transition: box-shadow 0.2s;
}
.stat-card:hover {
  box-shadow: 0 8px 30px rgba(120, 90, 40, 0.08);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.content-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  overflow: hidden;
}
.content-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Badge status */
.badge-status {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.btn-accent {
  background: var(--orange);
  color: white;
  border: none;
  border-radius: 24px;
  padding: 0.6rem 1.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 6px 16px rgba(230, 126, 34, 0.3);
  transition: all 0.2s ease;
}
.btn-accent:hover {
  background: var(--orange-dark);
  color: white;
  transform: translateY(-1px);
}

.search-input {
  background: var(--cream-2);
  border: 1.5px solid var(--card-border);
  border-radius: 12px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  color: var(--text-dark);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(30, 86, 49, 0.08);
  outline: none;
  background: #fff;
}
.search-input::placeholder {
  color: #b8a88a;
}

.avatar-square {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
}

.tab-section {
  display: none;
}
.tab-section.active {
  display: block;
}

.menu-item-card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.menu-item-card:hover {
  box-shadow: 0 8px 30px rgba(120, 90, 40, 0.08);
}

.progress-bar-custom {
  height: 8px;
  border-radius: 999px;
  background: var(--cream-2);
}
.progress-bar-custom .progress-fill {
  height: 100%;
  border-radius: 999px;
}

.toggle-switch {
  width: 44px;
  height: 24px;
  background: var(--card-border);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-switch.on {
  background: var(--green);
}
.toggle-switch::after {
  content: '';
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.toggle-switch.on::after {
  transform: translateX(20px);
}

.order-row {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--card-border);
  transition: background 0.15s;
}
.order-row:hover {
  background: var(--cream-2);
}

.chart-bar {
  border-radius: 6px 6px 0 0;
  min-height: 20px;
  transition: opacity 0.2s;
}
.chart-bar:hover {
  opacity: 0.8;
}

/* Table styling */
.table thead {
  background: var(--cream-2);
}
.table thead th {
  border: 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.table tbody td {
  border: 0;
  padding: 0.75rem 1rem;
  vertical-align: middle;
}
.table tbody tr {
  transition: background 0.15s;
}
.table tbody tr:hover {
  background: var(--cream-2);
}

/* ============================================================
   SERVICE AREAS / VENDOR SUMMARY BOXES
============================================================ */
.area-summary-box {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 1.25rem 1.5rem;
  transition: box-shadow 0.2s ease;
}
.area-summary-box:hover {
  box-shadow: 0 8px 30px rgba(120, 90, 40, 0.08);
}
.area-summary-box .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

/* ============================================================
   MODAL ENHANCEMENTS
============================================================ */
.modal-content {
  border: 1px solid var(--card-border);
  border-radius: 20px;
  background: var(--surface);
}
.modal-header {
  border-bottom: 1px solid var(--card-border);
  padding: 1.25rem 1.5rem;
}
.modal-header .modal-title {
  color: var(--green-dark);
}
.modal-header .btn-close {
  filter: none;
  opacity: 0.6;
}
.modal-footer {
  border-top: 1px solid var(--card-border);
  padding: 1rem 1.5rem;
}
.modal-footer .btn-light {
  background: #fff;
  border: 1px solid var(--card-border);
  color: var(--text-dark);
}
.modal-footer .btn-light:hover {
  background: var(--cream-2);
}

.modal-body .form-control,
.modal-body .form-select {
  border: 1.5px solid var(--card-border);
  border-radius: 12px;
  padding: 0.6rem 1rem;
}
.modal-body .form-control:focus,
.modal-body .form-select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(30, 86, 49, 0.08);
}
.modal-body .form-text {
  color: var(--text-secondary);
  font-size: 0.75rem;
  margin-top: 4px;
}

/* ============================================================
   INPUT GROUP (Search Bar)
============================================================ */
.input-group .input-group-text {
  border: 1.5px solid var(--card-border);
  border-right: 0;
  border-radius: 12px 0 0 12px;
  background: #fff;
  color: var(--text-secondary);
}
.input-group .form-control {
  border-radius: 0 12px 12px 0;
}

/* ============================================================
   ACTION BUTTONS (Table actions)
============================================================ */
.action-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0 4px;
  transition: color 0.2s;
}
.action-btn:hover {
  color: var(--orange-dark);
}

/* ============================================================
   ENSURE HEADER BUTTON STAYS RIGHT
============================================================ */
.content-card-header .btn-primary {
  flex-shrink: 0;
  margin-left: auto;
}

/* ============================================================
   SETTINGS (existing)
============================================================ */
.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.settings-nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 12px;
  border-radius: 10px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  color: var(--text-dark);
  transition: 0.2s ease;
}
.settings-nav-item > i {
  font-size: 18px;
  margin-top: 2px;
}
.settings-nav-item small {
  display: block;
  color: var(--text-secondary);
  margin-top: 2px;
}
.settings-nav-item:hover {
  background: var(--cream-2);
}
.settings-nav-item.active {
  background: var(--orange-light);
  color: var(--orange);
}
.settings-nav-item.active small {
  color: var(--orange);
}

.settings-row {
  min-height: 70px;
  padding: 16px 0;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.settings-row:last-child {
  border-bottom: 0;
}

.meal-option {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s ease;
}
.meal-option:hover {
  background: var(--cream-2);
}
.meal-option input {
  cursor: pointer;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
  }
  .overlay.show {
    display: block;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 24px 20px 22px;
  }
  .brand-name {
    font-size: 22px;
  }
  .auth-card.wide {
    max-width: 100%;
  }
}