:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --text: #182033;
  --muted: #667085;
  --line: #e4e7ec;
  --primary: #2563eb;
  --primary-soft: #e8f0ff;
  --success: #16a34a;
  --success-soft: #e8f7ed;
  --warning: #d97706;
  --warning-soft: #fff3dd;
  --danger: #dc2626;
  --danger-soft: #feeceb;
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}

body.dark {
  color-scheme: dark;
  --bg: #0f172a;
  --surface: #111c31;
  --surface-soft: #18243a;
  --text: #edf2f7;
  --muted: #9aa8bd;
  --line: #26344c;
  --primary: #60a5fa;
  --primary-soft: rgba(96, 165, 250, 0.14);
  --success-soft: rgba(34, 197, 94, 0.14);
  --warning-soft: rgba(245, 158, 11, 0.14);
  --danger-soft: rgba(248, 113, 113, 0.14);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Tahoma, Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.10), transparent 36%),
    linear-gradient(315deg, rgba(20, 184, 166, 0.12), transparent 34%),
    var(--bg);
}

.login-panel {
  width: min(430px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-brand {
  margin-bottom: 22px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.login-form input {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 12px;
}

.login-help {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 12px;
  font-size: 12px;
  line-height: 1.8;
}

.logo-preview {
  margin-top: 10px;
  width: 84px;
  height: 84px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-soft);
}

.logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.error {
  margin: 0;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  padding: 10px 12px;
  font-size: 13px;
}

.flash {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 80;
  min-width: 220px;
  max-width: min(420px, calc(100vw - 48px));
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  background: var(--surface);
}

.flash.success {
  border-color: color-mix(in srgb, var(--success) 38%, var(--line));
  background: var(--success-soft);
  color: var(--success);
}

.flash.error {
  border-color: color-mix(in srgb, var(--danger) 38%, var(--line));
  background: var(--danger-soft);
  color: var(--danger);
}

.shell {
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr);
  overflow-x: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-left: 1px solid var(--line);
  background: var(--surface);
  padding: 18px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #14b8a6);
  font-weight: 800;
}

.brand-mark.has-image {
  padding: 0;
  overflow: hidden;
  background: var(--surface-soft);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-title {
  margin: 0;
  font-size: 17px;
}

.brand-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 11px 12px;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: right;
}

.nav-label {
  flex: 1;
}

.nav-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 3px var(--surface);
}

.nav button.active,
.nav button:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.sidebar-card {
  margin-top: 24px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.sidebar-card strong {
  display: block;
  margin-bottom: 8px;
}

.sidebar-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.sidebar-logout {
  width: 100%;
  margin-top: 12px;
}

.main {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 74px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 24px;
}

.page-title {
  flex: 0 0 clamp(210px, 22vw, 330px);
  min-width: 0;
}

.page-title h1 {
  margin: 0;
  font-size: 24px;
}

.page-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
}

.egypt-clock {
  --clock-bg-color: #fff;
  --clock-text-color: #106048;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  direction: ltr;
}

.task-bell {
  position: relative;
  flex: 0 0 auto;
}

.bell-button {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.bell-button strong {
  position: absolute;
  top: -6px;
  inset-inline-start: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  box-shadow: 0 0 0 3px var(--bg);
}

.bell-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-start: 0;
  z-index: 40;
  width: min(320px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 10px;
  display: none;
}

.task-bell:focus-within .bell-menu,
.task-bell:hover .bell-menu {
  display: block;
}

.bell-head {
  padding: 4px 4px 8px;
  font-weight: 800;
}

.bell-item {
  border-top: 1px solid var(--line);
  padding: 10px 4px;
}

.bell-item strong {
  display: block;
  font-size: 13px;
}

.bell-item small,
.bell-empty {
  color: var(--muted);
  font-size: 12px;
}

.dark .egypt-clock {
  --clock-bg-color: #1e1f26;
  --clock-text-color: #106048;
}

.egypt-clock .clock {
  position: relative;
  min-width: 46px;
  min-height: 46px;
  width: 46px;
  height: 46px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--clock-bg-color);
  background-image: url("https://imvpn22.github.io/analog-clock/clock.png");
  background-position: center center;
  background-size: cover;
  border-radius: 50%;
  border: 1px solid var(--clock-bg-color);
  box-shadow: 0 -4px 8px rgba(255, 255, 255, 0.05),
    inset 0 -4px 8px rgba(255, 255, 255, 0.05), 0 5px 10px rgba(0, 0, 0, 0.22),
    inset 0 5px 10px rgba(0, 0, 0, 0.18);
}

