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

:root {
  --navy:       #0B1F3A;
  --navy-mid:   #142847;
  --teal:       #0D7A6B;
  --teal-light: #12A08E;
  --teal-pale:  #E6F4F2;
  --ice:        #F4F8FB;
  --white:      #FFFFFF;
  --slate:      #8A9BB0;
  --slate-mid:  #5C6E82;
  --text:       #1A2B3C;
  --border:     #D5E2EC;
  --danger:     #C0392B;
  --warn:       #E67E22;
  --success:    #27AE60;
  --gold:       #B8860B;
  --sidebar-w:  240px;
}

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

body {
  font-family: 'Libre Franklin', sans-serif;
  background: var(--ice);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 22px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 34px; height: 34px;
  background: var(--teal);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  color: white;
  font-weight: 700;
  font-family: 'DM Serif Display', serif;
}

.brand-name {
  font-family: 'DM Serif Display', serif;
  font-size: 16px;
  color: white;
  line-height: 1;
}
.brand-name span { color: var(--teal-light); }
.brand-portal {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--slate);
  margin-top: 2px;
}

.sidebar-user {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.user-name { font-size: 13px; font-weight: 600; color: white; line-height: 1.3; }
.user-role { font-size: 10.5px; color: var(--slate); font-family: 'DM Mono', monospace; }

.sidebar-nav {
  flex: 1;
  padding: 10px 10px;
  overflow-y: auto;
}

.nav-section {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  padding: 14px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 7px;
  text-decoration: none;
  color: rgba(255,255,255,0.55);
  font-size: 13.5px;
  font-weight: 400;
  margin-bottom: 1px;
  transition: all 0.15s;
  white-space: nowrap;
}

.nav-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }
.nav-item.active { background: rgba(13,122,107,0.25); color: var(--teal-light); font-weight: 500; }

.nav-icon { width: 16px; text-align: center; flex-shrink: 0; font-size: 14px; }

.nav-badge {
  margin-left: auto;
  background: var(--teal);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  font-family: 'DM Mono', monospace;
}

.sidebar-footer {
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.nav-item.logout { color: rgba(255,255,255,0.35); }
.nav-item.logout:hover { color: var(--danger); background: rgba(192,57,43,0.1); }

/* ── MAIN LAYOUT ── */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: calc(100vw - var(--sidebar-w));
  max-width: calc(100vw - var(--sidebar-w));
  transition: margin-left 0.25s ease, width 0.25s ease, max-width 0.25s ease;
}

.topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  height: 58px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  min-width: 0;
  flex-shrink: 0;
}

.topbar-title {
  font-family: 'DM Serif Display', serif;
  font-size: 19px;
  color: var(--navy);
  letter-spacing: -0.2px;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.page-body { padding: 28px; flex: 1; min-width: 0; overflow: hidden; }

/* ── CARDS ── */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

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

.card-title {
  font-family: 'DM Serif Display', serif;
  font-size: 16px;
  color: var(--navy);
}

/* ── STAT CARDS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 0 0 2px 2px;
}

.stat-card.teal::after  { background: var(--teal); }
.stat-card.navy::after  { background: var(--navy); }
.stat-card.warn::after  { background: var(--warn); }
.stat-card.gold::after  { background: var(--gold); }
.stat-card.green::after { background: var(--success); }

.stat-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 8px;
}

.stat-value {
  font-family: 'DM Serif Display', serif;
  font-size: 28px;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-sub { font-size: 12px; color: var(--slate); }

/* ── TABLES ── */
.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--slate);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-weight: 500;
  white-space: nowrap;
}

