/* ==========================================================================
   دليل الطالب الخدمي | اتحاد طلبة سوريا - فرع جامعة الأندلس
   نظام تصميم خفيف، سريع ومستقل بالكامل بدون أي اعتماديات خارجية أو CDN
   ========================================================================== */

:root {
  color-scheme: light;
  --surface: #ffffff;
  --on-accent: #ffffff;
  --color-teal-dark: #09332c;
  --color-teal: #0f4c42;
  --color-teal-light: #166557;
  --color-teal-soft: #f0fdfa;
  --color-teal-border: #ccfbf1;
  
  --color-red: #c11b1b;
  --color-red-light: #dc2626;
  --color-red-soft: #fef2f2;
  --color-red-border: #fecaca;
  
  --color-amber: #d97706;
  --color-amber-light: #f59e0b;
  --color-amber-soft: #fffbeb;
  
  --color-slate-50: #f8fafc;
  --color-slate-100: #f1f5f9;
  --color-slate-200: #e2e8f0;
  --color-slate-300: #cbd5e1;
  --color-slate-400: #94a3b8;
  --color-slate-500: #64748b;
  --color-slate-600: #475569;
  --color-slate-700: #334155;
  --color-slate-800: #1e293b;
  --color-slate-900: #0f172a;
  
  --font-sans: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-slate-50);
  color: var(--color-slate-800);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Accessibility */
:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Header & Nav */
.site-nav {
  background-color: #ffffff;
  border-bottom: 4px solid var(--color-red);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 30;
}

.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  gap: 0.75rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-emblem {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--color-teal), var(--color-teal-dark));
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.brand-title {
  color: var(--color-red);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.25;
}

.brand-subtitle {
  color: var(--color-teal);
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1.25;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(180deg, #ffffff 0%, var(--color-slate-100) 100%);
  border-bottom: 1px solid var(--color-slate-200);
  padding: 2.25rem 1rem;
  text-align: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-banner-img {
  display: block;
  max-height: 110px;
  width: auto;
  margin: 0 auto 0.85rem auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.06));
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  background-color: var(--color-teal-soft);
  color: var(--color-teal);
  border: 1px solid var(--color-teal-border);
  padding: 0.35rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.775rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  align-self: center;
}

.hero-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-teal-dark);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 2.25rem;
  }
  .brand-title {
    font-size: 1.15rem;
  }
  .brand-subtitle {
    font-size: 0.875rem;
  }
}

.hero-subtitle {
  color: var(--color-slate-600);
  font-size: 0.925rem;
  max-width: 620px;
  margin: 0 auto;
}

/* Main Controls Bar (Filter, Search, Sort) */
.controls-card {
  background-color: #ffffff;
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-xl);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  position: sticky;
  top: 4.25rem;
  z-index: 25;
}

.controls-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 900px) {
  .controls-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.tabs-group {
  display: flex;
  background-color: var(--color-slate-100);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  gap: 0.25rem;
  width: 100%;
}

@media (min-width: 900px) {
  .tabs-group {
    width: auto;
  }
}

.tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--color-slate-600);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.tab-btn:hover {
  color: var(--color-slate-900);
  background-color: rgba(255, 255, 255, 0.5);
}

.tab-btn.tab-active {
  background-color: var(--color-teal);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(15, 76, 66, 0.2);
}

.search-sort-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  flex-grow: 1;
  max-width: 600px;
}

@media (min-width: 600px) {
  .search-sort-group {
    flex-direction: row;
  }
}

.search-wrapper {
  position: relative;
  flex-grow: 1;
}

.search-icon {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-slate-400);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.search-input {
  width: 100%;
  padding: 0.65rem 2.5rem 0.65rem 1rem;
  background-color: var(--color-slate-50);
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--color-slate-800);
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(15, 76, 66, 0.12);
}

.sort-wrapper {
  position: relative;
  min-width: 170px;
}

.sort-select {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 2.25rem;
  background-color: var(--color-slate-50);
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--color-slate-700);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230f4c42'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.75rem center;
  background-size: 16px;
}

.sort-select:focus {
  outline: none;
  border-color: var(--color-teal);
  background-color: #ffffff;
}

/* Notice / Disclaimer Banner */
.notice-banner {
  background-color: var(--color-red-soft);
  border-right: 4px solid var(--color-red);
  border: 1px solid var(--color-red-border);
  border-right-width: 4px;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .notice-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.notice-content {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.85rem;
  color: var(--color-slate-800);
}

.notice-icon {
  color: var(--color-red);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.notice-highlight {
  font-weight: 800;
  color: var(--color-red);
}

.notice-link {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--color-teal);
  text-decoration: underline;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  white-space: nowrap;
  font-family: var(--font-sans);
}

.notice-link:hover {
  color: var(--color-red);
}

/* Syrian Services & Utilities Quick Hub (syfatora.com) */
.sy-hub-card {
  background: #ffffff;
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.15rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .sy-hub-card {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }
  .sy-hub-title { order: 1; flex: 1 1 auto; min-width: 0; }
  .exchange-strip { order: 2; }
  .sy-hub-chips { order: 3; flex: 1 1 100%; }
}

.sy-hub-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--color-teal-dark);
}

.sy-hub-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.sy-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all 0.15s ease;
  background-color: var(--color-slate-100);
  color: var(--color-slate-700);
  border: 1px solid var(--color-slate-200);
}

.sy-chip:hover {
  background-color: var(--color-teal-soft);
  color: var(--color-teal);
  border-color: var(--color-teal-border);
  transform: translateY(-1px);
}

.sy-chip svg {
  width: 13px;
  height: 13px;
}

/* Section Headers */
.section-header {
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid rgba(15, 76, 66, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-teal-dark);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title-mark {
  width: 6px;
  height: 24px;
  background-color: var(--color-red);
  border-radius: var(--radius-full);
  display: inline-block;
}

.section-desc {
  font-size: 0.8rem;
  color: var(--color-slate-500);
  margin-top: 0.25rem;
  margin-right: 1.1rem;
}

/* Grid Layouts */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

.transport-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 640px) {
  .transport-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .transport-grid {
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  }
}

/* Transport rif subgroup */
.transport-rif-subgroup {
  min-width:0;
  margin:.25rem .75rem .75rem;
  border:1px solid var(--color-slate-200);
  border-radius:12px;
  background:var(--surface);
  overflow:hidden;
}
.rif-subgroup-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  font-weight: 700;
  color: var(--color-slate-700);
  min-width:0;
  margin:0;
  padding:.75rem .85rem;
  background:var(--color-slate-50);
  border-bottom:1px solid var(--color-slate-200);
}
.rif-subgroup-name { flex:1; min-width:0; margin:0; font-size:.85rem; font-weight:800; line-height:1.7; }
.rif-subgroup-count { flex-shrink:0; min-width:1.75rem; padding:.15rem .45rem; text-align:center; border-radius:6px; background:var(--color-teal-soft); color:var(--color-teal-dark); font-size:.75rem; }
.rif-icon {
  width: 16px;
  height: 16px;
  color: var(--color-teal);
  flex-shrink: 0;
}
.transport-rif-subgroup .category-items-list {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.directory-detail .transport-rif-subgroup .category-items-list { grid-template-columns:minmax(0,1fr); }

/* Category Card */
.category-card {
  background-color: #ffffff;
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.category-header {
  background: var(--color-teal);
  color: #ffffff;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-header.transport-header {
  background: var(--color-slate-100);
  color: var(--color-teal-dark);
  border-bottom: 1px solid var(--color-slate-200);
}

.category-header.emergency-header { background: var(--color-red); }

.category-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.category-title {
  font-size: 1rem;
  font-weight: 800;
}

.category-icon {
  width: 20px;
  height: 20px;
  color: inherit;
  flex-shrink: 0;
}

.category-count {
  font-size: 0.75rem;
  background-color: rgba(255, 255, 255, 0.95);
  color: var(--color-teal);
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-slate-200);
}

.category-items-list {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
}

.category-items-list > *:not(:last-child) {
  border-bottom: 1px solid var(--color-slate-100);
}

/* Collapsible headers + show-more (debloat long categories) */
.category-header.collapsible {
  cursor: pointer;
  user-select: none;
  gap: 0.5rem;
}

.collapse-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  flex-shrink: 0;
}

.collapse-chevron svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.category-card.card-collapsed .collapse-chevron svg {
  transform: rotate(180deg);
}

