/* ═══════════════════════════════════════════════════════════════
   Excavate — Light Professional Theme
   ═══════════════════════════════════════════════════════════════ */

/* ── SPLIT PANE ───────────────────────────────────────────────── */
ion-split-pane {
  --side-max-width: 220px;
  --side-min-width: 220px;
  --side-width:     220px;
  --border: 1px solid #e2e8f0;
}

/* ── APP SIDEBAR — WHITE ──────────────────────────────────────── */
.app-sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 220px;
  min-width: 220px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  overflow: hidden;
}

/* Sidebar header (logo + user block) */
.sidebar-header {
  background: #ffffff;
  border-bottom: 1px solid #eef2f7;
  flex-shrink: 0;
}

.sidebar-header ion-toolbar {
  --background: #ffffff;
  --color: #1e293b;
  --min-height: 60px;
  --border-color: transparent;
  --padding-start: 0;
  --padding-end: 0;
}

.sidebar-header ion-toolbar img {
  height: 32px;
  padding-left: 16px;
}

/* Birthday / info text inside header */
.sidebar-header p {
  color: #64748b;
  font-size: 11px;
  margin: 0;
  text-align: center;
  padding: 0 12px 4px;
}

/* Profile image ring */
.sidebar-header img[style*="border-radius:50%"] {
  border: 2px solid #e2e8f0;
}

/* ── SIDEBAR NAVIGATION ───────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 6px;
}

.sidebar-nav::-webkit-scrollbar       { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }

.nav-list { background: transparent !important; }

/* Each nav link */
.nav-item {
  --background:           transparent !important;
  --background-hover:     #f0f4f8 !important;
  --background-activated: #ebf2ff !important;
  --color:                #374151 !important;
  --border-color:         transparent !important;
  --detail-icon-color:    transparent;
  --min-height: 40px;
  --padding-start: 12px;
  --inner-padding-end: 12px;
  margin: 1px 0;
  border-radius: 7px;
  transition: background 0.15s ease;
}

.nav-item ion-label {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #374151 !important;
}

.nav-item ion-icon {
  color: #64748b !important;
  font-size: 17px !important;
  margin-right: 2px;
}

/* Active nav item */
.nav-active {
  --background: #ebf2ff !important;
}

.nav-active ion-label {
  color: #1e3a5f !important;
  font-weight: 600 !important;
}

.nav-active ion-icon {
  color: #1e3a5f !important;
}

/* ── SIDEBAR FOOTER (Logout) ──────────────────────────────────── */
.sidebar-footer {
  flex-shrink: 0;
  padding: 6px;
  border-top: 1px solid #eef2f7;
}

.logout-item {
  --background:           transparent !important;
  --background-hover:     #fff0f0 !important;
  --background-activated: #fee2e2 !important;
  --color:                #dc2626 !important;
  --border-color:         transparent !important;
  --min-height: 40px;
  --padding-start: 12px;
  border-radius: 7px;
  cursor: pointer;
}

.logout-item ion-label {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #dc2626 !important;
}

.logout-item ion-icon {
  color: #dc2626 !important;
  font-size: 17px !important;
}

/* ── PAGE TOOLBAR — WHITE ─────────────────────────────────────── */
ion-header ion-toolbar,
ion-header ion-toolbar:first-child {
  --background: #ffffff !important;
  --color: #1e293b !important;
  --border-color: #e2e8f0 !important;
}

ion-toolbar ion-title {
  color: #1e293b !important;
  font-size: 16px;
  font-weight: 700;
}

ion-header {
  box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
}

