:root,
[data-theme="dark"] {
  color-scheme: dark;
  --brand-teal: #00C9A7;
  --brand-teal2: #00A88C;
  --brand-teal3: #007A66;
  --brand-teal-light: #00FFD4;
  --brand-night: #030E0C;
  --brand-night3: #0A1E19;
  --brand-night4: #0F2820;
  --brand-white: #F4FBF9;
  --brand-gold: #FFD166;
  --brand-muted: #0F2820;
  --bg: #151F1C;
  --bg-soft: #1A2421;
  --surface: #1F2F2A;
  --surface-hover: #2A3D36;
  --input-bg: #243832;
  --border: #3A524A;
  --separator: #3A524A;
  --border-subtle: #2F433C;
  --primary: #00D4B0;
  --primary-light: #243832;
  --primary-glow: rgba(0, 212, 176, 0.14);
  --accent: #00FFD4;
  --success: #00D4B0;
  --danger: #FF6961;
  --warning: #FFD166;
  --warning-surface: #2A2418;
  --worker: #00D4B0;
  --customer: #00D4B0;
  --text: #F4FBF9;
  --text-secondary: #A8C4BA;
  --text-muted: #7A9990;
  --chat-own: #2A3D36;
  --chat-peer: #1F2F2A;
  --radius: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --shadow: 0 4px 16px rgba(0,0,0,0.35);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --transition: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  --loading-bg: rgba(21, 31, 28, 0.88);
  --overlay: rgba(10, 18, 16, 0.65);
  --on-primary: #030E0C;
  --grouped-bg: #030E0C;
}

[data-theme="light"] {
  color-scheme: light;
  --brand-teal: #00C9A7;
  --brand-teal2: #00A88C;
  --brand-teal3: #007A66;
  --brand-teal-light: #00FFD4;
  --brand-night: #030E0C;
  --brand-night3: #0A1E19;
  --brand-night4: #0F2820;
  --brand-white: #F4FBF9;
  --brand-gold: #FFD166;
  --brand-muted: #2A5445;
  --bg: #F4FBF9;
  --bg-soft: #FFFFFF;
  --surface: #FFFFFF;
  --surface-hover: #EAF8F4;
  --input-bg: #FFFFFF;
  --border: #B8E8DE;
  --separator: #DDF5EF;
  --border-subtle: #DDF5EF;
  --primary: #00A88C;
  --primary-light: #E6FAF6;
  --primary-glow: rgba(0, 201, 167, 0.12);
  --accent: #00C9A7;
  --success: #00C9A7;
  --danger: #E53935;
  --warning: #FFD166;
  --warning-surface: #FFF8E8;
  --worker: #00C9A7;
  --customer: #00C9A7;
  --text: #030E0C;
  --text-secondary: #163528;
  --text-muted: #2A5445;
  --chat-own: #E6FAF6;
  --chat-peer: #FFFFFF;
  --shadow: 0 2px 12px rgba(3, 14, 12, 0.08);
  --shadow-sm: 0 1px 3px rgba(3, 14, 12, 0.06);
  --loading-bg: rgba(244, 251, 249, 0.92);
  --overlay: rgba(3, 14, 12, 0.45);
  --on-primary: #030E0C;
  --grouped-bg: #F4FBF9;
}

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

html { background: var(--bg); }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  margin: 0;
  overflow-x: hidden;
  transition: background 0.25s ease, color 0.25s ease;
}

.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.12;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
}
.bg-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 50% at 50% -10%, var(--primary-glow), transparent 70%);
}
[data-theme="light"] .bg-grid { opacity: 0.2; }

