/* GSMR Solar - Theme: primary #99f36c, bg #25494a */
:root {
  --theme-primary: #99f36c;
  --theme-bg: #25494a;
  --sidebar-bg: #25494a;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --sidebar-active: #99f36c;
  --header-bg: #f8fafc;
  --card-shadow: 0 1px 3px rgba(0,0,0,.08);
  --bs-primary: #99f36c;
  --bs-primary-rgb: 153, 243, 108;
}

body { margin: 0; background: #f1f5f9; min-height: 100vh; overflow-x: hidden; }

/* Theme: AdminLTE sidebar and Bootstrap primary */
.main-sidebar.sidebar-dark-primary,
.main-sidebar.sidebar-dark-primary .brand-link {
  background-color: var(--theme-bg) !important;
}
.main-sidebar .nav-sidebar .nav-link.active,
.main-sidebar .nav-sidebar .nav-item .nav-link.active {
  background-color: rgba(153, 243, 108, 0.2) !important;
  color: var(--theme-primary) !important;
}
.main-sidebar .brand-link:hover,
.main-sidebar .nav-sidebar .nav-link:hover {
  color: var(--theme-primary);
}
.btn-primary {
  background-color: var(--theme-primary) !important;
  border-color: var(--theme-primary) !important;
  color: #1a1a1a !important;
}
.btn-primary:hover {
  background-color: #8ae65f !important;
  border-color: #8ae65f !important;
  color: #1a1a1a !important;
}
.border-primary { border-color: var(--theme-primary) !important; }
.text-primary { color: var(--theme-primary) !important; }
.bg-primary { background-color: var(--theme-primary) !important; }
.stat-card.border-primary .stat-value,
a.stat-link .stat-value.text-primary { color: var(--theme-primary) !important; }
.btn-outline-primary {
  color: var(--theme-primary) !important;
  border-color: var(--theme-primary) !important;
}
.btn-outline-primary:hover {
  background-color: var(--theme-primary) !important;
  color: #1a1a1a !important;
}
.btn-outline-blue{
  color: #007bff !important;
  border-color: #007bff !important;
}
.btn-outline-blue:hover {
  background-color: #007bff !important;
  color: #ffffff !important;
}
.btn-outline-yellow{
  color: #FF9800 !important;
  border-color: #FF9800 !important;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 0.2rem rgba(153, 243, 108, 0.25);
}
.form-check-primary:checked {
  background-color: var(--theme-primary);
  border-color: var(--theme-primary);
}
.progress-bar.bg-primary { background-color: var(--theme-primary) !important; }
.badge.bg-primary { background-color: var(--theme-primary) !important; color: #1a1a1a; }
.spinner-border.text-primary { color: var(--theme-primary) !important; }
/* Sidebar user panel: avatar and links use theme primary */
.main-sidebar .user-panel .bg-warning {
  background-color: var(--theme-primary) !important;
  color: #1a1a1a !important;
}
.main-sidebar .user-panel .text-warning,
.main-sidebar .user-panel a.text-warning {
  color: var(--theme-primary) !important;
}
.main-sidebar .user-panel a.text-warning:hover {
  color: #b8f898 !important;
}
/* Buttons: ensure all primary-style buttons use theme */
.btn-primary:focus,
.btn-primary.focus,
.btn-primary:active {
  background-color: #8ae65f !important;
  border-color: #8ae65f !important;
  color: #1a1a1a !important;
  box-shadow: 0 0 0 0.2rem rgba(153, 243, 108, 0.35) !important;
}
.btn-outline-primary:focus,
.btn-outline-primary.focus,
.btn-outline-primary:active {
  background-color: rgba(153, 243, 108, 0.15) !important;
  border-color: var(--theme-primary) !important;
  color: var(--theme-primary) !important;
  box-shadow: 0 0 0 0.2rem rgba(153, 243, 108, 0.25) !important;
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  border-color: rgba(153, 243, 108, 0.4);
  color: #ffffff;
}
/* Action icon colors */
.icon-view {
  color: #2563eb; /* blue */
}
.icon-edit {
  color: #d97706; /* dark amber/yellow */
}
/* Links that act as primary actions */
a.btn-primary,
a.btn-outline-primary {
  text-decoration: none;
}
.link-primary {
  color: var(--theme-primary) !important;
}
.link-primary:hover {
  color: #8ae65f !important;
}
/* Pagination */
.pagination .page-link {
  color: #25494a;
}
.pagination .page-item.active .page-link {
  background-color: var(--theme-primary) !important;
  border-color: var(--theme-primary) !important;
  color: #1a1a1a !important;
}
.pagination .page-link:hover {
  color: #25494a;
  border-color: rgba(153, 243, 108, 0.5);
  background-color: rgba(153, 243, 108, 0.1);
}
/* Dropdown / filter buttons focus */
.director-multiselect .director-multiselect-btn:hover,
.director-multiselect .director-multiselect-btn:focus {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 0.2rem rgba(153, 243, 108, 0.15);
}
.director-multiselect-menu .director-option .form-check-input:focus {
  box-shadow: 0 0 0 0.25rem rgba(153, 243, 108, 0.25);
}
/* Table action links (View) */
.table-solar .btn-outline-primary {
  color: var(--theme-primary) !important;
  border-color: var(--theme-primary) !important;
}
.table-solar .btn-outline-primary:hover {
  background-color: var(--theme-primary) !important;
  color: #1a1a1a !important;
}
/* Progress and timeline use theme for “active” state */
.progress-thin .progress-bar {
  background: var(--theme-primary);
}
.timeline-dot.progress {
  background: var(--theme-primary);
}
.timeline-body .phase-badge.progress {
  color: var(--theme-primary);
}
/* Stat card first icon tint (Applications card) */
.stat-card .stat-icon.blue {
  background: rgba(153, 243, 108, 0.25);
  color: #25494a;
}
/* Alerts and list group */
.alert-primary {
  background-color: rgba(153, 243, 108, 0.2);
  border-color: var(--theme-primary);
  color: #1a1a1a;
}
.list-group-item-primary {
  background-color: rgba(153, 243, 108, 0.15);
  color: #1a1a1a;
}
/* Modal primary button in header/footer */
.modal .btn-primary {
  background-color: var(--theme-primary) !important;
  border-color: var(--theme-primary) !important;
  color: #1a1a1a !important;
}

/* Global link styling */
a,
a:hover,
a:focus,
a:active {
  text-decoration: none;
}

/* Capitalize role dropdown text */
#user-role,
#user-role option {
  text-transform: capitalize;
}

.app-layout { display: flex; min-height: 100vh; }
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--theme-bg);
  color: #e2e8f0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  transition: width .2s ease;
}
.app-sidebar .brand {
  padding: 1.25rem 1.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  white-space: nowrap;
  overflow: hidden;
}
.app-sidebar .brand-icon { font-size: 1.5rem; }
.app-sidebar .nav-menu { flex: 1; padding: 1rem 0; }
.app-sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.5rem;
  color: #94a3b8;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.app-sidebar .nav-icon {
  width: 1.5rem;
  text-align: center;
}
.app-sidebar .nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.app-sidebar .nav-item.active { background: rgba(153,243,108,.2); color: var(--theme-primary); }
.app-sidebar .nav-item.active.bg-blue { background: rgba(153,243,108,.2); color: var(--theme-primary); }
.app-sidebar .user-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.app-sidebar .user-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--theme-primary);
  color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}
