/* ═══════════════════════════════════════════════════════════════
   DotStudio® POS — APPLE 2026 COMPONENTS
   Liquid Glass buttons, fields, cards, tables, modals, toasts,
   navigation, chat and commerce primitives.
   Loaded SECOND on every page. Tokens only.
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════ BUTTONS ═══════════════════════════ */
.btn {
  --btn-bg: rgba(255, 255, 255, 0.07);
  --btn-fg: var(--text-primary);
  --btn-border: rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 14px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-border);
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  transition:
    background var(--transition-base),
    border-color var(--transition-base),
    color var(--transition-base),
    transform var(--transition-fast),
    box-shadow var(--transition-base);
}
.btn:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.22); }
.btn:active { transform: scale(0.975); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.42; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.9; }

.btn-primary { --btn-bg: var(--accent-blue); --btn-fg: #fff; --btn-border: transparent; font-weight: 700; box-shadow: 0 8px 24px rgba(0, 122, 255, 0.24); }
.btn-primary:hover { background: #2A8CFF; border-color: transparent; box-shadow: 0 10px 34px rgba(0, 122, 255, 0.34); }
.btn-secondary { --btn-bg: rgba(255, 255, 255, 0.06); --btn-fg: var(--text-primary); --btn-border: rgba(255, 255, 255, 0.14); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.11); border-color: rgba(255, 255, 255, 0.24); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--text-secondary); --btn-border: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.07); color: var(--text-primary); }
.btn-danger { --btn-bg: rgba(255, 69, 58, 0.14); --btn-fg: #FF6B61; --btn-border: rgba(255, 69, 58, 0.26); }
.btn-danger:hover { background: var(--accent-red); color: #fff; border-color: var(--accent-red); }
.btn-success { --btn-bg: rgba(48, 209, 88, 0.14); --btn-fg: #4AE073; --btn-border: rgba(48, 209, 88, 0.26); }
.btn-success:hover { background: var(--accent-green); color: #04120a; border-color: var(--accent-green); }
.btn-white { --btn-bg: #F5F5F7; --btn-fg: #050505; --btn-border: #F5F5F7; font-weight: 700; }
.btn-white:hover { background: #FFFFFF; border-color: #FFFFFF; }
.btn-dark { --btn-bg: #1C1C1E; --btn-fg: #F5F5F7; --btn-border: rgba(255, 255, 255, 0.12); font-weight: 700; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: var(--fs-sm); border-radius: 11px; gap: 6px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { min-height: 52px; padding: 0 28px; font-size: var(--fs-base); border-radius: 18px; }
.btn-block { width: 100%; }
.btn-icon { width: 42px; height: 42px; min-height: 42px; padding: 0; border-radius: 13px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); color: var(--text-secondary); }
.btn-icon:hover { background: rgba(255, 255, 255, 0.11); color: var(--text-primary); }
.btn-icon svg { width: 18px; height: 18px; }
.btn-icon.sm { width: 34px; height: 34px; min-height: 34px; }
.btn-icon.sm svg { width: 15px; height: 15px; }
.btn-circle { border-radius: 999px; }
.btn-group { display: inline-flex; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); border-radius: 14px; padding: 3px; gap: 2px; }
.btn-group .btn { min-height: 34px; border: 0; background: transparent; color: var(--text-secondary); border-radius: 11px; padding: 0 13px; font-size: var(--fs-sm); }
.btn-group .btn.active { background: rgba(255, 255, 255, 0.12); color: var(--text-primary); box-shadow: var(--shadow-xs); }
.btn .spin { width: 14px; height: 14px; border-width: 2px; }

/* ── Apple-specific named buttons ── */
.apple-btn-primary,
.apple-btn-lime,
.apple-btn-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: var(--transition-apple);
  cursor: pointer;
  border: 1px solid transparent;
}
.apple-btn-primary {
  background: linear-gradient(180deg, #2A8CFF, var(--accent-blue));
  color: #fff;
  box-shadow: 0 12px 34px rgba(0, 122, 255, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.apple-btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 18px 44px rgba(0, 122, 255, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.apple-btn-primary:active { transform: scale(0.975); }
.apple-btn-lime {
  background: linear-gradient(180deg, #A6FF5C, var(--accent-lime) 55%, #6FE60A);
  color: #050505;
  box-shadow: 0 14px 40px rgba(130, 255, 31, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.apple-btn-lime:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 20px 50px rgba(130, 255, 31, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.apple-btn-lime:active { transform: scale(0.975); }
.apple-btn-glass {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text-primary);
  -webkit-backdrop-filter: blur(var(--blur-glass));
  backdrop-filter: blur(var(--blur-glass));
}
.apple-btn-glass:hover { background: rgba(255, 255, 255, 0.13); border-color: rgba(255, 255, 255, 0.26); }
.apple-btn-primary:disabled, .apple-btn-lime:disabled { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }

/* Floating action */
.fab {
  position: fixed; inset-inline-end: 24px; bottom: 24px; z-index: 50;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent-lime); color: #050505;
  display: grid; place-items: center;
  box-shadow: var(--shadow-lime), var(--shadow-lg);
  transition: var(--transition-apple);
}
.fab:hover { transform: translateY(-2px) scale(1.04); background: #94FF45; }
.fab svg { width: 24px; height: 24px; stroke-width: 2; }

/* ═══════════════════════════ CARDS ═════════════════════════════ */
.card,
.glass-card {
  position: relative;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.022) 52%, rgba(255, 255, 255, 0.010)),
    var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-float), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(var(--blur-glass)) saturate(170%);
  backdrop-filter: blur(var(--blur-glass)) saturate(170%);
  transition: border-color var(--transition-base), background var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 32%);
}
.card > * { position: relative; z-index: 1; }
.card.hoverable:hover,
.glass-card.hoverable:hover {
  border-color: rgba(255, 255, 255, 0.20);
  transform: translateY(-2px);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.13);
}
.card.flat { background: rgba(255, 255, 255, 0.035); border-color: rgba(255, 255, 255, 0.07); box-shadow: none; }
.card.pad-0 { padding: 0; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); flex-wrap: wrap; }
.card-title { display: flex; align-items: center; gap: 10px; font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.015em; }
.card-title .icon { width: 34px; height: 34px; border-radius: 11px; background: var(--lime-soft); color: var(--accent-lime); display: grid; place-items: center; flex-shrink: 0; }
.card-title .icon svg { width: 18px; height: 18px; }
.card-subtitle { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 3px; font-weight: 400; }
.card-body { padding: 0; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--border-soft); flex-wrap: wrap; }
.card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: var(--space-4); }

/* KPI / stat */
.stat {
  position: relative;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.022) 55%, rgba(255, 255, 255, 0.010)),
    var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  box-shadow: var(--shadow-float), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(var(--blur-glass)) saturate(170%);
  backdrop-filter: blur(var(--blur-glass)) saturate(170%);
  transition: var(--transition-apple);
}
.stat:hover { border-color: rgba(255, 255, 255, 0.19); transform: translateY(-2px); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { font-size: var(--fs-sm); color: var(--text-secondary); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat-icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.07); color: var(--text-secondary); flex-shrink: 0; }
.stat-icon svg { width: 18px; height: 18px; }
.stat-icon.lime { background: var(--lime-soft); color: var(--accent-lime); }
.stat-icon.green { background: var(--success-soft); color: var(--accent-green); }
.stat-icon.blue { background: var(--blue-soft); color: var(--accent-blue); }
.stat-icon.orange { background: var(--orange-soft); color: var(--accent-orange); }
.stat-icon.red { background: var(--danger-soft); color: var(--accent-red); }
.stat-icon.purple { background: var(--purple-soft); color: var(--accent-purple); }
.stat-value { font-family: var(--font-display); font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: var(--fs-sm); color: var(--text-tertiary); font-weight: 500; margin-inline-start: 4px; }
.stat-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-xs); color: var(--text-tertiary); }
.stat-card-lime {
  background: linear-gradient(150deg, #A6FF5C 0%, var(--accent-lime) 48%, #6FE60A 100%);
  border-color: transparent;
  color: #050505;
  box-shadow: 0 18px 50px rgba(130, 255, 31, 0.22);
}
.stat-card-lime .stat-label, .stat-card-lime .stat-foot { color: rgba(5, 5, 5, 0.62); }
.stat-card-lime .stat-value { color: #050505; }
.stat-card-lime .stat-icon { background: rgba(5, 5, 5, 0.12); color: #050505; }
.stat-card-dark { background: linear-gradient(150deg, #1E1E22, #0C0C0E); border-color: rgba(255, 255, 255, 0.12); }
.stat-spark { margin-top: 2px; height: 38px; width: 100%; }

/* ═══════════════════════════ FORMS ═════════════════════════════ */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field label, .field .label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary); letter-spacing: 0.005em; }
.field .hint { font-size: var(--fs-xs); color: var(--text-tertiary); }
.input, .select, .textarea, .apple-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  font-size: var(--fs-md);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}
.input::placeholder, .textarea::placeholder, .apple-input::placeholder { color: var(--text-tertiary); }
.input:hover, .select:hover, .textarea:hover, .apple-input:hover { border-color: rgba(255, 255, 255, 0.20); background: rgba(255, 255, 255, 0.075); }
.input:focus, .select:focus, .textarea:focus, .apple-input:focus {
  outline: none;
  border-color: rgba(0, 122, 255, 0.75);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.18);
  background: rgba(255, 255, 255, 0.085);
}
.input:disabled, .select:disabled, .textarea:disabled { opacity: 0.5; cursor: not-allowed; }
.textarea { min-height: 112px; resize: vertical; line-height: 1.65; border-radius: var(--radius-md); }
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: 40px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2386868B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
html[dir="rtl"] .select { background-position: left 14px center; padding-inline-end: 16px; padding-inline-start: 40px; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-inline-start: 46px; }
.input-group > svg { position: absolute; inset-inline-start: 15px; width: 18px; height: 18px; color: var(--text-tertiary); pointer-events: none; }
.input-group .btn-icon { position: absolute; inset-inline-end: 6px; width: 34px; height: 34px; min-height: 34px; background: transparent; border: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); }
.form-stack { display: flex; flex-direction: column; gap: var(--space-4); }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: var(--fs-md); color: var(--text-secondary); user-select: none; }
.check input {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  display: grid; place-items: center; flex-shrink: 0;
  transition: var(--transition-fast); cursor: pointer;
}
.check input:checked { background: var(--accent-blue); border-color: var(--accent-blue); }
.check input:checked::after { content: ""; width: 11px; height: 6px; border: 2px solid #fff; border-top: 0; border-inline-end: 0; transform: rotate(-45deg) translateY(-1px); }
.check input:focus-visible { box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.22); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--fs-sm); color: var(--text-secondary); user-select: none; }
.switch input { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.10); position: relative; cursor: pointer; transition: var(--transition-base); }
.switch input::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35); transition: transform var(--transition-base); }
.switch input:checked { background: var(--accent-green); border-color: transparent; }
.switch input:checked::after { transform: translateX(18px); }
html[dir="rtl"] .switch input:checked::after { transform: translateX(-18px); }
.range { width: 100%; accent-color: var(--accent-blue); height: 4px; }