.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .glass {
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
[data-theme="light"] .glass { box-shadow: var(--shadow-sm); }

.hidden { display: none !important; }
.section { position: relative; z-index: 1; min-height: 100vh; width: 100%; }
#auth-section.active { display: flex; width: 100%; }

.loading-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: var(--loading-bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
  color: var(--text);
}
.spinner {
  width: 48px; height: 48px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 300; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  padding: 0.875rem 1.25rem; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  animation: slideIn 0.3s ease; max-width: 320px; font-size: 0.9rem; color: var(--text);
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

#auth-section { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; max-width: 960px; width: 100%; align-items: center; }
.auth-hero .logo-icon,
.auth-hero .shaghal-logo-mark--hero {
  display: block;
  width: 96px; height: 96px;
  margin: 0 auto 1rem;
}
.auth-hero .shaghal-logo-mark--hero { border-radius: 0; }
.brand-lockup { text-align: center; margin-bottom: 0.5rem; }
.brand-lockup h1 {
  font-family: var(--font-display);
  font-size: 2.625rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0;
}
.auth-hero .brand-native {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-teal);
  letter-spacing: 0.12em;
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
}
.brand-motto {
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brand-muted);
  margin: 0.5rem 0 0;
}
.hero-tagline { color: var(--text-secondary); font-size: 1rem; margin: 0.75rem auto 1.5rem; max-width: 400px; line-height: 1.45; }
.feature-list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.feature-list li { color: var(--text-secondary); font-size: 0.95rem; padding-left: 0.25rem; }

.auth-card { padding: 2rem; max-width: 420px; width: 100%; }
.tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; background: var(--input-bg); padding: 4px; border-radius: 12px; border: 1px solid var(--border); }
.tab {
  flex: 1; padding: 0.75rem; border: none; border-radius: 10px;
  background: transparent; color: var(--text-muted); cursor: pointer; font-weight: 600; transition: var(--transition);
}
.tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.form { display: none; flex-direction: column; gap: 0.75rem; }
.form.active { display: flex; }
.form label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
input, select, textarea {
  width: 100%; padding: 0.8rem 1rem; border-radius: 12px; border: 1px solid var(--border);
  background: var(--input-bg); color: var(--text); font-size: 0.95rem; font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-eyebrow { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.role-toggle { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.role-opt {
  flex: 1; padding: 0.7rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--input-bg); color: var(--text-muted); cursor: pointer; font-weight: 600; font-size: 0.85rem;
}
.role-opt.active { border-color: var(--primary); background: var(--surface); color: var(--primary); }
.demo-buttons { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.error { color: var(--danger); font-size: 0.85rem; text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.75rem 1.25rem; border-radius: 12px; border: none; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: var(--transition); font-size: 0.95rem;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--primary); }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.8rem; }
.btn-demo { flex: 1; background: var(--surface); border: 1.5px solid var(--border); color: var(--text); font-size: 0.85rem; }
.btn-success { background: var(--success); color: var(--on-primary); }
.btn-danger { background: var(--danger); color: var(--on-primary); }

#app-section { display: none; flex-direction: column; width: 100%; height: 100vh; max-height: 100vh; overflow: hidden; }
#app-section.active { display: flex; }

.navbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 1.25rem; margin: 0; position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator);
  border-radius: 0;
}
.nav-brand { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.nav-user { display: flex; align-items: center; gap: 0.75rem; }
.user-name { font-weight: 600; font-size: 0.9rem; }
.badge { padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700; text-transform: capitalize; }
.badge.customer { background: var(--primary-light); color: var(--primary); }
.badge.worker { background: var(--primary-light); color: var(--primary); }

.layout { display: flex; gap: 1rem; padding: 1rem 1.25rem 2rem; flex: 1; min-height: 0; max-width: 1280px; margin: 0 auto; width: 100%; background: var(--grouped-bg); }
.sidebar {
  width: 220px; flex-shrink: 0; padding: 0.5rem;
  position: sticky; top: 4.5rem; align-self: flex-start;
  max-height: calc(100vh - 5rem); overflow-y: auto;
  background: var(--surface); border-radius: var(--radius-lg);
}
[data-theme="light"] .sidebar { box-shadow: var(--shadow-sm); }
.sidebar-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.75rem; font-weight: 700; }
.nav-item {
  display: block; width: 100%; text-align: left; padding: 0.7rem 0.85rem; margin-bottom: 0.35rem;
  border: none; border-radius: 10px; background: transparent; color: var(--text-secondary);
  cursor: pointer; font-family: inherit; font-size: 0.9rem; font-weight: 500; transition: var(--transition);
}
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active {
  background: var(--primary-glow);
  color: var(--primary);
  font-weight: 600;
}