.category-card.card-collapsed > .category-items-list,
.category-card.card-collapsed > .card-show-more {
  display: none;
}

.card-show-more {
  padding: 0.5rem 0.75rem 0.75rem 0.75rem;
  text-align: center;
}

.card-show-more button {
  background: none;
  border: 1px dashed var(--color-slate-300);
  color: var(--color-teal);
  border-radius: var(--radius-full);
  padding: 0.35rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.card-show-more button:hover {
  background-color: var(--color-teal-soft);
}

/* Directory tools */
.brand-emblems { display:flex; align-items:center; gap:.4rem; flex-shrink:0; }
.smsa-emblem { background:transparent; }
.partner-brand { flex:1 1 auto; gap:.65rem; }
.partner-names { display:flex; align-items:center; flex-wrap:wrap; gap:.35rem .65rem; font-size:.95rem; line-height:1.5; }
.partner-name { border-inline-start:1px solid var(--color-slate-300); padding-inline-start:.65rem; font-size:.8rem; color:var(--color-teal-dark); }
.admin-partner-names { font-size:.8rem; font-weight:700; color:var(--color-teal-dark); margin:.2rem 0; }
.footer-partner-logos { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:center; gap:1rem; max-width:620px; margin:0 auto 1rem; }
.footer-partner-logos .footer-logo, .footer-partner-logos .collaboration-logo { width:100%; height:auto; max-height:110px; margin:0; object-fit:contain; background:transparent; padding:.5rem; }
@media (max-width:900px) {
  .site-nav-inner:has(.partner-brand) { flex-wrap:wrap; }
  .partner-brand { width:100%; }
}
@media (max-width:599px) {
  .partner-brand .brand-logo-img { width:34px; height:34px; }
  .partner-brand .brand-subtitle { font-size:.65rem; }
  .partner-names { font-size:.8rem; gap:.1rem .4rem; }
  .partner-name { font-size:.7rem; padding-inline-start:0; border:0; }
  .footer-partner-logos { gap:.65rem; }
}
.collaboration-credit { margin:.65rem auto; padding:.65rem 1rem; max-width:600px; color:var(--color-slate-700); font-size:.85rem; line-height:1.8; }
.collaboration-credit strong { color:var(--color-teal-dark); }
.developer-credit { margin:.5rem 0 .85rem; color:var(--color-slate-600); font-size:.8rem; line-height:1.8; }
.collaboration-logo { display:block; width:min(100%, 260px); height:auto; margin:.65rem auto 0; object-fit:contain; }
.admin-reference-links { display:flex; align-items:center; flex-wrap:wrap; justify-content:flex-start; gap:.75rem; padding-top:.75rem; border-top:1px solid var(--color-slate-200); }
.admin-publish-actions { flex-wrap:wrap; align-items:stretch; }
.admin-publish-card #publishStatus:not(.show) { display:none; }
@media (max-width:600px) {
  .admin-publish-actions { width:100%; }
  .admin-publish-actions button { flex:1 1 130px; white-space:normal; }
  .admin-reference-links > div { min-width:0; flex-wrap:wrap; }
  .admin-reference-links a { white-space:normal; text-align:center; }
}
.compact-heading { display:flex; justify-content:space-between; align-items:center; gap:.75rem; padding-top:1rem; padding-bottom:1rem; flex-wrap:wrap; }
.compact-heading h1 { font-size:clamp(1.1rem, 3vw, 1.6rem); color:var(--color-teal-dark); margin:0; }
.feature-actions { display:flex; align-items:center; flex-wrap:wrap; gap:.5rem; padding:.5rem 0; }
.feature-actions > span { flex:1 1 160px; overflow-wrap:anywhere; }
.feature-actions button, .review-row button { min-height:40px; }
.extra-fields { border:1px solid var(--color-slate-200); border-radius:12px; padding:.75rem; display:grid; gap:.75rem; margin:.75rem 0; min-width:0; }
.extra-fields { grid-column:1 / -1; }
.admin-navigation { display:flex; flex-wrap:wrap; gap:.5rem; margin-bottom:1rem; }
.admin-navigation button { flex:1 1 120px; min-height:44px; }
.admin-navigation button[aria-pressed="true"] { background:var(--color-teal); color:white; border-color:var(--color-teal); }
.admin-group { border:1px solid var(--color-slate-200); background:var(--surface); border-radius:12px; padding:.75rem; min-width:0; }
.admin-group > summary { cursor:pointer; color:var(--color-teal); min-height:44px; padding:.25rem; }
.admin-group > summary > div { display:inline-flex !important; width:calc(100% - 1.5rem); gap:.75rem; vertical-align:middle; margin-bottom:0 !important; }
.admin-group[open] > summary { border-bottom:1px solid var(--color-slate-200); margin-bottom:.75rem; }
#dashboardSection .admin-item-row { gap:.5rem; }
#dashboardSection .admin-item-meta { min-width:0; overflow-wrap:anywhere; }
#dashboardSection .admin-item-row > div:last-of-type { flex-wrap:wrap; }
#dashboardSection .admin-card { min-width:0; }
#suggestionsTableContainer { min-width:0; max-width:100%; }
.inbox-toolbar-actions { display:flex; gap:.5rem; align-items:center; flex-wrap:wrap; min-width:0; }
.inbox-table-scroll { max-width:100%; border:1px solid var(--color-slate-200); border-radius:12px; overflow:hidden; }
.inbox-list-head { display:grid; grid-template-columns:2.75rem minmax(0,1fr) 8rem 16rem; align-items:center; gap:0 .75rem; padding:.75rem .6rem; background:var(--color-slate-100); color:var(--color-slate-700); font-size:.75rem; font-weight:800; border-bottom:1px solid var(--color-slate-200); }
.inbox-list-head > :first-child { text-align:center; }
.inbox-list-head > span:not(:first-child) { padding-inline:.4rem; }
.inbox-table { width:100%; font-size:.8rem; text-align:right; }
.inbox-filters, .open-now-filter, .outbox-row { display:flex; align-items:center; flex-wrap:wrap; gap:.75rem; margin:.75rem 0; }
.inbox-filter-group { flex:1 1 20rem; min-width:0; border:1px solid var(--color-slate-200); border-radius:12px; padding:.75rem; margin:0; }
.inbox-filter-group legend { font-weight:800; font-size:.85rem; padding:0 .4rem; color:var(--color-slate-700); }
.inbox-filter-buttons { display:flex; flex-wrap:wrap; gap:.5rem; padding-top:.35rem; }
.inbox-filter-buttons button { flex:1 1 auto; min-height:44px; justify-content:center; }
.inbox-filter-buttons button[aria-pressed="true"] { background:var(--color-teal); color:#fff; border-color:var(--color-teal); box-shadow:inset 0 -3px rgba(0,0,0,.18); }
.inbox-filter-buttons button:focus-visible { outline:2px solid var(--color-teal); outline-offset:3px; }
.open-now-filter { padding:.75rem; border:1px solid var(--color-slate-200); border-radius:12px; cursor:pointer; }
.open-now-filter input { width:20px; height:20px; accent-color:var(--color-teal); }
.open-now-filter small { color:var(--color-slate-500); }
.outbox-panel { padding:1rem; margin:1rem 0; border:1px solid var(--color-amber); border-radius:12px; background:var(--surface); }
.outbox-row span { flex:1 1 12rem; overflow-wrap:anywhere; }
.map-link { margin:.4rem 0; align-self:flex-start; font-size:.75rem; }
#reportModal .modal-dialog { max-width:38rem; }
#reportModal .modal-header { background:var(--surface); color:var(--color-slate-900); border-bottom:1px solid var(--color-slate-200); padding:1rem 1.25rem; }
#reportModal .modal-header-title { min-width:0; gap:.6rem; }
#reportModal .modal-header-title > svg { color:var(--color-teal); flex-shrink:0; }
#reportModalTitle { font-size:1rem; line-height:1.6; }
#reportModal .modal-close-btn { color:var(--color-slate-500); flex-shrink:0; }
#reportModal .modal-body { display:flex; flex-direction:column; gap:1rem; padding:1.25rem; }
.report-recipient { padding:.85rem 1rem; border-radius:12px; background:var(--color-teal-soft); border:1px solid var(--color-teal-border); }
.report-recipient > span { font-size:.75rem; color:var(--color-slate-600); }
#reportItemName { margin:.25rem 0 0; font-size:.95rem; font-weight:800; color:var(--color-slate-900); overflow-wrap:anywhere; }
#reportField { display:flex; flex-wrap:wrap; gap:.5rem; padding:.85rem; }
#reportField legend, .report-hours legend { font-weight:800; font-size:.85rem; padding:0 .35rem; color:var(--color-slate-700); }
#reportField label, .report-days label { display:flex; align-items:center; gap:.4rem; min-height:44px; padding:.4rem .6rem; border:1px solid var(--color-slate-200); border-radius:10px; cursor:pointer; }
#reportField label:has(input:checked), .report-days label:has(input:checked) { background:var(--color-teal-soft); border-color:var(--color-teal); color:var(--color-teal-dark); }
#reportModal input[type="checkbox"] { width:18px; height:18px; margin:0; flex-shrink:0; accent-color:var(--color-teal); }
#reportCorrections { grid-template-columns:minmax(0,1fr); gap:1rem; padding:0; margin:0; border:0; }
#reportCorrections > .contact-note { font-size:.78rem; line-height:1.8; }
#reportModal .form-input { min-height:44px; }
#reportField { margin:0; }
#reportField label { flex:1 1 7.5rem; font-size:.82rem; justify-content:flex-start; }
#reportModal .modal-footer { border-top:1px solid var(--color-slate-200); gap:.5rem; }
#reportModal .modal-footer button { min-height:44px; }
@media (max-width:480px) {
  #reportModal .modal-body { padding:1rem; }
  #reportModal .modal-header { padding:.85rem 1rem; }
}
#reportCorrections > p, .report-hours { grid-column:1/-1; }
#reportCorrections .form-label > input, #reportCorrections .form-label > textarea { margin-top:.45rem; }
.report-hours { min-width:0; padding:1rem; border:1px solid var(--color-slate-200); border-radius:12px; }
.report-check { display:flex; gap:.5rem; align-items:center; min-height:44px; cursor:pointer; }
.report-times { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem; margin:.5rem 0; }
.report-times input { width:100%; min-width:0; margin-top:.4rem; }
.report-times input:disabled { opacity:.45; }
.report-days { display:grid; grid-template-columns:repeat(auto-fit,minmax(6rem,1fr)); gap:.5rem; margin:.75rem 0; }
.report-day-actions { display:flex; flex-wrap:wrap; gap:.5rem; }
.extra-periods { display:grid; gap:1rem; margin:.75rem 0; min-width:0; }
.hours-period { min-width:0; border:1px solid var(--color-slate-200); border-radius:12px; padding:.85rem; }
.hours-period legend { font-size:.85rem; font-weight:800; padding:0 .4rem; }
.hours-period input[type="checkbox"] { width:18px; height:18px; flex-shrink:0; accent-color:var(--color-teal); }
#reportNote { min-height:6rem; }
.inbox-table th, .inbox-table td { min-width:0; vertical-align:top; overflow-wrap:normal; word-break:normal; line-height:1.8; }
.inbox-table th { white-space:nowrap; }
.inbox-table td[data-label="المحافظة"], .inbox-table td[data-label="التقييم"] { white-space:nowrap; }
.inbox-contact { display:block; max-width:100%; font-family:monospace; text-align:left; white-space:normal; overflow-wrap:anywhere; unicode-bidi:isolate; }
.inbox-notes { white-space:pre-line; overflow-wrap:anywhere; }
.inbox-action-buttons { display:flex; flex-direction:column; align-items:stretch; gap:.4rem; }
.inbox-action-buttons > button { white-space:normal; overflow-wrap:anywhere; min-width:0; width:100%; margin-top:0 !important; }
.inbox-action-buttons svg { flex-shrink:0; }
.inbox-action-buttons > .admin-badge { align-self:flex-start; font-size:.7rem; padding:.2rem .5rem; }
.inbox-select-label { display:flex; align-items:center; justify-content:center; gap:.5rem; min-height:44px; cursor:pointer; }
.inbox-select-label span { display:none; }
.inbox-select-label input, #bulkSelectAll { width:20px; height:20px; flex:0 0 20px; margin:0; accent-color:var(--color-teal); cursor:pointer; }
.inbox-select-label input:focus-visible, #bulkSelectAll:focus-visible { outline:2px solid var(--color-teal); outline-offset:3px; }
.inbox-table tr:has(input[data-bulk]:checked) { box-shadow:inset -4px 0 var(--color-teal); }
#bulkBar > label { min-height:44px; }
/* #dashboardSection is hidden by default in HTML; JS shows it after login */
.inbox-table .admin-badge { max-width:100%; white-space:normal; text-align:center; line-height:1.6; }
.inbox-select-label { display:flex; align-items:center; justify-content:center; gap:.4rem; min-height:40px; cursor:pointer; }
.inbox-select-label span { display:none; }
.inbox-select-label input, #bulkSelectAll { width:20px; height:20px; flex:0 0 20px; margin:0; accent-color:var(--color-teal); cursor:pointer; }
.inbox-select-label input:focus-visible, #bulkSelectAll:focus-visible { outline:2px solid var(--color-teal); outline-offset:3px; }
.inbox-table tr:has(input[data-bulk]:checked) { box-shadow:inset -4px 0 var(--color-teal); }
#bulkBar > label { min-height:44px; }
.inbox-table, .inbox-table tbody { display:block; min-width:0; }
  .inbox-table colgroup { display:none; }
  .inbox-table thead { display:none; }
  .inbox-table tbody { display:grid; gap:0; }
  .inbox-table tbody tr {
    display:grid;
    grid-template-columns:2.75rem minmax(0,1fr) 8rem 16rem;
    gap: 0 .75rem;
    border-bottom: 1px solid var(--color-slate-200);
    padding: .7rem .6rem;
    align-items: center;
  }
  .inbox-table td { display:none; }
  .inbox-table tbody td { padding:.2rem .4rem !important; text-align:start !important; }
  .inbox-table td.inbox-select { display:flex; grid-column:1; grid-row:1/3; align-items:center; justify-content:center; padding:0 !important; }
  .inbox-table td[data-label="الاسم"] {
    display:block; grid-column:2; grid-row:1;
    font-size:.85rem; font-weight:800; color:var(--color-slate-900);
  }
  .inbox-table td.inbox-contact-cell {
    display:flex; flex-direction:column; align-items:flex-start; gap:.2rem;
    grid-column:2; grid-row:2;
  }
  .inbox-table .inbox-contact {
    font-family:monospace; font-size:.8rem; white-space:nowrap; width:fit-content; text-align:start;
    overflow:hidden; text-overflow:ellipsis; max-width:100%;
  }
  .inbox-table .inbox-contact-cell > .admin-badge {
    font-size:.7rem; padding:.25rem .5rem; line-height:1.4;
  }
  .inbox-table td[data-label="النوع"] {
    display:block; grid-column:3; grid-row:1;
    font-size:.7rem;
  }
  .inbox-table td[data-label="التقييم"] {
    display:block; grid-column:3; grid-row:2;
    color:var(--color-slate-600); font-size:.75rem; white-space:nowrap;
  }
  .inbox-table td.inbox-actions {
    display:flex; align-items:center; justify-content:flex-start; gap:.3rem;
    grid-column:4; grid-row:1/3;
  }
  .inbox-table td.inbox-actions .inbox-action-buttons { width:100%; }
  .inbox-toggle { display:inline-flex; min-height:40px; padding:.35rem .65rem; font-size:.725rem; flex-shrink:0; border-radius:6px; }
.inbox-action-buttons { display:flex; flex-direction:row; flex-wrap:wrap; gap:.4rem; align-items:center; justify-content:flex-start; max-width:100%; }
.inbox-action-buttons > button {
    flex:0 1 auto; width:auto; min-height:44px; font-size:.75rem !important;
    padding:.45rem .7rem !important; border-radius:6px; line-height:1.5;
    white-space:normal; overflow-wrap:normal;
}
.inbox-action-buttons > .admin-badge { align-self:flex-start; font-size:.7rem; padding:.25rem .5rem; }
.inbox-table .inbox-action-buttons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.4rem; align-items:stretch; }
.inbox-table .inbox-action-buttons > button { width:100%; min-width:0; min-height:44px; justify-content:center; text-align:center; margin:0 !important; padding:.45rem .5rem !important; line-height:1.6; }
.inbox-table .inbox-action-buttons > .admin-badge { grid-column:1/-1; justify-self:start; text-align:start; }
.submission-hours-group { min-width:0; margin:.75rem 0; padding:.75rem; border:1px solid var(--color-slate-200); border-radius:12px; }
.submission-hours-group legend { font-size:.85rem; font-weight:800; padding:0 .4rem; }
#inboxDetailsModal .modal-dialog { width:min(36rem,calc(100% - 1.5rem)); }
#inboxDetailsModal .modal-header {
    background:var(--surface); color:var(--color-slate-900);
    border-bottom:1px solid var(--color-slate-200);
    padding:1rem 1.25rem; display:flex; justify-content:space-between; align-items:center;
}
#inboxDetailsTitle { margin:0; font-size:1.1rem; font-weight:800; }
#inboxDetailsModal .modal-close-btn {
    background:none; border:none; color:var(--color-slate-500);
    font-size:1.6rem; line-height:1; cursor:pointer; padding:0;
}
#inboxDetailsModal .modal-close-btn:hover { color:var(--color-slate-900); }
#inboxDetailsActions {
    padding:1rem 1.25rem; border-top:1px solid var(--color-slate-200);
    background:var(--surface); display:flex; gap:.5rem; flex-wrap:wrap;
    justify-content:flex-end;
}
#inboxDetailsActions > button {
    min-height:40px; font-size:.75rem; padding:.5rem .9rem; border-radius:6px;
}
#inboxDetailsContent { margin:0; padding:0 1.25rem 1rem; }
#inboxDetailsContent dt {
    color:var(--color-slate-500); font-size:.725rem; font-weight:700;
    margin-top:.75rem; text-align:right;
}
#inboxDetailsContent dd {
    margin:.2rem 0 .65rem; padding-bottom:.65rem; border-bottom:1px solid var(--color-slate-200);
    white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.7; font-size:.85rem;
}
#inboxDetailsContent dd:last-child { border-bottom:0; }
@media (max-width:800px) {
    .inbox-list-head, .inbox-table tbody tr {
        grid-template-columns:2.5rem minmax(0,1fr) 5.5rem;
        gap: 0 .4rem;
    }
    .inbox-list-head > :last-child { display:none; }
    .inbox-list-head { font-size:.7rem; padding:.7rem .35rem; }
    .inbox-table tbody tr { padding:.6rem .35rem; }
    .inbox-table td.inbox-actions {
        grid-column: 1/-1; grid-row:3;
        flex-direction:column; align-items:stretch; gap:.3rem;
        padding-top:.65rem !important;
    }
    .inbox-table td.inbox-actions::before {
        content:'الإجراءات'; display:block; font-size:.65rem;
        color:var(--color-slate-500); margin-bottom:.3rem;
    }
    .inbox-action-buttons {
        display:grid; grid-template-columns:repeat(2,minmax(0,1fr));
        gap:.4rem; max-width:none; justify-content:inherit;
    }
    .inbox-action-buttons > button { width:100%; min-width:0; }
    .inbox-action-buttons > span { grid-column:1/-1; }
}
@media (min-width:700px) { .extra-fields { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:500px) {
  #dashboardSection .admin-card { padding:.85rem; }
  #dashboardSection .admin-card > div { max-width:100%; }
  #btnPushGitHub { font-size:.75rem; white-space:normal; }
  #repoNameBadge { overflow-wrap:anywhere; }
  .admin-group > summary > div { flex-wrap:wrap; }
}
.extra-fields legend { color:var(--color-teal-dark); font-size:.85rem; }
.extra-fields input { display:block; margin-top:.25rem; }
.review-row, .tracker-panel { border:1px solid var(--color-slate-200); border-radius:12px; padding:1rem; background:var(--surface); margin:.75rem 0; overflow-wrap:anywhere; }
.tracker-panel { display:flex; flex-direction:column; gap:.75rem; }
.tracker-panel h2, #directoryTools h3 { font-size:1rem; margin:.5rem 0; }
.tracker-panel p, .review-row p { font-size:.8rem; color:var(--color-slate-600); }
.drag-handle { touch-action:none; cursor:grab; flex-shrink:0; font-size:1.2rem; min-width:44px; min-height:44px; }
.dragging { opacity:.65; }
.report-shortcut { font-size:.7rem; padding:.35rem .5rem; gap:.25rem; }
.report-shortcut svg { width:14px; height:14px; }
.drop-target { outline:2px dashed var(--color-teal); outline-offset:2px; }
.directory-move-select { flex:0 1 12rem; width:12rem; max-width:100%; min-height:44px; font-size:.75rem; }
.extra-service-categories { display:contents; }
.create-category-form { display:flex; flex-wrap:wrap; align-items:center; gap:.75rem; margin-bottom:1rem; padding-bottom:1rem; border-bottom:1px solid var(--color-slate-200); }
.create-category-form input { flex:1 1 12rem; min-width:0; width:auto; }
.create-category-form label { font-weight:800; }
#submissionEditModal .modal-body { display:flex; flex-direction:column; gap:.5rem; }
#submissionEditModal .modal-header { background:var(--surface); color:var(--color-slate-900); border-bottom:1px solid var(--color-slate-200); }
#submissionEditTitle { font-size:1rem; }
.category-order-controls { display:inline-flex; gap:.35rem; margin-inline-start:auto; align-items:center; }
.category-order-controls button { min-width:44px; min-height:44px; }
.weekly-hours { min-width:0; width:100%; margin:.5rem 0; }
.weekly-hours-day { display:grid; grid-template-columns:6rem minmax(0,1fr) 44px; align-items:center; gap:.5rem; padding:.5rem 0; border-bottom:1px solid var(--color-slate-200); font-size:.82rem; }
.weekly-hours-value { text-align:end; color:var(--color-slate-600); overflow-wrap:anywhere; }
.weekly-hours-day button { min-width:44px; min-height:44px; padding:.3rem; }
.weekly-hours-quick, .weekly-hours-modes { display:flex; flex-wrap:wrap; gap:.5rem; margin:.8rem 0; }
.weekly-hours-quick button { min-height:44px; font-size:.75rem; }
.weekly-hours-pane { min-width:0; margin-top:1rem; padding:1rem; border:1px solid var(--color-slate-200); border-radius:12px; background:var(--surface); }
.weekly-hours-pane legend { font-size:.85rem; font-weight:800; padding:0 .4rem; }
.weekly-hours-days { display:grid; grid-template-columns:repeat(auto-fit,minmax(4rem,1fr)); gap:.4rem; }
.weekly-hours-days label { position:relative; display:flex; align-items:center; justify-content:center; min-height:44px; cursor:pointer; }
.weekly-hours-days input { position:absolute; opacity:0; width:1px; height:1px; }
.weekly-hours-days span { display:flex; width:100%; min-height:44px; align-items:center; justify-content:center; padding:.5rem .4rem; border:1px solid var(--color-slate-200); border-radius:24px; font-size:.75rem; }
.weekly-hours-days input:checked + span { color:var(--color-teal-dark); background:var(--color-teal-soft); border-color:var(--color-teal); }
.weekly-hours-days input:focus-visible + span { outline:2px solid var(--color-teal); outline-offset:2px; }
.weekly-hours-modes label { display:flex; align-items:center; gap:.4rem; min-height:44px; font-size:.8rem; cursor:pointer; }
.weekly-hours-modes input { width:18px; height:18px; flex:0 0 18px; margin:0; accent-color:var(--color-teal); }
.weekly-hours-shifts { display:grid; gap:.7rem; }
.weekly-hours-shift { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px; align-items:end; gap:.5rem; }
.weekly-hours-shift label { min-width:0; font-size:.75rem; }
.weekly-hours-shift input { display:block; width:100%; min-width:0; min-height:44px; margin-top:.3rem; }
.weekly-hours-shift button { min-height:44px; min-width:44px; padding:.3rem; }
.weekly-hours-error { color:var(--color-red); font-size:.8rem; }
.weekly-hours-modes { gap:.5rem; margin:1rem 0; }
.weekly-hours-modes label { flex:1 1 auto; justify-content:center; padding:.45rem .65rem; border:1px solid var(--color-slate-200); border-radius:8px; font-weight:600; }
.weekly-hours-modes label:has(input:checked) { border-color:var(--color-teal); background:var(--color-teal-soft); color:var(--color-teal-dark); }
.weekly-hours-shifts { gap:1rem; margin-top:.75rem; }
.weekly-hours-shift { gap:.65rem; }
.weekly-hours-shift input { padding:.5rem .65rem; border-radius:8px; }
.weekly-hours-shift button { border-radius:8px; }
.weekly-hours-pane .weekly-hours-add { display:flex; width:fit-content; min-height:44px; margin-top:1rem; padding:.45rem .8rem; border:1px dashed var(--color-teal); border-radius:8px; background:transparent; color:var(--color-teal-dark); font-size:.8rem; }
.weekly-hours-pane .weekly-hours-hint { margin:1rem 0; padding:.65rem .8rem; border-inline-start:3px solid var(--color-teal); border-radius:6px; background:var(--color-slate-50); color:var(--color-slate-600); font-size:.75rem; line-height:1.9; white-space:pre-line; }
.weekly-hours-error:empty { display:none; }
.weekly-hours-pane .weekly-hours-actions { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:.65rem; margin:1rem 0 0; padding-top:1rem; border-top:1px solid var(--color-slate-200); }
.weekly-hours-actions button { min-height:44px; padding:.6rem .85rem; border-radius:8px; line-height:1.6; white-space:normal; }
@media (max-width:480px) { .weekly-hours-pane .weekly-hours-actions { grid-template-columns:minmax(0,1fr); } }
.weekly-hours button:focus-visible { outline:2px solid var(--color-teal); outline-offset:3px; }
@media (max-width:480px) {
  .weekly-hours-shift { grid-template-columns:minmax(0,1fr) 44px; align-items:center; padding-bottom:.75rem; border-bottom:1px solid var(--color-slate-200); }
  .weekly-hours-shift label { grid-column:1; }
  .weekly-hours-shift button { grid-column:2; grid-row:1/3; }
  .weekly-hours-pane > .weekly-hours-quick { flex-direction:column; align-items:stretch; }
}
.modal-dialog, .modal-body { scrollbar-width:thin; scrollbar-color:var(--color-slate-400) var(--surface); scrollbar-gutter:stable; }
.modal-dialog::-webkit-scrollbar, .modal-body::-webkit-scrollbar { width:7px; height:7px; }
.modal-dialog::-webkit-scrollbar-track, .modal-body::-webkit-scrollbar-track { background:var(--surface); border-radius:10px; }
.modal-dialog::-webkit-scrollbar-thumb, .modal-body::-webkit-scrollbar-thumb { background:var(--color-slate-400); border:2px solid var(--surface); border-radius:10px; }
.modal-dialog::-webkit-scrollbar-thumb:hover, .modal-body::-webkit-scrollbar-thumb:hover { background:var(--color-slate-500); }
@media (max-width:400px) { .weekly-hours-day { grid-template-columns:4rem minmax(0,1fr) 44px; } .weekly-hours-pane { padding:.65rem; } }
#admin-panel-records > #directoryTools { margin-top:1.5rem; padding:1rem 0 0; border:0; border-top:1px solid var(--color-slate-200); border-radius:0; box-shadow:none; }
#directoryTools { margin-bottom:1rem; }

/* Category-first directory */
[hidden] { display: none !important; }
#categoryBrowser { margin: 1.5rem 0 2rem; }
.category-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.category-group { margin-top:1.5rem; }
.exchange-strip { flex:1 1 100%; width:100%; min-width:0; padding:.55rem .7rem; border:1px solid var(--color-slate-200); border-radius:12px; background:var(--color-slate-50); }
.exchange-heading { display:flex; justify-content:space-between; align-items:center; gap:.5rem; flex-wrap:wrap; }
.exchange-heading h2 { font-size:.85rem; color:var(--color-teal-dark); margin:0; }
.exchange-heading .btn-secondary { padding:.2rem .65rem; font-size:.7rem; white-space:nowrap; }
.exchange-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:.4rem; margin:.4rem 0; }
.exchange-rate { display:flex; flex-wrap:wrap; align-items:baseline; gap:.15rem .8rem; border:1px solid var(--color-slate-200); border-radius:10px; padding:.4rem .6rem; background:var(--surface); color:var(--color-slate-900); min-width:0; }
.exchange-rate strong { font-size:.8rem; }
.exchange-rate-values { display:inline-flex; flex-wrap:wrap; gap:.25rem .9rem; font-size:.82rem; font-weight:700; margin:0; }
.exchange-rate small, .exchange-status { font-size:.7rem; color:var(--color-slate-500); }
.exchange-rate small { display:inline; }
.exchange-status { margin:.35rem 0 .15rem; overflow-wrap:anywhere; }
.exchange-status.exchange-stale { color:var(--color-red); }
.exchange-disclaimer { font-size:.7rem; color:var(--color-slate-500); margin:0; overflow-wrap:anywhere; }
@media (max-width:599px) {
  .exchange-strip { padding:.45rem .55rem; }
  .exchange-heading h2 { font-size:.8rem; }
  .exchange-rate { gap:.1rem .6rem; padding:.35rem .5rem; }
  .exchange-rate strong { font-size:.75rem; }
  .exchange-rate-values { font-size:.78rem; gap:.15rem .7rem; }
  .exchange-rate small, .exchange-status, .exchange-disclaimer { font-size:.66rem; }
  .exchange-status, .exchange-disclaimer { line-height:1.5; }
}.category-group + .category-group { border-top:1px solid var(--color-slate-200); padding-top:1.5rem; margin-top:2rem; }
.category-group h3 { font-size:1.1rem; color:var(--color-teal-dark); }
.category-group > p { color:var(--color-slate-500); font-size:.8rem; margin:.35rem 0 1rem; }
.pharmacy-directory-hint { color:var(--color-slate-600); background:var(--color-teal-soft); border-bottom:1px solid var(--color-teal-border); font-size:.8rem; line-height:1.8; margin:0; padding:.65rem 1rem; }
.category-tile { display: flex; flex-direction: column; align-items: flex-start; gap: .65rem; text-align: right; padding: 1.15rem; border: 1px solid var(--color-slate-200); border-radius: var(--radius-lg); background: var(--surface, white); color: var(--color-slate-900); font: inherit; cursor: pointer; min-width: 0; }
.category-tile svg { width: 28px; height: 28px; color: var(--color-teal); }
.category-tile strong { font-size: .95rem; }
.category-tile span { color: var(--color-slate-500); font-size: .75rem; }
.tile-title-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; min-width: 0; }
.category-tile .tile-count { min-width: 1.7rem; height: 1.7rem; padding: 0 .45rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--color-teal-soft); color: var(--color-teal-dark); border: 1px solid var(--color-teal-border); font-size: .78rem; font-weight: 800; }
.category-tile:hover { border-color: var(--color-teal); background: var(--color-teal-soft); }
.category-tile:focus-visible { outline: 3px solid var(--color-teal); outline-offset: 3px; }
.browse-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; margin: 1.25rem 0; }
.card-filter { display: flex; align-items: center; gap: .5rem; padding: .55rem .9rem 0; }
.card-filter .form-label { font-size: .75rem; white-space: nowrap; margin: 0; }
.card-filter .form-select { flex: 1; min-width: 0; font-size: .8rem; padding: .4rem .6rem; }
.browse-toolbar button { min-height: 44px; }
#browseStatus { font-size: 1.1rem; color: var(--color-slate-900); }
.directory-detail .services-grid, .directory-detail .transport-grid { grid-template-columns: minmax(0, 1fr); }
.directory-detail #section-services > .section-header, .directory-detail #section-transport > .section-header { display: none; }
.directory-detail .category-items-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; padding: .75rem; }
.directory-detail .category-items-list > .contact-item { border: 1px solid var(--color-slate-200); }
@media (min-width: 700px) {
  .category-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .directory-detail .category-items-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1050px) { .category-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Contact Item Card */
.contact-item {
  padding: 0.95rem 0.85rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  height: 100%;
  transition: background-color 0.15s ease;
  background-color: #ffffff;
}

.contact-item:hover {
  background-color: var(--color-slate-50);
}

.contact-header {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.contact-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--color-slate-900);
  line-height: 1.35;
  word-break: break-word;
}

