/* ============================================================
   COBALT & WHITE THEME — Inventory System
   ============================================================ */

:root {
  --cobalt:        #0047AB;
  --cobalt-dark:   #003380;
  --cobalt-deeper: #002060;
  --cobalt-light:  #1565C0;
  --cobalt-soft:   #EFF1F5;
  --cobalt-muted:  #CBD5E1;
  --white:         #FFFFFF;
  --off-white:     #F8F9FA;
  --surface:       #F3F4F6;
  --border:        #E2E8F0;
  --text:          #1A1F36;
  --text-muted:    #5A6480;
  --success:       #1B8A4E;
  --success-bg:    #E6F5ED;
  --error:         #C0392B;
  --error-bg:      #FDECEA;
  --warning:       #A0660A;
  --warning-bg:    #FEF6E4;
  --radius:        8px;
  --radius-sm:     5px;
  --shadow:        0 2px 8px rgba(0,0,0,0.07);
  --shadow-md:     0 4px 18px rgba(0,0,0,0.11);
  --nav-height:    58px;
  --font:          'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html { font-size: 15px; }

body {
  font-family: var(--font);
  background: #FFFFFF;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--cobalt-muted); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--cobalt); }

/* ============================================================
   APP LAYOUT  (sidebar + header + content)
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.app-sidebar {
  width: 240px;
  background: #0d0d0d;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.26s cubic-bezier(0.4,0,0.2,1);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  padding: 28px 16px 22px;
  background: #ffffff;
  flex-shrink: 0;
  min-height: 110px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.sidebar-logo {
  height: 64px;
  width: auto;
  flex-shrink: 0;
  filter: brightness(1.15) drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0 12px;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

.sidebar-section-label {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #4fc3f7;
  padding: 14px 16px 5px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}
.sidebar-section-label:hover {
  color: #81d4fa;
}
.sidebar-section-label .section-chevron {
  font-size: 0.9rem;
  transition: transform 0.25s ease;
}
.sidebar-section-label.collapsed .section-chevron {
  transform: rotate(-90deg);
}
.sidebar-group {
  overflow: hidden;
  max-height: 600px;
  transition: max-height 0.3s ease;
}
.sidebar-group.collapsed {
  max-height: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  padding: 9px 14px;
  margin: 1px 6px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s, transform 0.2s cubic-bezier(0.2,0.9,0.3,1.3), box-shadow 0.2s;
  transform-origin: left center;
}
.sidebar-link .material-icons-round { font-size: 1.15rem; flex-shrink: 0; transition: transform 0.2s cubic-bezier(0.2,0.9,0.3,1.3); }
.sidebar-link:hover {
  background: rgba(143, 209, 79, 0.13);
  color: #8FD14F;
  transform: scale(1.06);
  box-shadow: 0 4px 16px rgba(143, 209, 79, 0.18);
}
.sidebar-link:hover .material-icons-round {
  transform: scale(1.2);
}
.sidebar-link.active {
  background: rgba(143, 209, 79, 0.18);
  color: #8FD14F;
  transform: scale(1.03);
}

/* Sidebar tooltip (rendered via JS to escape overflow:hidden) */
.sidebar-tooltip {
  position: fixed;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  padding: 10px 14px;
  border-radius: 10px;
  white-space: normal;
  width: max-content;
  max-width: 230px;
  z-index: 99999;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateX(-8px) scale(0.92);
  transform-origin: left center;
  transition: opacity 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sidebar-tooltip.visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}
.sidebar-tooltip.hiding {
  opacity: 0;
  transform: translateX(-6px) scale(0.95);
  transition: opacity 0.15s ease-in, transform 0.15s ease-in;
}
.sidebar-tooltip::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: #1e293b;
}

.sidebar-badge {
  margin-left: auto;
  background: #DC2626;
  color: #fff;
  font-size: 0.63rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.sidebar-user-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
  background: #000;
  flex-shrink: 0;
}
.sidebar-avatar .material-icons-round {
  font-size: 2rem;
  color: rgba(255,255,255,0.4);
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  display: block;
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  display: block;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-logout-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 7px;
  color: rgba(255,255,255,0.5);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s, color 0.18s;
}
.sidebar-logout-btn:hover { background: rgba(220,38,38,0.18); color: #f87171; border-color: rgba(220,38,38,0.3); }
.sidebar-logout-btn .material-icons-round { font-size: 1.05rem; }

/* ── Sidebar overlay (mobile) ────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.45);
  z-index: 79;
}
.sidebar-overlay.open { display: block; }

/* ── App main (header + content) ────────────────────────── */
.app-main {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── Top header ──────────────────────────────────────────── */
.app-header {
  height: var(--nav-height);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.header-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.header-hamburger:hover { background: var(--surface); }
.header-hamburger .material-icons-round { font-size: 1.4rem; }

.header-logo-link {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: flex 0.3s ease, transform 0.3s ease, height 0.3s ease;
}
.header-logo {
  height: 28px;
  width: auto;
  max-width: 100%;
  transition: height 0.3s ease;
}
.header-brand {
  font-size: 1rem;
  font-weight: 700;
  color: var(--cobalt);
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-user-icon {
  font-size: 1.6rem;
  color: var(--cobalt-muted);
}
.header-user-info { display: flex; flex-direction: column; }
.header-user-name {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.header-user-role {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.header-logout-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.header-logout-btn:hover {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #FCA5A5;
}
.header-logout-btn .material-icons-round { font-size: 1.15rem; }

/* ── Notification Bell ──────────────────────────────────── */
.nav-bell {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-bell-btn {
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #000;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}
.nav-bell-btn:hover { background: var(--surface); }
.nav-bell-btn .material-icons-round { font-size: 1.25rem; }

.nav-bell-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #DC2626;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--white);
  line-height: 1;
}

/* Dropdown */
.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  z-index: 95;
  overflow: hidden;
  border: 1px solid var(--border);
}
.notif-dropdown.open { display: block; animation: notifFadeIn .2s ease-out; }
@keyframes notifFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.notif-read-all {
  background: none;
  border: none;
  color: var(--cobalt);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0;
  font-weight: 600;
}
.notif-read-all:hover { text-decoration: underline; }

.notif-list {
  max-height: 380px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 16px;
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #F4F7FB; }
.notif-item.notif-unread { background: #EEF4FF; }
.notif-item.notif-unread:hover { background: #E3EDFF; }

.notif-icon {
  font-size: 1.2rem;
  color: var(--cobalt);
  margin-top: 2px;
  flex-shrink: 0;
}
.notif-content { flex: 1; min-width: 0; }
.notif-title {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-msg {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-time {
  font-size: 0.72rem;
  color: #9CA3AF;
  margin: 0;
}
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cobalt);
  flex-shrink: 0;
  margin-top: 5px;
}

.notif-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-muted);
}
.notif-empty .material-icons-round { font-size: 2rem; display: block; margin-bottom: 6px; }
.notif-empty p { font-size: 0.83rem; margin: 0; }

/* ── Notification categories ────────────────────────────── */
.notif-category {
  border-bottom: 1px solid #F0F1F3;
}
.notif-category:last-child {
  border-bottom: none;
}
.notif-category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #FAFBFC;
  border-bottom: 1px solid #E8EAED;
}

/* ── App content area ────────────────────────────────────── */
.app-content {
  flex: 1;
  padding: 28px 36px 40px;
  min-width: 0;
}

/* Legacy wrapper (login page guest view) */
.content-wrapper {
  max-width: 100%;
  width: 100%;
  padding: 28px 40px 40px;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.page-header-left { flex: 1; }

.page-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Page title ── */
h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1A2C3E;
  margin-bottom: 4px;
  padding: 0;
  border: none;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.85rem;
  color: #7C8EA0;
  margin: 0;
  font-weight: 400;
}

h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--cobalt);
  margin: 24px 0 12px;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 18px 0 10px;
}

/* ============================================================
   ALERTS / FLASH MESSAGES
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #a8d5be;
}

.alert-success::before { content: '✓'; font-weight: 700; }

.alert-error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid #f0b9b3;
}

.alert-error::before { content: '✕'; font-weight: 700; }

.alert ul { margin: 0; padding-left: 16px; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-header {
  background: var(--cobalt-soft);
  padding: 14px 20px;
  font-weight: 600;
  color: var(--cobalt-dark);
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.card-body { padding: 20px; }

/* ============================================================
   STAT CARDS (Dashboard)
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-top: 4px solid var(--cobalt);
  text-align: center;
  transition: box-shadow 0.2s, transform 0.15s;
}

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

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--cobalt);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.06);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 24px;
}

/* Table toolbar (above table: filter + actions) */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

table.bordered {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

thead th {
  background: #F4F7FB;
  color: #4A627A;
  padding: 13px 18px;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
  border-bottom: 1px solid #E4ECF4;
}

tbody tr {
  border-bottom: 1px solid #F0F5FA;
  transition: background 0.15s, transform 0.1s;
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover {
  background: #F7FAFF;
}

tbody td {
  padding: 13px 18px;
  vertical-align: middle;
  color: var(--text);
  font-size: 0.875rem;
}

tfoot td, tfoot th {
  padding: 10px 14px;
  background: var(--cobalt-soft);
  font-weight: 600;
  border-top: 2px solid var(--border);
}

/* Info table (key-value) */
.info-table td, .info-table th {
  padding: 9px 14px;
  border: 1px solid var(--border);
  vertical-align: top;
}

.info-table th {
  background: var(--cobalt-soft);
  color: var(--cobalt-dark);
  font-weight: 600;
  width: 180px;
  white-space: nowrap;
}

.info-table tr:hover { background: none; }

/* ============================================================
   STATUS BADGES
   ============================================================ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.2px;
}

.badge-available  { background: #E6F5ED; color: #1B8A4E; }
.badge-sold       { background: #FDECEA; color: #C0392B; }
.badge-warranty   { background: #FEF6E4; color: #A0660A; }
.badge-replaced   { background: #F0EDFA; color: #5E35B1; }
.badge-pending    { background: #E3F0FF; color: #0047AB; }
.badge-assigned   { background: #E8F5E9; color: #2E7D32; }
.badge-in_transit { background: #FFF3E0; color: #E65100; }
.badge-delivered  { background: #E6F5ED; color: #1B8A4E; }
.badge-failed     { background: #FEF3C7; color: #92400E; }
.badge-completed  { background: #E6F5ED; color: #1B8A4E; }
.badge-cancelled  { background: #F5F5F5; color: #757575; }
.badge-filed                    { background: #E3F0FF; color: #0047AB; }
.badge-in_review               { background: #FFF8E1; color: #F57F17; }
.badge-sent_to_supplier        { background: #EDE7F6; color: #4527A0; }
.badge-received_from_supplier  { background: #E0F2F1; color: #00695C; }
.badge-approved                { background: #E6F5ED; color: #1B8A4E; }
.badge-rejected                { background: #FDECEA; color: #C0392B; }
.badge-paid                    { background: #E6F5ED; color: #1B8A4E; }
.badge-pending                 { background: #FEF6E4; color: #A0660A; }
.badge-for_review              { background: #FFF3E0; color: #E65100; }
.badge-declined                { background: #FDECEA; color: #C0392B; }

/* Picker table rows */
.wc-row:hover, .ws-row:hover { background: #EFF6FF; }
.wc-row.selected, .ws-row.selected { background: #DBEAFE; }

/* Role badges */
.badge-admin             { background: var(--cobalt); color: var(--white); }
.badge-salesperson       { background: #1565C0; color: var(--white); }
.badge-delivery          { background: #E65100; color: var(--white); }
.badge-warranty_incharge { background: #4527A0; color: var(--white); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn, button[type="submit"], button[type="button"] {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  border: none;
  white-space: nowrap;
}

.btn:active, button[type="submit"]:active { transform: translateY(1px); }

/* Primary */
.btn-primary, button[type="submit"] {
  background: var(--cobalt);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(0,71,171,0.25);
}

.btn-primary:hover, button[type="submit"]:hover {
  background: var(--cobalt-dark);
  box-shadow: 0 3px 10px rgba(0,71,171,0.35);
}

/* Secondary */
.btn-secondary, button[type="button"] {
  background: var(--surface);
  color: var(--cobalt);
  border: 1px solid var(--border);
}

.btn-secondary:hover, button[type="button"]:hover {
  background: var(--cobalt-soft);
  border-color: var(--cobalt-muted);
}

/* Danger */
.btn-danger {
  background: var(--error);
  color: var(--white);
}

.btn-danger:hover { background: #a93226; }

/* Small */
.btn-sm { padding: 4px 11px; font-size: 0.8rem; }

/* Link-style */
.btn-link {
  background: none;
  color: var(--cobalt);
  padding: 4px 8px;
  border: none;
  box-shadow: none;
  text-decoration: underline;
}

.btn-link:hover { color: var(--cobalt-dark); }

/* Action row */
.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* Bundle item row */
.bundle-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.bundle-item:last-child { border-bottom: none; }
.bundle-item select { flex: 1; min-width: 180px; }

/* Inline form buttons (delete, etc.) */
form[style*="display:inline"] button,
form[style*="display: inline"] button {
  padding: 4px 11px;
  font-size: 0.8rem;
  background: var(--error);
  color: var(--white);
  box-shadow: none;
}

form[style*="display:inline"] button:hover,
form[style*="display: inline"] button:hover {
  background: #a93226;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 28px;
  max-width: 680px;
}

.form-card.wide { max-width: 960px; }

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px rgba(0,71,171,0.12);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--cobalt);
}

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

select { cursor: pointer; }

small {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Form p → form-group */
form p {
  margin-bottom: 16px;
}

/* Filter bar */
.filter-bar {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

.filter-bar label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 150px;
}

.filter-bar select,
.filter-bar input {
  width: auto;
  min-width: 150px;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 16px;
  align-items: center;
}

nav[role="navigation"] {
  margin-top: 16px;
}

nav[role="navigation"] span, nav[role="navigation"] a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--cobalt);
  text-decoration: none;
  transition: background 0.15s;
}

nav[role="navigation"] a:hover { background: var(--cobalt-soft); }

nav[role="navigation"] [aria-current="page"] > span,
nav[role="navigation"] span[aria-current="page"] {
  background: var(--cobalt);
  color: var(--white);
  border-color: var(--cobalt);
}

/* ============================================================
   LINKS
   ============================================================ */
a {
  color: var(--cobalt);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

a:hover { color: var(--cobalt-dark); text-decoration: underline; }

/* Table action links */
.table-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.table-actions a {
  font-size: 0.82rem;
  padding: 3px 9px;
  background: var(--cobalt-soft);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.table-actions a:hover {
  background: var(--cobalt-muted);
  text-decoration: none;
}

/* ============================================================
   SIGNATURE CANVAS PAGE
   ============================================================ */
#sigCanvas {
  border: 2px solid var(--cobalt);
  border-radius: var(--radius);
  background: var(--white);
  display: block;
  cursor: crosshair;
  box-shadow: var(--shadow);
  touch-action: none;
}

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.text-muted { color: var(--text-muted); }
.text-cobalt { color: var(--cobalt); }
.text-success { color: var(--success); }
.text-danger  { color: var(--error); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--cobalt-deeper) 0%, var(--cobalt) 60%, var(--cobalt-light) 100%);
}

.login-box {
  background: var(--white);
  border-radius: 12px;
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,32,96,0.35);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo h1 {
  font-size: 1.6rem;
  color: var(--cobalt);
  border: none;
  padding: 0;
  margin: 0;
}

.login-logo p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  /* Sidebar slides off-screen; header hamburger appears */
  .app-sidebar { transform: translateX(-240px); }
  .app-sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0; }

  /* Header layout for mobile: hamburger | centered logo | right icons */
  .app-header {
    justify-content: flex-start;
    padding: 0 8px;
    position: relative;
    transition: all 0.3s ease;
  }

  /* Show hamburger + logo in header */
  .header-hamburger {
    display: flex;
    flex-shrink: 0;
    transition: all 0.3s ease;
  }

  .header-logo-link {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
    margin: 0;
    gap: 0;
    transform: translateX(40px);
  }

  .header-logo {
    height: 56px;
    width: auto;
  }
  .header-brand { display: none; }

  /* Right icons stay on right */
  .header-right {
    margin-left: 0;
    flex-shrink: 0;
    gap: 6px;
    transition: all 0.3s ease;
  }

  /* Shrink notif dropdown on small screens */
  .notif-dropdown {
    width: min(320px, 92vw);
    transition: width 0.3s ease;
  }

  /* Hide detailed user info in header on very small */
  .header-user-info {
    display: none;
    transition: display 0.3s ease;
  }

  /* Hide user icon on mobile */
  .header-user {
    display: none;
    transition: display 0.3s ease;
  }

  /* Smooth transitions for layout changes */
  .app-sidebar {
    transition: transform 0.3s ease;
  }

  .app-main {
    transition: margin-left 0.3s ease;
  }

  .app-content {
    padding: 16px 16px 30px;
    transition: padding 0.3s ease;
  }

  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-card { padding: 18px; }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .filter-bar { flex-direction: column; }
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.45);
  z-index: 500;              /* above sidebar (80), header (90), notif-dropdown (95) */
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow-y: auto;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 640px;
  animation: modalIn 0.2s cubic-bezier(0.34,1.1,0.64,1) both;
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 48px);
}

.modal.modal-lg { max-width: 800px; }
.modal.modal-xl { max-width: 980px; }

/* Responsive modal tweaks */
@media (max-width: 640px) {
  .modal-overlay { padding: 0 6px; }
  .modal { max-height: calc(100dvh - 24px); border-radius: 10px; }
  .modal-body { padding: 12px 14px; }
  .modal-header { padding: 14px 16px 12px; }
  .modal-footer { padding: 10px 14px; }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cobalt-dark);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}

.modal-close:hover { background: var(--surface); color: var(--text); }

.modal-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-body form p { margin-bottom: 14px; }

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--off-white);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ============================================================
   MODULE CARDS (Dashboard)
   ============================================================ */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  margin: 1.5rem 0 2rem;
}

.module-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1rem 1.2rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: box-shadow 0.2s, transform 0.15s, border-color 0.15s;
  cursor: pointer;
}