.content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2rem;
}
.view { display: none; animation: fadeIn 0.25s ease; }
.view.active { display: block; }
.view.hidden.active { display: none !important; }

/* ─── Layout helpers ─── */
.section-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin: 1.25rem 0 0.75rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
}
.list { display: flex; flex-direction: column; gap: 0.75rem; }

/* ─── Service cards ─── */
.service-card {
  padding: 0.85rem 0.65rem;
  border-radius: 14px;
  border: 0.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition);
  text-align: center;
}
.service-card:hover {
  transform: scale(0.99);
  border-color: var(--primary);
}
.service-card .icon {
  font-size: 1.35rem; margin: 0 auto 0.5rem; line-height: 1;
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light);
}
.service-card h3 { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); line-height: 1.3; }
.service-card p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.35;
}
.home-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0 0 1.25rem;
}
.profile-settings { max-width: 520px; margin-bottom: 1rem; }
.profile-action { width: 100%; max-width: 520px; margin-top: 0.5rem; }

.search-input {
  width: 100%;
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--input-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") no-repeat 0.9rem center;
  color: var(--text);
  font-size: 0.95rem;
}
.filters {
  display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: center;
  padding: 1rem; margin-bottom: 1.25rem;
}
.filters select { flex: 1; min-width: 140px; margin: 0; }
.filters .btn { flex-shrink: 0; }
.filters .chk-inline { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; white-space: nowrap; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; font-weight: 600; padding: 0; }
.btn-link:hover { text-decoration: underline; }
.info { color: var(--success, #22c55e); font-size: 0.9rem; margin-top: 0.75rem; }
.review-photo-preview, .review-photos { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0 1rem; }
.review-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

/* ─── Stats ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  padding: 1.1rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-card .num { display: block; font-size: 1.75rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.stat-card .lbl { display: block; font-size: 0.72rem; font-weight: 600; color: var(--text-muted); margin-top: 0.35rem; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card.warning .num { color: var(--warning); }
.stat-card.primary .num { color: var(--primary); }
.stat-card.success .num { color: var(--success); }

/* ─── Cards & lists ─── */
.page-header, .view-header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 0.5px solid var(--separator);
}
.page-eyebrow { color: var(--primary); font-weight: 600; font-size: 0.85rem; margin-bottom: 0.25rem; }
.page-header h2, .view-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}
.page-header p, .view-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.45;
  max-width: 52ch;
}
.card-item {
  padding: 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card-item.clickable { cursor: pointer; }
.card-item.clickable:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.card-item.active { border-color: var(--primary); background: var(--primary-glow); }
.card-item h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.35rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.card-item p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.45; margin-top: 0.25rem; }
.card-item .card-actions {
  display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center;
  margin-top: 0.85rem; padding-top: 0.85rem;
  border-top: 0.5px solid var(--separator);
}
.card-divider { height: 1px; background: var(--separator); margin: 0.65rem 0 0; opacity: 0.55; }
.card-desc { font-size: 0.88rem !important; }
.card-loc { font-size: 0.82rem !important; color: var(--text-muted) !important; }
.card-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.worker-card {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 0; border: none; background: transparent; margin: 0; box-shadow: none;
}
.worker-avatar {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--primary-glow);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
  border: 1px solid var(--border);
}
.worker-info { flex: 1; min-width: 0; }
.worker-card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 0.5rem; margin-bottom: 0.25rem;
}
.worker-name { font-size: 1rem; font-weight: 700; line-height: 1.3; flex: 1; min-width: 0; }
.worker-rating-row {
  display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap;
  font-size: 0.85rem; margin-bottom: 0.35rem;
}
.worker-info h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.35rem; }
.worker-avatar-letter {
  font-size: 1.25rem; font-weight: 800; color: var(--primary);
}
.worker-meta {
  display: flex; flex-wrap: wrap; gap: 0.5rem 0.85rem;
  font-size: 0.8rem; color: var(--text-muted);
}
.avail-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 4px; vertical-align: middle;
}
.avail-available { background: var(--success); }
.avail-busy { background: var(--warning); }
.avail-offline { background: var(--text-muted); }
.stars { color: var(--warning); letter-spacing: 1px; }