.contact-phone-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.1rem;
}

.contact-phone {
  font-family: monospace;
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--color-slate-600);
  direction: ltr;
  display: inline-block;
  letter-spacing: 0.04em;
  background-color: var(--color-slate-100);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-slate-200);
}

.verified-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--color-teal);
  background-color: var(--color-teal-soft);
  border: 1px solid var(--color-teal-border);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.contact-note {
  font-size: 0.775rem;
  color: var(--color-slate-600);
  margin-top: 0.15rem;
  line-height: 1.45;
}

/* Honest Ratings Widget */
.rating-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.2rem;
  flex-wrap: wrap;
}

.stars-list {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.star-btn {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--color-slate-300);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: transform 0.15s ease, color 0.15s ease;
  min-width: 20px;
  min-height: 20px;
}

.star-btn:hover {
  transform: scale(1.2);
  color: var(--color-amber-light);
}

.star-btn.star-filled {
  color: var(--color-amber-light);
}

.star-btn svg {
  width: 14px;
  height: 14px;
}

/* Buttons are ordered 1..5 (right to left in Arabic). Preview every star
   through the hovered/focused value, not just the one under the pointer.
   Temporarily clear a saved higher score while previewing a lower one. */
.stars-list:has(.star-btn:is(:hover, :focus)) .star-btn {
  color: var(--color-slate-300);
}
.stars-list:has(.star-btn:hover) .star-btn:hover,
.stars-list:has(.star-btn:hover) .star-btn:has(~ .star-btn:hover),
.stars-list:not(:has(.star-btn:hover)):has(.star-btn:focus) .star-btn:focus,
.stars-list:not(:has(.star-btn:hover)):has(.star-btn:focus) .star-btn:has(~ .star-btn:focus) {
  color: var(--color-amber-light);
}
.star-btn:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 2px;
}