/* Filter bar */
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: var(--space-5); }
.filter-bar .input, .filter-bar .select { width: auto; min-width: 152px; min-height: 40px; }
.filter-bar .input-group { flex: 1; min-width: 220px; }
.filter-bar .input-group .input { width: 100%; }
.search-mini {
  display: flex; align-items: center; gap: 9px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 13px;
  padding: 0 14px; height: 42px;
  color: var(--text-tertiary);
  transition: var(--transition-fast);
}
.search-mini:focus-within { border-color: rgba(0, 122, 255, 0.7); box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.16); }
.search-mini input { background: none; border: 0; outline: none; flex: 1; height: 100%; font-size: var(--fs-md); color: var(--text-primary); min-width: 0; }
.search-mini svg { width: 17px; height: 17px; flex-shrink: 0; }
.kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.10); font-family: var(--font-en); font-size: 10px; color: var(--text-secondary); font-weight: 600; }

/* ═══════════════════════════ BADGES ════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 600; line-height: 1.45;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  border: 1px solid transparent;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge.success { background: var(--success-soft); color: #4AE073; }
.badge.danger { background: var(--danger-soft); color: #FF6B61; }
.badge.warning { background: var(--warning-soft); color: var(--accent-yellow); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.lime { background: var(--lime-soft); color: var(--accent-lime); }
.badge.orange { background: var(--orange-soft); color: var(--accent-orange); }
.badge.purple { background: var(--purple-soft); color: #CF7CFF; }
.badge.neutral { background: rgba(255, 255, 255, 0.07); color: var(--text-secondary); border-color: rgba(255, 255, 255, 0.08); }
.badge.solid { background: var(--accent-lime); color: #050505; }
.badge.lg { padding: 6px 13px; font-size: var(--fs-sm); }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.badge-dot.lime { background: var(--accent-lime); box-shadow: 0 0 0 3px var(--lime-soft); }
.badge-dot.green { background: var(--accent-green); }
.badge-dot.red { background: var(--accent-red); }
.badge-dot.orange { background: var(--accent-orange); }

/* ═══════════════════════════ AVATARS ═══════════════════════════ */
.avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: rgba(255, 255, 255, 0.10); border: 1px solid rgba(255, 255, 255, 0.14); flex-shrink: 0; }
.avatar.sm { width: 32px; height: 32px; }
.avatar.lg { width: 58px; height: 58px; }
.avatar.xl { width: 78px; height: 78px; }
.avatar-ring { border: 2px solid var(--accent-lime); padding: 2px; background: var(--bg-primary); }
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar { margin-inline-start: -10px; border: 2px solid #111; }
.avatar-stack .avatar:first-child { margin-inline-start: 0; }
.avatar-initial { display: grid; place-items: center; font-weight: 700; color: #050505; background: var(--accent-lime); font-size: var(--fs-md); }
.avatar-upload { position: relative; display: inline-block; cursor: pointer; }
.avatar-upload .edit { position: absolute; inset-inline-end: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-blue); color: #fff; display: grid; place-items: center; border: 2px solid #111; }
.avatar-upload .edit svg { width: 12px; height: 12px; }
.av-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.av-opt { aspect-ratio: 1; border-radius: 50%; border: 2px solid transparent; cursor: pointer; overflow: hidden; background: rgba(255, 255, 255, 0.06); transition: var(--transition-fast); position: relative; }
.av-opt img { width: 100%; height: 100%; object-fit: cover; }
.av-opt:hover { transform: scale(1.06); border-color: rgba(255, 255, 255, 0.25); }
.av-opt.selected { border-color: var(--accent-lime); box-shadow: 0 0 0 3px var(--lime-soft); }
.av-opt.upload { display: grid; place-items: center; border: 1.5px dashed rgba(255, 255, 255, 0.24); color: var(--text-tertiary); background: transparent; }
.av-opt.upload:hover { border-color: var(--accent-lime); color: var(--accent-lime); }

/* ═══════════════════════════ TABLES ════════════════════════════ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-float), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(var(--blur-glass)) saturate(160%);
  backdrop-filter: blur(var(--blur-glass)) saturate(160%);
}
.table, .apple-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-md); }
.table thead th, .apple-table thead th {
  text-align: start;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.045);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
  -webkit-backdrop-filter: blur(30px);
  backdrop-filter: blur(30px);
}
.table thead th:first-child, .apple-table thead th:first-child { border-start-start-radius: var(--radius-lg); }
.table thead th:last-child, .apple-table thead th:last-child { border-start-end-radius: var(--radius-lg); }
.table tbody td, .apple-table tbody td { padding: 14px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.055); vertical-align: middle; color: var(--text-primary); }
.table tbody tr:last-child td, .apple-table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr, .apple-table tbody tr { transition: background var(--transition-fast); }
.table tbody tr:hover, .apple-table tbody tr:hover { background: rgba(255, 255, 255, 0.045); }
.table .cell-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.table .cell-title { font-weight: 600; font-size: var(--fs-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table .cell-sub { font-size: var(--fs-xs); color: var(--text-tertiary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table .cell-img { width: 42px; height: 42px; border-radius: 11px; object-fit: cover; background: rgba(255, 255, 255, 0.07); flex-shrink: 0; border: 1px solid rgba(255, 255, 255, 0.08); }
.table .actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.table .num { white-space: nowrap; }
.table-compact tbody td { padding: 10px 13px; }
.table-compact thead th { padding: 10px 13px; }
.table-wrap.flush { border: 0; border-radius: 0; box-shadow: none; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.table-wrap.flush .table thead th { background: transparent; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-top: 1px solid var(--border-soft); font-size: var(--fs-xs); color: var(--text-tertiary); flex-wrap: wrap; }
.pagination { display: flex; align-items: center; gap: 4px; }
.pagination button { min-width: 32px; height: 32px; border-radius: 9px; border: 1px solid transparent; color: var(--text-secondary); font-size: var(--fs-sm); font-weight: 600; }
.pagination button:hover { background: rgba(255, 255, 255, 0.07); }
.pagination button.active { background: var(--accent-lime); color: #050505; }

/* ── Apple named table ── */
.apple-table { border-radius: var(--radius-lg); overflow: hidden; }

/* ═══════════════════════════ TABS ══════════════════════════════ */
.tabs { display: flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 14px; padding: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 11px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary); white-space: nowrap; transition: var(--transition-fast); }
.tab:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.05); }
.tab.active { background: rgba(255, 255, 255, 0.13); color: var(--text-primary); box-shadow: var(--shadow-xs); }
.tab .count { background: rgba(255, 255, 255, 0.10); border-radius: 999px; font-size: 10px; padding: 1px 7px; color: var(--text-secondary); }
.tab.active .count { background: var(--lime-soft); color: var(--accent-lime); }
.tabs-line { display: flex; gap: 22px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs-line::-webkit-scrollbar { display: none; }
.tabs-line .tab { padding: 13px 2px; border-radius: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--text-tertiary); }
.tabs-line .tab.active { background: none; box-shadow: none; color: var(--text-primary); border-bottom-color: var(--accent-lime); }

