/* ============================================================
   InvenTrack Pro — Metro Design System
   Flat, bold, restrained palette. No gradients. Minimal shadow.
   Primary: #0078D4  Secondary: #00B4D8  Accent: #FF8C00
   ============================================================ */

:root {
  --primary:       #0078D4;
  --primary-dark:  #005A9E;
  --primary-light: #C7E0F4;
  --secondary:     #00B4D8;
  --accent:        #FF8C00;
  --danger:        #D13438;
  --success:       #107C10;
  --warning:       #FF8C00;
  --info:          #0078D4;

  --bg:            #F3F2F1;
  --surface:       #FFFFFF;
  --surface-2:     #FAFAFA;
  --border:        #EDEBE9;
  --border-strong: #C8C6C4;

  --text:          #201F1E;
  --text-secondary:#605E5C;
  --text-muted:    #A19F9D;
  --text-inverse:  #FFFFFF;

  --sidebar-bg:    #1B1B3A;
  --sidebar-text:  #C8D0E0;
  --sidebar-hover: #252550;
  --sidebar-active:#0078D4;
  --sidebar-width: 260px;

  --topbar-height: 56px;
  --radius:        2px;   /* Metro: very subtle rounding */
  --radius-lg:     4px;
  --shadow-tile:   0 1px 3px rgba(0,0,0,.10);
  --transition:    0.15s ease;

  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Cascadia Code', 'Consolas', monospace;
}

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

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ---- Typography ---- */
h1 { font-size: 2rem;   font-weight: 300; letter-spacing: -0.5px; }
h2 { font-size: 1.5rem; font-weight: 400; }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: 1rem;   font-weight: 600; }
h5 { font-size: .875rem;font-weight: 600; }

