:root {
  --degh-navy: #083d77;
  --degh-navy-dark: #05264b;
  --degh-navy-soft: #eaf2fb;
  --degh-saffron: #d97706;
  --degh-saffron-soft: #fef3c7;
  --degh-bg: #f4f6fb;
  --degh-border: #e2e8f2;
  --degh-text: #142033;
  --degh-muted: #5e6d82;
}

html {
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  background-color: var(--degh-bg);
  color: var(--degh-text);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  overflow-x: clip;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.min-w-0 {
  min-width: 0 !important;
}

/* Brand surfaces & buttons */
.bg-degh-navy {
  background-color: var(--degh-navy) !important;
}

.text-degh-navy {
  color: var(--degh-navy) !important;
}

.btn-degh {
  background-color: var(--degh-navy);
  border-color: var(--degh-navy);
  color: #fff;
  font-weight: 600;
  border-radius: 10px;
}

.btn-degh:hover,
.btn-degh:focus {
  background-color: var(--degh-navy-dark);
  border-color: var(--degh-navy-dark);
  color: #fff;
}

.btn-outline-degh {
  color: var(--degh-navy);
  border-color: rgba(8, 61, 119, 0.35);
  font-weight: 600;
  border-radius: 10px;
}

.btn-outline-degh:hover {
  background-color: var(--degh-navy);
  border-color: var(--degh-navy);
  color: #fff;
}

.btn {
  border-radius: 10px;
}

/* Desktop sidebar */
.degh-sidebar {
  width: 268px;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--degh-navy-dark) 0%, var(--degh-navy) 100%);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1030;
  overflow-y: auto;
}

.degh-main {
  min-height: 100vh;
}

@media (min-width: 992px) {
  .degh-main {
    margin-left: 268px;
  }
}

@media (max-width: 991.98px) {
  .degh-main {
    padding-bottom: 84px;
  }
}

.degh-brand-logo {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 11px;
  background: #fff;
  padding: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.degh-login-logo {
  width: 116px;
  height: 116px;
  object-fit: contain;
  border-radius: 20px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 10px 28px rgba(8, 61, 119, 0.16);
}

/* Navigation links */
.degh-nav-label {
  font-size: 0.69rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.52);
  padding: 0.85rem 1rem 0.3rem;
  font-weight: 700;
}

.degh-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.62rem 0.95rem;
  margin: 0.14rem 0.65rem;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.degh-nav-link:hover {
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.degh-nav-link.active {
  background-color: #fff;
  color: var(--degh-navy-dark);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

/* Topbar */
.degh-topbar {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background-color: rgba(255, 255, 255, 0.94) !important;
  border-bottom: 1px solid var(--degh-border) !important;
  padding-top: max(0.5rem, env(safe-area-inset-top)) !important;
}

/* Cards & metrics */
.degh-card {
  background: #fff;
  border: 1px solid var(--degh-border);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.degh-hero-banner {
  background: linear-gradient(135deg, #062c56 0%, #083d77 65%, #11559c 100%);
  color: #fff;
  border-radius: 16px;
  padding: 1.25rem 1.4rem;
  box-shadow: 0 8px 24px rgba(8, 61, 119, 0.16);
}

.degh-stat-card {
  background: #fff;
  border: 1px solid var(--degh-border);
  border-radius: 16px;
  padding: 1rem 1.15rem;
  height: 100%;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.degh-stat-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.degh-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.degh-mobile-item {
  background: #fff;
  border: 1px solid var(--degh-border);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.03);
}

/* Quick action tiles on mobile/dashboard */
.degh-action-tile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid var(--degh-border);
  border-radius: 14px;
  text-decoration: none;
  color: var(--degh-text);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.degh-action-tile:hover {
  border-color: var(--degh-navy);
  background: var(--degh-navy-soft);
  color: var(--degh-navy-dark);
}

/* Mobile bottom bar with center + button */
.degh-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--degh-border);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
  padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
}

.degh-bottom-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.2rem;
  text-decoration: none;
  color: var(--degh-muted);
  font-size: 0.68rem;
  font-weight: 600;
}

.degh-bottom-link i {
  font-size: 1.15rem;
  margin-bottom: 0.1rem;
}

.degh-bottom-link.active {
  color: var(--degh-navy);
}

.degh-bottom-fab {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--degh-navy) 0%, #0f5299 100%);
  color: #fff;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-top: -14px;
  box-shadow: 0 6px 16px rgba(8, 61, 119, 0.35);
}