.app-sidebar .user-info { flex: 1; min-width: 0; }
.app-sidebar .user-name { font-weight: 600; color: #fff; font-size: 0.9rem; }
.app-sidebar .user-role { font-size: 0.75rem; color: #94a3b8; }

/* Collapsed sidebar */
body.sidebar-collapsed .app-sidebar {
  width: var(--sidebar-collapsed-width);
}
body.sidebar-collapsed .app-sidebar .brand-text { display: none; }
body.sidebar-collapsed .app-sidebar .nav-label { display: none; }
body.sidebar-collapsed .app-sidebar .user-info { display: none; }
body.sidebar-collapsed .app-sidebar .user-footer {
  justify-content: center;
  padding: 0.5rem 0.75rem;
  border-top: none;
}
body.sidebar-collapsed .app-sidebar .user-avatar {
  width: 32px;
  height: 32px;
}
body.sidebar-collapsed .app-sidebar .nav-item {
  justify-content: center;
  padding: 0.65rem 0;
}

.sidebar-toggle-btn {
  position: absolute;
  top: 14px;
  right: -14px;
  z-index: 1100;
  border-radius: 9999px;
  padding: 0.15rem 0.4rem;
}

/* Hide sidebar scrollbars but keep scrolling */
.app-sidebar {
  -ms-overflow-style: none; /* IE/Edge */
  scrollbar-width: none;     /* Firefox */
}
.app-sidebar::-webkit-scrollbar {
  display: none;             /* Chrome/Safari */
}

/* ---------- Responsive layout ---------- */
@media (max-width: 991.98px) {
  .app-sidebar {
    width: var(--sidebar-collapsed-width);
  }
  .app-sidebar .brand-text,
  .app-sidebar .nav-label,
  .app-sidebar .user-info {
    display: none;
  }
  .app-sidebar .user-footer {
    justify-content: center;
    padding: 0.5rem 0.75rem;
    border-top: none;
  }
  .app-sidebar .user-avatar {
    width: 32px;
    height: 32px;
  }
  .app-sidebar .nav-item {
    justify-content: center;
    padding: 0.65rem 0;
  }
  .app-header {
    padding: 0.75rem 1rem;
  }
  .app-header .page-title {
    font-size: 1.1rem;
  }
  .app-content {
    padding: 1rem;
  }
}

@media (max-width: 575.98px) {
  .card-solar .card-body {
    padding: 1rem;
  }
  .table-responsive {
    margin-bottom: 0.5rem;
  }
  .customer-card .cust-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
}

.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.app-header {
  background: var(--header-bg);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
}
.app-header .page-title { font-size: 1.35rem; font-weight: 700; color: #0f172a; margin: 0; }
.app-header .header-actions { display: flex; align-items: center; gap: 1rem; }
.app-header .btn-notify { position: relative; }
.app-header .btn-notify .badge-dot { position: absolute; top: 2px; right: 2px; width: 8px; height: 8px; background: #ef4444; border-radius: 50%; }

.app-content { padding: 1.5rem; flex: 1; }

/* Cards */
.card-solar { background: #fff; border-radius: 0.5rem; box-shadow: var(--card-shadow); border: none; }
.card-solar .card-body { padding: 1.25rem; }
.stat-card { position: relative; overflow: hidden; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; color: #0f172a; }
.stat-card .stat-meta { font-size: 0.85rem; color: #64748b; margin-top: 0.25rem; }
.stat-card .stat-icon { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 0.5rem; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.stat-card .stat-icon.blue { background: #dbeafe; color: #2563eb; }
.stat-card .stat-icon.amber { background: #fef3c7; color: #d97706; }
.stat-card .stat-icon.red { background: #fee2e2; color: #dc2626; }
.stat-card .stat-icon.green { background: #d1fae5; color: #059669; }
.stat-card .stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-link { display: block; color: inherit; }
.stat-link:hover .stat-card { box-shadow: 0 4px 12px rgba(15,23,42,.18); transform: translateY(-1px); transition: all .15s ease; }
.text-green { color: #059669; }
.text-red { color: #dc2626; }
.text-amber { color: #d97706; }

/* Badges */
.badge-role { font-size: 0.75rem; font-weight: 600; padding: 0.35rem 0.65rem; border-radius: 9999px; }
.badge-role.admin { background: #ede9fe; color: #6d28d9; }
.badge-role.subadmin { background: #dbeafe; color: #2563eb; }
.badge-role.channelpartner { background: #ffedd5; color: #c2410c; }
.badge-role.superadmin { background: #fef3c7; color: #b45309; }
.badge-status { font-size: 0.75rem; padding: 0.3rem 0.6rem; border-radius: 9999px; }
.badge-status.active { background: #d1fae5; color: #059669; }
.badge-status.inactive { background: #fee2e2; color: #dc2626; }
.badge-status.low { background: #fef3c7; color: #b45309; }
.badge-status.critical { background: #fee2e2; color: #dc2626; }
.badge-status.instock { background: #d1fae5; color: #059669; }
.badge-status.outofstock { background: #f1f5f9; color: #64748b; }

/* Application status (crayon-style backgrounds) */
.app-status { font-size: 0.75rem; font-weight: 500; padding: 0.25rem 0.5rem; border-radius: 0.25rem; white-space: nowrap; }
.app-status.status-pending { background: #fef9c3; color: #854d0e; }
.app-status.status-ready_to_dispatch { background: #ffedd5; color: #9a3412; }
.app-status.status-waiting_for_installation { background: #bae6fd; color: #0c4a6e; }
.app-status.status-net_metering { background: #e9d5ff; color: #5b21b6; }
.app-status.status-waiting_for_import_export { background: #bbf7d0; color: #14532d; }
.app-status.status-completed { background: #86efac; color: #14532d; }

/* Table */
.table-solar { background: #fff; }
.table-solar thead th { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; border-bottom: 1px solid #e2e8f0; padding: 0.75rem 1rem; }
.table-solar tbody td { padding: 0.85rem 1rem; vertical-align: middle; }
.table-solar .user-cell { display: flex; align-items: center; gap: 0.75rem; }
.table-solar .user-avatar-sm { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #64748b, #94a3b8); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 600; }
.table-solar .user-id { font-size: 0.75rem; color: #94a3b8; }

.user-link {
  cursor: pointer;
}

/* Roadmap / Timeline */
.timeline-item { display: flex; gap: 1rem; margin-bottom: 1rem; }
.timeline-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; margin-top: 0.35rem; }
.timeline-dot.done { background: #22c55e; }
.timeline-dot.progress { background: #f59e0b; }
.timeline-dot.upcoming { background: #cbd5e1; }
.timeline-body { flex: 1; }
.timeline-body .phase-title { font-weight: 600; color: #0f172a; }
.timeline-body .phase-desc { font-size: 0.85rem; color: #64748b; margin-top: 0.15rem; }
.timeline-body .phase-badge { font-size: 0.75rem; margin-top: 0.25rem; }
.timeline-body .phase-badge.done { color: #22c55e; }
.timeline-body .phase-badge.progress { color: #f59e0b; }
.timeline-body .phase-badge.upcoming { color: #94a3b8; }
.progress-thin { height: 4px; border-radius: 2px; background: #e2e8f0; margin-top: 0.5rem; overflow: hidden; }
.progress-thin .progress-bar { height: 100%; background: #f59e0b; }

/* Stock alerts panel */
.panel-alerts { background: #fff; border-radius: 0.5rem; box-shadow: var(--card-shadow); padding: 1rem; }
.panel-alerts .panel-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.25rem; display: flex; align-items: center; gap: 0.5rem; }
.panel-alerts .alert-item { padding: 0.85rem; border: 1px solid #e2e8f0; border-radius: 0.4rem; margin-bottom: 0.75rem; }
.panel-alerts .alert-item:last-child { margin-bottom: 0; }
.panel-alerts .alert-sku { font-size: 0.75rem; color: #64748b; }
.panel-alerts .alert-stock { font-size: 0.85rem; margin-top: 0.35rem; }
.panel-alerts .alert-stock .current { font-weight: 600; }

/* Customer detail */
.customer-card { background: #fff; border-radius: 0.5rem; box-shadow: var(--card-shadow); padding: 1.25rem; }
.customer-card .cust-name { font-size: 1.1rem; font-weight: 700; color: #0f172a; }
.customer-card .cust-meta { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.75rem; font-size: 0.9rem; color: #64748b; }
.disbursement-item { padding: 0.75rem 0; border-bottom: 1px solid #f1f5f9; }
.disbursement-item:last-child { border-bottom: none; }
.disbursement-item .d-amount { font-weight: 600; color: #059669; }
.disbursement-item .d-verified { color: #059669; font-size: 0.85rem; }
.disbursement-item .d-pending { color: #d97706; font-size: 0.85rem; }
.progress-paid { height: 8px; border-radius: 4px; background: #e2e8f0; overflow: hidden; }

/* Searchable dropdown */
.searchable-dropdown-list { min-width: 100%; box-shadow: 0 4px 12px rgba(0,0,0,.15); border-radius: 0.25rem; }
.searchable-dropdown-list .list-group-item { cursor: pointer; border-left: 0; border-right: 0; }
.searchable-dropdown-list .list-group-item:first-child { border-top: 0; }

/* Fix typo */
.timeline-body { flex: 1; }

/* Director multiselect – match form-select-sm and Bootstrap dropdown */
.director-multiselect .director-multiselect-btn {
  min-width: 200px;
  height: 31px;
  font-size: 0.875rem;
  text-align: left;
  padding: 0.25rem 0.5rem;
  background-color: #fff;
  color: #212529;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
}
.director-multiselect .director-multiselect-btn:hover,
.director-multiselect .director-multiselect-btn:focus {
  background-color: #fff;
  border-color: #86b7fe;
  color: #212529;
}
.director-multiselect .director-multiselect-btn::after {
  margin-left: auto;
}
.director-multiselect-menu .director-multiselect-list {
  padding: 0.25rem 0.5rem 0.25rem 0.5rem;
}
.director-multiselect-menu .director-option {
  margin: 0;
  padding: 0;
  cursor: pointer;
  list-style: none;
}
.director-multiselect-menu .director-option label {
  cursor: pointer;
  margin: 0;
  padding: 0.45rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  font-size: 0.875rem;
  font-weight: 400;
  border: 0;
  background: transparent;
  color: #212529;
  min-height: 2rem;
}
.director-multiselect-menu .director-option label:hover {
  background-color: #f8f9fa;
}
.director-multiselect-menu .director-option .form-check-input {
  width: 1.125em;
  height: 1.125em;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  vertical-align: middle;
}
.director-multiselect-menu .director-option .director-option-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.director-multiselect-menu .director-option .form-check-input:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}
.director-multiselect-menu .dropdown-item-text.empty {
  font-size: 0.8125rem;
  color: #6c757d;
  padding: 0.5rem 0.75rem;
}

/* Password show/hide toggle (eye icon) */
.password-toggle-btn {
  padding: 0.25rem 0.5rem;
  border: none;
  background: transparent;
  color: #6c757d;
  cursor: pointer;
  outline: none;
}
.password-toggle-btn:hover {
  color: var(--theme-primary, #99f36c);
}
.input-group .input-group-text .password-toggle-btn {
  padding: 0 0.5rem;
}
.field-wrap .field-password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  padding: 4px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  outline: none;
}
.field-wrap .field-password-toggle:hover {
  color: #99f36c;
}
.field-wrap.has-password-toggle .field-input {
  padding-right: 44px;
}