.module-card:hover {
  box-shadow: 0 6px 24px rgba(0,71,171,0.12);
  transform: translateY(-3px);
  border-color: var(--cobalt);
}

.module-card-icon {
  font-size: 2.75rem;
  line-height: 1;
  color: #1E3A8A;
}
/* Material Icons in module cards */
.module-card-icon.material-icons-round {
  font-size: 2.5rem;
}

.module-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.module-card-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Dashboard section heading */
.dash-section {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  margin: 2rem 0 0.75rem;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* Role-coloured top border variants */
.module-card.accent-green  { border-top: 3px solid #1B8A4E; }
.module-card.accent-cobalt { border-top: 3px solid var(--cobalt); }
.module-card.accent-orange { border-top: 3px solid #E65100; }
.module-card.accent-purple { border-top: 3px solid #4527A0; }
.module-card.accent-red    { border-top: 3px solid #C0392B; }

@media (max-width: 600px) {
  .module-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .module-card { padding: 1rem 0.6rem; }
  .module-card-icon { font-size: 1.5rem; }
}

/* ============================================================
   PAGE FADE-IN ANIMATION
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.app-content, .content-wrapper {
  animation: fadeInUp 0.28s ease both;
}

/* ============================================================
   FOR APPROVAL MODULE
   ============================================================ */
.approval-section {
  margin-bottom: 32px;
}

.approval-section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--white);
  border-radius: 12px 12px 0 0;
  border: 1px solid var(--border);
  border-bottom: 3px solid var(--accent, var(--cobalt));
  margin-bottom: 0;
}

.approval-section-header .material-icons-round {
  font-size: 1.8rem;
  color: var(--accent, var(--cobalt));
  flex-shrink: 0;
}

.approval-section-header > div {
  flex: 1;
}

.approval-section-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 2px;
}

.approval-section-header p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.approval-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  background: #FDECEA;
  color: #B91C1C;
  border: 1px solid #F5A5A5;
  flex-shrink: 0;
}

.approval-section .table-wrap {
  border-radius: 0 0 12px 12px;
  border-top: none;
}

/* Navbar approval badge */
.nav-link-approvals {
  position: relative;
  font-weight: 700;
}

.nav-approval-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #DC2626;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 5px;
  vertical-align: middle;
  line-height: 1;
}

