/* ===== INDUSTRIALLINK INDIA — GLOBAL STYLES v2 (ANDROID-FIRST) ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Sora:wght@400;600;700;800&display=swap');

/* ===== DESIGN TOKENS ===== */
:root {
  /* Brand Colors */
  --primary: #E8510A;
  --primary-light: #FF7A35;
  --primary-dark: #C23E00;
  --primary-bg: #FFF3ED;

  --blue: #1D6FE8;
  --blue-light: #EEF4FF;
  --blue-dark: #1253B5;

  --green: #12A454;
  --green-light: #E8F9F0;
  --green-dark: #0D8040;

  --amber: #F59E0B;
  --amber-light: #FFFBEB;

  --red: #EF4444;
  --red-light: #FEF2F2;

  /* Neutrals */
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;

  /* Shadows — crisp, app-like */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.18);
  --shadow-primary: 0 4px 20px rgba(232,81,10,0.35);
  --shadow-blue: 0 4px 20px rgba(29,111,232,0.28);
  --shadow-green: 0 4px 16px rgba(18,164,84,0.28);

  /* Spacing — touch-friendly */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Border Radius — app feel */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --sidebar-width: 260px;
  --topbar-height: 60px;
  --bottom-nav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  font-size: 16px;
  /* Disable text size adjust on mobile */
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevent overscroll bounce on iOS */
  overscroll-behavior: none;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
/* Prevent tap highlight on mobile */
* { -webkit-tap-highlight-color: transparent; }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Sora', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}
h1 { font-size: clamp(1.6rem, 4vw, 3rem); }
h2 { font-size: clamp(1.25rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
p { color: var(--text-secondary); line-height: 1.7; }
.text-muted { color: var(--text-muted) !important; }
.text-primary-color { color: var(--primary) !important; }
.text-blue { color: var(--blue) !important; }
.text-green { color: var(--green) !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ===== BUTTONS — Bigger touch targets ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-bounce);
  border: 2px solid transparent;
  white-space: nowrap;
  min-height: 44px; /* Android touch target */
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}
/* Ripple effect for touch */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.15s;
}
.btn:active::after { background: rgba(255,255,255,0.15); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover, .btn-primary:active { transform: scale(0.97); box-shadow: 0 2px 12px rgba(232,81,10,0.4); }

.btn-blue {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: #fff;
  box-shadow: var(--shadow-blue);
}
.btn-blue:hover { transform: scale(0.97); }

.btn-green {
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  color: #fff;
  box-shadow: var(--shadow-green);
}
.btn-green:hover { transform: scale(0.97); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover, .btn-outline:active { background: var(--primary-bg); transform: scale(0.97); }

.btn-outline-blue {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}
.btn-outline-blue:hover { background: var(--blue-light); }

.btn-ghost {
  background: var(--surface-2);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover, .btn-ghost:active { background: var(--border); transform: scale(0.97); }

.btn-sm { padding: 8px 16px; font-size: 0.82rem; min-height: 36px; }
.btn-lg { padding: 15px 32px; font-size: 1rem; min-height: 52px; }
.btn-xl { padding: 18px 40px; font-size: 1.1rem; min-height: 56px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: var(--transition);
}
.card-body { padding: var(--space-md); }
.card-header {
  padding: 14px var(--space-md);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3, .card-header h4 { margin: 0; font-size: 1rem; }

/* ===== STAT CARD ===== */
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--blue));
  opacity: 0;
  transition: var(--transition);
}
.stat-card:active { transform: scale(0.98); }
.stat-card:active::before, .stat-card:hover::before { opacity: 1; }
.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 2px;
}
.stat-card .stat-value { font-size: 1.6rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.stat-card .stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.stat-card .stat-change { font-size: 0.75rem; font-weight: 600; }
.stat-card .stat-change.up { color: var(--green); }
.stat-card .stat-change.down { color: var(--red); }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.badge-green { background: var(--green-light); color: var(--green-dark); }
.badge-amber { background: var(--amber-light); color: #B45309; }
.badge-red { background: var(--red-light); color: #DC2626; }
.badge-blue { background: var(--blue-light); color: var(--blue-dark); }
.badge-orange { background: var(--primary-bg); color: var(--primary-dark); }
.badge-gray { background: var(--bg); color: var(--text-secondary); }

/* ===== FORM ELEMENTS — Touch friendly ===== */
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-label { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.form-label span { color: var(--red); }
.form-control {
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem; /* Prevents zoom on iOS */
  color: var(--text-primary);
  background: var(--surface);
  transition: var(--transition);
  width: 100%;
  min-height: 48px; /* Touch target */
  -webkit-appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29,111,232,0.12);
  background: var(--surface);
}
.form-control::placeholder { color: var(--text-muted); }
.form-hint { font-size: 0.78rem; color: var(--text-muted); }
.form-error { font-size: 0.78rem; color: var(--red); font-weight: 600; }

.input-group { position: relative; }
.input-group .form-control { padding-left: 46px; }
.input-group .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
@media(max-width: 600px) { .form-grid-2 { grid-template-columns: 1fr; } }

/* ===== DIVIDERS ===== */
.divider { border: none; border-top: 1px solid var(--border); margin: var(--space-lg) 0; }
.divider-text {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-muted);
  font-size: 0.82rem;
}
.divider-text::before, .divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ===== AVATAR ===== */
.avatar {
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.7rem; }
.avatar-md { width: 44px; height: 44px; font-size: 0.95rem; }
.avatar-lg { width: 60px; height: 60px; font-size: 1.3rem; }
.avatar-xl { width: 80px; height: 80px; font-size: 1.8rem; }
.avatar-blue { background: var(--blue-light); color: var(--blue); }
.avatar-orange { background: var(--primary-bg); color: var(--primary); }
.avatar-green { background: var(--green-light); color: var(--green); }
.avatar-purple { background: #F3E8FF; color: #8B5CF6; }
.avatar-red { background: var(--red-light); color: var(--red); }

/* ===== STARS ===== */
.stars { color: #F59E0B; font-size: 0.88rem; letter-spacing: 1px; }

/* ===== PROGRESS BAR ===== */
.progress-bar-wrap { background: var(--bg); border-radius: var(--radius-full); height: 8px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: var(--radius-full); transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1); }
.progress-bar-fill.blue { background: linear-gradient(90deg, var(--blue-dark), var(--blue)); }
.progress-bar-fill.green { background: linear-gradient(90deg, var(--green-dark), var(--green)); }
.progress-bar-fill.orange { background: linear-gradient(90deg, var(--primary-dark), var(--primary)); }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--surface-2); }
th {
  padding: 12px 14px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}
td {
  padding: 14px;
  font-size: 0.87rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:active td { background: var(--surface-2); }

/* ===== TABS ===== */
.tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: var(--radius); }
.tab-btn {
  flex: 1;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  border-radius: var(--radius-sm);
  text-align: center;
  min-height: 40px;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { background: var(--surface); color: var(--blue); box-shadow: var(--shadow-xs); }

/* ===== SEARCH BAR ===== */
.search-bar {
  display: flex;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}
.search-bar:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29,111,232,0.10); }
.search-bar input {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: none;
  font-size: 0.95rem;
  color: var(--text-primary);
  outline: none;
  min-height: 48px;
}
.search-bar button {
  background: var(--primary);
  color: #fff;
  padding: 10px 22px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: var(--transition);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}