.location-banner {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 1rem 1.15rem; margin-bottom: 1rem;
}
.location-banner .loc-icon { font-size: 1.35rem; flex-shrink: 0; }
.location-banner .loc-text { flex: 1; min-width: 0; }
.loc-city { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.location-banner .loc-addr { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.15rem; }
.location-status {
  padding: 0.75rem 1rem; border-radius: 10px;
  background: var(--input-bg); border: 1px solid var(--border);
  font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 0.5rem;
}

.reviews-summary {
  text-align: center; padding: 2rem 1.5rem; margin-bottom: 1.25rem;
}
.big-rating { font-size: 3.5rem; font-weight: 800; color: var(--text); line-height: 1; }

.star-rating { display: flex; gap: 0.35rem; justify-content: center; margin: 1rem 0; }
.star-rating button {
  background: none; border: none; font-size: 2rem; cursor: pointer;
  color: var(--border); padding: 0; line-height: 1; transition: color 0.15s, transform 0.15s;
}
.star-rating button.active, .star-rating button:hover { color: var(--warning); transform: scale(1.08); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 0.5rem; }
.chk-item {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.85rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--input-bg);
  font-size: 0.82rem; cursor: pointer; color: var(--text-secondary);
  transition: var(--transition);
}
.chk-item.checked { border-color: var(--primary); background: var(--primary-glow); color: var(--primary); font-weight: 600; }
.chk-item input { display: none; }

