/**
 * Cheapito 2TI Suite UI — Design System
 * Engineered according to 2TITHEME specifications.
 * Enforcing light/dark theme invariance, mathematical alignments, bottom-pinned actions, and spatial agency aesthetics.
 */

:root {
  /* 2TI Signature Dark Theme (Default) */
  --base: #0f172a;
  --base-card: rgba(15, 23, 42, 0.85);
  --bg-color: #080d1a;
  --panel-bg: rgba(22, 32, 54, 0.7);
  --panel-hover: rgba(30, 45, 74, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-light: rgba(255, 255, 255, 0.14);
  --border-active: rgba(56, 189, 248, 0.45);

  /* Primary Brand & Accents */
  --brand: #38bdf8;
  --primary-600: #0284c7;
  --accent-cyan: #38bdf8;
  --accent-amber: #f59e0b;
  --accent-amber-light: #fef3c7;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;

  /* Typography Colors */
  --text-primary-light: #f8fafc;
  --text-secondary-light: #94a3b8;
  --text-muted: #64748b;

  /* Semantic Tints */
  --primary-focus: rgba(56, 189, 248, 0.12);
  --success-focus: rgba(16, 185, 129, 0.12);
  --warning-focus: rgba(245, 158, 11, 0.15);
  --danger-focus: rgba(244, 63, 94, 0.15);
  --info-focus: rgba(56, 189, 248, 0.12);

  /* Spacing & Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  /* Transitions */
  --transition-fast: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  /* 2TI Pristine Light Theme */
  --base: #ffffff;
  --base-card: #ffffff;
  --bg-color: #f8fafc;
  --panel-bg: #f1f5f9;
  --panel-hover: #e2e8f0;
  --border-color: rgba(15, 23, 42, 0.08);
  --border-subtle: rgba(15, 23, 42, 0.04);
  --border-light: rgba(15, 23, 42, 0.14);
  --border-active: rgba(2, 132, 199, 0.5);

  --text-primary-light: #0f172a;
  --text-secondary-light: #475569;
  --text-muted: #64748b;

  --primary-focus: rgba(2, 132, 199, 0.08);
  --success-focus: rgba(16, 185, 129, 0.08);
  --warning-focus: rgba(245, 158, 11, 0.1);
  --danger-focus: rgba(244, 63, 94, 0.1);
  --info-focus: rgba(2, 132, 199, 0.08);
}

/* Global Resets & Typography */
body {
  background-color: var(--bg-color);
  color: var(--text-primary-light);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

/* Dashboard Layout Structure */
.dashboard-main {
  min-height: 100vh;
  background-color: var(--bg-color);
  transition: var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.dashboard-main-body {
  padding: 24px 32px 36px;
  flex: 1 0 auto;
}

@media (max-width: 768px) {
  .dashboard-main-body {
    padding: 16px 14px 28px;
  }
}

/* Card Architecture */
.suite-card {
  background: var(--base-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px -2px rgba(0, 0, 0, 0.25);
  transition: var(--transition-fast);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

[data-theme="light"] .suite-card {
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.05);
}

.suite-card:hover {
  border-color: var(--border-light);
  box-shadow: 0 10px 32px -4px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .suite-card:hover {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.suite-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.suite-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Bottom Pinned Actions */
.card-action-bottom {
  margin-top: auto !important;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Metric KPI Cards */
.kpi-card {
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background: var(--base-card);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-height: 140px;
  transition: var(--transition-fast);
  box-shadow: 0 4px 18px -2px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .kpi-card {
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), transparent);
  opacity: 0.8;
}

.kpi-card.kpi-amber::before {
  background: linear-gradient(90deg, var(--accent-amber), transparent);
}

.kpi-card.kpi-emerald::before {
  background: linear-gradient(90deg, var(--accent-emerald), transparent);
}

.kpi-card.kpi-rose::before {
  background: linear-gradient(90deg, var(--accent-rose), transparent);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-active);
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-primary-light);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}

/* Badges & Pills */
.badge-suite-cyan {
  background: var(--primary-focus);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-suite-amber {
  background: var(--warning-focus);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-suite-emerald {
  background: var(--success-focus);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-suite-rose {
  background: var(--danger-focus);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Live Pulse Indicators */
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  display: inline-block;
  position: relative;
  flex-shrink: 0;
}

.live-dot::after {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-emerald);
  animation: pulse-ring 1.8s infinite;
}

.live-dot-amber {
  background: var(--accent-amber);
}

.live-dot-amber::after {
  border-color: var(--accent-amber);
}

.live-dot-rose {
  background: var(--accent-rose);
}

.live-dot-rose::after {
  border-color: var(--accent-rose);
}

@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 0.95; }
  100% { transform: scale(2.3); opacity: 0; }
}

/* Operations Hub 3-Column Grid */
.ops-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

@media (max-width: 1024px) {
  .ops-grid {
    grid-template-columns: 1fr;
  }
}

.ops-column {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.ops-card {
  background: var(--base-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: var(--transition-fast);
  position: relative;
  display: flex;
  flex-direction: column;
}

.ops-card:hover {
  border-color: var(--border-active);
  background: var(--panel-hover);
}

.ops-card.alert-card {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.06);
  animation: glow-pulse 2.2s infinite alternate;
}

@keyframes glow-pulse {
  0% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.15); }
  100% { box-shadow: 0 0 24px rgba(245, 158, 11, 0.4); }
}

/* Progress Bars */
.suite-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 8px;
}

[data-theme="light"] .suite-progress {
  background: rgba(15, 23, 42, 0.08);
}

.suite-progress-bar {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

/* Sidebar Modern Styling */
.sidebar {
  background: #090d16 !important;
  border-right: 1px solid var(--border-color) !important;
}

[data-theme="light"] .sidebar {
  background: #ffffff !important;
  border-right: 1px solid rgba(15, 23, 42, 0.08) !important;
}

[data-theme="light"] .sidebar-menu li a {
  color: #475569;
}

[data-theme="light"] .sidebar-menu li a:hover,
[data-theme="light"] .sidebar-menu li a.active {
  color: #0284c7;
  background: rgba(2, 132, 199, 0.08);
  border-left: 3px solid #0284c7;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
}

.sidebar-menu li a {
  color: var(--text-secondary-light);
  font-weight: 500;
  border-radius: var(--radius-md);
  margin: 3px 14px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition-fast);
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
  color: #ffffff;
  background: rgba(56, 189, 248, 0.12);
  border-left: 3px solid var(--accent-cyan);
}

.sidebar-menu-group-title {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 16px 24px 6px;
}

/* ==========================================================================
   Retractable / Compact Sidebar (Max Workspace for Tellers & Busy Cashiers)
   ========================================================================== */
.sidebar {
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-main {
  transition: margin-left 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.active {
  width: 76px !important;
}

.dashboard-main.active {
  margin-left: 76px !important;
}

.sidebar.active .sidebar-logo > div,
.sidebar.active .sidebar-menu-group-title,
.sidebar.active .sidebar-menu li a span,
.sidebar.active .sidebar-menu li a .badge,
.sidebar.active .sidebar-menu li a iconify-icon:last-child {
  display: none !important;
}

.sidebar.active .sidebar-logo {
  padding: 16px 8px;
  justify-content: center;
}

.sidebar.active .sidebar-menu li a {
  justify-content: center;
  padding: 12px 0;
  margin: 4px 8px;
}

.sidebar.active .sidebar-menu li a .menu-icon {
  font-size: 22px;
  margin: 0 !important;
}

/* Hover expansion on retracted mode for quick navigation */
.sidebar.active:hover {
  width: 260px !important;
  box-shadow: 12px 0 30px rgba(0, 0, 0, 0.6);
  z-index: 1060;
}

.sidebar.active:hover .sidebar-logo > div,
.sidebar.active:hover .sidebar-menu-group-title,
.sidebar.active:hover .sidebar-menu li a span,
.sidebar.active:hover .sidebar-menu li a .badge,
.sidebar.active:hover .sidebar-menu li a iconify-icon:last-child {
  display: flex !important;
}

.sidebar.active:hover .sidebar-logo {
  justify-content: flex-start;
  padding: 18px 24px;
}

.sidebar.active:hover .sidebar-menu li a {
  justify-content: flex-start;
  padding: 10px 16px;
  margin: 3px 14px;
}

.sidebar.active:hover .sidebar-menu li a .menu-icon {
  font-size: 18px;
  margin-inline-end: 8px !important;
}

/* Universal Dark Theme Font Lightener & High Contrast */
[data-theme="dark"] .text-dark,
[data-theme="dark"] .text-black,
[data-theme="dark"] .text-body {
  color: #f8fafc !important;
}

[data-theme="dark"] .text-muted {
  color: #94a3b8 !important;
}

[data-theme="dark"] .text-secondary {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .text-secondary-light {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .bg-white {
  background-color: var(--base-card) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .bg-light {
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .card {
  background-color: var(--base-card);
  border-color: var(--border-color);
  color: #f8fafc;
}

[data-theme="dark"] .table {
  color: #f1f5f9;
  border-color: var(--border-subtle);
}

[data-theme="dark"] .table th {
  color: #94a3b8;
  background-color: rgba(15, 23, 42, 0.7);
  border-bottom-color: var(--border-subtle);
}

[data-theme="dark"] .table td {
  color: #f1f5f9;
  border-bottom-color: var(--border-subtle);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background-color: #0b1329 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
  background-color: #0f1c3d !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
}

[data-theme="dark"] .form-label,
[data-theme="dark"] label {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .form-text {
  color: #94a3b8 !important;
}

/* Button Hierarchy (Dark & Light Invariance) */
.btn-suite-primary {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: #04101e !important;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}

.btn-suite-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.45);
  color: #000 !important;
}

.btn-suite-ghost {
  background: transparent;
  color: var(--text-secondary-light) !important;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 9px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
}

.btn-suite-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary-light) !important;
  border-color: var(--border-light);
}

[data-theme="light"] .btn-suite-ghost:hover {
  background: rgba(15, 23, 42, 0.05);
}

.btn-suite-amber {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000000 !important;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}

.btn-suite-amber:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}

.btn-suite-emerald {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff !important;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.btn-suite-emerald:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-suite-purple {
  background: linear-gradient(135deg, #a855f7, #7e22ce);
  color: #ffffff !important;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.25);
}

.btn-suite-purple:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.45);
}

/* ==========================================================================
   Mobile Bottom Navigation Bar (Smartphones & Tablets for Retailers)
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(9, 13, 22, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    z-index: 1050;
    align-items: center;
    justify-content: space-around;
    padding: 0 4px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.45);
  }

  [data-theme="light"] .mobile-bottom-nav {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -2px 14px rgba(15, 23, 42, 0.08);
  }

  .mobile-bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-secondary-light);
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    flex: 1;
    height: 100%;
    padding: 6px 0;
    transition: var(--transition-fast);
    touch-action: manipulation;
  }

  .mobile-bottom-item.active,
  .mobile-bottom-item:hover {
    color: var(--brand);
  }

  .mobile-bottom-item iconify-icon {
    font-size: 22px;
  }

  body {
    padding-bottom: 74px;
  }
}

/* ==========================================================================
   TV / HDMI / Raspberry Pi / Mini-PC High-Contrast Kiosk Mode
   ========================================================================== */
.kiosk-fullscreen header {
  padding: 16px 28px !important;
}

.kiosk-fullscreen .ticket-head .order-no {
  font-size: 34px !important;
}

.kiosk-fullscreen .items {
  font-size: 18px !important;
}

.kiosk-fullscreen .actions button {
  padding: 13px 14px !important;
  font-size: 15px !important;
}

/* ==========================================================================
   Supermarket / Retail Item Checklists & Shelf Tags
   ========================================================================== */
.item-check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  user-select: none;
  transition: var(--transition-fast);
}

.item-check-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.item-check-row.picked {
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1px solid rgba(16, 185, 129, 0.3);
  text-decoration: line-through;
  opacity: 0.7;
}

.item-shelf-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

