/* ============================================
   Craftsmen Marketplace — Design System
   ============================================ */

:root {
  /* Colors — Light */
  --color-bg: #eef2f5;
  --color-surface: #fbfcfd;
  --color-surface-alt: #f4f6f8;
  --color-border: #dde4ec;
  --color-border-strong: #cfd7e1;

  --color-text: #0f1c2e;
  --color-text-muted: #435266;
  --color-text-soft: #6f7d90;

  --color-primary: #0d6b4e;
  --color-primary-hover: #0b5a42;
  --color-primary-soft: #e6f2ed;
  --color-primary-ink: #0a4a38;

  --color-accent: #b87333;
  --color-accent-soft: #f5ebe0;

  --color-success: #10b981;
  --color-success-soft: #d1fae5;
  --color-warning: #f59e0b;
  --color-warning-soft: #fef3c7;
  --color-danger: #ef4444;
  --color-danger-soft: #fee2e2;
  --color-info: #3b82f6;
  --color-info-soft: #dbeafe;

  /* Typography */
  --font-brand: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-brand-ar: 'Tajawal', 'Cairo', var(--font-brand);
  --font-sans: var(--font-brand);
  --font-ar: var(--font-brand-ar);

  --fs-xs: 1rem;
  --fs-sm: 1rem;
  --fs-base: 1rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;

  /* Radius */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 28, 46, 0.05);
  --shadow-sm: 0 1px 3px rgba(15, 28, 46, 0.06), 0 1px 2px rgba(15, 28, 46, 0.04);
  --shadow-md: 0 4px 10px rgba(15, 28, 46, 0.06), 0 2px 4px rgba(15, 28, 46, 0.04);
  --shadow-lg: 0 18px 40px rgba(15, 28, 46, 0.12);

  /* Spacing (8pt grid) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 48px;
  --s-10: 64px;

  /* Layout */
  --sidebar-w: 260px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 68px;

  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --color-bg: #0b1220;
  --color-surface: #121a2b;
  --color-surface-alt: #0f1729;
  --color-border: #1f2a3f;
  --color-border-strong: #2a3852;

  --color-text: #eaf0f9;
  --color-text-muted: #9aa7bd;
  --color-text-soft: #6b7a94;

  --color-primary: #34d399;
  --color-primary-hover: #22c088;
  --color-primary-soft: #0a2e22;
  --color-primary-ink: #6ee7b7;

  --color-accent: #d4a574;
  --color-accent-soft: #2e1f10;

  --color-success: #34d399;
  --color-success-soft: #07302a;
  --color-warning: #fbbf24;
  --color-warning-soft: #3a2c0b;
  --color-danger: #f87171;
  --color-danger-soft: #3a1b1b;
  --color-info: #60a5fa;
  --color-info-soft: #132240;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.45);
}

/* ============================================
   Base
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body,
button,
input,
select,
textarea,
optgroup {
  font-family: var(--font-sans);
}

body {
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

[dir="rtl"] body,
[dir="rtl"] button,
[dir="rtl"] input,
[dir="rtl"] select,
[dir="rtl"] textarea,
[dir="rtl"] optgroup {
  font-family: var(--font-ar);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  line-height: 1.2;
  color: var(--color-text);
  font-weight: 600;
}

p {
  margin: 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  color: var(--color-primary-hover);
}

img {
  max-width: 100%;
  display: block;
}

/* ============================================
   Layout: App Shell
   ============================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  transition: grid-template-columns var(--transition);
}

.app.is-collapsed {
  grid-template-columns: var(--sidebar-w-collapsed) 1fr;
}

/* Sidebar */
.sidebar {
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

[dir="rtl"] .sidebar {
  border-right: 0;
  border-left: 1px solid var(--color-border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-5) var(--s-5);
  border-bottom: 1px solid var(--color-border);
  min-height: var(--topbar-h);
}

.sidebar-brand .logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-primary), #14b8a6);
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-brand .brand-name {
  font-weight: 700;
  font-size: var(--fs-lg);
  letter-spacing: -0.01em;
}

.sidebar-brand .brand-sub {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--s-4) var(--s-3);
}

.nav-group {
  margin-bottom: var(--s-5);
}