.rating-score {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--color-amber);
}

.rating-count {
  font-size: 0.7rem;
  color: var(--color-slate-400);
}

.rating-unrated {
  font-size: 0.7rem;
  color: var(--color-slate-400);
  font-weight: 600;
}

.rating-average {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--color-amber);
  background: var(--color-amber-soft);
  border: 1px solid var(--color-amber-border, #fde68a);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  white-space: nowrap;
}

/* Contact Footer Actions Bar */
.contact-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--color-slate-200);
  margin-top: auto;
}

.contact-primary-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.contact-tool-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.btn-icon {
  background: none;
  border: none;
  padding: 0.35rem;
  color: var(--color-slate-400);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 30px;
}

.btn-icon:hover {
  color: var(--color-teal);
  background-color: var(--color-slate-100);
  transform: scale(1.08);
}

.btn-icon.btn-report:hover {
  color: var(--color-red);
  background-color: var(--color-red-soft);
}

.btn-icon svg {
  width: 15px;
  height: 15px;
}

.btn-call {
  background-color: var(--color-teal);
  color: #ffffff;
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  min-height: 32px;
}

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

.btn-call svg {
  width: 13px;
  height: 13px;
}

.btn-visit {
  background-color: var(--color-red);
  color: #ffffff;
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  min-height: 32px;
}