/* ═══════════════════════════ MODAL ═════════════════════════════ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: rgba(0, 0, 0, 0.62);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: dsFadeIn var(--transition-base) both;
  overflow-y: auto;
}
.modal {
  width: 100%; max-width: 580px; max-height: calc(100vh - 48px); overflow-y: auto;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03) 45%, rgba(255, 255, 255, 0.015)),
    rgba(18, 18, 20, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  animation: dsScaleIn var(--transition-slow) both;
  position: relative;
  -webkit-backdrop-filter: blur(var(--blur-glass)) saturate(180%);
  backdrop-filter: blur(var(--blur-glass)) saturate(180%);
}
.modal.sm { max-width: 430px; }
.modal.lg { max-width: 780px; }
.modal.xl { max-width: 980px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 26px 0; }
.modal-title { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.025em; }
.modal-sub { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 5px; }
.modal-close { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--text-secondary); background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.10); flex-shrink: 0; transition: var(--transition-fast); }
.modal-close:hover { background: rgba(255, 255, 255, 0.14); color: var(--text-primary); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body { padding: 22px 26px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 0 26px 26px; flex-wrap: wrap; }
.modal-foot .btn { min-width: 104px; }
.modal-foot .spacer { flex: 1; }
body.modal-open { overflow: hidden; }

/* ═══════════════════════════ TOASTS ════════════════════════════ */
.toast-stack { position: fixed; bottom: 24px; inset-inline-end: 24px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 15px 17px;
  border-radius: var(--radius-md);
  background: rgba(28, 28, 30, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.10);
  -webkit-backdrop-filter: blur(var(--blur-glass)) saturate(180%);
  backdrop-filter: blur(var(--blur-glass)) saturate(180%);
  pointer-events: auto;
  animation: dsSlideUp var(--transition-slow) both;
  position: relative;
  overflow: hidden;
}
.toast::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px; background: var(--info); }
.toast.success::before { background: var(--accent-green); }
.toast.error::before { background: var(--accent-red); }
.toast.warning::before { background: var(--accent-yellow); }
.toast.info::before { background: var(--accent-blue); }
.toast-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--info-soft); color: var(--info); }
.toast.success .toast-icon { background: var(--success-soft); color: var(--accent-green); }
.toast.error .toast-icon { background: var(--danger-soft); color: var(--accent-red); }
.toast.warning .toast-icon { background: var(--warning-soft); color: var(--accent-yellow); }
.toast-icon svg { width: 16px; height: 16px; }
.toast-body { flex: 1; min-width: 0; padding-top: 1px; }
.toast-title { font-size: var(--fs-md); font-weight: 600; color: var(--text-primary); }
.toast-msg { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 2px; line-height: 1.5; }
.toast-x { color: var(--text-tertiary); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; flex-shrink: 0; }
.toast-x:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }
.toast.out { animation: dsFadeIn var(--transition-base) reverse both; }