.text-primary   { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-danger    { color: var(--danger); }
.text-success   { color: var(--success); }
.text-warning   { color: var(--warning); }
.text-muted     { color: var(--text-muted); }
.text-bold      { font-weight: 700; }
.text-sm        { font-size: .8rem; }
.text-lg        { font-size: 1.15rem; }
.text-xl        { font-size: 1.5rem; }
.text-2xl       { font-size: 2rem; }
.text-center    { text-align: center; }
.text-right     { text-align: right; }

/* ---- Layout Shell ---- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.sidebar-brand-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #fff; font-weight: 700;
}
.sidebar-brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.sidebar-brand-sub {
  font-size: .7rem;
  color: var(--sidebar-text);
  opacity: .7;
}

.sidebar-nav { flex: 1; padding: 12px 0; }

.sidebar-section {
  padding: 12px 24px 4px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  color: var(--sidebar-text);
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--secondary);
}
.nav-item .nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 34px; height: 34px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .85rem;
  flex-shrink: 0;
}
.user-name  { font-size: .85rem; font-weight: 600; color: #fff; }
.user-role  { font-size: .7rem; color: var(--sidebar-text); opacity: .7; }

/* ---- Top Bar ---- */
.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-title { font-size: 1.1rem; font-weight: 600; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ---- Main Content ---- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.page-body {
  flex: 1;
  padding: 24px;
}

/* ---- Page Header ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h1 { font-size: 1.6rem; font-weight: 300; }

/* ---- Metro Tiles / KPI Cards ---- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
  position: relative;
  overflow: hidden;
  cursor: default;
  transition: box-shadow var(--transition);
}
.tile:hover { box-shadow: var(--shadow-tile); }
.tile-accent {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
}
.tile-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
  opacity: .85;
}
.tile-value {
  font-size: 1.8rem;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -1px;
  color: var(--text);
}
.tile-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.tile-sub { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }

/* Tile colour variants */
.tile-primary   .tile-accent { background: var(--primary); }
.tile-secondary .tile-accent { background: var(--secondary); }
.tile-success   .tile-accent { background: var(--success); }
.tile-warning   .tile-accent { background: var(--warning); }
.tile-danger    .tile-accent { background: var(--danger); }

/* ---- Cards / Panels ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.card-title { font-size: 1rem; font-weight: 600; }
.card-body  { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th {
  background: var(--bg);
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text-secondary);
  padding: 10px 16px;
  text-align: left;
  border-bottom: 2px solid var(--border-strong);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:hover { background: var(--bg); }
tbody td { padding: 10px 16px; vertical-align: middle; }
tbody tr:last-child { border-bottom: none; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background var(--transition), opacity var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:hover { text-decoration: none; }

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

.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { opacity: .85; }

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

.btn-danger    { background: var(--danger);    color: #fff; }
.btn-danger:hover { opacity: .85; }

.btn-success   { background: var(--success);   color: #fff; }
.btn-success:hover { opacity: .85; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-strong);
  color: var(--text);
}
.btn-outline:hover { background: var(--bg); }

.btn-ghost  { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-light); }

.btn-sm { padding: 5px 10px; font-size: .78rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-icon { padding: 8px; aspect-ratio: 1; }
.btn-block { width: 100%; justify-content: center; }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-control {
  display: block;
  width: 100%;
  padding: 9px 12px;
  font-size: .875rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition);
}
.form-control:focus { border-color: var(--primary); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 90px; }

.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23605E5C' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check input[type=checkbox], .form-check input[type=radio] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

.form-hint { font-size: .72rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: .72rem; color: var(--danger); margin-top: 4px; }
.input-group { display: flex; }
.input-group .form-control { border-radius: var(--radius) 0 0 var(--radius); }
.input-group .btn { border-radius: 0 var(--radius) var(--radius) 0; }
.input-addon {
  display: flex; align-items: center; padding: 0 12px;
  background: var(--bg); border: 1.5px solid var(--border-strong);
  border-right: none; font-size: .875rem; color: var(--text-secondary);
}

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: .7rem;
  font-weight: 700;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.badge-primary   { background: var(--primary-light); color: var(--primary-dark); }
.badge-success   { background: #DFF6DD; color: #107C10; }
.badge-warning   { background: #FFF4CE; color: #7A5200; }
.badge-danger    { background: #FDE7E9; color: #B10E1E; }
.badge-secondary { background: #E1F5FE; color: #0277BD; }
.badge-muted     { background: var(--bg); color: var(--text-secondary); }

/* ---- Alerts / Flash ---- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-left: 4px solid;
  margin-bottom: 16px;
  font-size: .875rem;
}
.alert-success { background: #DFF6DD; border-color: var(--success); color: #0D6B0D; }
.alert-error,
.alert-danger  { background: #FDE7E9; border-color: var(--danger);  color: #A80000; }
.alert-warning { background: #FFF4CE; border-color: var(--warning); color: #7A5200; }
.alert-info    { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }
.alert-dismiss { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 1rem; opacity: .6; }
.alert-dismiss:hover { opacity: 1; }

/* ---- Status Indicators ---- */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot-success  { background: var(--success); }
.status-dot-warning  { background: var(--warning); }
.status-dot-danger   { background: var(--danger); }
.status-dot-muted    { background: var(--text-muted); }

/* ---- Online/Offline Banner ---- */
.connectivity-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 24px;
  font-size: .75rem;
  font-weight: 600;
  transition: all var(--transition);
}
.connectivity-bar.online  { background: var(--success); color: #fff; }
.connectivity-bar.offline { background: var(--danger);  color: #fff; }
.connectivity-bar.syncing { background: var(--accent);  color: #fff; }
.connectivity-bar .pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.7);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(.8); }
}

/* ---- Pagination ---- */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.page-link {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  font-size: .8rem; font-weight: 600;
  border: 1.5px solid var(--border-strong);
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition);
}
.page-link:hover { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-link.disabled { opacity: .4; cursor: default; pointer-events: none; }

/* ---- Search Box ---- */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box .form-control { padding-left: 36px; }
.search-box .search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: .85rem;
  pointer-events: none;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal {
  background: var(--surface);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 1.2rem; color: var(--text-muted); padding: 4px; }
.modal-body    { padding: 20px; }
.modal-footer  { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ---- Dropdown ---- */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  z-index: 300;
  display: none;
}
.dropdown-menu.show { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  font-size: .875rem;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
}
.dropdown-item:hover { background: var(--bg); text-decoration: none; }
.dropdown-divider { border: none; border-top: 1px solid var(--border); margin: 4px 0; }

/* ---- Progress Bar ---- */
.progress { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s ease; }
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger  { background: var(--danger); }

/* ---- Chart Containers ---- */
.chart-container { position: relative; width: 100%; }
.chart-container canvas { width: 100% !important; }

/* ---- POS Specific ---- */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  height: calc(100vh - var(--topbar-height) - 48px);
}
.pos-products { overflow-y: auto; }
.pos-cart     { display: flex; flex-direction: column; }
.pos-cart-items { flex: 1; overflow-y: auto; }
.pos-cart-footer { flex-shrink: 0; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.product-tile {
  background: var(--surface);
  border: 1.5px solid var(--border);
  padding: 12px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  text-align: center;
}
.product-tile:hover { border-color: var(--primary); box-shadow: var(--shadow-tile); }
.product-tile img { width: 60px; height: 60px; object-fit: cover; margin: 0 auto 8px; border-radius: var(--radius); }
.product-tile-name  { font-size: .78rem; font-weight: 600; margin-bottom: 4px; }
.product-tile-price { font-size: .9rem; font-weight: 700; color: var(--primary); }
.product-tile-stock { font-size: .7rem; color: var(--text-muted); }

/* ---- Category Filter Chips (POS) ---- */
.category-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cat-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
}
.cat-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.cat-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.cart-item-name { flex: 1; font-size: .83rem; font-weight: 600; }
.cart-qty-ctrl  { display: flex; align-items: center; gap: 4px; }
.cart-qty-btn   { background: var(--bg); border: 1px solid var(--border-strong); width: 26px; height: 26px; cursor: pointer; font-size: .9rem; display: flex; align-items: center; justify-content: center; }
.cart-qty-input { width: 40px; text-align: center; border: 1px solid var(--border-strong); padding: 4px; font-size: .83rem; }
.cart-item-total { font-weight: 700; font-size: .85rem; min-width: 60px; text-align: right; }
.cart-remove    { background: none; border: none; color: var(--danger); cursor: pointer; opacity: .7; }
.cart-remove:hover { opacity: 1; }

