/* ==========================================================================
   Rail Ops Hub | Digital Services Portal Layout
   Colleague Operational Shift Links & Bookmarks
   ========================================================================== */

:root {
  /* Colors - Light Mode (Default as in screenshot) */
  --portal-bg: #F4F6F9;
  --topbar-bg: #FFFFFF;
  --surface-bg: #FFFFFF;
  --card-bg: #FFFFFF;
  --card-border: #E5E7EB;
  --card-shadow: 0 2px 6px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --card-shadow-hover: 0 8px 20px -3px rgba(0, 0, 0, 0.1);

  --rail-bg: #0284C7; /* Iconic Blue Rail Strip from Screenshot */
  --rail-active: #0369A1;
  --sidebar-bg: #FFFFFF;
  --sidebar-border: #E5E7EB;

  --text-main: #1F2937;
  --text-secondary: #4B5563;
  --text-muted: #9CA3AF;
  --text-blue: #0284C7;
  --text-blue-hover: #0369A1;

  /* Primary Accent & Emergency Colors */
  --brand-primary: #0284C7;
  --brand-primary-hover: #0369A1;
  --brand-red: #DC2626;
  --color-emergency: #DC2626;
  --color-whatsapp: #16A34A;
  --color-gold: #F59E0B;
  --color-online: #10B981;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Dark Mode Support */
[data-theme="dark"] {
  --portal-bg: #0B0F19;
  --topbar-bg: #111827;
  --surface-bg: #111827;
  --card-bg: #162032;
  --card-border: #1F2E47;
  --card-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  --card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.4);

  --rail-bg: #075985;
  --rail-active: #0284C7;
  --sidebar-bg: #111827;
  --sidebar-border: #1F2E47;

  --text-main: #F9FAFB;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-blue: #38BDF8;
  --text-blue-hover: #7DD3FC;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--portal-bg);
  color: var(--text-main);
  line-height: 1.45;
  min-height: 100vh;
  padding-bottom: calc(72px + var(--safe-bottom));
}

@media (min-width: 992px) {
  body {
    padding-bottom: 16px;
  }
}

/* ==========================================================================
   1. Topbar Navigation (Clean Header Bar)
   ========================================================================== */
.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--sidebar-border);
  padding: 8px 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

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

.menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 992px) {
  .menu-btn {
    display: none;
  }
}

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

.brand-badge-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-texts {
  display: flex;
  flex-direction: column;
}

.portal-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brand-primary);
}

.portal-subtitle {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  display: none;
}

@media (min-width: 640px) {
  .portal-subtitle {
    display: block;
  }
}

/* Search Box in Topbar (Matching the center search in screenshot) */
.topbar-search-wrap {
  flex: 1;
  max-width: 580px;
  margin: 0 8px;
}

.portal-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-glass-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.portal-search-box input {
  width: 100%;
  padding: 8px 36px 8px 38px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  background: var(--portal-bg);
  color: var(--text-main);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-full);
  outline: none;
  transition: all 0.2s ease;
}

.portal-search-box input:focus {
  background: var(--topbar-bg);
  border-color: var(--text-blue);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.search-clear-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px;
}

/* Right Topbar Icons */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.online-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.12);
  color: var(--color-online);
}

.online-status-chip.offline {
  background: rgba(245, 158, 11, 0.12);
  color: var(--color-gold);
}

.status-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 1px solid var(--card-border);
  background: var(--surface-bg);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.topbar-icon-btn:hover {
  background: var(--portal-bg);
  color: var(--text-main);
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

.notes-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-primary);
}

.topbar-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--brand-primary);
  color: #FFFFFF;
  border: none;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

/* ==========================================================================
   2. Horizontal Quick Service Ribbon (Icon + Title Beneath, as in Screenshot)
   ========================================================================== */
.horizontal-service-ribbon {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--sidebar-border);
  padding: 6px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.horizontal-service-ribbon::-webkit-scrollbar {
  display: none;
}

.ribbon-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: max-content;
  padding: 0 4px;
}

.ribbon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 72px;
}

.ribbon-item:hover {
  background: var(--portal-bg);
  color: var(--text-blue);
}

.ribbon-item.active {
  background: rgba(2, 132, 199, 0.08);
  border-color: rgba(2, 132, 199, 0.25);
  color: var(--text-blue);
}