.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--ice); }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'DM Mono', monospace;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-processing { background: rgba(230,126,34,0.1);  color: var(--warn); }
.badge-pending    { background: rgba(138,155,176,0.15); color: var(--slate-mid); }
.badge-filled     { background: rgba(39,174,96,0.1);   color: var(--success); }
.badge-shipped    { background: rgba(13,122,107,0.1);  color: var(--teal); }
.badge-cancelled  { background: rgba(192,57,43,0.1);   color: var(--danger); }
.badge-active     { background: rgba(39,174,96,0.1);   color: var(--success); }
.badge-inactive   { background: rgba(138,155,176,0.15); color: var(--slate-mid); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-family: 'Libre Franklin', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary   { background: var(--teal); color: white; }
.btn-primary:hover { background: var(--teal-light); transform: translateY(-1px); }

.btn-secondary { background: white; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--teal); color: var(--teal); }

.btn-danger    { background: white; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: white; }

.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }

/* ── FORMS ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.thirds { grid-template-columns: 1fr 1fr 1fr; }
.form-full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; }

.field-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 6px;
  font-weight: 500;
}

.field-input, .field-select, .field-textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'Libre Franklin', sans-serif;
  font-size: 13.5px;
  color: var(--text);
  background: white;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus { border-color: var(--teal); }

.field-textarea { resize: vertical; min-height: 80px; }

/* ── STEP INDICATOR ── */
.steps {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
}

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

.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 12px; font-weight: 700;
  color: var(--slate);
  background: white;
  flex-shrink: 0;
  transition: all 0.3s;
}

.step.active .step-num  { border-color: var(--teal); color: var(--teal); background: var(--teal-pale); }
.step.done .step-num    { background: var(--teal); border-color: var(--teal); color: white; }
.step-label { font-size: 12px; font-weight: 500; color: var(--slate); white-space: nowrap; }
.step.active .step-label { color: var(--teal); font-weight: 600; }
.step.done .step-label   { color: var(--slate-mid); }
.step-line { flex: 1; height: 1px; background: var(--border); margin: 0 8px; min-width: 20px; }
.step-line.done { background: var(--teal); }

/* ── PRODUCT GRID ── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-height: 500px;
  overflow-y: auto;
  padding: 4px;
}

.products-grid::-webkit-scrollbar { width: 4px; }
.products-grid::-webkit-scrollbar-track { background: var(--ice); }
.products-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.product-card {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: white;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.product-card:hover  { border-color: var(--teal); box-shadow: 0 2px 12px rgba(13,122,107,0.1); }
.product-card.in-cart { border-color: var(--teal); background: var(--teal-pale); }

.product-cat  { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: var(--teal); margin-bottom: 5px; }
.product-name { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 2px; line-height: 1.3; }
.product-str  { font-size: 11.5px; color: var(--slate-mid); margin-bottom: 10px; line-height: 1.4; }

.product-footer { display: flex; align-items: center; justify-content: space-between; }
.product-price  { font-family: 'DM Mono', monospace; font-size: 14px; font-weight: 500; color: var(--navy); }

.add-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--teal);
  background: white;
  color: var(--teal);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  line-height: 1;
  padding-bottom: 1px;
}

.add-btn:hover { background: var(--teal); color: white; }
.in-cart-check { width: 26px; height: 26px; border-radius: 50%; background: var(--teal); color: white; font-size: 13px; display: flex; align-items: center; justify-content: center; }

/* ── CART ── */
.order-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }

.cart-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  position: sticky;
  top: 74px;
  overflow: hidden;
}

.cart-header {
  background: var(--navy);
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
}

.cart-header-title {
  font-family: 'DM Serif Display', serif;
  font-size: 15px;
  color: white;
  display: flex; align-items: center; gap: 8px;
}

.cart-count {
  background: var(--teal);
  color: white;
  font-size: 11px; font-weight: 700;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Mono', monospace;
}