/* ---- Store / E-commerce ---- */
.store-hero {
  background: var(--primary);
  color: #fff;
  padding: 48px 24px;
  text-align: center;
}
.store-hero h1 { font-size: 2.5rem; font-weight: 700; }
.store-hero p  { font-size: 1.1rem; opacity: .85; margin-top: 8px; }

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  transition: box-shadow var(--transition);
  cursor: pointer;
}
.product-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); text-decoration: none; }
.product-card img   { width: 100%; aspect-ratio: 1; object-fit: cover; }
.product-card-body  { padding: 14px; }
.product-card-name  { font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.product-card-price { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.product-card-cat   { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.product-grid-store { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

/* Order Timeline */
.timeline { padding: 8px 0; }
.timeline-item {
  display: flex;
  gap: 16px;
  padding-bottom: 16px;
  position: relative;
}
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 10px; top: 20px; bottom: 0;
  width: 2px;
  background: var(--border-strong);
}
.timeline-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem; color: #fff;
  position: relative; z-index: 1;
}
.timeline-content { flex: 1; }
.timeline-title { font-weight: 600; font-size: .875rem; }
.timeline-time  { font-size: .72rem; color: var(--text-muted); }
.timeline-note  { font-size: .8rem; color: var(--text-secondary); margin-top: 2px; }

/* ---- Utility Classes ---- */
.d-flex   { display: flex; }
.d-grid   { display: grid; }
.d-none   { display: none; }
.d-block  { display: block; }
.gap-1    { gap: 4px; }
.gap-2    { gap: 8px; }
.gap-3    { gap: 12px; }
.gap-4    { gap: 16px; }
.gap-6    { gap: 24px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.flex-1   { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.mt-1     { margin-top: 4px; }
.mt-2     { margin-top: 8px; }
.mt-3     { margin-top: 12px; }
.mt-4     { margin-top: 16px; }
.mt-6     { margin-top: 24px; }
.mb-1     { margin-bottom: 4px; }
.mb-2     { margin-bottom: 8px; }
.mb-3     { margin-bottom: 12px; }
.mb-4     { margin-bottom: 16px; }
.mb-6     { margin-bottom: 24px; }
.p-0      { padding: 0; }
.p-3      { padding: 12px; }
.p-4      { padding: 16px; }
.p-6      { padding: 24px; }
.w-100    { width: 100%; }
.rounded  { border-radius: var(--radius); }
.shadow   { box-shadow: var(--shadow-tile); }
.overflow-hidden { overflow: hidden; }
.position-relative { position: relative; }

/* ---- Responsive: Tablet / Mobile ---- */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .pos-layout { grid-template-columns: 1fr; height: auto; }
}

@media (max-width: 640px) {
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
  .page-body { padding: 16px; }
  h1 { font-size: 1.4rem; }
  .product-grid-store { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 0 16px; }
}

/* ---- Print / PDF ---- */
@media print {
  .sidebar, .topbar, .btn, .no-print { display: none !important; }
  .main-content { margin-left: 0; }
  body { background: #fff; }
  table { font-size: 11px; }
}

/* ---- Loading Spinner ---- */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Notification Toast ---- */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 320px;
}
.toast {
  background: var(--text);
  color: #fff;
  padding: 12px 16px;
  font-size: .875rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  animation: slideIn .2s ease;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--text); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