/* ── Activity Logs ──────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.filter-search { flex: 1 1 200px; }
.filter-select { flex: 1 1 140px; }
.filter-date   { flex: 0 1 140px; }

.log-action {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--cobalt-soft);
  color: var(--cobalt-dark);
}
.log-action-created, .log-action-filed       { background: #E6F5ED; color: #1B8A4E; }
.log-action-cancelled, .log-action-rejected, .log-action-failed { background: #FDECEA; color: #C0392B; }
.log-action-approved, .log-action-delivered, .log-action-gcash_confirmed { background: #E8F5E9; color: #2E7D32; }
.log-action-assigned, .log-action-in_review, .log-action-in_transit { background: #FEF6E4; color: #A0660A; }
.log-action-updated, .log-action-stock_assigned { background: #EFF1F5; color: #3B4A6B; }

.badge-sale     { background: #E3F2FD; color: #1565C0; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-warranty { background: #FFF3E0; color: #E65100; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-delivery { background: #E8F5E9; color: #2E7D32; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-branch, .badge-warehouse { background: #F3E5F5; color: #6A1B9A; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }

/* ── Warehouse Branch Cards ─────────────────────────── */
.warehouse-branch-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.warehouse-branch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--cobalt-soft);
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.warehouse-branch-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--cobalt-dark);
}