.btn-visit:hover {
  background-color: var(--color-red-light);
  transform: translateY(-1px);
}

.btn-visit svg {
  width: 13px;
  height: 13px;
}

.btn-whatsapp {
  background-color: #128c7e;
  color: #ffffff;
  border: none;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  min-height: 32px;
}

.btn-whatsapp:hover {
  background-color: #075e54;
  transform: translateY(-1px);
}

.btn-whatsapp svg {
  width: 13px;
  height: 13px;
}

.schedule-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.725rem;
  font-weight: 700;
  color: #0369a1;
  background-color: #f0f9ff;
  border: 1px solid #bae6fd;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  margin-top: 0.35rem;
  max-width: 100%;
  line-height: 1.4;
  word-break: break-word;
}

/* Install PWA Prompt Banner */
.pwa-banner {
  background: linear-gradient(135deg, var(--color-teal-dark), var(--color-teal));
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-md);
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pwa-banner-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Empty Search State */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background-color: #ffffff;
  border: 1px dashed var(--color-slate-300);
  border-radius: var(--radius-xl);
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  display: none;
}

.empty-state-icon {
  width: 44px;
  height: 44px;
  color: var(--color-slate-300);
  margin: 0 auto 0.75rem auto;
}

.empty-state-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-slate-700);
}