.btn-warning { background: var(--warning); color: #1a1a1a; }
.btn-warning:hover { filter: brightness(1.05); }

[dir="rtl"] .auth-card { text-align: right; }
[dir="rtl"] .auth-card .btn { width: 100%; }
[dir="rtl"] .settings-row { direction: rtl; }
[dir="rtl"] #auth-section .form-eyebrow { text-align: right; }

[dir="rtl"] .toast-container { right: auto; left: 1rem; }
[dir="rtl"] .search-input {
  padding: 0.85rem 2.75rem 0.85rem 1rem;
  background-position: calc(100% - 0.9rem) center;
}
[dir="rtl"] .worker-card { flex-direction: row-reverse; }
[dir="rtl"] .card-actions { flex-direction: row-reverse; }
[dir="rtl"] .msg-own { align-self: flex-start; border-bottom-right-radius: 16px; border-bottom-left-radius: 4px; }
[dir="rtl"] .msg-other { align-self: flex-end; border-bottom-left-radius: 16px; border-bottom-right-radius: 4px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-eyebrow { font-size: 0.85rem; color: var(--accent); font-weight: 600; margin-bottom: 0.25rem; }

.industry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
.industry-card {
  padding: 1rem; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.industry-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.industry-card .icon { font-size: 1.75rem; margin-bottom: 0.5rem; }
.industry-card h4 { font-size: 0.9rem; font-weight: 700; }
.industry-card p { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; line-height: 1.35; }

.request-card, .review-card {
  padding: 1rem; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); margin-bottom: 0.75rem; box-shadow: var(--shadow-sm);
}

.status { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700; text-transform: capitalize; }
.status-pending { background: rgba(245,158,11,0.15); color: var(--warning); }
.status-accepted { background: rgba(99,102,241,0.15); color: var(--primary); }
.status-in_progress { background: rgba(16,185,129,0.15); color: var(--success); }
.status-completed { background: rgba(16,185,129,0.15); color: var(--success); }
.status-cancelled { background: rgba(239,68,68,0.15); color: var(--danger); }

.empty-state {
  text-align: center; padding: 3rem 1.5rem; color: var(--text-muted);
}
.empty-state span { font-size: 3rem; display: block; margin-bottom: 0.75rem; opacity: 0.5; }

.chat-layout { display: flex; gap: 1rem; height: calc(100vh - 130px); min-height: 400px; }
.chat-sidebar { width: 280px; flex-shrink: 0; }
.chat-sidebar h3 { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; padding-left: 0.25rem; }
.chat-requests { display: flex; flex-direction: column; gap: 0.5rem; overflow-y: auto; max-height: 100%; }
.chat-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); }
.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
  gap: 0.5rem;
}
.chat-header-title { display: flex; align-items: center; gap: 0.5rem; flex: 1; min-width: 0; }
.chat-header span { font-weight: 600; }
.chat-back-btn {
  display: none; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--input-bg);
  color: var(--text); cursor: pointer; flex-shrink: 0;
}
.chat-actions { display: flex; gap: 0.35rem; }
.typing { padding: 0 1.25rem; font-size: 0.8rem; color: var(--text-muted); font-style: italic; }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem;
  background: var(--bg);
}
.msg { max-width: 75%; padding: 0.7rem 1rem; border-radius: 16px; font-size: 0.9rem; line-height: 1.45; }
.msg-own {
  align-self: flex-end;
  background: var(--chat-own);
  color: var(--text-secondary);
  border: 0.5px solid var(--border-subtle);
  border-bottom-right-radius: 4px;
}
.msg-other {
  align-self: flex-start;
  background: var(--chat-peer);
  color: var(--text-secondary);
  border: 0.5px solid var(--border);
  border-bottom-left-radius: 4px;
}
.msg-time { color: var(--text-muted); }
.chat-input-bar {
  display: flex; gap: 0.4rem; align-items: center;
  padding: 0.65rem 0.75rem; border-top: 0.5px solid var(--border); background: var(--bg);
}
.chat-input-bar input {
  flex: 1; margin: 0; border-radius: 22px; padding: 0.65rem 1rem;
  border: 0.5px solid var(--border); background: var(--surface);
}
.chat-icon-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 0.5px solid var(--border);
  background: var(--surface); color: var(--primary); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.chat-send-btn {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: var(--primary); color: var(--on-primary); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.chat-send-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.msg-location { border: 1px solid var(--primary); cursor: pointer; }
.msg-location:hover { background: var(--primary-light); }
.msg-call { font-style: italic; opacity: 0.85; }
.msg-time { font-size: 0.65rem; margin-top: 0.3rem; }

/* ─── Shaghal UI blocks ─── */
.smart-pricing-banner {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.85rem 1rem; margin-bottom: 1rem;
  border-radius: 12px; border: 0.5px solid #2A1E08;
  background: var(--warning-surface);
}
.smart-pricing-banner .icon { font-size: 1.25rem; line-height: 1; }
.smart-pricing-banner strong { display: block; color: var(--warning); font-size: 0.9rem; margin-bottom: 0.2rem; }
.smart-pricing-banner p { color: var(--text-secondary); font-size: 0.82rem; line-height: 1.45; margin: 0; }

.active-job-card {
  padding: 1rem; margin-bottom: 1rem; border-radius: 12px;
  border: 1px solid var(--primary); background: var(--surface);
}
.active-job-card .row { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.active-job-card .meta { color: var(--text-secondary); font-size: 0.85rem; margin-top: 0.25rem; }
.active-job-card .status { color: var(--primary); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }

.payment-plan {
  margin-top: 0.75rem; padding: 0.85rem; border-radius: 12px;
  border: 0.5px solid var(--border); background: var(--surface);
}
.payment-plan-label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.65rem;
}
.payment-plan-row { display: flex; align-items: center; gap: 0.5rem; }
.payment-plan-box {
  flex: 1; text-align: center; padding: 0.55rem 0.35rem; border-radius: 10px; border: 1px solid var(--border-subtle);
  background: var(--surface-hover);
}
.payment-plan-box.active-hourly { border-color: var(--primary); background: var(--chat-own); }
.payment-plan-box.active-daily { border-color: var(--warning); background: var(--warning-surface); }
.payment-plan-box .kind { font-size: 0.68rem; font-weight: 600; margin-bottom: 0.15rem; }
.payment-plan-box .amount { font-size: 1.35rem; font-weight: 700; line-height: 1.1; }
.payment-plan-box .unit { font-size: 0.68rem; color: var(--text-muted); margin-top: 0.15rem; }
.payment-plan-mid { text-align: center; font-size: 0.68rem; color: var(--warning); font-weight: 700; }
.payment-plan-summary { margin-top: 0.65rem; font-size: 0.82rem; color: var(--text-secondary); line-height: 1.45; }

.shaghal-logo-mark,
.fanni-logo-mark {
  display: inline-block;
  width: 28px; height: 28px;
  border-radius: 8px;
  vertical-align: middle;
  object-fit: contain;
}
.shaghal-logo-mark--hero { width: 72px; height: 72px; border-radius: 18px; }

.profile-hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 2rem 1.5rem; max-width: 520px; margin-bottom: 1rem;
}
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--primary-glow); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; font-weight: 800; color: var(--primary);
  margin-bottom: 0.75rem;
}
.profile-hero h3 { font-size: 1.35rem; font-weight: 700; margin: 0; }
.profile-email { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.25rem; }
.profile-hero .badge { margin-top: 0.65rem; }
.profile-card { padding: 1.75rem; max-width: 520px; }
.profile-row { display: flex; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.profile-row:last-child { border: none; }
.profile-row .label { color: var(--text-muted); min-width: 90px; font-size: 0.85rem; }
.profile-row .value { font-weight: 500; color: var(--text); }

.profile-form { padding: 1.75rem; max-width: 600px; }
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin: 0.25rem 0 0.75rem; line-height: 1.45; }
.compliance-block {
  margin: 1rem 0;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  background: var(--bg);
}
.compliance-block input[type="file"] {
  display: block;
  width: 100%;
  margin: 0.35rem 0 0.85rem;
  font-size: 0.85rem;
}
.privacy-consent {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 1rem 0;
  line-height: 1.45;
}
.privacy-consent input { margin-top: 0.2rem; flex-shrink: 0; }
.verified-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  margin-left: 0.35rem;
  vertical-align: middle;
}
.card-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; flex-wrap: wrap; }
.portfolio-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.portfolio-thumb {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--input-bg);
  border: 1px solid var(--border);
  display: block;
}
.portfolio-thumb img,
.portfolio-thumb video,
.portfolio-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.portfolio-thumb.editable .portfolio-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.portfolio-video-wrap { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.portfolio-video-dur {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(0,0,0,0.55);
  color: #fff;
  padding: 2px 5px;
  border-radius: 4px;
}
.portfolio-section .portfolio-grid { margin-top: 0.35rem; }
.work-portfolio-block {
  margin: 1.25rem 0 0.5rem;
  padding: 1rem;
  border-radius: 12px;
  background: var(--input-bg);
  border: 1px solid var(--border);
}
.portfolio-block-title { font-weight: 700; font-size: 1rem; margin: 0 0 0.75rem; color: var(--text); }
.portfolio-block-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin: 0.5rem 0; text-transform: uppercase; letter-spacing: 0.04em; }
.portfolio-customer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.portfolio-customer-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  aspect-ratio: 1;
  display: block;
}
.portfolio-customer-item img,
.portfolio-customer-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #111;
}
.portfolio-customer-grid.videos .portfolio-customer-item { aspect-ratio: 16 / 10; }
#modal-worker-body {
  max-height: min(78vh, 680px);
  overflow-y: auto;
  padding-right: 0.35rem;
}
.avail-group { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.avail-btn {
  flex: 1; padding: 0.65rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--input-bg); color: var(--text-muted); cursor: pointer; font-weight: 600; font-size: 0.8rem;
  text-transform: capitalize; font-family: inherit;
}
.avail-btn.active { background: var(--primary-glow); border-color: var(--primary); color: var(--primary); }
.checkbox-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.service-chip {
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.45rem 0.75rem;
  border-radius: 999px; border: 1px solid var(--border); background: var(--input-bg);
  font-size: 0.8rem; cursor: pointer; color: var(--text-secondary);
}
.service-chip.selected { border-color: var(--primary); background: var(--primary-glow); color: var(--primary); font-weight: 600; }