.nav-group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-soft);
  padding: 0 var(--s-3);
  margin-bottom: var(--s-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 10px var(--s-3);
  border-radius: var(--radius);
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  margin-bottom: 2px;
  position: relative;
  transition: background var(--transition), color var(--transition);
}

.nav-item:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.nav-item.active {
  background: var(--color-primary-soft);
  color: var(--color-primary-ink);
  font-weight: 600;
}

[data-theme="dark"] .nav-item.active {
  color: var(--color-primary-ink);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-item .badge {
  margin-inline-start: auto;
}

.app.is-collapsed .sidebar-brand .brand-name,
.app.is-collapsed .sidebar-brand .brand-sub,
.app.is-collapsed .nav-item span,
.app.is-collapsed .nav-group-title {
  display: none;
}

.app.is-collapsed .nav-item {
  justify-content: center;
}

.sidebar-footer {
  padding: var(--s-4);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.sidebar-footer .avatar {
  width: 36px;
  height: 36px;
}

.app.is-collapsed .sidebar-footer .user-meta {
  display: none;
}

/* Main */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: 0 var(--s-6);
}

.topbar-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  height: 42px;
  padding: 0 var(--s-4) 0 40px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  border-radius: var(--radius);
  color: var(--color-text);
  font-size: var(--fs-sm);
  outline: none;
}

[dir="rtl"] .topbar-search input {
  padding: 0 40px 0 var(--s-4);
}

.topbar-search svg {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  inset-inline-start: 12px;
  color: var(--color-text-soft);
  width: 18px;
  height: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-inline-start: auto;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius);
  color: var(--color-text-muted);
  cursor: pointer;
  position: relative;
  transition: all var(--transition);
}

.icon-btn:hover {
  color: var(--color-text);
  background: var(--color-surface-alt);
}

.icon-btn .dot {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-danger);
  border: 2px solid var(--color-surface);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 4px var(--s-3) 4px 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  background: var(--color-surface);
}

[dir="rtl"] .user-menu {
  padding: 4px 4px 4px var(--s-3);
}

.user-menu:hover {
  background: var(--color-surface-alt);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d6b4e, #11866a);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: var(--fs-sm);
  flex-shrink: 0;
}

.user-meta {
  line-height: 1.1;
}

.user-name {
  font-size: var(--fs-sm);
  font-weight: 600;
}

.user-role {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Page */
.page {
  padding: var(--s-6);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.cm-page-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
  flex-wrap: wrap;
}

.page-title {
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  margin-top: 4px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--s-2);
}

.breadcrumb a {
  color: var(--color-text-muted);
}

.breadcrumb .sep {
  opacity: 0.5;
}

/* ============================================
   Components
   ============================================ */