/* ═══════════════════════════ SKELETONS ═════════════════════════ */
.skeleton {
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.10) 37%, rgba(255, 255, 255, 0.05) 63%);
  background-size: 400% 100%;
  animation: dsShimmer 1.4s ease-in-out infinite;
  border-radius: 10px;
  min-height: 12px;
}
.skeleton.circle { border-radius: 50%; }
.skeleton-lines { display: flex; flex-direction: column; gap: 9px; }
.skeleton-line { height: 12px; }
.skeleton-line.w-75 { width: 75%; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-30 { width: 30%; }
.skeleton-card { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.07); border-radius: var(--radius-lg); padding: var(--space-5); display: flex; flex-direction: column; gap: 14px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-4); }
.skeleton-table { display: flex; flex-direction: column; gap: 1px; background: rgba(255, 255, 255, 0.05); border-radius: var(--radius-lg); overflow: hidden; }
.skeleton-row { display: flex; align-items: center; gap: 16px; padding: 15px 17px; background: rgba(255, 255, 255, 0.03); }
.skeleton-row .skeleton { height: 12px; }
.spin { width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, 0.15); border-top-color: var(--accent-lime); border-radius: 50%; animation: dsSpin 0.7s linear infinite; display: inline-block; }
.loading-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); display: grid; place-items: center; border-radius: inherit; z-index: 2; }