.cart-items { max-height: 320px; overflow-y: auto; }
.cart-items::-webkit-scrollbar { width: 4px; }
.cart-items::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 12.5px; font-weight: 600; color: var(--navy); }
.cart-item-str  { font-size: 11px; color: var(--slate); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.qty-ctrl { display: flex; align-items: center; gap: 5px; background: var(--ice); border-radius: 6px; padding: 3px 6px; }
.qty-btn  { width: 18px; height: 18px; border: none; background: none; cursor: pointer; color: var(--teal); font-size: 14px; display: flex; align-items: center; justify-content: center; border-radius: 3px; line-height: 1; }
.qty-btn:hover { background: var(--border); }
.qty-val  { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 600; min-width: 16px; text-align: center; }

.cart-price  { font-family: 'DM Mono', monospace; font-size: 12.5px; color: var(--navy); font-weight: 500; width: 50px; text-align: right; }
.cart-remove { color: var(--slate); cursor: pointer; font-size: 14px; background: none; border: none; padding: 2px 4px; border-radius: 4px; }
.cart-remove:hover { color: var(--danger); background: rgba(192,57,43,0.05); }

.cart-empty { padding: 30px 16px; text-align: center; color: var(--slate); }
.cart-empty-icon { font-size: 28px; margin-bottom: 8px; opacity: 0.4; }
.cart-empty-text { font-size: 13px; }

.cart-summary { padding: 14px 16px; border-top: 1px solid var(--border); background: var(--ice); }
.sum-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; color: var(--slate-mid); }
.sum-row.total { font-size: 15px; font-weight: 700; color: var(--navy); border-top: 1px solid var(--border); padding-top: 10px; margin-top: 8px; font-family: 'DM Mono', monospace; }
.sum-row.total span:first-child { font-family: 'Libre Franklin', sans-serif; }

.cart-btn {
  display: block; width: 100%; margin-top: 14px;
  padding: 13px;
  background: var(--teal); color: white; border: none; border-radius: 8px;
  font-family: 'Libre Franklin', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.2s; letter-spacing: 0.2px;
}
.cart-btn:hover { background: var(--teal-light); }
.cart-btn:disabled { background: var(--border); color: var(--slate); cursor: not-allowed; }

/* ── FILTERS / SEARCH ── */
.filters {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-wrap input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--border); border-radius: 8px;
  font-family: 'Libre Franklin', sans-serif; font-size: 13.5px;
  color: var(--text); background: white; outline: none;
  transition: border-color 0.2s;
}
.search-wrap input:focus { border-color: var(--teal); }
.search-wrap::before {
  content: '🔍'; font-size: 13px;
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  pointer-events: none; opacity: 0.5;
}

.filter-select {
  padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-family: 'Libre Franklin', sans-serif; font-size: 13.5px;
  color: var(--text); background: white; outline: none; cursor: pointer;
}

/* ── INFO BOX ── */
.info-box {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 20px;
  display: flex; align-items: flex-start; gap: 8px;
  line-height: 1.5;
}
.info-box.teal { background: rgba(13,122,107,0.08); border: 1px solid rgba(13,122,107,0.2); color: var(--teal); }
.info-box.warn { background: rgba(230,126,34,0.08); border: 1px solid rgba(230,126,34,0.2); color: var(--warn); }

/* ── PAYMENT CARD VISUAL ── */
.cc-visual {
  background: linear-gradient(135deg, var(--navy) 0%, #1a3a5c 100%);
  border-radius: 14px; padding: 22px 24px;
  position: relative; overflow: hidden; margin-bottom: 20px; color: white;
}
.cc-visual::before {
  content: ''; position: absolute; top: -20px; right: -20px;
  width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,0.05);
}
.cc-chip { width: 36px; height: 26px; background: var(--gold); border-radius: 4px; margin-bottom: 18px; }
.cc-number { font-family: 'DM Mono', monospace; font-size: 16px; letter-spacing: 3px; margin-bottom: 16px; }
.cc-footer { display: flex; justify-content: space-between; align-items: flex-end; }
.cc-meta-label { font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; opacity: 0.5; margin-bottom: 3px; }
.cc-meta-val { font-family: 'DM Mono', monospace; font-size: 13px; }