.ribbon-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.ribbon-text {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ==========================================================================
   Priority Emergency Ticker Strip
   ========================================================================== */
.priority-strip {
  background: linear-gradient(90deg, #DC2626 0%, #B91C1C 100%);
  color: #FFFFFF;
  padding: 8px 16px;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

.strip-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

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

.alert-icon {
  font-size: 1.1rem;
}

.strip-title {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.strip-phone {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 800;
  color: #FEF08A;
}

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

.strip-dial-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #FFFFFF;
  color: #DC2626;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}

.strip-dial-btn:hover {
  transform: scale(1.03);
}

.strip-copy-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

/* ==========================================================================
   3. Portal Main Body (Two-Column Layout: Sidebar + Catalog)
   ========================================================================== */
.portal-body-layout {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 140px);
}

/* Left Sidebar (Desktop + Mobile Drawer) */
.portal-sidebar {
  display: flex;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  width: 280px;
  flex-shrink: 0;
  z-index: 100;
}

/* On Mobile, Sidebar is an Off-Canvas Drawer */
@media (max-width: 991px) {
  .portal-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }

  .portal-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 95;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Blue Icon Rail (Exact visual element on left of screenshot) */
.sidebar-icon-rail {
  width: 52px;
  background: var(--rail-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  gap: 16px;
  flex-shrink: 0;
}

.rail-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.rail-icon:hover, .rail-icon.active {
  background: var(--rail-active);
  color: #FFFFFF;
}

/* Sidebar Filter Pane */
.sidebar-pane {
  flex: 1;
  padding: 16px 14px;
  overflow-y: auto;
}

.sidebar-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-left: 6px;
}

.sidebar-menu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.menu-item-btn:hover {
  background: var(--portal-bg);
  color: var(--text-blue);
}

.menu-item-btn.active {
  background: rgba(2, 132, 199, 0.09);
  color: var(--text-blue);
  font-weight: 700;
}

.menu-bullet {
  color: var(--text-muted);
  width: 14px;
  flex-shrink: 0;
}

.menu-text {
  flex: 1;
}

.menu-count {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--portal-bg);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.sidebar-quick-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-action-pill {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--portal-bg);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.sidebar-action-pill:hover {
  background: var(--surface-bg);
  color: var(--text-blue);
  border-color: var(--text-blue);
}

/* ==========================================================================
   4. Main Content Area (Services Catalog Header + Grid)
   ========================================================================== */
.portal-main-catalog {
  flex: 1;
  padding: 16px 16px 36px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

@media (min-width: 768px) {
  .portal-main-catalog {
    padding: 20px 24px 48px 24px;
  }
}

/* Breadcrumb Bar (Matching SERVICES header in screenshot) */
.catalog-top-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 12px;
}

.breadcrumb-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.back-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--card-border);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.back-arrow:hover {
  background: var(--text-blue);
  color: #FFFFFF;
}

.catalog-heading {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text-main);
}

.catalog-subcount {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.view-tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  background: var(--card-border);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

/* Section Header Bar */
.catalog-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid var(--card-border);
  padding-bottom: 8px;
}

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

.bar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.bar-dot.blue { background: var(--text-blue); }
.bar-dot.purple { background: #8B5CF6; }
.bar-dot.red { background: var(--brand-red); }
.bar-dot.gold { background: var(--color-gold); }

.section-title-bar h2 {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.bar-sub {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ==========================================================================
   5. Service Catalog Grid & Card Design (Direct Match to Screenshot)
   ========================================================================== */
.catalog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 540px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .catalog-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
}

@media (min-width: 1280px) {
  .catalog-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }
}

/* The Service Card (Matching Digital Seva Screenshot) */
.service-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 16px 14px 16px;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  min-height: 230px;
}

.service-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
  border-color: rgba(2, 132, 199, 0.4);
}

.service-card.is-emergency {
  border-top: 3px solid var(--color-emergency);
}

/* Top Center Circular Avatar */
.card-avatar-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}

.card-avatar-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--portal-bg);
  border: 1.5px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Card Content / Texts */
.card-content-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  margin-bottom: 12px;
  flex: 1;
}

.service-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.service-subtitle {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-blue);
  word-break: break-all;
}

.service-phone-num {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--brand-red);
}

.service-brief {
  font-size: 0.73rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Bottom Action Bar (Heart on left, Badge center, Action Button on right) */
.card-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px dashed var(--card-border);
  padding-top: 10px;
  margin-top: auto;
}

