/* ==========================================================================
   Sii POS — iPOS Report Styling & Layout (Near 1:1 Reproduction)
   ========================================================================== */

:root {
  --ipos-brand: #0560a6;
  --ipos-brand-light: #def1fe;
  --ipos-brand-dark: #034275;
  --ipos-hero-start: #5333ed;
  --ipos-hero-end: #7752fe;
  --ipos-text-dark: #181d27;
  --ipos-text-main: #363636;
  --ipos-text-muted: #666666;
  --ipos-text-light: #94a3b8;
  --ipos-border: rgba(0, 0, 0, 0.125);
  --ipos-border-subtle: #e5e7eb;
  --ipos-bg-header: #f4f6f8;
  --ipos-bg-hover: #f8fafc;
  --ipos-success: #00c853;
  --ipos-warning: #f59e0b;
  --ipos-danger: #ef4444;
}

/* Master Layout */
.ipos-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ipos-text-main);
  overflow: hidden;
  position: relative;
}

section.view.ipos-container:not(.active) {
  display: none !important;
}

/* Topbar */
.ipos-topbar {
  height: 60px;
  min-height: 60px;
  background: #ffffff;
  border-bottom: 1px solid var(--ipos-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  position: sticky;
  top: 0;
}

.ipos-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ipos-hamburger-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--ipos-text-dark);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ipos-hamburger-btn:hover {
  background: #f1f5f9;
}

.ipos-topbar-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ipos-text-dark);
  margin: 0;
  white-space: nowrap;
}

.ipos-quick-search {
  position: relative;
  display: flex;
  align-items: center;
  height: 34px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 0 10px;
  background: #fff;
}
.ipos-quick-search input {
  border: none;
  outline: none;
  font-size: 13px;
  width: 160px;
  padding-left: 6px;
  color: var(--ipos-text-dark);
}
.ipos-quick-search .ipos-search-icon {
  font-size: 13px;
  color: #9ca3af;
}

.ipos-topbar-center {
  font-size: 16px;
  font-weight: 600;
  color: var(--ipos-text-dark);
  text-align: center;
}

.ipos-topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ipos-badge-pill {
  background: #eff6ff;
  color: var(--ipos-brand);
  border: 1px solid #bfdbfe;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 9999px;
}

.ipos-user-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ipos-text-dark);
  cursor: pointer;
}

/* Body (Sidebar + Content) */
.ipos-body {
  display: flex;
  flex: 1;
  height: calc(100% - 60px);
  overflow: hidden;
  position: relative;
}

/* Sidebar */
.ipos-sidebar {
  width: 320px;
  min-width: 320px;
  background: #ffffff;
  border-right: 1px solid var(--ipos-border-subtle);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  z-index: 900;
  transition: transform 0.25s ease, width 0.25s ease;
}

.ipos-sidebar-backdrop {
  position: fixed;
  inset: 60px 0 0 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 850;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}
.ipos-sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* Accordion Menu */
.ipos-menu-group {
  margin-bottom: 8px;
}

.ipos-menu-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--ipos-text-dark);
  cursor: pointer;
  border-radius: 4px;
  text-align: left;
  transition: background 0.15s;
}
.ipos-menu-group-header:hover {
  background: #f8fafc;
}
.ipos-menu-group-header .ipos-caret {
  font-size: 12px;
  color: #64748b;
  transition: transform 0.2s ease;
}
.ipos-menu-group-header.collapsed .ipos-caret {
  transform: rotate(-90deg);
}

.ipos-submenu-list {
  display: flex;
  flex-direction: column;
  padding-left: 8px;
  margin-top: 2px;
}
.ipos-submenu-list.hidden {
  display: none;
}

.ipos-submenu-item {
  display: flex;
  align-items: center;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ipos-text-muted);
  border: none;
  background: transparent;
  text-align: left;
  border-radius: 4px;
  cursor: pointer;
  margin: 1px 0;
  transition: all 0.15s;
  text-decoration: none;
}
.ipos-submenu-item:hover {
  background: #f1f5f9;
  color: var(--ipos-brand);
}
.ipos-submenu-item.active {
  background: var(--ipos-brand-light);
  color: var(--ipos-brand);
  font-weight: 600;
}