/* ── SUCCESS SCREEN ── */
.success-wrap { text-align: center; padding: 48px 32px; }
.success-icon { width: 72px; height: 72px; background: rgba(39,174,96,0.12); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 34px; }
.success-title { font-family: 'DM Serif Display', serif; font-size: 28px; color: var(--navy); margin-bottom: 10px; }
.success-sub   { font-size: 14px; color: var(--slate-mid); margin-bottom: 24px; line-height: 1.6; }
.order-ref     { display: inline-block; font-family: 'DM Mono', monospace; font-size: 16px; color: var(--teal); background: var(--teal-pale); border: 1px solid rgba(13,122,107,0.2); border-radius: 8px; padding: 8px 24px; margin-bottom: 28px; letter-spacing: 1px; }
.success-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── INVOICE PRINT ── */
.invoice-page { background: white; max-width: 760px; margin: 0 auto; }
.invoice-hdr  { background: var(--navy); color: white; padding: 28px 32px; display: flex; justify-content: space-between; align-items: flex-start; }
.invoice-brand { font-family: 'DM Serif Display', serif; font-size: 22px; }
.invoice-brand span { color: var(--teal-light); }
.invoice-company { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 4px; line-height: 1.6; }
.invoice-num-wrap { text-align: right; }
.invoice-num  { font-family: 'DM Mono', monospace; font-size: 18px; color: var(--teal-light); margin-bottom: 4px; }
.invoice-date { font-size: 12px; color: rgba(255,255,255,0.5); }
.invoice-body { padding: 28px 32px; }
.invoice-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.party-label { font-family: 'DM Mono', monospace; font-size: 9.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--slate); margin-bottom: 8px; }
.party-name  { font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: 2px; }
.party-detail { font-size: 12.5px; color: var(--slate-mid); line-height: 1.6; }
.invoice-totals { width: 260px; margin-left: auto; }
.inv-total-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; color: var(--slate-mid); }
.inv-total-row.final { font-size: 15px; font-weight: 700; color: var(--navy); border-top: 2px solid var(--navy); padding-top: 10px; margin-top: 8px; font-family: 'DM Mono', monospace; }
.invoice-footer-note { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--slate); line-height: 1.6; text-align: center; }
.invoice-actions { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ── REP LINK BOX ── */
.reg-link-box {
  background: var(--ice); border: 1px dashed var(--border); border-radius: 8px;
  padding: 12px 14px; display: flex; align-items: center; gap: 10px; margin-top: 12px;
}
.reg-link-url { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--teal); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-btn { padding: 5px 12px; border: 1px solid var(--teal); border-radius: 6px; background: none; color: var(--teal); font-size: 12px; font-weight: 600; cursor: pointer; font-family: 'DM Mono', monospace; transition: all 0.15s; white-space: nowrap; }
.copy-btn:hover { background: var(--teal); color: white; }

/* ── CHART BARS ── */
.bar-chart { height: 140px; display: flex; align-items: flex-end; gap: 5px; padding: 0 4px; }
.bar { flex: 1; background: var(--teal); border-radius: 3px 3px 0 0; opacity: 0.7; transition: opacity 0.2s; min-height: 2px; }
.bar:hover { opacity: 1; }
.bar.current { opacity: 1; background: var(--navy); }

/* ── PROGRESS BAR ── */
.progress { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; background: var(--teal); border-radius: 2px; transition: width 0.8s ease; }

/* ── TWO COLUMN ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ── UTILITIES ── */
.mono  { font-family: 'DM Mono', monospace; }
.muted { color: var(--slate); }
.small { font-size: 12px; }
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.link  { color: var(--teal); text-decoration: none; font-weight: 500; cursor: pointer; font-size: 13px; }
.link:hover { text-decoration: underline; }

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy);
  position: relative; overflow: hidden;
}
.login-page::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 20% 110%, rgba(13,122,107,0.25) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 90% -10%, rgba(13,122,107,0.12) 0%, transparent 50%);
}
.login-page::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255,255,255,0.025) 39px, rgba(255,255,255,0.025) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255,255,255,0.025) 39px, rgba(255,255,255,0.025) 40px);
}