.search-bar button:active { background: var(--primary-dark); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: var(--space-md); opacity: 0.6; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 8px; }

/* ===== TOAST — Mobile position ===== */
#toast-container {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 12px + var(--safe-bottom));
  left: 12px;
  right: 12px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--text-primary);
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 600;
  animation: slideInUp 0.35s cubic-bezier(0.34,1.56,0.64,1);
  width: 100%;
  max-width: 420px;
}
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.toast.info { background: var(--blue); }
@keyframes slideInUp {
  from { transform: translateY(60px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes slideInRight {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== MODAL — Slide up from bottom on mobile ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: flex-end; /* bottom sheet on mobile */
  justify-content: center;
  z-index: 999;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
}
/* Drag indicator */
.modal::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
  margin: 10px auto -4px;
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header {
  padding: var(--space-md) var(--space-md) var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
  border-bottom: 1px solid var(--border);
}
.modal-body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding-bottom: 0;
}
.modal-footer {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: calc(var(--space-md) + var(--safe-bottom));
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.modal-footer .btn { width: 100%; justify-content: center; }
.modal-close {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.modal-close:active { background: var(--red-light); color: var(--red); }

/* Desktop modal style (center card, not bottom sheet) */
@media(min-width: 768px) {
  .modal-overlay { align-items: center; }
  .modal {
    border-radius: var(--radius-xl);
    max-width: 560px;
    max-height: 90vh;
  }
  .modal::before { display: none; }
  .modal-overlay { transform: none; }
  .modal { transform: scale(0.92); }
  .modal-overlay.active .modal { transform: scale(1); }
  .modal-footer { flex-direction: row; justify-content: flex-end; border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
  .modal-footer .btn { width: auto; }
  #toast-container { left: auto; right: 24px; bottom: 24px; align-items: flex-end; }
}

/* ===== PORTAL LAYOUT — Mobile First ===== */
.portal-layout {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height */
}

/* ===== SIDEBAR — Hidden on mobile, shown via toggle ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--text-primary);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0,0,0,0.16);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar.open { transform: translateX(0); }
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 199;
  display: none;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

.sidebar-logo {
  padding: 20px var(--space-md);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.sidebar-logo .logo-text {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  letter-spacing: -0.02em;
}
.sidebar-logo .logo-sub { font-size: 0.7rem; color: rgba(255,255,255,0.45); }

.sidebar-section-label {
  padding: 14px 16px 5px;
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.sidebar-nav { padding: 6px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
  text-decoration: none;
  min-height: 48px;
}
.nav-item .nav-icon { font-size: 1.1rem; flex-shrink: 0; width: 22px; text-align: center; }
.nav-item:active { background: rgba(255,255,255,0.08); }
.nav-item.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: 0 4px 14px rgba(232,81,10,0.4);
}
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-full);
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
}
.nav-item.active .nav-badge { background: rgba(255,255,255,0.25); }

.sidebar-user {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user .user-name { color: #fff; font-weight: 700; font-size: 0.88rem; }
.sidebar-user .user-role { color: rgba(255,255,255,0.45); font-size: 0.72rem; }
.sidebar-user .logout-btn {
  margin-left: auto;
  color: rgba(255,255,255,0.35);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  padding: 6px;
}
.sidebar-user .logout-btn:active { color: var(--red); }

/* ===== PORTAL MAIN ===== */
.portal-main {
  flex: 1;
  margin-left: 0;
  padding-bottom: var(--bottom-nav-height);
  min-width: 0;
}

/* ===== TOP HEADER — Mobile ===== */
.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-md);
  gap: var(--space-sm);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-xs);
}
.topbar-menu-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1.5px solid var(--border);
  transition: var(--transition);
}
.topbar-menu-btn:active { background: var(--border); }
.topbar-title { font-size: 1rem; font-weight: 800; color: var(--text-primary); font-family: 'Sora', sans-serif; }
.topbar-subtitle { font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; line-height: 1.3; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar-notif {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.topbar-notif:active { background: var(--blue-light); }
.notif-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

/* ===== BOTTOM NAV — Android Style ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-nav-height) + var(--safe-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  padding-bottom: var(--safe-bottom);
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  flex: 1;
  position: relative;
  min-height: 48px;
  justify-content: center;
}
.bottom-nav-item:active { background: var(--bg); transform: scale(0.93); }
.bottom-nav-icon {
  font-size: 1.35rem;
  transition: var(--transition);
  position: relative;
}
.bottom-nav-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: var(--transition);
}
.bottom-nav-item.active .bottom-nav-icon { transform: translateY(-2px); }
.bottom-nav-item.active .bottom-nav-label { color: var(--blue); }
.bottom-nav-badge {
  position: absolute;
  top: 4px;
  right: 50%;
  transform: translateX(10px);
  background: var(--red);
  color: #fff;
  border-radius: var(--radius-full);
  min-width: 17px;
  height: 17px;
  font-size: 0.62rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
}
/* Active indicator dot */
.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--blue);
  border-radius: var(--radius-full);
}

/* ===== PORTAL CONTENT ===== */
.portal-content { padding: var(--space-md); display: flex; flex-direction: column; gap: var(--space-md); }

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}
@media(min-width: 600px) { .stats-grid { grid-template-columns: repeat(4, 1fr); gap: var(--space-md); } }