.modal { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: var(--overlay); }
.modal-content {
  position: relative; z-index: 1; padding: 1.75rem; width: 90%; max-width: 480px;
  animation: modalIn 0.25s ease;
}
.modal-lg { max-width: 640px; }
.modal-close {
  position: absolute; top: 1rem; right: 1rem; background: var(--input-bg); border: 1px solid var(--border);
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer; color: var(--text-muted); font-size: 1rem;
}
.modal h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.modal-sub { color: var(--text-secondary); margin-bottom: 0.35rem; font-size: 0.9rem; }
.modal-form { display: flex; flex-direction: column; gap: 0.85rem; max-height: 90vh; overflow-y: auto; }
.modal-form label { display: block; margin-top: 0.35rem; }
.modal-form input, .modal-form select, .modal-form textarea {
  width: 100%; margin-top: 0.35rem; padding: 0.65rem 0.75rem;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--input-bg); color: var(--text); font-family: inherit; font-size: 0.95rem;
}
.form-section {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1rem; background: var(--surface); display: flex; flex-direction: column; gap: 0.5rem;
}
.form-section-head { display: flex; gap: 0.75rem; align-items: flex-start; margin-bottom: 0.35rem; }
.form-section-head strong { display: block; font-size: 0.95rem; }
.form-section-head p { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.15rem; line-height: 1.4; }
.form-step {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary-glow); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 800;
}
.checkbox-row {
  display: flex; align-items: flex-start; gap: 0.6rem; margin-top: 0.5rem;
  font-size: 0.85rem; color: var(--text-secondary); line-height: 1.45; cursor: pointer;
}
.checkbox-row input { width: auto; margin-top: 0.15rem; accent-color: var(--primary); }
.contract-body { display: flex; flex-direction: column; gap: 0.65rem; max-height: 50vh; overflow-y: auto; }
.contract-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem 1rem;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1rem; background: var(--surface);
}
.contract-detail-grid .full { grid-column: 1 / -1; }
.contract-detail-grid dt { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.contract-detail-grid dd { font-size: 0.92rem; color: var(--text); margin: 0.15rem 0 0.5rem; line-height: 1.45; }

/* Upgrade pass: cleaner visual hierarchy + smoother interactions */
.worker-card,
.request-card,
.review-card,
.smart-card,
.contract-header {
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.worker-card:hover,
.request-card:hover,
.review-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 34%, var(--border));
  box-shadow: var(--shadow);
}