/* Content Area */
.ipos-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  background: #ffffff;
  padding: 20px 24px;
}

/* Filter Toolbar */
.ipos-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ipos-border-subtle);
}

.ipos-filter-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.ipos-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ipos-branch-context {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #d7e1e8;
  border-radius: 4px;
  background: #f7fafb;
  color: #6a7b86;
  font-size: 13px;
}

.ipos-branch-context strong {
  color: var(--ipos-text-dark);
  font-size: 14px;
}

.ipos-filter-date-btn,
.ipos-filter-select,
.ipos-filter-input {
  height: 38px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background: #ffffff;
  padding: 0 12px;
  font-size: 14px;
  color: var(--ipos-text-dark);
  outline: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ipos-filter-date-btn {
  cursor: pointer;
  min-width: 220px;
  justify-content: center;
  font-weight: 500;
}
.ipos-filter-date-btn:hover {
  border-color: #94a3b8;
}

.ipos-filter-btn {
  height: 38px;
  border: 1px solid var(--ipos-brand);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ipos-brand);
  font-size: 14px;
  font-weight: 500;
  padding: 0 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.ipos-filter-btn:hover {
  background: var(--ipos-brand-light);
}

.ipos-filter-btn.primary {
  background: var(--ipos-brand);
  color: #fff;
  border: none;
}
.ipos-filter-btn.primary:hover {
  background: var(--ipos-brand-dark);
}

/* Hero Purple Banner */
.ipos-hero-banner {
  background: linear-gradient(135deg, var(--ipos-hero-start) 0%, var(--ipos-hero-end) 100%);
  border-radius: 8px;
  padding: 24px 28px;
  color: #ffffff;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(83, 51, 237, 0.2);
}
.ipos-hero-banner::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 180px;
  height: 180px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  pointer-events: none;
}

.ipos-hero-title {
  font-size: 15px;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: 6px;
}
.ipos-hero-amount {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}
.ipos-hero-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  opacity: 0.9;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.ipos-hero-badges span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* KPI Cards Grid */
.ipos-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.ipos-kpi-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ipos-kpi-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ipos-card {
  background: #ffffff;
  border: 0.8px solid var(--ipos-border);
  border-radius: 4px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ipos-card-header {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 400;
  color: #212121;
  background: #ffffff;
  border-bottom: 0.8px solid var(--ipos-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ipos-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ipos-card-value {
  font-size: 28px;
  font-weight: 500;
  color: var(--ipos-text-main);
  margin: 0;
  line-height: 1.2;
}
.ipos-card-sub {
  font-size: 13px;
  color: var(--ipos-text-muted);
  margin-top: 6px;
}

/* Special Decorative Cards on C01 / Dashboard */
.ipos-card-soft-cyan {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 100%);
  border-color: #ccfbf1;
}
.ipos-card-soft-green {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  border-color: #dcfce7;
}

/* Chart Card Containers */
.ipos-chart-section {
  background: #ffffff;
  border: 0.8px solid var(--ipos-border);
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 24px;
}

.ipos-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.ipos-chart-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ipos-text-dark);
  text-transform: uppercase;
  margin: 0;
}

.ipos-chart-grid-2 {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
  margin-bottom: 24px;
}

.ipos-chart-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* Tables */
.ipos-table-wrapper {
  background: #ffffff;
  border: 0.8px solid var(--ipos-border);
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 24px;
}

.ipos-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.ipos-table th {
  background: var(--ipos-bg-header);
  color: #475569;
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ipos-border-subtle);
  white-space: nowrap;
}

.ipos-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--ipos-border-subtle);
  color: var(--ipos-text-main);
  vertical-align: middle;
}

.ipos-table tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}
.ipos-table tbody tr:hover {
  background: var(--ipos-bg-hover);
}

.ipos-table-footer {
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid var(--ipos-border-subtle);
  font-size: 14px;
  font-weight: 600;
  color: var(--ipos-text-dark);
  text-align: right;
  display: flex;
  justify-content: flex-end;
  gap: 20px;
}