/* ===== CONTENT GRIDS ===== */
.content-grid-2 { display: grid; grid-template-columns: 1fr; gap: var(--space-md); }
.content-grid-3 { display: grid; grid-template-columns: 1fr; gap: var(--space-md); }
@media(min-width: 768px) { .content-grid-2 { grid-template-columns: 1fr 1fr; } .content-grid-3 { grid-template-columns: 1fr 1fr; } }
@media(min-width: 1100px) { .content-grid-3 { grid-template-columns: repeat(3,1fr); } }

/* ===== DESKTOP: Show sidebar, hide bottom nav ===== */
@media(min-width: 768px) {
  .sidebar { transform: translateX(0); }
  .sidebar-overlay { display: none !important; }
  .portal-main { margin-left: var(--sidebar-width); padding-bottom: 0; }
  .bottom-nav { display: none; }
  .topbar-menu-btn { display: none; }
  .topbar { padding: 0 var(--space-xl); }
  .portal-content { padding: var(--space-xl); gap: var(--space-xl); }
  .modal-footer { flex-direction: row; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

.fade-in { animation: fadeInUp 0.45s ease both; }
.fade-in-delay-1 { animation: fadeInUp 0.45s 0.08s ease both; }
.fade-in-delay-2 { animation: fadeInUp 0.45s 0.16s ease both; }
.fade-in-delay-3 { animation: fadeInUp 0.45s 0.24s ease both; }

/* ===== SKELETON LOADING ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg) 25%, var(--border) 50%, var(--bg) 75%);
  background-size: 1000px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }

/* ===== CHIP ===== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  transition: var(--transition-bounce);
  white-space: nowrap;
  min-height: 36px;
}
.chip:active, .chip.active {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
  transform: scale(0.96);
}

/* ===== CHIPS SCROLL ROW ===== */
.chips-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.chips-row::-webkit-scrollbar { display: none; }

/* ===== PRODUCT CARD ===== */
.product-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
}
.product-card:active { transform: scale(0.97); border-color: var(--blue); }
.product-card .product-img {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, var(--bg), var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  position: relative;
  overflow: hidden;
}
.product-card .product-body { padding: 14px; }
.product-card .product-name { font-weight: 700; font-size: 0.88rem; margin-bottom: 3px; line-height: 1.3; }
.product-card .product-brand { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
.product-card .product-price { font-size: 1.1rem; font-weight: 800; color: var(--primary); }
.product-card .product-price span { font-size: 0.78rem; color: var(--text-muted); text-decoration: line-through; font-weight: 400; margin-left: 5px; }
.product-card .product-foot { padding: 10px 14px; border-top: 1px solid var(--border); display: flex; gap: 8px; }

/* ===== WORKER CARD ===== */
.worker-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  padding: 16px;
  transition: var(--transition);
}
.worker-card:active { transform: scale(0.98); border-color: var(--green); }
.worker-card .worker-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.worker-card .worker-info h4 { margin-bottom: 2px; font-size: 0.95rem; }
.worker-card .worker-info p { font-size: 0.78rem; color: var(--text-muted); margin: 0; line-height: 1.6; }
.worker-card .worker-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.worker-card .worker-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.worker-card .worker-rate { font-weight: 800; color: var(--green); font-size: 1rem; }

/* ===== ROLE CARD (Auth) ===== */
.role-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-bounce);
  background: var(--surface);
  min-height: 100px;
}
.role-card:active { transform: scale(0.95); border-color: var(--blue); background: var(--blue-light); }
.role-card.selected { border-color: var(--blue); background: var(--blue-light); box-shadow: 0 0 0 3px rgba(29,111,232,0.15); }
.role-card .role-icon { font-size: 2.2rem; margin-bottom: 8px; }
.role-card h4 { font-size: 0.88rem; margin-bottom: 3px; }
.role-card p { font-size: 0.72rem; color: var(--text-muted); margin: 0; }

