/* ==========================================================
   1. CENTRALIZED THEME VARIABLES (Single Source of Truth)
   ================================================---------- */
:root {
  /*  Yahan se poori website ka default (Admin) primary color control hoga.
      User portal pages ismein apna override karte hain (see user/includes/header.php) */
  --primary-color: #1C6936;
  --primary-hover: #1f7d3f;
  --primary-rgb: 30, 64, 175;
  --success-color: #1C6936;
  --danger-color: #ef4444;

  /* Mapping for legacy variables used in your layout */
  --brand: #1C6936;
  --brand-dark: #1f7d3f;
  --brand-light: rgba(var(--primary-rgb), 0.15);
  --success: #1C6936;

  --sidebar-bg: #1C6936;
  --sidebar-hover: #1f7d3f;
  --sidebar-text: #94a3b8;

  --bg-color: radial-gradient(circle at center, #FFFFFF 20%, #EAF6F1 100%);
  --card-bg: #fff;
  --text-main: #1C6936;
  --text-muted: #1f7d3f;
  --border-color: #fff;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}

/* Global Buttons & Form Focus States */
.btn-primary {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  border-radius: 8px !important;
  font-weight: 600;
}

.btn-primary:hover {
  background-color: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.12);
}


/* ==========================================================
   2. LANDING PAGE STYLES
   ================================================---------- */
.landing-body {
  min-height: 100vh;
  background-color: #fff;
}

.landing-icon {
  font-size: 3.5rem;
  color: var(--brand);
}

.portal-card {
  border: none;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.08);
  transition: transform .2s ease, box-shadow .2s ease;
  background: var(--card-bg);
}

.portal-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(var(--primary-rgb), 0.18);
}


/* ==========================================================
   3. ADMIN SAAS SIDEBAR & TOPBAR LAYOUT
   ================================================---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
}

.app-sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
  padding: 20px 24px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand i {
  color: #1C6936;
  font-size: 1.25rem;
}

.sidebar-menu {
  padding: 20px 14px;
  list-style: none;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

.sidebar-menu .menu-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1f7d3f;
  padding: 10px 12px 6px;
  font-weight: 700;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 4px;
  transition: all 0.2s ease;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
  background-color: var(--sidebar-hover);
  color: #fff;
}

.sidebar-menu a.active {
  background-color: var(--primary-color) !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.app-main {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100% - 260px);
}

.app-topbar {
  height: 70px;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1040;
}

.mz-brand {
  object-fit: cover;

}

/* ==========================================================
   4. AUTH & SHARED NAVBAR STYLES
   ================================================---------- */
.navbar-brand-custom {
  font-weight: 700;
  letter-spacing: .3px;
}

.navbar-app {
  background: linear-gradient(90deg, var(--brand), var(--brand-dark));
}

.navbar-app .nav-link,
.navbar-app .navbar-brand {
  color: #fff !important;
}

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, #eef2ff, #f6f7fb 60%);
}

.auth-card {
  border: none;
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(79, 70, 229, 0.12);
  max-width: 420px;
  width: 100%;
  background: var(--card-bg);
}


/* ==========================================================
   5. DASHBOARD STAT CARDS & TABLES
   ================================================---------- */
.stat-card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  padding: 1.25rem;
  background: #fff;
  height: 100%;
}

.stat-card .stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
}

.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 700;
}

.saas-header-title {
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
}

.saas-card {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.saas-card .form-control,
.saas-card .btn {
  border-radius: 8px;
}

.saas-table th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background-color: var(--bg-color) !important;
  border-bottom: 1px solid var(--border-color);
}

.saas-table td {
  font-size: 0.875rem;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
}

.saas-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.35em 0.65em;
  border-radius: 6px;
}


/* ==========================================================
   6. USER PORTAL STEPPERS & FORMS
   ================================================---------- */
.phase-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow-x: auto;
  padding: 1rem 0;
  gap: 4px;
}

.phase-step {
  flex: 1;
  min-width: 90px;
  text-align: center;
  position: relative;
}

.phase-step .circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin: 0 auto 6px;
  border: 2px solid #e5e7eb;
  transition: all .2s ease;
}

