/* ============================================================
   KARAM SWEET CRM - Main Stylesheet
   Aesthetic: Warm terracotta & gold - traditional Indian sweets shop
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Tiro+Tamil:ital@0;1&family=Playfair+Display:wght@500;700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --primary:       #c0392b;
  --primary-dark:  #96281b;
  --primary-light: #e74c3c;
  --gold:          #d4a017;
  --gold-light:    #f0c040;
  --cream:         #fdf8f0;
  --cream-dark:    #f5ead6;
  --brown:         #5c3317;
  --brown-light:   #7d4f2a;
  --text-dark:     #2c1a0e;
  --text-mid:      #5a3e28;
  --text-light:    #9a7b60;
  --white:         #ffffff;
  --border:        #e8d5b7;
  --success:       #27ae60;
  --danger:        #e74c3c;
  --warning:       #f39c12;
  --info:          #2980b9;
  --shadow-sm:     0 2px 8px rgba(92,51,23,0.10);
  --shadow:        0 4px 20px rgba(92,51,23,0.15);
  --shadow-lg:     0 8px 40px rgba(92,51,23,0.20);
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     20px;
  --sidebar-w:     260px;
  --header-h:      64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
}

body.lang-ta { font-family: 'Tiro Tamil', 'DM Sans', sans-serif; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--cream-dark); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ===== LAYOUT ===== */
.app-wrapper { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--brown);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  text-align: center;
}
.sidebar-brand .brand-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--gold), var(--primary));
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin: 0 auto 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.sidebar-brand h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.5px;
}
.sidebar-brand small {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.55);
  display: block;
  margin-top: 2px;
}

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

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.35);
  padding: 12px 20px 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  border-radius: 0;
  transition: all 0.2s;
  font-size: 0.88rem;
  border-left: 3px solid transparent;
}
.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: var(--gold-light);
  border-left-color: var(--gold);
}
.nav-item.active {
  background: rgba(212,160,23,0.15);
  color: var(--gold-light);
  border-left-color: var(--gold);
  font-weight: 600;
}
.nav-item .nav-icon { width: 18px; text-align: center; font-size: 0.95rem; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 20px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== TOPBAR ===== */
.topbar {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.topbar-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  font-family: 'Playfair Display', serif;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.lang-toggle {
  display: flex; gap: 4px;
  background: var(--cream-dark);
  padding: 3px;
  border-radius: 8px;
}
.lang-btn {
  padding: 4px 10px;
  border: none; cursor: pointer;
  border-radius: 6px;
  font-size: 0.78rem; font-weight: 600;
  background: transparent;
  color: var(--text-mid);
  transition: all 0.2s;
}
.lang-btn.active {
  background: var(--primary);
  color: #fff;
}
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--text-mid);
}
.topbar-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.85rem;
}
.menu-toggle {
  display: none;
  background: none; border: none;
  font-size: 1.2rem; cursor: pointer;
  color: var(--text-dark);
}