/* ===== STEP INDICATOR ===== */
.steps { display: flex; align-items: center; gap: 0; margin-bottom: var(--space-lg); }
.step { display: flex; align-items: center; gap: 8px; }
.step-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: var(--transition);
}
.step.active .step-circle { border-color: var(--blue); background: var(--blue); color: #fff; }
.step.done .step-circle { border-color: var(--green); background: var(--green); color: #fff; }
.step-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); display: none; }
@media(min-width: 400px) { .step-label { display: block; } }
.step.active .step-label { color: var(--blue); }
.step.done .step-label { color: var(--green); }
.step-line { flex: 1; height: 2px; background: var(--border); min-width: 20px; }
.step.done ~ .step-line { background: var(--green); }

/* ===== QUICK ACTION GRID ===== */
.quick-actions-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media(max-width: 400px) { .quick-actions-grid { grid-template-columns: repeat(2, 1fr); } }
.quick-action-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-bounce);
}
.quick-action-card:active { transform: scale(0.9); }
.quick-action-card .qa-icon { font-size: 1.8rem; margin-bottom: 6px; }
.quick-action-card .qa-label { font-size: 0.72rem; font-weight: 700; color: var(--text-secondary); line-height: 1.3; }

/* ===== SECTION HEADER ===== */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-sm); }
.section-header h3 { font-size: 0.95rem; }

/* ===== HORIZONTAL SCROLL SECTION ===== */
.h-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.h-scroll::-webkit-scrollbar { display: none; }
.h-scroll > * { flex-shrink: 0; }

/* ===== CARD LIST ITEM (for order items, team etc) ===== */
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px var(--space-md);
  border-bottom: 1px solid var(--border);
  min-height: 64px;
}
.list-item:last-child { border-bottom: none; }
.list-item:active { background: var(--surface-2); }

/* ===== GRADIENT BANNER ===== */
.gradient-banner {
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-md);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.gradient-banner::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 180px;
  height: 180px;
  background: rgba(255,255,255,0.07);
  border-radius: 50%;
}
.gradient-banner::before {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -30px;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}
.gradient-banner > * { position: relative; z-index: 1; }