/* ═════════════════════════ EMPTY STATES ════════════════════════ */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 60px 24px; gap: 6px; }
.empty-icon { width: 78px; height: 78px; border-radius: 24px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.10); display: grid; place-items: center; color: var(--text-secondary); margin-bottom: 12px; }
.empty-icon svg { width: 32px; height: 32px; stroke-width: 1.5; }
.empty-title { font-size: var(--fs-lg); font-weight: 700; color: var(--text-primary); }
.empty-text { font-size: var(--fs-sm); color: var(--text-secondary); max-width: 360px; line-height: 1.7; margin-bottom: 10px; }
.empty-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

/* ═══════════════════════════ PROGRESS ══════════════════════════ */
.progress { height: 8px; background: rgba(255, 255, 255, 0.08); border-radius: 999px; overflow: hidden; position: relative; }
.progress-bar { height: 100%; background: var(--accent-lime); border-radius: 999px; transition: width var(--transition-slow); min-width: 0; }
.progress.thin { height: 4px; }
.progress.green .progress-bar { background: var(--accent-green); }
.progress.blue .progress-bar { background: var(--accent-blue); }
.progress.orange .progress-bar { background: var(--accent-orange); }
.progress.red .progress-bar { background: var(--accent-red); }
.ring-progress { --p: 0; width: 66px; height: 66px; border-radius: 50%; background: conic-gradient(var(--accent-lime) calc(var(--p) * 1%), rgba(255, 255, 255, 0.08) 0); display: grid; place-items: center; position: relative; flex-shrink: 0; }
.ring-progress::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #131315; }
.ring-progress span { position: relative; z-index: 1; font-size: var(--fs-sm); font-weight: 700; font-family: var(--font-display); }