.btn {
  border-radius: 14px;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.contract-detail-grid {
  gap: 0.35rem 1rem;
}
.contract-header { text-align: center; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.contract-number { font-size: 1.05rem; font-weight: 800; color: var(--primary); margin-top: 0.35rem; }
.contract-status-pill {
  display: inline-block; margin-top: 0.5rem; padding: 0.25rem 0.75rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700;
}
.contract-status-pill.pending { background: rgba(255, 159, 10, 0.15); color: var(--warning); }
.contract-status-pill.accepted { background: rgba(48, 209, 88, 0.15); color: var(--success); }
.contract-status-pill.rejected { background: rgba(255, 69, 58, 0.15); color: var(--danger); }
.contract-strip {
  display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap;
  padding: 0.65rem 0.75rem; margin-top: 0.5rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--input-bg);
}
.contract-strip .num { font-weight: 700; font-size: 0.85rem; }
.contract-strip .meta { flex: 1; font-size: 0.8rem; color: var(--text-secondary); min-width: 120px; }
.contract-actions { display: flex; flex-direction: column; gap: 0.65rem; margin-top: 0.5rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.contract-actions .card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.contract-ref { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); margin-top: 0.35rem; }
.contract-pending { font-size: 0.8rem; color: var(--warning); font-weight: 600; margin-top: 0.25rem; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: none; } }

.menu-toggle { display: none; background: var(--surface); border: 1px solid var(--border); padding: 0.5rem 0.75rem; border-radius: 8px; cursor: pointer; color: var(--text); }