/* Empty State */
.ipos-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
}
.ipos-empty-icon {
  width: 90px;
  height: 90px;
  margin-bottom: 16px;
  opacity: 0.7;
}
.ipos-empty-text {
  font-size: 14px;
  color: var(--ipos-text-muted);
}
.ipos-table td.ipos-empty-state {
  display: table-cell;
  padding: 48px 20px;
  text-align: center;
}
.ipos-chart-empty {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--ipos-text-muted);
  font-size: 14px;
  text-align: center;
}

/* Invoice Detail Modal */
.ipos-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}
.ipos-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.ipos-modal {
  background: #ffffff;
  border-radius: 8px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.ipos-modal-header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ipos-border-subtle);
}
.ipos-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--ipos-text-dark);
}
.ipos-modal-close-btn {
  background: transparent;
  border: none;
  font-size: 22px;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}

.ipos-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
}

.ipos-invoice-info-card {
  background: #f8fafc;
  border: 1px solid var(--ipos-border-subtle);
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 16px;
}
.ipos-invoice-code {
  font-size: 15px;
  font-weight: 700;
  color: var(--ipos-text-dark);
}
.ipos-invoice-meta {
  font-size: 13px;
  color: var(--ipos-text-muted);
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
}

.ipos-invoice-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed var(--ipos-border-subtle);
  font-size: 14px;
}

.ipos-invoice-summary-line {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}
.ipos-invoice-total-line {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ipos-brand);
  border-top: 1px solid var(--ipos-border-subtle);
  margin-top: 10px;
}

.ipos-shift-detail-head,
.ipos-shift-invoices-head,
.ipos-shift-payments-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ipos-shift-detail-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  margin-bottom: 16px;
  align-items: center;
}
.ipos-shift-detail-head h2 {
  margin: 0;
  font-size: 20px;
  color: var(--ipos-text-dark);
  text-align: center;
}
.ipos-shift-detail-head > :last-child {
  justify-self: end;
}

.ipos-shift-detail-layout,
.ipos-shift-detail-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 20px;
}

.ipos-shift-left-col {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--ipos-border);
  background: #fff;
}

.ipos-shift-cash-card {
  padding: 20px 24px;
  color: #fff;
  background: linear-gradient(135deg, #1e70c2 0%, #115293 100%);
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.ipos-shift-cash-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
  opacity: 0.95;
}
.ipos-shift-cash-row {
  margin-bottom: 14px;
}
.ipos-shift-cash-row:last-child {
  margin-bottom: 0;
}
.ipos-shift-cash-label {
  font-size: 12px;
  text-transform: uppercase;
  opacity: 0.85;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.ipos-shift-cash-val {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 4px;
}

.ipos-shift-info-card {
  padding: 0;
  background: #fff;
}
.ipos-shift-metrics-table {
  display: flex;
  flex-direction: column;
}
.ipos-shift-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--ipos-border-subtle);
  font-size: 13px;
  color: var(--ipos-text);
}
.ipos-shift-metric-row:nth-child(even) {
  background: #fafbfc;
}
.ipos-shift-metric-row.indent {
  padding-left: 28px;
  font-size: 12.5px;
  color: #475569;
}
.ipos-shift-metric-row .label {
  color: #475569;
}
.ipos-shift-metric-row .value {
  font-weight: 500;
  text-align: right;
  color: #0f172a;
}
.ipos-shift-metric-row .font-bold {
  font-weight: 700;
}
.ipos-shift-metric-row .font-mono {
  font-family: monospace;
}
.ipos-shift-btn-invoices {
  width: 100%;
  padding: 12px;
  background: #2575fc;
  color: #fff;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease;
}
.ipos-shift-btn-invoices:hover {
  background: #1a60d8;
}

.ipos-shift-right-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.ipos-shift-widget {
  background: #fff;
  border: 1px solid var(--ipos-border);
  border-radius: 6px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ipos-shift-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ipos-border-subtle);
}
.ipos-shift-widget-head h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.ipos-widget-menu-icon {
  font-size: 16px;
  color: #94a3b8;
  cursor: default;
}
.ipos-shift-widget-body {
  flex: 1;
  min-height: 140px;
}