/* ═══════════════════════════ DROPDOWN ══════════════════════════ */
.dropdown { position: relative; display: inline-flex; }
.dropdown-menu {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0;
  min-width: 200px; padding: 7px;
  background: rgba(28, 28, 30, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.10);
  -webkit-backdrop-filter: blur(var(--blur-glass)) saturate(180%);
  backdrop-filter: blur(var(--blur-glass)) saturate(180%);
  z-index: var(--z-dropdown);
  animation: dsSlideDown var(--transition-fast) both;
}
.dropdown-menu.start { inset-inline-end: auto; inset-inline-start: 0; }
.dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 11px; border-radius: 10px; font-size: var(--fs-sm); color: var(--text-secondary); text-align: start; transition: var(--transition-fast); }
.dropdown-item:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }
.dropdown-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.85; }
.dropdown-item.danger { color: #FF6B61; }
.dropdown-item.danger:hover { background: var(--danger-soft); }
.dropdown-sep { height: 1px; background: rgba(255, 255, 255, 0.07); margin: 5px 4px; }
.dropdown-head { padding: 8px 11px 6px; font-size: var(--fs-xs); color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

/* ═══════════════════════════ TOOLTIP ═══════════════════════════ */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); inset-inline-start: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(245, 245, 247, 0.95); color: #050505;
  font-size: var(--fs-xs); font-weight: 500;
  padding: 6px 10px; border-radius: 8px; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: var(--transition-fast); z-index: 90;
}
[data-tip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ════════════════════════════ CHAT ═════════════════════════════ */
.chat-shell { display: grid; grid-template-columns: 270px minmax(0, 1fr); background: var(--bg-elevated); border: 1px solid rgba(255, 255, 255, 0.10); border-radius: var(--radius-lg); overflow: hidden; min-height: 560px; height: calc(100vh - 190px); box-shadow: var(--shadow-float); -webkit-backdrop-filter: blur(var(--blur-glass)); backdrop-filter: blur(var(--blur-glass)); }
.chat-side { border-inline-end: 1px solid rgba(255, 255, 255, 0.08); background: rgba(255, 255, 255, 0.025); display: flex; flex-direction: column; min-height: 0; }
.chat-side-head { padding: 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.chat-rooms { padding: 8px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.chat-tab-rail { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.chat-rail-item { display: flex; align-items: center; gap: 9px; padding: 10px 11px; border-radius: 11px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary); transition: var(--transition-fast); text-align: start; width: 100%; }
.chat-rail-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-primary); }
.chat-rail-item.active { background: var(--accent-lime); color: #050505; }
.chat-rail-item .lock { margin-inline-start: auto; opacity: 0.6; width: 13px; height: 13px; }
.chat-rail-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.chat-room { display: flex; align-items: center; gap: 10px; padding: 11px; border-radius: 13px; cursor: pointer; transition: background var(--transition-fast); text-align: start; width: 100%; }
.chat-room:hover { background: rgba(255, 255, 255, 0.05); }
.chat-room.active { background: rgba(255, 255, 255, 0.08); box-shadow: inset 2px 0 0 var(--accent-lime); }
html[dir="rtl"] .chat-room.active { box-shadow: inset -2px 0 0 var(--accent-lime); }
.chat-room .avatar { width: 38px; height: 38px; }
.chat-room-info { flex: 1; min-width: 0; }
.chat-room-name { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); }
.chat-room-preview { font-size: var(--fs-xs); color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-room-time { font-size: 10px; color: var(--text-tertiary); flex-shrink: 0; }
.chat-main { display: flex; flex-direction: column; min-height: 0; background: rgba(0, 0, 0, 0.25); }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); background: rgba(255, 255, 255, 0.035); flex-wrap: wrap; }
.chat-head-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chat-head-name { font-size: var(--fs-md); font-weight: 700; }
.chat-head-sub { font-size: var(--fs-xs); color: var(--text-tertiary); }
.chat-body { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.chat-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 78%; }
.chat-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg .avatar { width: 28px; height: 28px; margin-bottom: 2px; }
.chat-bubble { padding: 11px 15px; border-radius: 18px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.06); font-size: var(--fs-md); line-height: 1.55; color: var(--text-primary); position: relative; word-break: break-word; }
.chat-msg.mine .chat-bubble { background: var(--accent-lime); color: #050505; border-color: var(--accent-lime); border-end-end-radius: 6px; }
.chat-msg:not(.mine) .chat-bubble { border-end-start-radius: 6px; }
.chat-meta { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--text-tertiary); margin-top: 5px; }
.chat-msg.mine .chat-meta { justify-content: flex-end; color: rgba(5, 5, 5, 0.55); }
.chat-name { font-size: var(--fs-xs); font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.chat-composer { display: flex; align-items: flex-end; gap: 8px; padding: 13px 16px; border-top: 1px solid rgba(255, 255, 255, 0.07); background: rgba(255, 255, 255, 0.03); }
.chat-composer textarea { flex: 1; min-height: 44px; max-height: 120px; resize: none; padding: 11px 15px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.10); outline: none; font-size: var(--fs-md); color: var(--text-primary); line-height: 1.5; }
.chat-composer textarea:focus { border-color: rgba(0, 122, 255, 0.7); box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.14); }
.chat-send { width: 44px; height: 44px; min-height: 44px; border-radius: 50%; background: var(--accent-lime); color: #050505; display: grid; place-items: center; flex-shrink: 0; transition: var(--transition-fast); }
.chat-send:hover { background: #94FF45; transform: scale(1.04); }
.chat-send:disabled { opacity: 0.4; transform: none; cursor: not-allowed; }
.chat-send svg { width: 18px; height: 18px; }
.chat-empty { flex: 1; display: grid; place-items: center; color: var(--text-tertiary); font-size: var(--fs-sm); padding: 40px; }
.chat-locked { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 40px; color: var(--text-tertiary); flex: 1; }
.chat-locked .empty-icon { width: 56px; height: 56px; border-radius: 16px; margin: 0; }
.chat-locked b { color: var(--text-primary); font-size: var(--fs-md); }
.chat-locked p { font-size: var(--fs-sm); max-width: 300px; line-height: 1.6; }
.chat-day { align-self: center; font-size: 10px; color: var(--text-tertiary); background: rgba(255, 255, 255, 0.06); padding: 4px 11px; border-radius: 999px; margin-block: 4px; }
.chat-dock { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--bg-elevated); border: 1px solid rgba(255, 255, 255, 0.10); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-float); }
.chat-dock-head { padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-dock-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-dock .chat-bubble { font-size: var(--fs-sm); }
.chat-dock .chat-composer { padding: 8px; gap: 6px; }
.chat-dock .chat-composer textarea { min-height: 36px; font-size: var(--fs-sm); }
.chat-dock .chat-send { width: 36px; height: 36px; min-height: 36px; }
.dock-tabs { display: flex; gap: 3px; padding: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); overflow-x: auto; scrollbar-width: none; }
.dock-tabs::-webkit-scrollbar { display: none; }
.dock-tab { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 8px; font-size: 11px; font-weight: 600; color: var(--text-tertiary); white-space: nowrap; }
.dock-tab:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-primary); }
.dock-tab.active { background: var(--accent-lime); color: #050505; }
.dock-tab svg { width: 12px; height: 12px; }

/* ════════════════════════════ MAP ══════════════════════════════ */
.map-card { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.10); background: #0A0F16; min-height: 300px; }
.map-canvas { width: 100%; height: 100%; display: block; }
.map-overlay { position: absolute; inset: 0; pointer-events: none; }
.map-badge { position: absolute; top: 14px; inset-inline-start: 14px; display: flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, 0.72); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 999px; padding: 7px 13px; font-size: var(--fs-xs); font-weight: 600; color: var(--accent-lime); z-index: 3; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.map-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-lime); animation: dsPulse 1.6s infinite; }
.map-eta { position: absolute; bottom: 14px; inset-inline-start: 14px; background: rgba(0, 0, 0, 0.74); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: var(--radius-md); padding: 11px 15px; z-index: 3; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.map-eta .lbl { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; }
.map-eta .val { font-size: var(--fs-lg); font-weight: 700; color: var(--accent-lime); font-family: var(--font-display); line-height: 1.2; }
.map-eta .sub { font-size: 10px; color: var(--text-secondary); }
.map-legend { position: absolute; bottom: 14px; inset-inline-end: 14px; display: flex; flex-direction: column; gap: 5px; background: rgba(0, 0, 0, 0.72); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: var(--radius-md); padding: 9px 12px; z-index: 3; font-size: 10px; color: var(--text-secondary); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.map-legend span { display: flex; align-items: center; gap: 6px; }
.map-legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.moto-marker { position: absolute; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-lime); display: grid; place-items: center; font-size: 17px; box-shadow: 0 0 0 5px rgba(130, 255, 31, 0.15), 0 10px 24px rgba(0, 0, 0, 0.55); transform: translate(-50%, -50%); z-index: 4; transition: left 1s linear, top 1s linear; will-change: left, top; border: 2px solid #050505; }
.moto-marker.static { transition: none; }
.map-pin { position: absolute; transform: translate(-50%, -100%); z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.map-pin .pin { width: 32px; height: 32px; border-radius: 50% 50% 50% 4px; transform: rotate(45deg); display: grid; place-items: center; border: 2px solid #050505; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55); }
.map-pin .pin span { transform: rotate(-45deg); font-size: 14px; }
.map-pin.store .pin { background: var(--accent-lime); }
.map-pin.customer .pin { background: #fff; border-color: var(--accent-blue); }
.map-pin .lbl { font-size: 9px; background: rgba(0, 0, 0, 0.78); padding: 3px 7px; border-radius: 5px; color: var(--text-primary); white-space: nowrap; border: 1px solid rgba(255, 255, 255, 0.12); }
.map-empty { display: grid; place-items: center; height: 100%; min-height: 280px; color: var(--text-tertiary); font-size: var(--fs-sm); gap: 8px; flex-direction: column; }
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ══════════════════════ STATUS / TIMELINE ══════════════════════ */
.status-line { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 600; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-dot.pending { background: var(--accent-yellow); }
.status-dot.confirmed { background: var(--accent-blue); }
.status-dot.preparing { background: var(--accent-orange); }
.status-dot.delivering { background: var(--accent-lime); box-shadow: 0 0 0 3px var(--lime-soft); }
.status-dot.delivered { background: var(--accent-green); }
.status-dot.cancelled { background: var(--accent-red); }
.timeline { display: flex; flex-direction: column; gap: 0; padding-block: 4px; }
.timeline-step { display: flex; gap: 14px; position: relative; padding-bottom: 22px; }
.timeline-step:last-child { padding-bottom: 0; }
.timeline-step::before { content: ""; position: absolute; inset-inline-start: 15px; top: 32px; bottom: 0; width: 2px; background: rgba(255, 255, 255, 0.10); }
.timeline-step:last-child::before { display: none; }
.timeline-step.done::before { background: var(--accent-lime); }
.timeline-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.06); border: 2px solid rgba(255, 255, 255, 0.12); color: var(--text-tertiary); flex-shrink: 0; z-index: 1; font-size: 13px; }
.timeline-step.done .timeline-dot { background: var(--accent-lime); border-color: var(--accent-lime); color: #050505; }
.timeline-step.current .timeline-dot { box-shadow: 0 0 0 4px var(--lime-soft); }
.timeline-info { padding-top: 4px; }
.timeline-info b { display: block; font-size: var(--fs-md); color: var(--text-secondary); }
.timeline-step.done .timeline-info b { color: var(--text-primary); }
.timeline-info span { font-size: var(--fs-xs); color: var(--text-tertiary); }
.timeline-step:not(.done):not(.current) .timeline-info b { color: var(--text-tertiary); font-weight: 500; }

/* ════════════════════════════ MISC ═════════════════════════════ */
.divider-labeled { display: flex; align-items: center; gap: 12px; color: var(--text-tertiary); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; }
.divider-labeled::before, .divider-labeled::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.10); font-size: var(--fs-xs); color: var(--text-secondary); white-space: nowrap; transition: var(--transition-fast); }
.chip:hover { border-color: rgba(255, 255, 255, 0.22); color: var(--text-primary); background: rgba(255, 255, 255, 0.09); }
.chip.active { background: var(--lime-soft); border-color: var(--border-lime); color: var(--accent-lime); }
.chip img { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.list-row:last-child { border-bottom: 0; }
.list-row .meta { flex: 1; min-width: 0; }
.list-row .title { font-size: var(--fs-md); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .sub { font-size: var(--fs-xs); color: var(--text-tertiary); margin-top: 2px; }
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; border-radius: var(--radius-md); background: rgba(0, 122, 255, 0.10); border: 1px solid rgba(0, 122, 255, 0.20); font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.6; }
.notice svg { width: 16px; height: 16px; color: var(--accent-blue); flex-shrink: 0; margin-top: 2px; }
.notice.success { background: var(--success-soft); border-color: rgba(48, 209, 88, 0.22); }
.notice.success svg { color: var(--accent-green); }
.notice.warning { background: var(--warning-soft); border-color: rgba(255, 214, 10, 0.22); }
.notice.warning svg { color: var(--accent-yellow); }
.notice.danger { background: var(--danger-soft); border-color: rgba(255, 69, 58, 0.22); }
.notice.danger svg { color: var(--accent-red); }
.code-block { font-family: var(--font-mono); font-size: var(--fs-sm); background: rgba(0, 0, 0, 0.5); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 13px 15px; color: var(--text-secondary); overflow-x: auto; direction: ltr; text-align: left; }
.segmented { display: inline-flex; gap: 2px; padding: 3px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); border-radius: 13px; }
.segmented button { padding: 7px 13px; border-radius: 10px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-tertiary); }
.segmented button.active { background: rgba(255, 255, 255, 0.12); color: var(--text-primary); box-shadow: var(--shadow-xs); }
.callout-lime { border: 1px solid var(--border-lime); background: linear-gradient(135deg, var(--lime-soft), transparent 70%); border-radius: var(--radius-lg); padding: var(--space-5); }
.rating { display: inline-flex; align-items: center; gap: 2px; color: var(--accent-yellow); font-size: var(--fs-sm); }
.rating svg { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.copy-row { display: flex; align-items: center; gap: 6px; }
.copy-row code { font-family: var(--font-mono); font-size: var(--fs-xs); padding: 4px 8px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); border-radius: 6px; }

/* Command palette */
.cmd-backdrop { position: fixed; inset: 0; z-index: var(--z-command); background: rgba(0, 0, 0, 0.58); -webkit-backdrop-filter: blur(26px); backdrop-filter: blur(26px); display: flex; align-items: flex-start; justify-content: center; padding: 12vh 20px 40px; animation: dsFadeIn var(--transition-fast) both; }
.cmd { width: 100%; max-width: 640px; background: rgba(24, 24, 26, 0.84); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); overflow: hidden; animation: dsSlideDown var(--transition-base) both; -webkit-backdrop-filter: blur(var(--blur-glass)) saturate(180%); backdrop-filter: blur(var(--blur-glass)) saturate(180%); }
.cmd-input { display: flex; align-items: center; gap: 10px; padding: 15px 17px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.cmd-input svg { width: 18px; height: 18px; color: var(--text-tertiary); flex-shrink: 0; }
.cmd-input input { flex: 1; background: none; border: 0; outline: none; font-size: var(--fs-lg); color: var(--text-primary); }
.cmd-list { max-height: min(52vh, 420px); overflow-y: auto; padding: 8px; }
.cmd-group { padding: 8px 11px 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-tertiary); }
.cmd-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 12px; border-radius: 12px; text-align: start; color: var(--text-secondary); font-size: var(--fs-md); transition: background var(--transition-fast); }
.cmd-item:hover, .cmd-item.active { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }
.cmd-item .ci-icon { width: 32px; height: 32px; border-radius: 9px; background: rgba(255, 255, 255, 0.07); display: grid; place-items: center; color: var(--text-secondary); flex-shrink: 0; }
.cmd-item .ci-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }
.cmd-item .ci-icon svg { width: 15px; height: 15px; }
.cmd-item .ci-main { flex: 1; min-width: 0; }
.cmd-item .ci-title { font-size: var(--fs-md); color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-item .ci-sub { font-size: var(--fs-xs); color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.cmd-item .kbd { flex-shrink: 0; }
.cmd-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 15px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 10px; color: var(--text-tertiary); gap: 10px; }
.cmd-foot span { display: flex; align-items: center; gap: 5px; }
.cmd-empty { padding: 38px; text-align: center; color: var(--text-tertiary); font-size: var(--fs-sm); }

/* ═══════════════════ APPLE LANGUAGE SWITCH ═════════════════════ */
.apple-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.13);
  -webkit-backdrop-filter: blur(var(--blur-glass));
  backdrop-filter: blur(var(--blur-glass));
  min-height: 38px;
}
.apple-lang-switch .lang-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  transition: var(--transition-apple);
}
.apple-lang-switch .lang-opt:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.07); }
.apple-lang-switch .lang-opt.active {
  background: linear-gradient(180deg, #A6FF5C, var(--accent-lime));
  color: #050505;
  box-shadow: 0 4px 14px rgba(130, 255, 31, 0.28);
}
.apple-lang-switch .lang-globe { width: 30px; height: 30px; display: grid; place-items: center; color: var(--text-secondary); }
.apple-lang-switch .lang-globe svg { width: 14px; height: 14px; }

/* ══════════════════════ RESPONSIVE ═════════════════════════════ */
@media (max-width: 900px) {
  .chat-shell { grid-template-columns: 1fr; height: auto; min-height: 540px; }
  .chat-side { border-inline-end: 0; border-bottom: 1px solid var(--border); }
  .chat-rooms { flex-direction: row; overflow-x: auto; padding: 8px; }
  .chat-room { min-width: 190px; }
  .chat-main { min-height: 440px; }
  .modal-backdrop { padding: 12px; }
  .modal { max-height: calc(100vh - 24px); border-radius: var(--radius-md); }
  .modal-head, .modal-body { padding-inline: 19px; }
  .modal-foot { padding-inline: 19px; }
}
@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
  .btn { min-height: 42px; padding: 0 16px; font-size: var(--fs-sm); }
  .btn-lg { min-height: 48px; padding: 0 22px; }
  .card { padding: var(--space-4); border-radius: var(--radius-md); }
  .stat { padding: var(--space-4); border-radius: var(--radius-md); }
  .stat-value { font-size: var(--fs-2xl); }
  .toast-stack { inset-inline: 12px; bottom: 12px; max-width: none; }
  .toast { width: 100%; }
  .av-grid { grid-template-columns: repeat(4, 1fr); }
  .cmd-backdrop { padding: 8vh 10px 20px; }
  .chat-body { padding: 14px; }
  .chat-msg { max-width: 88%; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tbody tr { border-bottom: 1px solid var(--border); padding: 9px 0; }
  .table tbody td { border: 0; padding: 7px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: end; }
  .table tbody td::before { content: attr(data-label); font-size: var(--fs-xs); color: var(--text-tertiary); font-weight: 600; text-align: start; flex-shrink: 0; }
  .table tbody td:first-child { padding-top: 13px; }
  .table tbody td:last-child { padding-bottom: 13px; }
  .table .actions { justify-content: flex-end; }
  .table-wrap { border-radius: var(--radius-md); }
}
