@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   MOBILE POS - MAIN STYLESHEET
   ============================================================ */

/* --- Design Tokens --- */
:root {
  --primary: #0f172a;
  --primary-800: #1e293b;
  --primary-700: #334155;
  --primary-600: #475569;
  --accent: #38bdf8;
  --accent-hover: #0284c7;
  --accent-light: rgba(56, 189, 248, 0.15);
  --success: #22c55e;
  --success-light: rgba(34, 197, 94, 0.15);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.15);
  --bg: #0b0f19;
  --bg-white: #111827;
  --border: #1f293d;
  --border-dark: #374151;
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --text-light: #6b7280;
  --sidebar-w: 260px;
  --topbar-h: 60px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
  --transition: 0.2s ease;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

a {
  text-decoration: none;
  color: var(--accent);
}

a:hover {
  color: var(--accent-hover);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-dark);
  border-radius: 10px;
}

/* ============================================================
   LAYOUT
   ============================================================ */

body.app-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.app-header {
  background: #0f172a !important;
  /* Slate 900 Dark Header */
  border-bottom: 1px solid #1e293b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 6px 0;
}

.app-header .brand-title {
  color: #38bdf8 !important;
  font-size: 1.1rem;
}

.app-header .brand-subtitle {
  color: #94a3b8 !important;
  font-size: 0.72rem;
}

.app-header .brand-icon {
  width: 36px;
  height: 36px;
  background: #0284c7;
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.app-header .nav-link {
  color: #cbd5e1 !important;
  font-weight: 500;
  font-size: 0.86rem;
  padding: 8px 12px !important;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.app-header .nav-link:hover,
.app-header .nav-link.active {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1);
}

.app-header .nav-pos-btn {
  background: #0284c7 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  padding: 8px 16px !important;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4);
}

.app-header .nav-pos-btn:hover {
  background: #0369a1 !important;
}

.app-header .dropdown-menu {
  background: #1e293b;
  border: 1px solid #334155;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.app-header .dropdown-item {
  color: #e2e8f0;
  font-size: 0.85rem;
  padding: 8px 16px;
}

.app-header .dropdown-item:hover {
  background: #334155;
  color: #ffffff;
}

.app-header .dropdown-divider {
  border-color: #334155;
}

.avatar-circle {
  width: 28px;
  height: 28px;
  background: #0284c7;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.content-area {
  flex: 1;
  width: 100%;
  padding: 24px;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--primary);
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  z-index: 1000;

  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-header {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
}

.shop-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.shop-logo-icon {
  width: 44px;
  height: 44px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  flex-shrink: 0;
}

.shop-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  line-height: 1.2;
}

.shop-sub {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
}

.sidebar-body {
  flex: 1;
  padding: 8px 0;
}

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-section {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.3);
  padding: 16px 20px 4px;
  text-transform: uppercase;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 20px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.855rem;
  font-weight: 500;
  transition: all var(--transition);
  border-radius: 0;
  position: relative;
}

.nav-item a i {
  font-size: 1.05rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item.active>a {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.nav-item.active>a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: #fff;
  border-radius: 0 3px 3px 0;
}

/* --- Main Wrapper --- */
.main-wrapper {
  margin-left: 0 !important;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- Topbar --- */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.sidebar-toggle:hover {
  background: var(--bg);
}

.topbar-title {
  flex: 1;
}

.page-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.topbar-license {
  margin-right: 8px;
}

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

.user-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all var(--transition);
}

.user-btn:hover {
  background: var(--bg);
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--accent-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--accent);
}

.user-name {
  font-weight: 600;
  font-size: 0.82rem;
  line-height: 1.2;
}

.user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* --- Content Area --- */
.content-area {
  flex: 1;
  padding: 24px;
  overflow-x: auto;
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-header h5,
.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
}

.card-body {
  padding: 20px;
}

/* ============================================================
   STAT CARDS (Dashboard)
   ============================================================ */

.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--card-accent, var(--accent));
  border-radius: var(--radius) 0 0 var(--radius);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  background: var(--card-accent-light, var(--accent-light));
  color: var(--card-accent, var(--accent));
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.stat-change {
  font-size: 0.72rem;
  margin-top: 4px;
  color: var(--text-muted);
}

/* ============================================================
   TABLES
   ============================================================ */

.table-responsive {
  overflow-x: auto;
}

.table {
  font-size: 0.84rem;
  margin: 0;
}

.table thead th {
  background: var(--bg);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  padding: 10px 12px;
  white-space: nowrap;
}

.table tbody td {
  padding: 10px 12px;
  vertical-align: middle;
  border-color: var(--border);
}