/* ===== PAGE CONTENT ===== */
.page-content { padding: 24px; flex: 1; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--text-dark);
}
.page-header p { font-size: 0.85rem; color: var(--text-light); margin-top: 2px; }

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #fff 60%, var(--cream));
}
.card-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--text-dark);
  font-weight: 600;
}
.card-body { padding: 20px; }

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none; color: inherit;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.stat-icon.red    { background: #fde8e8; color: var(--primary); }
.stat-icon.gold   { background: #fef3cd; color: var(--gold); }
.stat-icon.green  { background: #d4edda; color: var(--success); }
.stat-icon.blue   { background: #cce5ff; color: var(--info); }
.stat-icon.brown  { background: #f0e6d3; color: var(--brown); }
.stat-value {
  font-size: 1.5rem; font-weight: 700;
  color: var(--text-dark); line-height: 1;
}
.stat-label { font-size: 0.78rem; color: var(--text-light); margin-top: 4px; }

/* ===== TABLES ===== */
.table-wrapper { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table thead th {
  background: var(--cream-dark);
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--brown);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.data-table tbody tr:hover { background: #fdf6ec; }
.data-table tbody td {
  padding: 11px 14px;
  color: var(--text-dark);
  vertical-align: middle;
}
.data-table tbody tr:last-child { border-bottom: none; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-success  { background: #d4edda; color: #155724; }
.badge-danger   { background: #f8d7da; color: #721c24; }
.badge-warning  { background: #fff3cd; color: #856404; }
.badge-info     { background: #cce5ff; color: #004085; }
.badge-secondary{ background: #e2e3e5; color: #383d41; }
.badge-gold     { background: #fef3cd; color: #7d5a00; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer; font-size: 0.85rem; font-weight: 500;
  text-decoration: none; font-family: inherit;
  transition: all 0.2s; line-height: 1.4;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary   { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-gold      { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-gold:hover { background: #b8860b; }
.btn-success   { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #219a52; }
.btn-danger    { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #c0392b; }
.btn-outline   { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-light     { background: var(--cream-dark); color: var(--text-dark); border-color: var(--border); }
.btn-light:hover { background: var(--border); }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-icon { padding: 6px; border-radius: 6px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-label {
  display: block; margin-bottom: 6px;
  font-size: 0.82rem; font-weight: 600;
  color: var(--text-mid);
}
.form-label .required { color: var(--danger); margin-left: 3px; }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-dark);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.10);
}
.form-control::placeholder { color: #bbb; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-text { font-size: 0.75rem; color: var(--text-light); margin-top: 4px; }

/* ===== ALERTS / FLASH ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.875rem;
  display: flex; align-items: center; gap: 10px;
  border-left: 4px solid transparent;
}
.alert-success { background: #d4edda; color: #155724; border-left-color: var(--success); }
.alert-danger  { background: #f8d7da; color: #721c24; border-left-color: var(--danger); }
.alert-warning { background: #fff3cd; color: #856404; border-left-color: var(--warning); }
.alert-info    { background: #cce5ff; color: #004085; border-left-color: var(--info); }

/* ===== MODAL ===== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(44,26,14,0.55);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-backdrop.show { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.2s;
}
.modal-backdrop.show .modal { transform: translateY(0) scale(1); }
.modal-lg { max-width: 800px; }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem; color: var(--text-dark);
}
.modal-close {
  background: none; border: none; font-size: 1.2rem;
  cursor: pointer; color: var(--text-light);
  width: 30px; height: 30px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--cream-dark); color: var(--text-dark); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ===== LOGIN PAGE ===== */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--brown) 0%, var(--primary-dark) 60%, var(--primary) 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  position: relative; overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 420px;
  padding: 40px 36px;
  position: relative;
}
.auth-logo {
  text-align: center; margin-bottom: 28px;
}
.auth-logo .logo-icon {
  width: 70px; height: 70px;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; margin: 0 auto 12px;
  box-shadow: 0 8px 24px rgba(192,57,43,0.35);
}
.auth-logo h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem; color: var(--text-dark);
}
.auth-logo p { font-size: 0.82rem; color: var(--text-light); margin-top: 2px; }
.auth-form .form-label { color: var(--text-dark); font-size: 0.85rem; }
.auth-form .form-control { padding: 11px 14px; font-size: 0.925rem; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 0.82rem; color: var(--text-light); }
.auth-footer a { color: var(--primary); text-decoration: none; font-weight: 600; }

/* ===== ORDER PAGE ===== */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}
.item-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.item-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.item-card.selected { border-color: var(--primary); background: #fff5f4; }
.item-card.selected::after {
  content: '✓';
  position: absolute; top: 8px; right: 10px;
  color: var(--primary); font-weight: 700; font-size: 0.9rem;
}
.item-card img {
  width: 80px; height: 80px;
  object-fit: cover; border-radius: 10px;
  margin-bottom: 10px;
}
.item-card .item-placeholder {
  width: 80px; height: 80px;
  background: var(--cream-dark);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; margin: 0 auto 10px;
}
.item-card .item-name { font-weight: 600; font-size: 0.88rem; color: var(--text-dark); }
.item-card .item-name-ta { font-size: 0.82rem; color: var(--text-light); font-family: 'Tiro Tamil', sans-serif; }
.item-card .item-price { color: var(--primary); font-weight: 700; font-size: 0.9rem; margin-top: 4px; }
.item-qty-input {
  width: 70px; padding: 4px 8px;
  border: 1.5px solid var(--border); border-radius: 6px;
  text-align: center; font-size: 0.85rem;
  margin-top: 8px;
}

/* ===== CART ===== */
.cart-section {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky; top: calc(var(--header-h) + 16px);
}
.cart-total-row {
  display: flex; justify-content: space-between;
  padding: 8px 0; font-size: 0.875rem;
}
.cart-total-row.grand {
  border-top: 2px solid var(--border);
  margin-top: 8px; padding-top: 12px;
  font-weight: 700; font-size: 1rem;
  color: var(--primary);
}

/* ===== IMAGE UPLOAD ===== */
.img-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.img-upload-area:hover { border-color: var(--primary); background: #fff9f8; }
.img-preview { max-width: 120px; max-height: 120px; border-radius: 10px; margin: 8px auto; display: block; }

/* ===== SEARCH BAR ===== */
.search-bar {
  display: flex; align-items: center;
  background: var(--cream-dark);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px; gap: 8px;
  min-width: 240px;
}
.search-bar input {
  background: none; border: none; outline: none;
  padding: 8px 0; font-size: 0.875rem;
  color: var(--text-dark); width: 100%;
  font-family: inherit;
}
.search-bar span { color: var(--text-light); }

/* ===== PAGINATION ===== */
.pagination { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.page-btn {
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px; background: var(--white);
  color: var(--text-mid); font-size: 0.82rem;
  cursor: pointer; text-decoration: none;
  transition: all 0.2s;
}
.page-btn:hover, .page-btn.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

/* ===== INVOICE PRINT ===== */
@media print {
  body { background: white; }
  .no-print { display: none !important; }
  .invoice-print-area { padding: 0; margin: 0; }
}
.invoice-print-area {
  background: white;
  max-width: 800px; margin: 0 auto;
  padding: 0;
  font-family: 'DM Sans', sans-serif;
}
.inv-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 24px 28px 20px;
  background: linear-gradient(135deg, var(--brown) 0%, var(--primary-dark) 100%);
  color: white;
}
.inv-company-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem; font-weight: 700;
}
.inv-company-name-ta { font-family: 'Tiro Tamil', sans-serif; font-size: 1rem; opacity: 0.85; }
.inv-title { font-size: 2rem; font-weight: 700; letter-spacing: 2px; opacity: 0.9; }
.inv-body { padding: 20px 28px; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.inv-party-box { background: var(--cream); padding: 14px; border-radius: var(--radius-sm); }
.inv-party-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-light); margin-bottom: 6px; }
.inv-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.inv-table th { background: var(--cream-dark); padding: 9px 12px; text-align: left; border-bottom: 2px solid var(--border); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--brown); }
.inv-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.inv-totals { margin-top: 16px; display: flex; justify-content: flex-end; }
.inv-totals-box { min-width: 280px; }
.inv-total-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 0.875rem; }
.inv-total-row.grand { border-top: 2px solid var(--primary); margin-top: 6px; padding-top: 10px; font-weight: 700; font-size: 1rem; color: var(--primary); }
.inv-footer { background: var(--cream-dark); padding: 14px 28px; text-align: center; font-size: 0.78rem; color: var(--text-light); border-top: 1px solid var(--border); }
.inv-stamp { font-family: 'Playfair Display', serif; font-size: 0.9rem; color: var(--primary); font-weight: 700; }
.amount-words { background: var(--cream); padding: 10px 14px; border-radius: var(--radius-sm); margin: 12px 0; font-size: 0.82rem; }
.amount-words strong { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-light); display: block; margin-bottom: 3px; }

/* ===== OUTSTANDING TABLE ===== */
.outstanding-row.high-balance { background: #fff5f4 !important; }
.outstanding-row.high-balance td:last-child { color: var(--danger); font-weight: 700; }

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    transform: translateX(-260px);
    width: 260px;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: flex; }
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }
  .sidebar-overlay.show { display: block; }
}
@media (max-width: 767px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .items-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 16px; }
  .inv-parties { grid-template-columns: 1fr; }
  .inv-header { flex-direction: column; gap: 12px; }
  .card-body { padding: 14px; }
  .topbar { padding: 0 14px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .items-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-card { padding: 28px 20px; }
}

/* ===== UTILITIES ===== */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted   { color: var(--text-light); }
.fw-bold { font-weight: 700; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }
.p-3 { padding: 12px; }
.w-100 { width: 100%; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.empty-state {
  text-align: center; padding: 48px 20px; color: var(--text-light);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; }