.empty-state-text {
  font-size: 0.825rem;
  color: var(--color-slate-400);
  margin-top: 0.35rem;
}

/* Buttons */
.btn-primary {
  background-color: var(--color-teal);
  color: #ffffff;
  border: none;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s, transform 0.1s;
}

.btn-primary:hover {
  background-color: var(--color-teal-light);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-accent {
  background-color: var(--color-red);
  color: #ffffff;
  border: none;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s;
}

.btn-accent:hover {
  background-color: var(--color-red-light);
}

.btn-secondary {
  background-color: var(--color-slate-100);
  color: var(--color-slate-700);
  border: 1px solid var(--color-slate-200);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: background-color 0.15s;
}

.btn-secondary:hover {
  background-color: var(--color-slate-200);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}

.toast {
  background-color: var(--color-slate-900);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.toast-show {
  opacity: 1;
  transform: translateY(0);
}

.toast.toast-error {
  background-color: #991b1b;
}

.toast.toast-success {
  background-color: var(--color-teal-dark);
}

.toast svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Modal System (Pure CSS, Default Hidden, Zero Flash) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
  overflow-y: auto;
}

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

.modal-dialog {
  background-color: #ffffff;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-slate-200);
  animation: modalIn 0.2s ease-out forwards;
}

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

.modal-header {
  background: var(--color-teal);
  color: #ffffff;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header.modal-header-alert {
  background: var(--color-red);
}

.modal-header-title {
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.modal-close-btn:hover {
  color: #ffffff;
}

.modal-close-btn svg {
  width: 20px;
  height: 20px;
}

.modal-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-slate-700);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background-color: var(--color-slate-50);
  border: 1px solid var(--color-slate-300);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--color-slate-800);
  transition: border-color 0.15s, background-color 0.15s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(15, 76, 66, 0.12);
}

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

.form-error {
  color: var(--color-red);
  font-size: 0.75rem;
  font-weight: 700;
  display: none;
}

.form-error.form-error-show {
  display: block;
}

.modal-footer {
  padding: 0.75rem 1.25rem;
  background-color: var(--color-slate-50);
  border-top: 1px solid var(--color-slate-200);
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Footer */
.site-footer {
  background-color: #ffffff;
  border-top: 1px solid var(--color-slate-200);
  padding: 2.5rem 1rem 1.75rem 1rem;
  margin-top: auto;
  text-align: center;
}

.footer-logo {
  display: block;
  height: 100px;
  width: 320px;
  margin: 0 auto 0.75rem auto;
  object-fit: cover;
  cursor: pointer;
  user-select: none;
}

.footer-team-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--color-teal-dark);
}

.footer-team-subtitle {
  font-size: 0.8rem;
  color: var(--color-slate-500);
  margin-top: 0.25rem;
  margin-bottom: 1.25rem;
}

.footer-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.footer-admin-link {
  font-size: 0.75rem;
  color: var(--color-slate-400);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.15s;
}

.footer-admin-link:hover {
  color: var(--color-teal);
}

/* ==========================================================================
   Admin Dashboard Specific Styles
   ========================================================================== */

.admin-card {
  background-color: #ffffff;
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.admin-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background-color: var(--color-slate-50);
  border-radius: var(--radius-md);
  margin-bottom: 0.4rem;
  font-size: 0.825rem;
  border: 1px solid var(--color-slate-200);
  gap: 0.5rem;
}

.admin-item-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
}

.admin-badge-teal {
  background-color: var(--color-teal-soft);
  color: var(--color-teal);
  border: 1px solid var(--color-teal-border);
}

.admin-badge-red {
  background-color: var(--color-red-soft);
  color: var(--color-red);
  border: 1px solid var(--color-red-border);
}

.admin-badge-amber {
  background-color: var(--color-amber-soft);
  color: var(--color-amber);
  border: 1px solid #fde68a;
}

.status-box {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  font-weight: 700;
  display: none;
  margin-top: 1rem;
}

.status-box.show {
  display: block;
}

.status-box-info {
  background-color: var(--color-amber-soft);
  color: var(--color-amber);
  border: 1px solid #fde68a;
}

.status-box-success {
  background-color: var(--color-teal-soft);
  color: var(--color-teal-dark);
  border: 1px solid var(--color-teal-border);
}

.status-box-error {
  background-color: var(--color-red-soft);
  color: var(--color-red);
  border: 1px solid var(--color-red-border);
}