.ipos-sources-chart {
  display: flex;
  height: 160px;
  gap: 12px;
  align-items: stretch;
  padding-top: 10px;
}
.ipos-sources-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 11px;
  color: #94a3b8;
  padding-bottom: 24px;
  min-width: 32px;
  text-align: right;
}
.ipos-sources-bars {
  flex: 1;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0;
  position: relative;
}
.ipos-sources-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  flex: 1;
  max-width: 90px;
}
.ipos-sources-bar-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 6px;
}
.ipos-sources-bar-fill {
  width: 44px;
  background: #2575fc;
  border-radius: 4px 4px 0 0;
  position: relative;
  transition: height 0.3s ease;
  min-height: 4px;
}
.ipos-sources-bar-val {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}
.ipos-sources-bar-label {
  font-size: 12px;
  color: #475569;
  font-weight: 500;
  height: 22px;
}

.ipos-shift-payments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ipos-shift-payment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 4px;
  border: 1px solid var(--ipos-border-subtle);
  font-size: 13px;
}
.ipos-shift-payment-name {
  color: #334155;
  font-weight: 500;
}
.ipos-shift-payment-count {
  font-size: 11.5px;
  color: #94a3b8;
  font-weight: normal;
}
.ipos-shift-payment-amt {
  color: #0f172a;
  font-size: 14px;
}

.ipos-donut-widget-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ipos-donut-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  min-width: 0;
}
.ipos-donut-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ipos-donut-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ipos-donut-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #475569;
}
.ipos-donut-pct {
  font-weight: 600;
  color: #1e293b;
  margin-left: auto;
  font-size: 11.5px;
}
.ipos-donut-visual {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ipos-donut-conic {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.ipos-donut-hole {
  width: 62px;
  height: 62px;
  background: #fff;
  border-radius: 50%;
}
.ipos-empty-widget {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 13px;
  height: 120px;
}

.ipos-shift-invoices {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--ipos-border);
  background: #fff;
  margin-top: 16px;
}
.ipos-shift-invoices-head {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ipos-shift-invoices-head h3 {
  margin: 0 0 4px;
  font-size: 17px;
  color: var(--ipos-text-dark);
}
.ipos-shift-invoices-head span {
  color: var(--ipos-text-muted);
  font-size: 13px;
}
.ipos-shift-invoices-head input {
  max-width: 280px;
}
.ipos-shift-invoices .ipos-table-wrapper {
  margin: 0;
}
.ipos-shift-invoices tbody tr[data-order-id] {
  cursor: pointer;
}
.ipos-shift-code {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ipos-brand);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.ipos-shift-code:hover {
  text-decoration: underline;
}

@media (max-width: 991px) {
  .ipos-shift-detail-layout,
  .ipos-shift-detail-grid {
    grid-template-columns: 1fr;
  }
  .ipos-shift-right-col {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 599px) {
  .ipos-shift-cash-val {
    font-size: 22px;
  }
  .ipos-donut-widget-layout {
    flex-direction: column-reverse;
    align-items: center;
  }
  .ipos-donut-legend {
    width: 100%;
  }
  .ipos-shift-invoices-head {
    flex-direction: column;
    align-items: stretch;
  }
  .ipos-shift-invoices-head input {
    max-width: none;
  }
}

.ipos-content.ipos-c04-view { min-height: 0; overflow: hidden; }
.ipos-c04-view .ipos-filter-bar { flex: 0 0 auto; }
.ipos-c04-feed { flex: 1 1 0; height: 0; min-height: 0; overflow: auto; padding: 0 2px 16px; overscroll-behavior: contain; }
.ipos-c04-log { margin-bottom: 12px; border: 1px solid var(--ipos-border); border-radius: 5px; background: #fff; }
.ipos-c04-log > header { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--ipos-border-subtle); background: #f4f6f8; }
.ipos-c04-log > header strong { color: var(--ipos-brand); }
.ipos-c04-log > header span,.ipos-c04-log-meta,.ipos-c04-log-items time { color: var(--ipos-text-muted); font-size: 12px; }
.ipos-c04-log-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 8px 14px; }
.ipos-c04-log-action { display: flex; align-items: center; gap: 10px; padding: 0 14px 8px; font-size: 12px; }
.ipos-c04-log-items > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, auto) 48px; gap: 12px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--ipos-border-subtle); }
.ipos-c04-log-items strong { text-align: right; }
.ipos-c04-log-empty { margin: 0; padding: 10px 14px; border-top: 1px solid var(--ipos-border-subtle); color: var(--ipos-text-muted); font-size: 12px; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .ipos-shift-detail-grid { grid-template-columns: 1fr; }
}