/* Card */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.card-header {
  padding: var(--s-5) var(--s-5) var(--s-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.card-title {
  font-size: var(--fs-md);
  font-weight: 600;
}

.card-subtitle {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.card-body {
  padding: var(--s-5);
}

.card-footer {
  padding: var(--s-4) var(--s-5);
  border-top: 1px solid var(--color-border);
}

/* Stat card */
.stat-grid {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  position: relative;
  overflow: hidden;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--color-primary);
  background: var(--color-primary-soft);
}

.stat-icon.accent {
  color: var(--color-accent);
  background: var(--color-accent-soft);
}

.stat-icon.success {
  color: var(--color-success);
  background: var(--color-success-soft);
}

.stat-icon.warning {
  color: var(--color-warning);
  background: var(--color-warning-soft);
}

.stat-icon.danger {
  color: var(--color-danger);
  background: var(--color-danger-soft);
}

.stat-icon.info {
  color: var(--color-info);
  background: var(--color-info-soft);
}

.stat-label {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: 1;
}

.stat-meta {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.stat-meta.up {
  color: var(--color-success);
}

.stat-meta.down {
  color: var(--color-danger);
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: 42px;
  padding: 0 var(--s-5);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  color: #fff;
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-surface-alt);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
}

.btn-ghost:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}

.btn-danger:hover {
  filter: brightness(0.95);
  color: #fff;
}

.btn-success {
  background: var(--color-success);
  color: #fff;
}

.btn-success:hover {
  filter: brightness(0.95);
  color: #fff;
}

.btn-sm {
  height: 34px;
  padding: 0 var(--s-3);
  font-size: var(--fs-xs);
}

.btn-lg {
  height: 48px;
  padding: 0 var(--s-6);
  font-size: var(--fs-md);
}

.btn-block {
  width: 100%;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.badge .dot-mini {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-primary {
  background: var(--color-primary-soft);
  color: var(--color-primary-ink);
  border-color: transparent;
}

.badge-success {
  background: var(--color-success-soft);
  color: #065f46;
  border-color: transparent;
}

.badge-warning {
  background: var(--color-warning-soft);
  color: #92400e;
  border-color: transparent;
}

.badge-danger {
  background: var(--color-danger-soft);
  color: #991b1b;
  border-color: transparent;
}

.badge-info {
  background: var(--color-info-soft);
  color: #1e40af;
  border-color: transparent;
}

.badge-neutral {
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
}

[data-theme="dark"] .badge-success {
  color: #6ee7b7;
}

[data-theme="dark"] .badge-warning {
  color: #fcd34d;
}

[data-theme="dark"] .badge-danger {
  color: #fca5a5;
}

[data-theme="dark"] .badge-info {
  color: #93c5fd;
}

/* Forms */
.form-grid {
  display: grid;
  gap: var(--s-4);
}

.form-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.form-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 720px) {

  .form-grid.cols-2,
  .form-grid.cols-3 {
    grid-template-columns: 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-text);
}

.label .req {
  color: var(--color-danger);
  margin-inline-start: 2px;
}

.help {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.input,
.select,
.textarea {
  width: 100%;
  font-family: inherit;
  font-size: var(--fs-sm);
  height: 42px;
  padding: 0 var(--s-3);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.textarea {
  height: auto;
  padding: 10px var(--s-3);
  resize: vertical;
  min-height: 96px;
  line-height: 1.5;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 18%, transparent);
}

.input-group {
  position: relative;
}

.input-group .input {
  padding-inline-start: 40px;
}

.input-group .icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  inset-inline-start: 12px;
  color: var(--color-text-soft);
}

.fieldset-group {
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius);
  padding: var(--s-4);
  background: var(--color-surface-alt);
}

.fieldset-group .group-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: var(--s-3);
}

.upload-box {
  border: 2px dashed var(--color-border-strong);
  border-radius: var(--radius);
  padding: var(--s-6);
  text-align: center;
  color: var(--color-text-muted);
  background: var(--color-surface-alt);
  cursor: pointer;
}

.upload-box:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
}

/* Table */
.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.table th,
.table td {
  padding: 14px var(--s-4);
  text-align: start;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  font-weight: 600;
  background: var(--color-surface-alt);
}

.table tbody tr {
  transition: background var(--transition);
}

.table tbody tr:hover {
  background: var(--color-surface-alt);
}

.table .cell-user {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

/* Filters bar */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  padding: var(--s-4);
  margin-bottom: var(--s-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.filters .field {
  flex: 1;
  min-width: 180px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--color-surface-alt);
  border-radius: var(--radius);
  width: fit-content;
  border: 1px solid var(--color-border);
  margin-bottom: var(--s-4);
}

.tab {
  padding: 8px 14px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: 6px;
  cursor: pointer;
  border: 0;
  background: transparent;
}

.tab:hover {
  color: var(--color-text);
}

.tab.active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-xs);
  font-weight: 600;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Timeline */
.timeline {
  position: relative;
  padding-inline-start: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  inset-inline-start: 8px;
  width: 2px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--s-5);
}

.timeline-item::before {
  content: '';
  position: absolute;
  inset-inline-start: -20px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-border-strong);
}

.timeline-item.done::before {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.timeline-item.active::before {
  background: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px var(--color-accent-soft);
}

.timeline-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: 2px;
}

.timeline-meta {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

/* Status progress (horizontal) */
.progress-track {
  display: flex;
  gap: var(--s-2);
  position: relative;
  padding: var(--s-4) 0;
}

.progress-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.progress-step .dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-surface-alt);
  border: 2px solid var(--color-border);
  display: grid;
  place-items: center;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
  z-index: 1;
}