#call-overlay {
  position: fixed; inset: 0; z-index: 500; background: var(--overlay);
  display: flex; align-items: center; justify-content: center;
}
#call-overlay.hidden { display: none; }
.call-card { text-align: center; padding: 2rem; min-width: 280px; }
.call-rings {
  position: relative; width: 120px; height: 120px; margin: 0 auto 1.25rem;
}
.call-rings::before, .call-rings::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--primary); opacity: 0.35;
  animation: callRing 2s ease-out infinite;
}
.call-rings::after { animation-delay: 1s; }
@keyframes callRing {
  0% { transform: scale(0.85); opacity: 0.5; }
  100% { transform: scale(1.35); opacity: 0; }
}
.call-avatar {
  position: absolute; inset: 18px; border-radius: 50%;
  background: var(--primary-glow); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}
.call-pulse {
  width: 100px; height: 100px; border-radius: 50%; margin: 0 auto 1.5rem;
  background: var(--primary-glow); display: flex; align-items: center; justify-content: center;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 var(--primary-glow); } 50% { box-shadow: 0 0 0 20px transparent; } }
#call-status { font-size: 1rem; color: var(--text-muted); }
#call-name { font-size: 1.5rem; font-weight: 700; margin-top: 0.5rem; color: var(--text); }
.call-timer { font-size: 1.25rem; font-variant-numeric: tabular-nums; color: var(--accent); margin-top: 0.5rem; }
.call-actions { display: flex; gap: 2rem; justify-content: center; margin-top: 2rem; }
.call-btn {
  width: 56px; height: 56px; border-radius: 50%; border: none; font-size: 1.25rem;
  cursor: pointer; color: var(--on-primary); transition: var(--transition);
}
.call-btn.accept { background: var(--success); }
.call-btn.reject { background: var(--danger); }
.call-btn:hover { transform: scale(1.08); }

.settings-panel { padding: 1rem 1.25rem; margin-bottom: 1rem; max-width: 520px; }
.settings-panel h4 { font-size: 1rem; margin-bottom: 0.75rem; color: var(--text); }
.settings-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); margin: 0.75rem 0 0.5rem;
}
.settings-row { display: flex; gap: 0.5rem; flex-wrap: wrap; background: var(--input-bg); padding: 4px; border-radius: 12px; border: 1px solid var(--border); }
.settings-opt {
  flex: 1; min-width: 100px; padding: 0.65rem 0.75rem; border-radius: 10px;
  border: none; background: transparent; color: var(--text-muted);
  cursor: pointer; font-weight: 600; font-size: 0.85rem; font-family: inherit;
  transition: var(--transition);
}
.settings-opt:hover { color: var(--text); }
.settings-opt.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
[dir="rtl"] .sidebar { text-align: right; }
[dir="rtl"] .nav-item { text-align: right; }
[dir="rtl"] .profile-row .label { min-width: auto; }

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-hero { text-align: center; }
  .auth-hero h1 { font-size: 2rem; }
  .feature-list { align-items: center; }
  .auth-card { margin: 0 auto; }
}
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .layout { flex-direction: column; padding: 0 0.75rem 1.5rem; }
  .navbar { margin: 0.5rem 0.75rem 0; padding: 0.75rem 1rem; }
  .sidebar {
    width: min(280px, 85vw); position: fixed; left: -100%; top: 0; bottom: 0; z-index: 100;
    max-height: none; border-radius: 0; transition: left 0.3s ease; padding-top: 4.5rem;
    box-shadow: var(--shadow);
  }
  .sidebar.open { left: 0; }
  .sidebar.open::after {
    content: ''; position: fixed; inset: 0; left: min(280px, 85vw);
    background: var(--overlay); z-index: -1;
  }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }
  .service-card { padding: 0.9rem 0.75rem; }
  .service-card .icon { font-size: 1.6rem; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .chat-layout { flex-direction: column; height: auto; }
  .chat-sidebar { width: 100%; }
  .chat-requests { max-height: 220px; }
  .chat-layout.thread-open .chat-sidebar { display: none; }
  .chat-layout.thread-open .chat-panel { min-height: calc(100vh - 160px); }
  .chat-back-btn { display: inline-flex; }
  .user-name { display: none; }
  .form-row { grid-template-columns: 1fr; }
}