/* Receipt / upload area */
.degh-upload-box {
  border: 1.5px dashed rgba(8, 61, 119, 0.3);
  border-radius: 12px;
  padding: 0.9rem;
  background: #f9fbff;
}

/* Date quick chips */
.degh-date-chips {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.degh-date-chip {
  font-size: 0.72rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--degh-border);
  background: #f8fafc;
  color: var(--degh-navy);
  font-weight: 600;
  cursor: pointer;
}

.degh-date-chip:hover,
.degh-date-chip.active {
  background: var(--degh-navy);
  border-color: var(--degh-navy);
  color: #fff;
}

/* Empty state */
.degh-empty-state {
  text-align: center;
  padding: 2.75rem 1.25rem;
}

.degh-empty-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: var(--degh-navy-soft);
  color: var(--degh-navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 0.85rem;
}

/* Touch friendly inputs (16px on mobile prevents iOS Safari auto-zoom) */
.form-control,
.form-select,
.btn {
  min-height: 44px;
}

.form-select {
  -webkit-appearance: none;
  appearance: none;
}

@media (max-width: 991.98px) {
  .form-control,
  .form-select {
    font-size: 16px;
  }
  .degh-main {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(8, 61, 119, 0.5);
  box-shadow: 0 0 0 0.2rem rgba(8, 61, 119, 0.12);
}

.btn-sm,
.form-control-sm,
.form-select-sm {
  min-height: 36px;
}

.degh-kpi-value {
  font-size: clamp(1.05rem, 3.8vw, 1.45rem);
  line-height: 1.2;
}

.degh-pill-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--degh-border);
  background: #fff;
  color: var(--degh-muted);
  white-space: nowrap;
}

.degh-pill-tab.active,
.degh-pill-tab:hover {
  background: var(--degh-navy);
  border-color: var(--degh-navy);
  color: #fff;
}

.degh-scroll-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
}

.degh-scroll-pills::-webkit-scrollbar {
  display: none;
}

/* Bill / receipt zoom viewport */
.degh-bill-viewport {
  overflow: auto;
  max-height: 70vh;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.degh-bill-image {
  max-width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-select: none;
}

/* Top instant feedback progress bar */
.degh-top-loader {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 2000;
  background: linear-gradient(90deg, var(--degh-saffron), var(--degh-navy));
  transition: width 0.25s ease, opacity 0.2s ease;
  opacity: 0;
  pointer-events: none;
}

.degh-top-loader.active {
  width: 78%;
  opacity: 1;
}

.degh-collapse-toggle {
  min-height: 52px;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 0;
  border-radius: 0;
  color: var(--degh-navy);
  transition: background-color 0.15s ease;
}

.degh-collapse-toggle:hover,
.degh-collapse-toggle:focus-visible {
  background: var(--degh-navy-soft);
  outline: none;
}

.degh-chevron {
  transition: transform 0.2s ease;
}

[aria-expanded="true"] .degh-chevron {
  transform: rotate(180deg);
}

/* Record Daily Sale POS-style components */
.degh-channel-pills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

@media (min-width: 576px) {
  .degh-channel-pills {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.degh-channel-pill {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 40px;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--degh-border);
  background: #fff;
  color: var(--degh-text);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s ease;
  cursor: pointer;
}

.degh-channel-pill:hover {
  border-color: rgba(8, 61, 119, 0.45);
  background: var(--degh-navy-soft);
}

.degh-channel-pill.active {
  background: var(--degh-navy);
  border-color: var(--degh-navy);
  color: #fff;
  box-shadow: 0 4px 10px rgba(8, 61, 119, 0.18);
}

.degh-channel-pill.active i {
  color: #fff !important;
}

.sale-item-row {
  border: 1px solid var(--degh-border);
  border-radius: 12px;
  background: #fff;
  max-width: 100%;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sale-item-row:focus-within {
  border-color: rgba(8, 61, 119, 0.45);
  box-shadow: 0 2px 10px rgba(8, 61, 119, 0.08);
}

.sale-row-collapsed,
.purchase-row-collapsed,
.menu-ing-collapsed,
.batch-ing-collapsed {
  cursor: pointer;
}

.sale-row-expanded-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--degh-border);
}

.degh-row-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.degh-qty-stepper {
  max-width: 148px;
}

.degh-qty-stepper input[type="number"]::-webkit-outer-spin-button,
.degh-qty-stepper input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.degh-qty-stepper input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.degh-qty-stepper .btn {
  min-width: 34px;
  border: 1px solid #ced4da;
  background: #f8fafc;
  color: var(--degh-navy);
  font-weight: 700;
}

.degh-qty-stepper .btn:hover {
  background: var(--degh-navy-soft);
  border-color: rgba(8, 61, 119, 0.35);
}

.degh-no-spin::-webkit-outer-spin-button,
.degh-no-spin::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.degh-no-spin {
  -moz-appearance: textfield;
  appearance: textfield;
}

.degh-batch-mobile-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(68px + env(safe-area-inset-bottom));
  z-index: 1029;
}