.egypt-clock .clock::before {
  content: "";
  height: 4px;
  width: 4px;
  background-color: var(--clock-text-color);
  border: 1px solid var(--clock-bg-color);
  position: absolute;
  border-radius: 50%;
  z-index: 10;
}

.egypt-clock .hour,
.egypt-clock .min,
.egypt-clock .sec {
  position: absolute;
  display: flex;
  justify-content: center;
  border-radius: 50%;
}

.egypt-clock .hour {
  height: 26px;
  width: 26px;
}

.egypt-clock .hour::before {
  content: "";
  position: absolute;
  height: 50%;
  width: 2px;
  background-color: var(--clock-text-color);
  border-radius: 6px;
}

.egypt-clock .min {
  height: 32px;
  width: 32px;
}

.egypt-clock .min::before {
  content: "";
  height: 50%;
  width: 1.8px;
  background-color: var(--clock-text-color);
  border-radius: 4px;
}

.egypt-clock .sec {
  height: 35px;
  width: 35px;
}

.egypt-clock .sec::before {
  content: "";
  height: 60%;
  width: 1px;
  background-color: #d8a870;
  border-radius: 2px;
}

.date-filter {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  flex: 0 1 auto;
  min-width: 0;
}

.date-filter select,
.date-filter input {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 7px 8px;
  font-size: 12px;
}

.date-filter input {
  width: 112px;
}

.date-filter select {
  width: 106px;
}

.lead-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 18px 16px;
  flex-wrap: wrap;
}

.lead-count-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 8px 11px;
  color: var(--muted);
  font-size: 12px;
}

.lead-count-box strong {
  color: var(--text);
  font-size: 18px;
}

.lead-date-filter {
  margin-inline-start: auto;
  flex-wrap: wrap;
}

.search {
  width: clamp(130px, 13vw, 190px);
  min-width: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
}

.btn {
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 13px;
}

.btn.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.btn.compact {
  padding: 7px 9px;
  font-size: 12px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.content {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 28px;
}

.grid {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.grid > * {
  min-width: 0;
}

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-wide {
  grid-column: 1 / -1;
}

.file-btn {
  position: relative;
  overflow: hidden;
}

.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.card.pad {
  padding: 18px;
}

.section-note {
  margin: 16px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 12px 14px;
  font-size: 13px;
}

.import-actions {
  margin-bottom: 12px;
}

.import-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.import-summary > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.import-summary strong {
  display: block;
  font-size: 24px;
}

.import-summary span {
  color: var(--muted);
  font-size: 13px;
}

.import-preview-table {
  margin: 12px 0;
}

.import-error {
  margin: 10px 0;
  border: 1px solid #f5b5b2;
  border-radius: 8px;
  background: #feeceb;
  color: #dc2626;
  padding: 10px 12px;
  font-size: 13px;
}

.stat {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.stat small {
  color: var(--success);
}

.icon-box {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  flex: 0 0 auto;
}

.two-col {
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
  align-items: start;
  margin-top: 16px;
}

.dashboard-wide {
  margin-top: 16px;
}

.dashboard-panels {
  align-items: stretch;
}

.dashboard-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.dashboard-leads-panel,
.dashboard-tasks-panel {
  height: clamp(340px, 42vh, 460px);
}

.dashboard-activity-panel {
  height: clamp(260px, 32vh, 360px);
}

.dashboard-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  scrollbar-gutter: stable;
}

.dashboard-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.dashboard-scroll::-webkit-scrollbar-track {
  background: var(--surface-soft);
  border-radius: 999px;
}

.dashboard-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 44%, transparent);
  border-radius: 999px;
}