.table tbody tr:hover {
  background: var(--bg);
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  font-weight: 600;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  padding: 7px 16px;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-success {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-outline-primary {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-outline-primary:hover {
  background: var(--accent);
  color: #fff;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.78rem;
}

.btn-lg {
  padding: 10px 24px;
  font-size: 0.95rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   FORMS
   ============================================================ */

.form-label {
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 4px;
  color: var(--text);
}

.form-control,
.form-select {
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  font-size: 0.855rem;
  padding: 7px 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
  color: var(--text);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

/* ============================================================
   BADGES
   ============================================================ */

.badge {
  font-weight: 600;
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 4px;
}

/* Status Badges */
.badge-in-stock {
  background: var(--success-light);
  color: var(--success);
}

.badge-sold {
  background: var(--accent-light);
  color: var(--accent);
}

.badge-defective {
  background: var(--danger-light);
  color: var(--danger);
}

.badge-returned {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-reserved {
  background: #f3f4f6;
  color: #6b7280;
}

/* ============================================================
   POS SPECIFIC
   ============================================================ */

.pos-wrapper {
  display: flex;
  gap: 0;
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}

.pos-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.pos-right {
  width: 380px;
  flex-shrink: 0;
  background: var(--bg-white);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pos-search-bar {
  padding: 12px 16px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
}

.scanner-input {
  font-size: 1rem;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  border: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
}

.scanner-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.scanner-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
  border-color: #60a5fa;
}

.filter-bar {
  padding: 8px 16px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex-wrap: nowrap;
}

.filter-btn {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-dark);
  background: var(--bg-white);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.products-grid {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 10px;
  align-content: start;
}

.product-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.product-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.product-card.out-of-stock {
  opacity: 0.5;
  cursor: not-allowed;
}

.product-card-img {
  width: 100%;
  height: 80px;
  object-fit: contain;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
}

.product-card-icon {
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text-muted);
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.product-card-name {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 4px;
}

.product-card-price {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent);
}

.product-card-stock {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.product-card .badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.62rem;
}

/* Cart */
.cart-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.cart-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 8px;
  position: relative;
  border: 1px solid var(--border);
}

.cart-item-name {
  font-weight: 600;
  font-size: 0.83rem;
  padding-right: 24px;
  line-height: 1.3;
}

.cart-item-imei {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: monospace;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border-dark);
  background: var(--bg-white);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all var(--transition);
  color: white !important;
}

.qty-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.qty-input {
  width: 44px;
  text-align: center;
  border: 1px solid var(--border-dark);
  border-radius: 4px;
  padding: 2px 4px;
  font-weight: 700;
  font-size: 0.85rem;
}

.remove-item {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 2px;
  font-size: 1rem;
  line-height: 1;
}

.cart-item-total {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.9rem;
}

/* Cart Summary */
.cart-summary {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  background: var(--bg);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.summary-row.total {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 8px;
}

.cart-actions {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.btn-complete-sale {
  width: 100%;
  padding: 12px;
  background: var(--success);
  border-color: var(--success);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-complete-sale:hover {
  background: #15803d;
}

.btn-complete-sale:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   MODALS
   ============================================================ */

.modal-header {
  background: var(--primary);
  color: #fff;
  padding: 14px 20px;
}

.modal-header .btn-close {
  filter: invert(1);
}

.modal-title {
  font-weight: 700;
  font-size: 0.95rem;
}

/* ============================================================
   PAGE HEADERS
   ============================================================ */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
}

/* ============================================================
   INSTALL WIZARD
   ============================================================ */

.install-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-700) 50%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.install-card {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.install-header {
  background: var(--primary);
  color: #fff;
  padding: 28px 32px;
  text-align: center;
}

.install-logo {
  font-size: 3rem;
  margin-bottom: 8px;
}

.install-title {
  font-size: 1.5rem;
  font-weight: 800;
}

.install-sub {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.install-steps {
  display: flex;
  padding: 0 32px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.step-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.step-item.done {
  color: var(--success);
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
}

.step-item.active .step-num {
  background: var(--accent);
  color: #fff;
}

.step-item.done .step-num {
  background: var(--success);
  color: #fff;
}

.install-body {
  padding: 32px;
  background-color: var(--bg);
}

/* ============================================================
   LOGIN
   ============================================================ */

.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, #1e3a5f 50%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-box {
  background: #fff;
  border-radius: 16px;
  width: 440px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.login-header {
  background: var(--primary);
  padding: 36px 32px;
  text-align: center;
}

.login-logo-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

.login-shop-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

.login-tagline {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
}

.login-body {
  padding: 32px;
}

.login-divider {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  position: relative;
  margin: 20px 0;
}

/* ============================================================
   RECEIPT PRINT
   ============================================================ */

@media print {

  .sidebar,
  .topbar,
  .no-print,
  .cart-actions {
    display: none !important;
  }

  .main-wrapper {
    margin-left: 0 !important;
  }

  .content-area {
    padding: 0 !important;
  }

  .receipt-paper {
    max-width: 90mm;
    margin: 0 auto;
    font-size: 12px;
  }
}

.receipt-paper {
  max-width: 80mm;
  margin: 0 auto;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  padding: 10px;
}

.receipt-title {
  text-align: center;
  font-weight: 700;
  font-size: 16px;
}

.receipt-divider {
  border: none;
  border-top: 1px dashed #000;
  margin: 8px 0;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
}

.receipt-total {
  font-weight: 700;
  font-size: 16px;
  border-top: 1px solid #000;
  padding-top: 4px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-left: 0;
  }

  .pos-wrapper {
    flex-direction: column;
    height: auto;
  }

  .pos-right {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

/* ============================================================
   UTILITIES
   ============================================================ */

.text-accent {
  color: var(--accent);
}

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

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

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

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

.fw-800 {
  font-weight: 800;
}

.font-mono {
  font-family: 'Courier New', monospace;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 12px;
  display: block;
  opacity: 0.4;
}

.empty-state h6 {
  font-weight: 700;
  font-size: 0.9rem;
}

/* Loading spinner */
.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Notification toast */
.pos-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  min-width: 280px;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* IMEI Display */
.imei-badge {
  font-family: monospace;
  font-size: 0.76rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--text-muted);
}

.pay-method-btn {
  color: white !important;
}

/* ============================================================
   GLOBAL DARK THEME OVERRIDES
   ============================================================ */

/* Form Inputs & Selects */
.form-control,
.form-select,
.form-check-input {
  background-color: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

.form-control::placeholder {
  color: #64748b !important;
}

.form-control:focus,
.form-select:focus {
  background-color: #1e293b !important;
  color: #ffffff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
}

/* Tables */
.table {
  color: #f8fafc !important;
}

.table thead th {
  background-color: #0f172a !important;
  color: #94a3b8 !important;
  border-bottom: 2px solid #1e293b !important;
}

.table tbody td {
  background-color: #111827 !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

.table tbody tr:hover td {
  background-color: #1e293b !important;
}

/* Cards & Containers */
.card {
  background-color: #111827 !important;
  border: 1px solid #1e293b !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
  color: #f8fafc !important;
}

.card-header {
  border-bottom: 1px solid #1e293b !important;
  color: #f8fafc !important;
  background: transparent !important;
}

.stat-card {
  background-color: #111827 !important;
  border: 1px solid #1e293b !important;
  color: #f8fafc !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

/* Modals */
.modal-content {
  background-color: #111827 !important;
  border: 1px solid #1e293b !important;
  color: #f8fafc !important;
}

.modal-header {
  border-bottom: 1px solid #1e293b !important;
  background-color: #0f172a !important;
}

.modal-footer {
  border-top: 1px solid #1e293b !important;
  background-color: #0f172a !important;
}

/* Dropdowns */
.dropdown-menu {
  background-color: #1e293b !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

.dropdown-item {
  color: #cbd5e1 !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: #334155 !important;
  color: #ffffff !important;
}

.dropdown-divider {
  border-color: #334155 !important;
}

/* Typography & Helpers */
.text-dark {
  color: #f8fafc !important;
}

.text-muted {
  color: #94a3b8 !important;
}

.bg-light {
  background-color: #1e293b !important;
}

.border {
  border-color: #1e293b !important;
}

.border-bottom {
  border-bottom-color: #1e293b !important;
}

/* Alerts */
.alert-info {
  background-color: rgba(56, 189, 248, 0.1) !important;
  border-color: rgba(56, 189, 248, 0.2) !important;
  color: #38bdf8 !important;
}

.alert-success {
  background-color: rgba(34, 197, 94, 0.1) !important;
  border-color: rgba(34, 197, 94, 0.2) !important;
  color: #4ade80 !important;
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.1) !important;
  border-color: rgba(245, 158, 11, 0.2) !important;
  color: #fbbf24 !important;
}

.alert-danger {
  background-color: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
  color: #f87171 !important;
}

/* POS Specific Dark Tweaks */
.pos-right,
.pos-search-bar,
.filter-bar,
.cart-header,
.cart-summary {
  background-color: #111827 !important;
  border-color: #1e293b !important;
}

.product-card {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

.cart-item {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}