.phase-step.done .circle {
  background: var(--success) !important;
  border-color: var(--success) !important;
  color: #fff;
}

.phase-step.active .circle {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff;
  box-shadow: 0 0 0 4px var(--brand-light);
}

.phase-step .label {
  font-size: .72rem;
  color: #6b7280;
  line-height: 1.1;
}

.phase-step.active .label,
.phase-step.done .label {
  color: #111827;
  font-weight: 600;
}

.phase-step .line {
  position: absolute;
  top: 21px;
  left: -50%;
  width: 100%;
  height: 3px;
  background: #e5e7eb;
  z-index: -1;
}

.phase-step.done .line {
  background: var(--success);
}

.phase-step:first-child .line {
  display: none;
}

.form-card {
  border:2px solid #1C6936;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  background: var(--card-bg);
}

.form-card .card-header {
  background-color:  var(--primary-color);
  color: #fff;
  border-radius: 18px 18px 0 0 !important;
  padding: 1.1rem 1.5rem;
}

.upload-box {
  border: 2px dashed #1C6936;
  border-radius: 12px;
  padding: 3px;
  text-align: center;
  background: #fafaff;
  transition: border-color .2s ease;
  cursor: pointer;
}

@media (min-width: 576px) {
  .upload-box {
      padding: 1rem;
  }
}

.upload-box:hover {
  border-color: var(--brand);
}

.upload-box i {
  color: var(--brand);
}

.table-responsive-custom {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.badge-phase {
  font-weight: 600;
  padding: .45em .7em;
}

.locked-banner {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.completed-banner {
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  color: #1C6936;
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

/* Backdrop Overlay for Mobile/Tablets */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 1045;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
  display: block;
}

@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-100%);
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .app-main {
    margin-left: 0 !important;
    width: 100% !important;
  }
}

@media (max-width: 576px) {
  .phase-step .label {
    display: none;
  }
}

@media (max-width: 991.98px) {

  .saas-card form .col-12,
  .saas-card form .col-sm-6,
  .saas-card form .col-lg-2,
  .saas-card form .col-lg-4 {
    margin-bottom: 4px;
  }

  .saas-card .d-sm-flex {
    flex-direction: column;
  }

}

/* ==========================================================
   ORDER FILTER + EXPORT BUTTONS
   ========================================================== */

.export-buttons {
  width: 100%;
  display: flex;
  gap: 8px;
}

.export-btn {
  min-width: 0;
  height: 38px;
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  white-space: nowrap;
  text-decoration: none;
  font-weight: 600;
  border-radius: 8px;
  box-sizing: border-box;
}

.export-btn i {
  flex-shrink: 0;
}


/* Excel */
.btn-export-xlsx {
  color: #fff;
  background-color: #198754;
  border: 1px solid #198754;
}

.btn-export-xlsx:hover {
  color: #fff;
  background-color: #157347;
  border-color: #157347;
}


/* PDF */
.btn-export-pdf {
  color: #fff;
  background-color: #dc3545;
  border: 1px solid #dc3545;
}

.btn-export-pdf:hover {
  color: #fff;
  background-color: #bb2d3b;
  border-color: #bb2d3b;
}


/* ==========================================================
   ORDER ACTION BUTTONS
   View + Delete same size
   ========================================================== */

.order-action-btn {
  height: 36px;
  min-width: 110px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 6px;
  white-space: nowrap;
  font-weight: 600;
  text-decoration: none;
  box-sizing: border-box;
}

.order-action-form {
  display: inline-flex;
  margin: 0;
}

.order-action-form .order-action-btn {
  width: 110px;
}


/* ==========================================================
   MOBILE / TABLET
   ========================================================== */

@media (max-width: 991.98px) {

  .export-buttons {
    width: 100%;
  }

  .export-btn {
    flex: 1 1 0;
    width: 50%;
  }

}


/* Small mobile */
@media (max-width: 575.98px) {

  .export-buttons {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 8px;
  }

  .export-btn {
    width: 50%;
    min-width: 0;
    flex: 1 1 50%;
    height: 40px;
    padding: 0 8px;
  }

  .export-btn span {
    display: inline;
  }

  .order-action-btn,
  .order-action-form .order-action-btn {
    width: 100%;
    min-width: 0;
  }

}