.dashboard-leads-panel .table-wrap {
  overflow-x: auto;
  overflow-y: visible;
}

.dashboard-leads-panel table {
  min-width: 980px;
}

.dashboard-leads-panel th,
.dashboard-leads-panel td {
  padding: 11px 12px;
  font-size: 12px;
}

.dashboard-leads-panel .row-actions .btn {
  padding: 6px 8px;
}

.dashboard-tasks-panel .task-list {
  display: block;
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
  min-height: 182px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background-image:
    linear-gradient(90deg, rgba(246, 250, 255, 0.92) 0%, rgba(246, 250, 255, 0.78) 48%, rgba(246, 250, 255, 0.58) 100%),
    url("./assets/dashboard-hero-day.jpg");
  background-position: center center;
  background-size: cover;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 36px;
  direction: ltr;
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.dashboard-hero::after {
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.18));
}

.dashboard-hero.night {
  border-color: rgba(116, 143, 190, 0.22);
  background-image:
    linear-gradient(90deg, rgba(6, 13, 28, 0.78) 0%, rgba(8, 18, 39, 0.64) 50%, rgba(8, 18, 39, 0.42) 100%),
    url("./assets/dashboard-hero-night.png");
  color: #f7fbff;
}

.dashboard-hero-copy,
.dashboard-date-block {
  position: relative;
  z-index: 1;
}

.dashboard-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #2f6fa8;
  font-size: 18px;
  font-weight: 800;
}

.dashboard-hero.night .dashboard-kicker {
  color: #a8d2ff;
}

.spark {
  font-size: 27px;
  line-height: 1;
}

.dashboard-hero h2 {
  margin: 18px 0 14px;
  color: #03091f;
  font-size: clamp(34px, 3.25vw, 54px);
  line-height: 1;
  letter-spacing: 0;
}

.dashboard-hero.night h2 {
  color: #ffffff;
}

.dashboard-hero p {
  margin: 0;
  color: #536173;
  font-size: clamp(17px, 1.55vw, 24px);
  line-height: 1.35;
}

.dashboard-hero.night p {
  color: #d9e7ff;
}

.dashboard-date-block {
  min-width: 190px;
  color: #6d778a;
  text-align: right;
}

.dashboard-date-block span {
  display: block;
  margin-bottom: 8px;
  font-size: 21px;
  font-weight: 700;
}

.dashboard-date-block strong {
  display: block;
  color: #2f3a4d;
  font-size: 24px;
}

.dashboard-hero.night .dashboard-date-block,
.dashboard-hero.night .dashboard-date-block strong {
  color: #eef5ff;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  margin: 0;
  font-size: 17px;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.table-wrap::-webkit-scrollbar,
.kanban::-webkit-scrollbar {
  height: 8px;
}

.table-wrap::-webkit-scrollbar-track,
.kanban::-webkit-scrollbar-track {
  background: var(--surface-soft);
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb,
.kanban::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 44%, transparent);
  border-radius: 999px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-soft);
}

td {
  font-size: 14px;
}

.phone-line {
  direction: ltr;
  text-align: right;
  white-space: nowrap;
}