.login-card {
  position: relative; z-index: 2;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; padding: 48px 44px;
  width: 420px; backdrop-filter: blur(20px);
  animation: fadeUp 0.5s ease;
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo-img { max-width: 260px; width: 100%; object-fit: contain; margin-bottom: 16px; border-radius: 10px; background: rgba(255,255,255,0.95); padding: 14px 18px; }
.login-pharmacy { font-family: 'Libre Franklin', sans-serif; font-size: 13px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--teal-light); margin-bottom: 4px; }
.login-brand { font-family: 'DM Serif Display', serif; font-size: 28px; color: white; }
.login-brand span { color: var(--teal-light); }
.login-sub { font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--slate); margin-top: 5px; }

.portal-tabs { display: flex; background: rgba(255,255,255,0.05); border-radius: 8px; padding: 4px; margin-bottom: 26px; gap: 2px; }
.portal-tab { flex: 1; padding: 8px 6px; border: none; background: transparent; color: var(--slate); font-family: 'Libre Franklin', sans-serif; font-size: 12px; font-weight: 500; border-radius: 6px; cursor: pointer; transition: all 0.2s; }
.portal-tab.active { background: var(--teal); color: white; }

.login-field { margin-bottom: 16px; }
.login-label { display: block; font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--slate); margin-bottom: 6px; }
.login-input { width: 100%; padding: 11px 14px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; color: white; font-family: 'Libre Franklin', sans-serif; font-size: 14px; outline: none; transition: border-color 0.2s; }
.login-input:focus { border-color: var(--teal-light); }
.login-input::placeholder { color: rgba(255,255,255,0.25); }

.login-btn { width: 100%; padding: 13px; background: var(--teal); border: none; border-radius: 8px; color: white; font-family: 'Libre Franklin', sans-serif; font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.2s; margin-top: 8px; letter-spacing: 0.3px; }
.login-btn:hover { background: var(--teal-light); }

.login-error { background: rgba(192,57,43,0.15); border: 1px solid rgba(192,57,43,0.3); color: #e88; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.login-footer { text-align: center; margin-top: 18px; font-size: 12px; color: rgba(255,255,255,0.25); }
.login-help-links { text-align: center; margin-top: 16px; font-size: 13px; color: rgba(255,255,255,0.4); }
.login-help-links a { color: rgba(255,255,255,0.5); text-decoration: none; transition: color 0.2s; }
.login-help-links a:hover { color: var(--teal-light); text-decoration: underline; }
.login-help-sep { margin: 0 8px; color: rgba(255,255,255,0.2); }
.login-reg-link { text-align: center; margin-top: 10px; font-size: 13px; color: rgba(255,255,255,0.4); }
.login-reg-link a { color: var(--teal-light); text-decoration: none; }
.login-reg-link a:hover { text-decoration: underline; }
.login-success { background: rgba(46,204,113,0.15); border: 1px solid rgba(46,204,113,0.3); color: #6ddf9a; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }

/* ── SIDEBAR COLLAPSE / EXPAND ── */
.sidebar-collapse-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  color: rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.sidebar-collapse-btn:hover { color: white; background: rgba(255,255,255,0.1); }

.sidebar-expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-right: 10px;
  border-radius: 6px;
  color: var(--navy);
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.sidebar-expand-btn:hover { background: var(--ice); }

.sidebar {
  transition: margin-left 0.25s ease;
}

body.sidebar-collapsed .sidebar {
  margin-left: calc(-1 * var(--sidebar-w));
}
body.sidebar-collapsed .main-content {
  margin-left: 0;
  width: 100vw;
  max-width: 100vw;
}
body.sidebar-collapsed .sidebar-expand-btn {
  display: flex;
}

@media print {
  .sidebar, .topbar, .invoice-actions, .no-print { display: none !important; }
  .main-content { margin-left: 0 !important; max-width: 100% !important; }
  .invoice-page { box-shadow: none; }
}