.degh-share-bar {
  height: 6px;
  border-radius: 999px;
  background: #edf1f7;
  overflow: hidden;
}

.degh-share-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--degh-navy), #2563eb);
}

/* Staff & Payroll mobile-first UI helpers */
.degh-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  background: var(--degh-navy-soft);
  color: var(--degh-navy);
  border: 1px solid rgba(8, 61, 119, 0.14);
}

.degh-avatar-lg {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  font-size: 1.05rem;
}

.degh-avatar-partner {
  background: var(--degh-saffron-soft);
  color: #92400e;
  border-color: rgba(217, 119, 6, 0.28);
}

.degh-att-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
}

.degh-att-pills .btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.35rem 0.25rem;
  font-size: 0.78rem;
  border-radius: 10px !important;
  white-space: nowrap;
}

.degh-att-row-card {
  border-left: 4px solid #16a34a;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.degh-att-row-card[data-status="HALF_DAY"] {
  border-left-color: #d97706;
}

.degh-att-row-card[data-status="PAID_LEAVE"] {
  border-left-color: #0284c7;
}

.degh-att-row-card[data-status="ABSENT"] {
  border-left-color: #94a3b8;
  background: #fbfcfe;
}

.degh-seg-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
  text-align: left;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  border: 1.5px solid var(--degh-border);
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.degh-seg-card:hover {
  border-color: rgba(8, 61, 119, 0.4);
  background: #f8fbff;
}

.degh-seg-card.active {
  border-color: var(--degh-navy);
  background: var(--degh-navy-soft);
  box-shadow: 0 0 0 2px rgba(8, 61, 119, 0.1);
}

.degh-seg-card.active-success {
  border-color: #16a34a;
  background: #ecfdf5;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.12);
}

.degh-seg-card.active-warning {
  border-color: #d97706;
  background: #fffbeb;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.12);
}

.degh-seg-card.active-danger {
  border-color: #dc2626;
  background: #fef2f2;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.12);
}

.degh-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid var(--degh-border);
  background: #f8fafc;
  color: var(--degh-navy);
  cursor: pointer;
  transition: all 0.12s ease;
}

.degh-chip-btn:hover,
.degh-chip-btn:active {
  background: var(--degh-navy-soft);
  border-color: rgba(8, 61, 119, 0.35);
}

.degh-sheet-sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff !important;
  box-shadow: 2px 0 6px rgba(15, 23, 42, 0.06);
}

thead .degh-sheet-sticky-col {
  background: #f8f9fa !important;
  z-index: 3;
}

.degh-bulk-row {
  background: #ffffff;
  transition: background-color 0.14s ease, opacity 0.14s ease, border-color 0.14s ease;
}

.degh-bulk-row:hover {
  background: #f8fafd;
}

.degh-bulk-row-excluded {
  background: #f8fafc !important;
  opacity: 0.65;
}

@media print {
  .degh-sidebar,
  .degh-bottom-nav,
  .degh-topbar,
  .no-print {
    display: none !important;
  }
  .degh-main {
    margin-left: 0 !important;
    padding: 0 !important;
  }
  body {
    background: #fff !important;
  }
}