.progress-step.done .dot {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.progress-step.active .dot {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  box-shadow: 0 0 0 4px var(--color-accent-soft);
}

.progress-step .label {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  text-align: center;
}

.progress-step.done .label,
.progress-step.active .label {
  color: var(--color-text);
  font-weight: 600;
}

.progress-step::after {
  content: '';
  position: absolute;
  top: 18px;
  inset-inline-start: 50%;
  width: 100%;
  height: 2px;
  background: var(--color-border);
  z-index: 0;
}

.progress-step:last-child::after {
  display: none;
}

.progress-step.done::after {
  background: var(--color-primary);
}

/* Custom Modal (non-Bootstrap) - DEPRECATED - Use Bootstrap modals instead */
/* .modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,28,46,0.55);
  display: none; align-items: center; justify-content: center; z-index: 100;
  padding: var(--s-4);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--color-surface); border-radius: var(--radius-lg);
  max-width: 560px; width: 100%; box-shadow: var(--shadow-lg);
  max-height: 90vh; display: flex; flex-direction: column;
}
.modal-header { padding: var(--s-5); border-bottom: 1px solid var(--color-border); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: var(--fs-lg); font-weight: 600; }
.modal-body { padding: var(--s-5); overflow-y: auto; }
.modal-footer { padding: var(--s-4) var(--s-5); border-top: 1px solid var(--color-border); display: flex; justify-content: flex-end; gap: var(--s-2); }
*/

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 240px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 40;
  display: none;
}

.dropdown.open .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 10px var(--s-3);
  font-size: var(--fs-sm);
  color: var(--color-text);
  border-radius: 6px;
  cursor: pointer;
}

.dropdown-item:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.dropdown-divider {
  height: 1px;
  background: var(--color-border);
  margin: 4px 0;
}

/* Empty state */
.empty {
  text-align: center;
  padding: var(--s-9) var(--s-5);
  color: var(--color-text-muted);
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-surface-alt);
  display: grid;
  place-items: center;
  margin: 0 auto var(--s-4);
  color: var(--color-text-soft);
}

.empty-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

/* Offer / Request cards */
.item-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.item-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-sm);
}

.item-card.recommended {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.item-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--s-3);
}

.item-card-title {
  font-size: var(--fs-md);
  font-weight: 600;
}

.item-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.item-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.item-card-desc {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  line-height: 1.55;
}

.item-card-actions {
  display: flex;
  gap: var(--s-2);
  margin-top: auto;
  flex-wrap: wrap;
}

.grid-cards {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* Layout splits */
.split {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: 2fr 1fr;
}

@media (max-width: 960px) {
  .split {
    grid-template-columns: 1fr;
  }
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--s-3);
}

.gallery-item {
  aspect-ratio: 1;
  background: var(--color-surface-alt);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--color-text-soft);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Profile completion */
.progress-bar {
  height: 8px;
  background: var(--color-surface-alt);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), #11866a);
  border-radius: var(--radius-pill);
}

/* Notifications list */
.notif-list {
  display: flex;
  flex-direction: column;
}

.notif {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-4);
  border-bottom: 1px solid var(--color-border);
}

.notif:last-child {
  border-bottom: 0;
}

.notif.unread {
  background: var(--color-primary-soft);
}

[data-theme="dark"] .notif.unread {
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}

.notif-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-surface-alt);
  display: grid;
  place-items: center;
  color: var(--color-primary);
  flex-shrink: 0;
}

.notif-title {
  font-size: var(--fs-sm);
  font-weight: 600;
}

.notif-body {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-top: 2px;
}

.notif-time {
  font-size: 11px;
  color: var(--color-text-soft);
  margin-top: 4px;
}

/* Auth layout */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
}

.auth-hero {
  background: linear-gradient(135deg, #0d6b4e, #0a4a38);
  color: #fff;
  padding: var(--s-9);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.auth-hero::after {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  inset-block-start: -140px;
  inset-inline-end: -140px;
}

.auth-hero h1 {
  color: #fff;
  font-size: var(--fs-3xl);
  letter-spacing: -0.02em;
  max-width: 440px;
  line-height: 1.15;
}

.auth-hero p {
  color: rgba(255, 255, 255, 0.8);
  max-width: 460px;
  margin-top: var(--s-3);
}

.auth-hero-stats {
  display: flex;
  gap: var(--s-7);
  margin-top: var(--s-6);
}

.auth-hero-stats .num {
  font-size: var(--fs-2xl);
  font-weight: 700;
}

.auth-hero-stats .lbl {
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.75);
}

.auth-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-7);
  background: var(--color-bg);
}