/* ==========================================================================
   DARK MODE THEME
   ========================================================================== */
html[data-theme="dark"] {
  color-scheme: dark;
  --surface: #151f2b;
  --on-accent: #ffffff;
  --action-teal: #0f766e;
  --action-teal-hover: #115e59;
  --color-slate-50: #0d141c;
  --color-slate-100: #151f2b;
  --color-slate-200: #243243;
  --color-slate-300: #3a4b5d;
  --color-slate-400: #a3b3c8;
  --color-slate-500: #94a3b8;
  --color-slate-600: #cbd5e1;
  --color-slate-700: #e2e8f0;
  --color-slate-800: #f1f5f9;
  --color-slate-900: #f8fafc;

  --color-teal-dark: #d7eee7;
  --color-teal: #71cbbb;
  --color-teal-light: #9cddcf;
  --color-teal-soft: #152e2b;
  --color-teal-border: #2d514a;

  --color-red: #f87171;
  --color-amber: #fbbf24;
  --color-amber-soft: #382b16;
  --color-red-soft: #2b1717;
  --color-red-border: #5f1f1f;
}

html[data-theme="dark"] body {
  background-color: var(--color-slate-50);
  color: var(--color-slate-800);
}

html[data-theme="dark"] .site-nav {
  background-color: #111a24;
  border-bottom: 1px solid #34414d;
}

html[data-theme="dark"] .brand-title {
  color: #f8fafc;
}

html[data-theme="dark"] .brand-subtitle {
  color: #94a3b8;
}

html[data-theme="dark"] .site-footer {
  background-color: #111a24;
  border-top-color: var(--color-slate-200);
}

html[data-theme="dark"] .footer-team-title {
  color: var(--color-teal);
}

html[data-theme="dark"] .controls-card,
html[data-theme="dark"] .category-card,
html[data-theme="dark"] .sy-hub-card,
html[data-theme="dark"] .modal-dialog,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .admin-card {
  background-color: var(--color-slate-100);
  border-color: var(--color-slate-200);
}

html[data-theme="dark"] .admin-item-row {
  background-color: var(--color-slate-200);
  border-color: var(--color-slate-300);
}

html[data-theme="dark"] .admin-item-row strong {
  color: #ffffff;
}

html[data-theme="dark"] .contact-item {
  border-color: var(--color-slate-200);
  background-color: transparent;
}

html[data-theme="dark"] .contact-item:hover {
  background-color: var(--color-slate-200);
}

html[data-theme="dark"] .search-input,
html[data-theme="dark"] .sort-select,
html[data-theme="dark"] .form-input,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .form-textarea {
  background-color: var(--color-slate-200);
  border-color: var(--color-slate-300);
  color: #ffffff;
}

html[data-theme="dark"] .btn-secondary {
  background-color: var(--color-slate-200);
  border-color: var(--color-slate-300);
  color: var(--color-slate-700);
}

html[data-theme="dark"] .category-header.transport-header {
  background: var(--color-slate-200);
  color: #ffffff;
  border-bottom-color: var(--color-slate-300);
}

html[data-theme="dark"] .schedule-badge {
  background-color: #0c4a6e !important;
  color: #38bdf8 !important;
  border-color: #0284c7 !important;
}

html[data-theme="dark"] .btn-icon:hover {
  background-color: var(--color-slate-200);
}

/* Open / Closed Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
}

.status-badge-open {
  background-color: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

html[data-theme="dark"] .status-badge-open {
  background-color: #064e3b;
  color: #6ee7b7;
  border-color: #047857;
}

.status-badge-closed {
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

html[data-theme="dark"] .status-badge-closed {
  background-color: #450a0a;
  color: #fca5a5;
  border-color: #7f1d1d;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.status-badge-open .status-dot {
  background-color: #10b981;
}

.status-badge-closed .status-dot {
  background-color: #ef4444;
}

/* Favorite Pin Button & Heart */
.btn-fav {
  color: var(--color-slate-400);
}

.btn-fav.fav-active {
  color: #e11d48;
}

.btn-fav.fav-active svg {
  fill: #e11d48;
}

/* Favorites Pinned Section */
#section-favorites {
  display: none;
  margin-bottom: 2rem;
}

.favorites-card {
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
  border: 1.5px solid #fecdd3;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

html[data-theme="dark"] .favorites-card {
  background: linear-gradient(135deg, #2b1115, #1f0b0f);
  border-color: #4c1d24;
}

.favorites-header {
  padding: 0.85rem 1.15rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #fecdd3;
}

html[data-theme="dark"] .favorites-header {
  border-bottom-color: #4c1d24;
}

/* Emergency Floating Action Button (FAB) */
.fab-emergency {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 35;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 0.65rem;
}

.fab-main-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-red), var(--color-red-light));
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 14px rgba(193, 27, 27, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-main-btn:hover {
  transform: scale(1.08);
}

.fab-menu {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  animation: fabFadeIn 0.2s ease-out forwards;
}

.fab-menu.fab-open {
  display: flex;
}

.fab-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #ffffff;
  color: var(--color-slate-800);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  font-size: 0.775rem;
  font-weight: 800;
  border: 1px solid var(--color-slate-200);
  white-space: nowrap;
  transition: all 0.15s ease;
}

html[data-theme="dark"] .fab-item {
  background-color: var(--color-slate-100);
  color: #ffffff;
  border-color: var(--color-slate-300);
}

.fab-item:hover {
  background-color: var(--color-red-soft);
  color: var(--color-red);
  transform: translateX(-3px);
}

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

/* Today's On-Duty Pharmacy Banner Card */
.duty-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1.5px solid #6ee7b7;
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.09);
  transition: all 0.2s ease;
}

.duty-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px dashed #a7f3d0;
}

.duty-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background-color: #d1fae5;
  color: #065f46;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.775rem;
  font-weight: 800;
  border: 1px solid #6ee7b7;
}

.duty-live-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
  animation: dutyPulse 2s infinite;
}

@keyframes dutyPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.duty-modal-btn {
  background-color: #ffffff;
  color: var(--color-teal);
  border: 1px solid var(--color-teal-border);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.duty-modal-btn:hover {
  background-color: var(--color-teal-soft);
  color: var(--color-teal-dark);
  transform: translateY(-1px);
}
.duty-divider { border: 0; border-top: 1px dashed #a7f3d0; margin: 0.9rem 0; }

.duty-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.duty-main-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.duty-icon-box {
  width: 46px;
  height: 46px;
  background-color: #10b981;
  color: #ffffff;
  font-size: 1.4rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
  flex-shrink: 0;
}

.duty-pharmacy-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #064e3b;
  line-height: 1.3;
}

.duty-address-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.825rem;
  color: #047857;
  margin-top: 0.25rem;
}

.duty-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.duty-call-btn {
  background-color: #059669;
  font-size: 0.8rem;
  padding: 0.45rem 1rem;
}

.duty-call-btn:hover {
  background-color: #047857;
}

/* Pharmacy Schedule Modal List */
.pharmacy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem;
  background-color: var(--color-slate-50);
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-md);
  gap: 0.75rem;
  transition: all 0.15s ease;
}

.pharmacy-row:hover {
  background-color: #ffffff;
  border-color: var(--color-teal-border);
}

.pharmacy-row.pharmacy-row-today {
  background-color: #ecfdf5;
  border: 1.5px solid #10b981;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12);
}