/* Toolbar back/menu button icons → dark */
ion-toolbar ion-back-button    { --color: #1e293b; }
ion-toolbar ion-menu-button    { --color: #1e293b; }
ion-toolbar ion-button         { --color: #1e293b; }

/* ── SEGMENT / TAB SWITCHER ───────────────────────────────────── */
ion-segment {
  background: #f0f4f8 !important;
  border-radius: 8px;
  padding: 3px;
  margin: 8px 12px;
  border: 1px solid #e2e8f0;
}

ion-segment-button {
  --background: transparent;
  --background-checked: #1e3a5f;
  --color: #475569;
  --color-checked: #ffffff;
  --indicator-height: 0px;
  --indicator-color: transparent;
  --border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  min-height: 32px;
}

ion-segment-button::part(indicator) { display: none !important; }

/* Ensure checked segment text is always white */
ion-segment-button.segment-button-checked {
  color: #ffffff !important;
}

ion-segment-button.segment-button-checked ion-label {
  color: #ffffff !important;
  font-weight: 600 !important;
}

ion-segment-button.segment-button-checked::part(native) {
  background: #1e3a5f !important;
  color: #ffffff !important;
  border-radius: 6px;
}

/* Unchecked: dark readable text */
ion-segment-button:not(.segment-button-checked) ion-label {
  color: #475569 !important;
  font-weight: 500 !important;
}

ion-segment-button:not(.segment-button-checked)::part(native) {
  color: #475569 !important;
}

/* ── TABLE STYLES ─────────────────────────────────────────────── */
table thead tr {
  background: #1e3a5f !important;
}

table thead th {
  color: #ffffff !important;
  background: transparent !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  padding: 11px 12px !important;
  border: none !important;
  white-space: nowrap;
}

table tbody tr {
  border-bottom: 1px solid #f1f5f9 !important;
  transition: background 0.12s;
}

table tbody tr:hover {
  background-color: #f0f5ff !important;
}

table tbody td {
  padding: 8px 12px !important;
  vertical-align: middle !important;
  font-size: 13px !important;
  color: #1e293b !important;
  border: none !important;
}

.table-striped tbody tr:nth-of-type(odd)  { background-color: #f8fafc !important; }
.table-striped tbody tr:nth-of-type(even) { background-color: #ffffff !important; }
.table-striped tbody tr:hover             { background-color: #f0f5ff !important; }

.table-bordered th,
.table-bordered td {
  padding: 8px 12px !important;
  border: 1px solid #e8edf4 !important;
}

.table-bordered thead th {
  border-color: rgba(255,255,255,0.25) !important;
}

/* Table wrapper card */
.table-responsive {
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  overflow: auto;
  background: #ffffff;
}

/* ── ION-CARD ─────────────────────────────────────────────────── */
ion-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  margin: 8px 12px;
}

ion-card-header {
  border-bottom: 1px solid #f1f5f9;
  padding: 14px 16px 10px;
}

ion-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e3a5f;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── DROPDOWN PANEL ───────────────────────────────────────────── */
.ng-dropdown-panel .ng-dropdown-panel-items .ng-option {
  font-size: 13px !important;
  padding: 8px 12px !important;
  color: #1e293b;
}

.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-marked {
  background: #f0f5ff;
}

.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-selected {
  background: #e0eaff;
  color: #1e3a5f;
  font-weight: 600;
}

/* ── STATUS COLORS ────────────────────────────────────────────── */
.text-success, td.text-success  { color: #16a34a !important; font-weight: 600; }
.text-danger,  td.text-danger   { color: #dc2626 !important; font-weight: 600; }
.text-warning, td.text-warning  { color: #d97706 !important; font-weight: 600; }

/* ── CHART CONTAINER ──────────────────────────────────────────── */
div.chart-container {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px;
  padding: 12px;
}

div.chart-container .chart-container {
  background: #ffffff !important;
  border: none !important;
  padding: 0;
}

/* ── ION-CONTENT BG ───────────────────────────────────────────── */
ion-content {
  --background: #f4f7fb;
}

/* ── ION-ITEM BASE ────────────────────────────────────────────── */
ion-item {
  --background: #ffffff;
  --border-color: #eef2f7;
}

/* ── FORM CONTROL ─────────────────────────────────────────────── */
.form-control {
  border: 1.5px solid #e2e8f0;
  border-radius: 7px;
  font-size: 13px;
  padding: 9px 12px;
  color: #1e293b;
  background: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  border-color: #1e3a5f;
  box-shadow: 0 0 0 3px rgba(30,58,95,0.08);
  outline: none;
}

/* ── BOOTSTRAP BUTTONS POLISH ─────────────────────────────────── */
.btn {
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #1e3a5f;
  border-color: #1e3a5f;
  color: #ffffff;
}

.btn-primary:hover {
  background: #2d4f78;
  border-color: #2d4f78;
}

.btn-sm { font-size: 12px; padding: 5px 12px; }

/* ── ALERTS ───────────────────────────────────────────────────── */
.alert         { border-radius: 7px; font-size: 13px; padding: 10px 14px; }
.alert-danger  { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #16a34a; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }

/* ── SCROLLBAR ────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f8fafc; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── RESPONSIVE ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .app-sidebar { width: 100%; }

  table thead th { font-size: 10px !important; padding: 8px !important; }
  table tbody td { font-size: 12px !important; padding: 6px 8px !important; }
}