.auth-form {
  width: 100%;
  max-width: 420px;
}

.auth-form h2 {
  font-size: var(--fs-2xl);
  margin-bottom: 6px;
}

.auth-form .muted {
  color: var(--color-text-muted);
  margin-bottom: var(--s-6);
  font-size: var(--fs-sm);
}

.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: var(--s-4);
  font-size: var(--fs-xs);
}

/* Landing */
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 var(--s-7);
}

.landing-nav .brand {
  font-weight: 700;
  font-size: var(--fs-lg);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--color-text);
}

.landing-nav .nav-links {
  display: flex;
  gap: var(--s-5);
  margin-inline-start: var(--s-8);
}

.landing-nav .nav-links a {
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
}

.landing-nav .nav-actions {
  margin-inline-start: auto;
  display: flex;
  gap: var(--s-2);
}

/* ── Landing nav: hamburger (hidden on desktop) ── */
.landing-hamburger {
  display: none;
  margin-inline-start: auto;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Landing nav: mobile dropdown ── */
.landing-mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  inset-inline-end: var(--s-4);
  width: 260px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--s-3);
  z-index: 40;
  flex-direction: column;
  gap: var(--s-1);
}

.landing-mobile-menu.open {
  display: flex;
}

.landing-mobile-link {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--color-text);
  font-weight: 500;
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: background 0.15s;
}

.landing-mobile-link:hover {
  background: var(--color-surface-alt);
  color: var(--color-primary);
}

.landing-mobile-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--s-1) 0;
}

.landing-mobile-row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 4px 8px;
}

.landing-mobile-btn {
  width: 100%;
  justify-content: center;
  text-align: center;
}

/* ── Landing nav: mobile breakpoint ── */
@media (max-width: 768px) {
  .landing-nav {
    padding: 0 var(--s-4);
    position: relative;
  }

  .landing-nav .nav-links,
  .landing-nav .nav-actions {
    display: none;
  }

  .landing-hamburger {
    display: flex;
  }
}

.hero {
  padding: var(--s-10) var(--s-7);
  text-align: center;
  background: radial-gradient(ellipse at top, var(--color-primary-soft), transparent 60%);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.03em;
  max-width: 820px;
  margin: 0 auto var(--s-4);
}

.hero p {
  color: var(--color-text-muted);
  max-width: 620px;
  margin: 0 auto var(--s-6);
  font-size: var(--fs-lg);
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.features {
  padding: var(--s-9) var(--s-7);
  display: grid;
  gap: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  max-width: 1200px;
  margin: 0 auto;
}

.feature {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--s-6);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  display: grid;
  place-items: center;
  margin-bottom: var(--s-3);
}

.feature h3 {
  font-size: var(--fs-md);
  margin-bottom: 6px;
}

.feature p {
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
}

/* Landing sections */
.section {
  padding: var(--s-10) var(--s-7);
  max-width: 1280px;
  margin: 0 auto;
}

[data-theme="dark"] .section-alt-wrap {
  background: #0d1525;
  background-image: none;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--s-5);
  margin-bottom: var(--s-7);
  flex-wrap: wrap;
}

.section-head .title-block {
  max-width: 520px;
}

.section-pill {
  display: inline-block;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: rgba(184, 115, 51, 0.1);
  color: #b87333;
  font-size: var(--fs-xs);
  font-weight: 600;
  margin-bottom: var(--s-3);
}

[data-theme="dark"] .section-pill {
  color: #d4a574;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-sub {
  color: var(--color-text-muted);
  font-size: var(--fs-md);
  max-width: 480px;
  line-height: 1.6;
}