.fav-heart-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s ease, transform 0.15s ease;
}

.fav-heart-btn:hover {
  color: var(--brand-red);
  transform: scale(1.15);
}

.fav-heart-btn.active {
  color: var(--brand-red);
}

.card-category-tag {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* Click Here / Action Button (Matching screenshot's blue outline/pill style) */
.card-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.15s ease;
}

/* Blue "CLICK HERE" style */
.btn-click-here {
  background: rgba(2, 132, 199, 0.08);
  color: var(--text-blue);
  border: 1px solid rgba(2, 132, 199, 0.35);
}

.btn-click-here:hover {
  background: var(--text-blue);
  color: #FFFFFF;
  border-color: var(--text-blue);
}

/* Red "1-CLICK DIAL" style for phone calls */
.btn-dial-now {
  background: rgba(200, 16, 46, 0.08);
  color: var(--brand-red);
  border: 1px solid rgba(200, 16, 46, 0.35);
}

.btn-dial-now:hover {
  background: var(--brand-red);
  color: #FFFFFF;
}

/* WhatsApp Emerald style */
.btn-whatsapp-chat {
  background: rgba(22, 163, 74, 0.08);
  color: var(--color-whatsapp);
  border: 1px solid rgba(22, 163, 74, 0.35);
}

.btn-whatsapp-chat:hover {
  background: var(--color-whatsapp);
  color: #FFFFFF;
}

/* ==========================================================================
   Empty State & Footer
   ========================================================================== */
.catalog-empty-state {
  text-align: center;
  padding: 48px 16px;
  background: var(--card-bg);
  border: 1px dashed var(--card-border);
  border-radius: var(--radius-lg);
}

.empty-avatar {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.catalog-empty-state h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.catalog-empty-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.portal-btn-primary {
  background: var(--text-blue);
  color: #FFFFFF;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.portal-btn-primary:hover {
  background: var(--text-blue-hover);
}

.portal-btn-secondary {
  background: var(--portal-bg);
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.portal-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--card-border);
  text-align: center;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.footer-sublinks {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.footer-sublinks button {
  background: none;
  border: none;
  color: var(--text-blue);
  font-size: 0.74rem;
  cursor: pointer;
  text-decoration: underline;
}

/* ==========================================================================
   Bottom Mobile Action Bar (Mobile Only)
   ========================================================================== */
.mobile-action-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--topbar-bg);
  border-top: 1px solid var(--card-border);
  padding: 6px 12px calc(6px + var(--safe-bottom)) 12px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  z-index: 90;
  justify-content: space-around;
  align-items: center;
}

@media (max-width: 991px) {
  .mobile-action-bar {
    display: flex;
  }
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 4px 6px;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  min-width: 50px;
}

.mobile-nav-btn.active {
  color: var(--text-blue);
}

.mobile-center-call {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-emergency);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
  text-decoration: none;
  transform: translateY(-8px);
  border: 3px solid var(--portal-bg);
}

/* ==========================================================================
   Shift Scratchpad Drawer & Modals
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.notes-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 380px;
  background: var(--surface-bg);
  border-left: 1px solid var(--card-border);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 160;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.notes-drawer.active {
  transform: translateX(0);
}

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

.drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-red);
}

.drawer-title h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.drawer-close-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--portal-bg);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.drawer-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.notes-drawer textarea {
  width: 100%;
  flex: 1;
  background: var(--portal-bg);
  color: var(--text-main);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  resize: none;
  outline: none;
}

.notes-drawer textarea:focus {
  border-color: var(--text-blue);
}

.drawer-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

/* Modals & Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: 90%;
  max-width: 420px;
  background: var(--surface-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  z-index: 210;
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
}

.modal-card.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.install-steps {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.share-icon-preview, .add-icon-preview {
  display: inline-block;
  padding: 2px 6px;
  background: var(--portal-bg);
  border: 1px solid var(--card-border);
  border-radius: 4px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 300;
  pointer-events: none;
}

@media (max-width: 991px) {
  .toast-container {
    bottom: calc(72px + var(--safe-bottom) + 8px);
    right: 12px;
    left: 12px;
    align-items: center;
  }
}

.toast {
  background: #111827;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  animation: toastIn 0.2s ease-out;
}

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