.phone-line + .phone-line {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

tr:hover td {
  background: color-mix(in srgb, var(--surface-soft) 62%, transparent);
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.pill.blue {
  color: var(--primary);
  background: var(--primary-soft);
}

.pill.green {
  color: var(--success);
  background: var(--success-soft);
}

.pill.orange {
  color: var(--warning);
  background: var(--warning-soft);
}

.pill.red {
  color: var(--danger);
  background: var(--danger-soft);
}

.pill.status-new {
  color: #155eef;
  background: #e7efff;
}

.pill.status-qualified {
  color: #047857;
  background: #dff8ec;
}

.pill.status-follow {
  color: #0369a1;
  background: #e0f2fe;
}

.pill.status-closed {
  color: #166534;
  background: #dcfce7;
}

.pill.interest-hot {
  color: #b42318;
  background: #fee4e2;
}

.pill.interest-follow {
  color: #175cd3;
  background: #dbeafe;
}

.pill.interest-cold {
  color: #475467;
  background: #f2f4f7;
}

.pill.interest-later {
  color: #b54708;
  background: #fef0c7;
}

.activity {
  padding: 6px 18px 18px;
}

.activity-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.activity-item:last-child {
  border-bottom: 0;
}

.dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}

.activity-item p {
  margin: 0;
}

.activity-item small {
  color: var(--muted);
}

.task-list {
  display: grid;
  gap: 0;
}

.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.task-item:last-child {
  border-bottom: 0;
}

.task-item strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.task-item small {
  color: var(--muted);
  font-size: 12px;
}

.attachment-list {
  display: grid;
  gap: 5px;
  min-width: 160px;
}

.attachment-list a {
  color: var(--primary);
  font-size: 12px;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-list a:hover {
  text-decoration: underline;
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 14px;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.lane {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  min-height: 420px;
  padding: 12px;
}

.lane h3 {
  margin: 0 0 12px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
}

.deal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 13px;
  margin-bottom: 10px;
}

.deal-card strong {
  display: block;
  margin-bottom: 8px;
}

.deal-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.bar-list {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 12px;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #14b8a6);
}

.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 12px;
}

.field small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.phone-add-field {
  align-content: end;
}

.field input,
.field select,
.field textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
}

.inline-select {
  width: 100%;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 10px;
}

.lead-details {
  display: grid;
  gap: 10px;
}

.lead-details > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 11px 12px;
}

.lead-details span {
  color: var(--muted);
  font-size: 12px;
}

.lead-details strong {
  color: var(--text);
  font-size: 14px;
}

.backup-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.storage-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.row-actions .btn {
  min-width: 58px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.5);
}

.modal {
  width: min(760px, 100%);
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.modal-body {
  padding: 18px;
}

.modal-footer {
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-start;
  gap: 10px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .stats,
  .two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-title {
    flex: none;
    width: 100%;
  }

  .actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .egypt-clock {
    order: 1;
  }

  .search {
    order: 2;
    flex: 1 1 180px;
  }

  .actions .btn {
    order: 3;
  }

  .date-filter {
    order: 5;
    flex: 1 0 100%;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .date-filter input,
  .date-filter select {
    width: 100%;
    min-width: 0;
  }

  .lead-toolbar {
    align-items: stretch;
  }

  .lead-count-box,
  .lead-date-filter {
    width: 100%;
    margin-inline-start: 0;
  }

  .dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 26px;
  }

  .dashboard-date-block {
    min-width: 0;
    width: 100%;
    text-align: left;
  }
}

@media (max-width: 820px) {
  .shell {
    width: 100%;
    max-width: 100vw;
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    padding: 14px;
  }

  .actions {
    display: flex;
    align-items: center;
  }

  .date-filter {
    order: 5;
    flex: 1 0 100%;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .egypt-clock {
    order: 1;
  }

  .search {
    order: 2;
    flex: 1 1 140px;
  }

  .actions .btn {
    order: 3;
  }

  .date-filter input,
  .date-filter select,
  .search {
    width: 100%;
    min-width: 0;
  }

  .lead-toolbar {
    padding: 0 14px 14px;
  }

  .lead-date-filter {
    grid-template-columns: 1fr;
  }

  .actions .btn {
    padding-inline: 11px;
  }

  .content {
    padding: 16px;
  }

  .dashboard-hero {
    min-height: 0;
    border-radius: 18px;
    padding: 22px;
  }

  .dashboard-kicker {
    font-size: 16px;
  }

  .spark {
    font-size: 24px;
  }

  .dashboard-hero h2 {
    margin: 16px 0 12px;
    font-size: 34px;
  }

  .dashboard-hero p {
    font-size: 17px;
  }

  .dashboard-date-block span {
    font-size: 18px;
  }

  .dashboard-date-block strong {
    font-size: 22px;
  }

  table {
    min-width: 680px;
  }

  .stats,
  .two-col,
  .form {
    grid-template-columns: 1fr;
  }

  .dashboard-leads-panel,
  .dashboard-tasks-panel,
  .dashboard-activity-panel {
    height: min(420px, 70vh);
  }
}