/* Dark mode overrides for duty card */
html[data-theme="dark"] .duty-card {
  background: linear-gradient(135deg, #162c29, #17252c);
  border-color: #33554d;
  box-shadow: none;
}
html[data-theme="dark"] .duty-header {
  border-bottom-color: rgba(5, 150, 105, 0.4);
}
html[data-theme="dark"] .duty-pharmacy-name {
  color: #a7f3d0;
}
html[data-theme="dark"] .duty-address-row {
  color: #6ee7b7;
}
html[data-theme="dark"] .duty-modal-btn {
  background-color: #064e3b;
  color: #a7f3d0;
  border-color: #059669;
}
html[data-theme="dark"] .pharmacy-row {
  background-color: var(--color-slate-100);
  border-color: var(--color-slate-200);
}
html[data-theme="dark"] .pharmacy-row.pharmacy-row-today {
  background-color: #064e3b;
  border-color: #10b981;
}

/* Theme-aware surfaces and foregrounds, including dynamic admin content. */
html[data-theme="dark"] .hero-section {
  background: radial-gradient(ellipse at top, #1c3437 0%, #131e29 55%, #0d141c 100%);
  border-bottom-color: var(--color-slate-200);
}
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .btn-call:not(.duty-call-btn),
html[data-theme="dark"] .tab-btn.tab-active {
  background: var(--action-teal);
  color: var(--on-accent);
}
html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .btn-call:not(.duty-call-btn):hover,
html[data-theme="dark"] .tab-btn.tab-active:hover { background: var(--action-teal-hover); }
html[data-theme="dark"] .category-header:not(.transport-header),
html[data-theme="dark"] .modal-header:not(.modal-header-alert) {
  background: #203b39;
  color: #e3f3ee;
  border-bottom: 1px solid #34524b;
}
html[data-theme="dark"] .category-header.emergency-header {
  background: #38282d;
  border-bottom-color: #58383d;
  color: #ffe2e2;
}
html[data-theme="dark"] .category-icon { color: inherit; }
html[data-theme="dark"] .category-count { background: #14232a; border-color: #3a4b5d; }
html[data-theme="dark"] .btn-accent,
html[data-theme="dark"] .btn-visit,
html[data-theme="dark"] .modal-header-alert,
html[data-theme="dark"] .fab-main-btn { background: #b91c1c; color: #ffffff; }
html[data-theme="dark"] .modal-header .modal-close-btn { color: inherit; }
html[data-theme="dark"] .toast,
html[data-theme="dark"] .toast.toast-success { background: #134e48; color: #ffffff; }
html[data-theme="dark"] .toast.toast-error { background: #991b1b; }
html[data-theme="dark"] .pwa-banner,
html[data-theme="dark"] .brand-emblem { background: linear-gradient(135deg, #203b39, #192d31); }
html[data-theme="dark"] .pwa-banner { border: 1px solid #34524b; box-shadow: none; }
html[data-theme="dark"] .notice-banner { background: #261f25; border-color: #51363c; }
html[data-theme="dark"] .hero-title { color: #e4f2ed; }
html[data-theme="dark"] .hero-subtitle { color: #b7c6d2; }
html[data-theme="dark"] .hero-banner-img {
  background: #dce8e3;
  border-radius: 12px;
  padding: 8px;
  filter: none;
}
/* Transparent brand artwork with theme-specific, legible ink colors. */
:root { --brand-union-red:#c51a1b; --brand-smsa-red:#8b0000; --brand-union-teal:#134f47; }
html[data-theme="dark"] { --brand-union-red:#f87171; --brand-smsa-red:#f28080; --brand-union-teal:#71cbbb; }
.partner-names > span:first-child { color:var(--brand-union-red); }
.partner-names .partner-name, .collaboration-credit strong { color:var(--brand-smsa-red); }
.site-footer .footer-team-title { color:var(--brand-union-teal); }
html[data-theme="dark"] .brand-emblems .brand-logo-img:not(.smsa-emblem) { content:url('union-emblem-dark.png'); }
html[data-theme="dark"] .smsa-emblem { content:url('smsa-emblem-dark.png'); }
html[data-theme="dark"] .footer-partner-logos .footer-logo { content:url('union-logo-horizontal-dark.png'); }
html[data-theme="dark"] .footer-partner-logos .collaboration-logo { content:url('smsa-logo-dark.png'); }
html[data-theme="dark"] .controls-card { box-shadow: 0 8px 24px rgb(0 0 0 / 12%); }
html[data-theme="dark"] .tab-btn:not(.tab-active):hover,
html[data-theme="dark"] .btn-secondary:hover,
html[data-theme="dark"] .pharmacy-row:hover { background-color: #243349; }
html[data-theme="dark"] .sort-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2399f6e4'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
}
html[data-theme="dark"] .duty-badge-wrap { background: #064e3b; color: #d1fae5; border-color: #059669; }
html[data-theme="dark"] .section-header { border-color: var(--color-slate-300); }
input::placeholder, textarea::placeholder { color: var(--color-slate-500); opacity: 1; }
.rating-unrated, .rating-count, .empty-state-text, .footer-admin-link { color: var(--color-slate-500); }
.star-btn { color: var(--color-slate-400); }
.star-btn.star-filled, .star-btn:hover { color: var(--color-amber-light); }
.btn-whatsapp { background-color: #08786c; }
.modal-dialog { max-height: calc(100dvh - 2rem); overflow-y: auto; }
.modal-header { gap: 0.75rem; }
.modal-header-title { min-width: 0; }
.modal-header-title h2 { font-size: inherit; }
.modal-header-title > svg, .modal-close-btn { flex-shrink: 0; }
.modal-footer { flex-wrap: wrap; }
.brand-wrapper, .search-wrapper, .category-card, .admin-item-meta { min-width: 0; }
.admin-item-meta, .pharmacy-row, .duty-pharmacy-name { overflow-wrap: anywhere; }
.admin-item-row { flex-wrap: wrap; }
.hero-banner-img, .footer-logo { max-width: 100%; }
.pwa-banner { flex-wrap: wrap; }
.fab-menu { max-width: calc(100vw - 3rem); }
.fab-item { white-space: normal; }
button:disabled { cursor: not-allowed; opacity: 0.6; }
.controls-card { top: var(--nav-height, 5rem); }
@media (min-width: 900px) {
  .tabs-group { flex-shrink: 0; }
  .tab-btn { white-space: nowrap; }
  .search-sort-group { min-width: 0; }
}
.site-footer { padding-bottom: 6rem; }
@media (max-width: 599px) {
  .site-nav-inner { flex-wrap: wrap; }
  .nav-actions { flex-wrap: wrap; }
  .controls-card { position: static; }
  .tab-btn { padding-inline: 0.4rem; font-size: 0.8rem; }
  .admin-card { padding: 1rem; }
  .pharmacy-row { flex-wrap: wrap; }
  .pharmacy-row > div { max-width: 100%; }
  .fab-emergency { bottom: 1rem; left: 1rem; }
  .toast-container { bottom: 5rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Shared action sizing: consistent touch targets and icon alignment. */
.btn-primary, .btn-accent, .btn-secondary, .btn-call, .btn-whatsapp, .btn-visit, .btn-icon {
  box-sizing: border-box;
  min-height: 44px;
  line-height: 1.25;
  border-radius: 12px;
  justify-content: center;
  gap: .4rem;
}
.btn-primary > svg, .btn-accent > svg, .btn-secondary > svg,
.btn-call > svg, .btn-whatsapp > svg, .btn-visit > svg, .btn-icon > svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.btn-icon { min-width: 44px; }
.directory-nav-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 23rem);
  gap: .5rem;
}
.directory-nav-actions > button, .directory-nav-actions > a {
  width: 100%;
  height: 44px;
  padding: 0 .5rem;
  font-size: .8rem;
  white-space: nowrap;
}
.contact-footer { flex-direction: column; align-items: stretch; gap: .65rem; }
.contact-primary-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; width: 100%; }
.contact-primary-actions > a { min-width: 0; height: 44px; padding: 0 .5rem; margin: 0; }
.contact-primary-actions > a:only-child { grid-column: 1 / -1; }
.contact-tool-actions { gap: .5rem; flex-wrap: wrap; }
.contact-tool-actions > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--color-slate-200);
  background: var(--color-slate-100);
  color: var(--color-slate-600);
  box-shadow: none;
}
.contact-tool-actions > button:hover { transform: none; background: var(--color-slate-200); color: var(--color-teal); }
.contact-tool-actions > .btn-report:hover { color: var(--color-red); background: var(--color-red-soft); }
.contact-tool-actions > .fav-active { color: var(--color-red); background: var(--color-red-soft); }
.duty-actions > a { min-height: 44px; }
.install-card {
  background: var(--surface);
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 0 0 1.5rem;
}
.install-card .pwa-banner {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 1rem;
}
.install-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.install-help { margin: 0; color: var(--color-slate-700); padding: .75rem 1rem; }
.install-help > summary { cursor: pointer; font-weight: 700; font-size: .8rem; min-height: 28px; align-content: center; }
.install-help[open] { border-top: 1px solid var(--color-slate-200); }
html[data-theme="dark"] .install-card .pwa-banner { border: 0; }
@media (max-width: 599px) {
  .directory-nav-actions { width: 100%; }
  .directory-nav-actions > button, .directory-nav-actions > a { font-size: .75rem; }
}