.warehouse-branch-title .material-icons-round {
  font-size: 1.2rem;
  color: var(--cobalt);
}

.warehouse-branch-address {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
}

.warehouse-branch-card .table-wrapper {
  border-radius: 0;
  box-shadow: none;
  border: none;
  margin: 0;
}

.warehouse-branch-card tfoot td {
  background: var(--surface);
  font-size: 0.85rem;
  padding: 8px 16px;
  border-top: 2px solid var(--border);
}

.warehouse-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}
.warehouse-badge-available { background: #E6F5ED; color: #1B8A4E; }
.warehouse-badge-sold      { background: #F3F4F6; color: #5A6480; }
.warehouse-badge-warranty  { background: #FFF3E0; color: #E65100; }

.warehouse-available { color: #1B8A4E; font-weight: 700; }
.warehouse-sold      { color: var(--text-muted); }
.warehouse-warranty  { color: #E65100; }

/* ── Warranty Workflow Show Page ────────────────────── */

/* Status badges for warranty — cobalt & white themed */
.badge-warranty-filed                  { background: var(--cobalt-soft);  color: var(--cobalt-dark); }
.badge-warranty-in_review              { background: var(--cobalt-soft);  color: var(--cobalt); border: 1px solid var(--cobalt-muted); }
.badge-warranty-sent_to_supplier       { background: var(--cobalt);       color: #fff; }
.badge-warranty-received_from_supplier { background: var(--cobalt-dark);  color: #fff; }
.badge-warranty-approved               { background: var(--cobalt-deeper);color: #fff; }
.badge-warranty-replaced               { background: var(--cobalt-deeper);color: #fff; }
.badge-warranty-rejected               { background: var(--surface);      color: var(--text-muted); border: 1px solid var(--border); }
.badge-lg { padding: 5px 14px; font-size: 0.85rem; border-radius: 999px; font-weight: 700; display: inline-block; }

/* Progress steps */
.warranty-steps {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
  overflow-x: auto;
  padding: 4px 0;
  gap: 0;
}
.warranty-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 80px;
  flex-shrink: 0;
}
.step-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  background: var(--white);
  color: var(--cobalt-muted);
}
.step-icon .material-icons-round { font-size: 1.2rem; }
.step-label { font-size: 0.7rem; font-weight: 600; color: var(--text-muted); text-align: center; }
.step-connector { flex: 1; height: 2px; background: var(--border); min-width: 24px; }
.connector-done { background: var(--cobalt); }

.step-active .step-icon   { border-color: var(--cobalt); background: var(--cobalt); color: #fff; }
.step-active .step-label  { color: var(--cobalt-dark); }
.step-done .step-icon     { border-color: #1B8A4E; background: #1B8A4E; color: #fff; }
.step-done .step-label    { color: #1B8A4E; }
.step-rejected .step-icon { border-color: #C0392B; background: #C0392B; color: #fff; }
.step-rejected .step-label{ color: #C0392B; }

/* Layout */
.warranty-layout { display: flex; flex-direction: column; gap: 20px; }

/* Cards */
.warranty-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.warranty-card.wc-locked {
  opacity: 0.65;
  pointer-events: none;
}
.warranty-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 20px;
  background: var(--cobalt-soft);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  color: var(--cobalt-dark);
  font-size: 0.95rem;
}
.warranty-card-header .material-icons-round { color: var(--cobalt); }
.wc-meta { margin-left: auto; font-size: 0.78rem; font-weight: 400; color: var(--text-muted); }
.wc-locked-label { color: #E65100; font-weight: 600; }
.warranty-card-body { padding: 18px 20px; }
.warranty-card-action {
  padding: 12px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Grid fields */
.wc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px 20px;
  margin-bottom: 14px;
}
.wc-field .wc-label  { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 3px; }
.wc-field .wc-value  { font-size: 0.9rem; color: var(--text); }
.wc-text-field       { margin-bottom: 14px; }
.wc-text-field:last-child { margin-bottom: 0; }
.wc-text-field .wc-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 4px; }
.wc-text-field .wc-text  { font-size: 0.9rem; background: var(--surface); padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); color: var(--text); white-space: pre-wrap; }

/* Transmittal row */
.transmittal-row { padding: 4px 0; }
.transmittal-form-box {
  margin-top: 12px;
  border: 1px dashed var(--cobalt-muted);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  background: #F8FAFF;
}
.tf-title { font-size: 0.8rem; font-weight: 700; color: var(--cobalt); display: flex; align-items: center; gap: 5px; }
.tf-title .material-icons-round { font-size: 1rem; }

/* Form row helper */
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 140px; }

/* ── Warranty Portal (warranty_incharge role) ─────────── */
.portal-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.portal-stat {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
}
.ps-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ps-icon .material-icons-round { font-size: 1.4rem; }
.ps-icon-blue   { background: var(--cobalt-soft); color: var(--cobalt); }
.ps-icon-orange { background: var(--cobalt-soft); color: var(--cobalt); }
.ps-icon-green  { background: var(--cobalt-soft); color: var(--cobalt); }
.ps-icon-grey   { background: var(--cobalt-soft); color: var(--cobalt-muted); }
.ps-value { font-size: 1.6rem; font-weight: 800; line-height: 1; color: var(--text); }
.ps-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 3px; }

/* Portal sections */
.portal-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.portal-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 20px;
  font-weight: 700;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
}
.portal-header-blue   { background: var(--cobalt-soft); color: var(--cobalt-dark); }
.portal-header-orange { background: var(--cobalt-soft); color: var(--cobalt-dark); }
.portal-header-green  { background: var(--cobalt-soft); color: var(--cobalt-dark); }
.portal-header-grey   { background: var(--surface);     color: var(--text-muted); }
.portal-count {
  margin-left: auto;
  min-width: 24px; height: 24px;
  border-radius: 999px;
  background: rgba(0,0,0,0.1);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 800;
  padding: 0 7px;
}
.portal-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.portal-empty .material-icons-round { font-size: 1.2rem; }

/* Portal cards */
.portal-card {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.portal-card:last-child { border-bottom: none; }

.pc-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.pc-id   { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); min-width: 32px; }
.pc-item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1; }
.pc-chip {
  display: inline-block;
  padding: 2px 9px;
  background: #EFF1F5;
  color: var(--text-muted);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.pc-chip-muted { background: var(--surface); color: #888; }
.pc-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.pc-icon { font-size: 0.95rem; }

.pc-diag {
  background: var(--cobalt-soft);
  border-left: 3px solid var(--cobalt-muted);
  padding: 8px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.85rem;
  margin-bottom: 8px;
}
.pc-diag-done {
  background: var(--cobalt-soft);
  border-left-color: var(--cobalt);
}
.pc-diag-label { font-weight: 700; margin-right: 4px; }
.pc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* Transmittal row in portal */
.pc-transmittal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 8px;
}
.pt-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}
.pt-icon    { font-size: 1rem; color: var(--cobalt); }
.pt-supplier{ font-weight: 700; color: var(--text); }
.pt-date    { color: var(--text-muted); }
.pt-received-by { background: var(--cobalt-soft); color: var(--cobalt-dark); padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.pt-returned { display: flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 0.82rem; color: var(--cobalt); font-weight: 600; }