/* Dual Calendar Date Picker Popover */
.ipos-datepicker-modal {
  background: #ffffff;
  border-radius: 8px;
  width: 100%;
  max-width: 680px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ipos-datepicker-layout {
  display: flex;
  border-bottom: 1px solid var(--ipos-border-subtle);
}

.ipos-datepicker-presets {
  width: 140px;
  border-right: 1px solid var(--ipos-border-subtle);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #f8fafc;
}
.ipos-preset-btn {
  background: transparent;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--ipos-text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.ipos-preset-btn:hover {
  background: #e2e8f0;
  color: var(--ipos-text-dark);
}
.ipos-preset-btn.active {
  background: var(--ipos-brand-light);
  color: var(--ipos-brand);
  font-weight: 600;
}

.ipos-datepicker-calendars {
  flex: 1;
  padding: 16px;
  display: flex;
  gap: 20px;
}

.ipos-calendar-box {
  flex: 1;
}
.ipos-calendar-title {
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 10px;
}
.ipos-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.ipos-cal-day-header {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  padding: 4px 0;
}
.ipos-cal-day-btn {
  background: transparent;
  border: none;
  height: 32px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--ipos-text-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
}
.ipos-cal-day-btn:hover {
  background: #f1f5f9;
}
.ipos-cal-day-btn.selected {
  background: var(--ipos-brand) !important;
  color: #fff !important;
  font-weight: 600;
}
.ipos-cal-day-btn.in-range {
  background: var(--ipos-brand-light);
  border-radius: 0;
}

.ipos-datepicker-footer {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 1024px) {
  .ipos-chart-grid-2 {
    grid-template-columns: 1fr;
  }
  .ipos-kpi-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .ipos-sidebar {
    position: fixed;
    top: 60px;
    bottom: 0;
    left: -330px;
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
    max-height: calc(100dvh - 60px);
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    z-index: 1100;
  }
  .ipos-sidebar.open {
    transform: translateX(330px);
  }
  .ipos-sidebar-backdrop {
    z-index: 1050;
    touch-action: none;
    overscroll-behavior: contain;
  }
  body.ipos-drawer-open,
  body.ipos-drawer-open .ipos-content,
  .ipos-container.ipos-drawer-open .ipos-content {
    overflow: hidden !important;
    touch-action: none;
  }
  .ipos-topbar {
    padding: 0 12px;
    gap: 8px;
  }
  .ipos-topbar-left {
    min-width: 0;
    flex: 1;
    gap: 8px;
  }
  .ipos-topbar-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .ipos-quick-search,
  .ipos-topbar-center,
  .ipos-topbar-right {
    display: none;
  }
  .ipos-content {
    padding: 14px 16px;
  }
  .ipos-kpi-grid-2,
  .ipos-kpi-grid-3 {
    grid-template-columns: 1fr;
  }
  .ipos-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .ipos-filter-left {
    flex-direction: column;
    align-items: stretch;
  }
  .ipos-filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .ipos-filter-actions .ipos-filter-btn {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    justify-content: center;
  }
  .ipos-branch-context {
    width: 100%;
    min-height: 46px;
    font-size: 13px;
  }
  .ipos-branch-context strong {
    font-size: 14px;
  }
  .ipos-filter-date-btn {
    width: 100%;
    min-height: 46px;
  }
  .ipos-datepicker-calendars {
    flex-direction: column;
  }
  .ipos-datepicker-layout {
    flex-direction: column;
  }
  .ipos-datepicker-presets {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--ipos-border-subtle);
  }
}

@media (max-width: 480px) {
  .ipos-topbar {
    height: 64px;
    min-height: 64px;
    padding: 0 14px;
  }

  .ipos-topbar-left {
    gap: 10px;
  }

  .ipos-hamburger-btn {
    min-width: 50px;
    min-height: 50px;
    padding: 8px 11px;
    font-size: 22px;
  }

  .ipos-topbar-title {
    max-width: calc(100vw - 92px);
    font-size: 18px;
    line-height: 1.3;
  }

  .ipos-content {
    padding: 16px 14px calc(88px + env(safe-area-inset-bottom, 0px));
  }

  .ipos-filter-bar {
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
  }

  .ipos-filter-left {
    gap: 8px;
  }

  .ipos-branch-context {
    min-height: 48px;
    padding: 0 14px;
    font-size: 15px;
    border-radius: 7px;
  }

  .ipos-branch-context strong {
    font-size: 17px;
  }

  .ipos-filter-date-btn,
  .ipos-filter-select,
  .ipos-filter-input,
  .ipos-filter-btn {
    width: 100%;
    min-height: 48px;
    height: 48px;
    padding: 0 12px;
    border-radius: 7px;
    font-size: 16px;
  }

  .ipos-filter-actions .ipos-filter-btn {
    padding: 0 8px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
  }

  .ipos-hero-banner {
    padding: 24px 20px;
    margin-bottom: 20px;
    border-radius: 12px;
  }

  .ipos-hero-title {
    font-size: 17px;
  }

  .ipos-hero-amount {
    font-size: clamp(40px, 11.5vw, 46px);
    line-height: 1.08;
  }

  .ipos-hero-badges {
    gap: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
  }

  .ipos-kpi-grid {
    gap: 14px;
    margin-bottom: 20px;
  }

  .ipos-card {
    border-radius: 8px;
  }

  .ipos-card-header {
    padding: 14px 16px;
    font-size: 16px;
  }

  .ipos-card-body {
    padding: 22px 18px;
  }

  .ipos-card-value {
    font-size: 34px;
  }

  .ipos-card-sub {
    font-size: 14px;
    line-height: 1.5;
  }

  .ipos-chart-section {
    padding: 16px;
  }

  .ipos-chart-title {
    font-size: 17px;
  }

  .ipos-table {
    font-size: 15px;
  }

  .ipos-table th,
  .ipos-table td {
    padding: 13px 14px;
  }

  .ipos-table-footer {
    font-size: 15px;
  }

  .ipos-menu-group-header {
    min-height: 52px;
    font-size: 17px;
  }

  .ipos-submenu-item {
    min-height: 50px;
    font-size: 16px;
  }
  .ipos-shift-detail-head { grid-template-columns: 1fr 1fr; }
  .ipos-shift-detail-head h2 { grid-column: 1 / -1; grid-row: 1; font-size: 18px; }
  .ipos-shift-detail-head > button { width: 100%; }
  .ipos-shift-detail-grid { grid-template-columns: 1fr; }
  .ipos-shift-invoices-head { align-items: stretch; flex-direction: column; }
  .ipos-shift-invoices-head input { max-width: none; }
  .ipos-c04-view .ipos-filter-bar { max-height: 42%; overflow-y: auto; }
  .ipos-c04-log > header { align-items: flex-start; flex-direction: column; gap: 4px; }
  .ipos-c04-log-items > div { grid-template-columns: minmax(0, 1fr) 44px; gap: 4px 10px; }
  .ipos-c04-log-items time { grid-column: 1; grid-row: 2; }
  .ipos-c04-log-items strong { grid-column: 2; grid-row: 1 / span 2; }
}
/* Manager invoice actions remain reachable on narrow screens. */
.ipos-invoice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.ipos-invoice-actions .ipos-filter-btn {
  height: auto;
  min-height: 48px;
  white-space: normal;
}
.ipos-invoice-actions [data-invoice-delete] { color: #b91c1c; }