/* Categories grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--s-4);
}

@media (max-width: 1100px) {
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.category-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--s-6) var(--s-4);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: var(--color-text);
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
  color: var(--color-text);
}

.category-ico {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: rgba(13, 107, 78, 0.08);
  color: #0d6b4e;
  font-size: 1.5rem;
}

[data-theme="dark"] .category-ico {
  background: rgba(13, 107, 78, 0.15);
  color: #11866a;
}

.category-label {
  font-weight: 600;
  font-size: var(--fs-sm);
}

/* Steps grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-4);
}

@media (max-width: 960px) {
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .steps-grid {
    grid-template-columns: 1fr;
  }
}

.step-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--s-6) var(--s-5);
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.step-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.step-num {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: var(--fs-md);
  margin: 0 auto var(--s-4);
}

.step-num.green {
  background: #0d6b4e;
}

.step-num.orange {
  background: #b87333;
}

.step-card h3 {
  font-size: var(--fs-md);
  margin-bottom: var(--s-2);
}

.step-card p {
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

/* Trust grid */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-4);
}

@media (max-width: 900px) {
  .trust-grid {
    grid-template-columns: 1fr;
  }
}

.trust-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--s-6);
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.trust-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.trust-ico {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  margin: 0 auto var(--s-4);
}

.trust-ico.emerald {
  background: rgba(13, 107, 78, 0.1);
  color: #0d6b4e;
}

.trust-ico.copper {
  background: rgba(184, 115, 51, 0.1);
  color: #b87333;
}

[data-theme="dark"] .trust-ico.emerald {
  background: rgba(13, 107, 78, 0.15);
  color: #11866a;
}

[data-theme="dark"] .trust-ico.copper {
  background: rgba(184, 115, 51, 0.15);
  color: #c9896e;
}

.trust-card h3 {
  font-size: var(--fs-md);
  margin-bottom: var(--s-2);
}

.trust-card p {
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  line-height: 1.7;
}

/* CTA banner */
.cta-banner {
  position: relative;
  padding: var(--s-10) var(--s-7);
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.06), transparent 50%),
    radial-gradient(circle at 80% 90%, rgba(255, 255, 255, 0.04), transparent 50%),
    linear-gradient(135deg, #1a2332, #0d3a2e 50%, #0d6b4e);
  color: #fff;
  text-align: center;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.cta-banner>* {
  position: relative;
}

.cta-banner h2 {
  color: #fff;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: -0.02em;
  margin-bottom: var(--s-3);
}

.cta-banner p {
  color: rgba(255, 255, 255, 0.78);
  max-width: 520px;
  margin: 0 auto var(--s-6);
  font-size: var(--fs-md);
}

.cta-actions {
  display: flex;
  gap: var(--s-3);
  justify-content: center;
  flex-wrap: wrap;
}

.cta-banner .btn-cta-primary {
  background: #b87333;
  color: #fff;
  border: 1px solid #b87333;
}

.cta-banner .btn-cta-primary:hover {
  background: #a0643a;
  border-color: #a0643a;
  color: #fff;
}

.cta-banner .btn-dark {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
}

.cta-banner .btn-dark:hover {
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
}

/* Utils */
.text-muted {
  color: var(--color-text-muted);
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.d-flex {
  display: flex;
}

.align-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: var(--s-2);
}

.gap-3 {
  gap: var(--s-3);
}

.gap-4 {
  gap: var(--s-4);
}

.mt-2 {
  margin-top: var(--s-2);
}

.mt-3 {
  margin-top: var(--s-3);
}

.mt-4 {
  margin-top: var(--s-4);
}

.mt-5 {
  margin-top: var(--s-5);
}

.mb-2 {
  margin-bottom: var(--s-2);
}

.mb-3 {
  margin-bottom: var(--s-3);
}

.mb-4 {
  margin-bottom: var(--s-4);
}

.mb-5 {
  margin-bottom: var(--s-5);
}

.w-full {
  width: 100%;
}

.flex-1 {
  flex: 1;
}

.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 960px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform var(--transition);
    z-index: 60;
  }

  [dir="rtl"] .sidebar {
    transform: translateX(100%);
  }

  .app.mobile-open .sidebar {
    transform: translateX(0);
  }

  .app.mobile-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
  }

  .page {
    padding: var(--s-4);
  }

  .topbar {
    padding: 0 var(--s-4);
  }

  .topbar-search {
    display: none;
  }
}