:root {
  --bg: #f5f4f1;
  --panel: #ffffff;
  --ink: #1f2328;
  --muted: #6b7280;
  --line: #dedbd4;
  --brand: #161616;
  --accent: #c7472c;
  --accent-soft: #fff0eb;
  --sidebar-green: #062d21;
  --sidebar-green-deep: #021912;
  --sidebar-gold: #b07a2b;
  --sidebar-gold-soft: #d1b06a;
  --green: #1f8a5b;
  --yellow: #a76908;
  --blue: #2d66b3;
  --radius: 8px;
  --shadow: 0 18px 45px rgba(33, 30, 25, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 8%, rgba(176, 122, 43, 0.72), transparent 28%),
    radial-gradient(circle at 84% 12%, rgba(18, 92, 65, 0.75), transparent 34%),
    linear-gradient(145deg, #6f4d1e 0%, #0b241a 46%, #021912 100%);
}

.login-screen.hidden {
  display: none;
}

.app-shell.locked {
  display: none;
}

.login-panel {
  width: min(760px, 100%);
  border: 1px solid rgba(209, 176, 106, 0.28);
  border-radius: 12px;
  padding: 28px;
  color: #fff8df;
  background: rgba(4, 28, 21, 0.82);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.login-brand img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
}

.login-brand h1 {
  color: #fff8df;
}

.login-brand p:not(.eyebrow) {
  margin-bottom: 0;
  color: #d8c99b;
}

.login-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.login-form label {
  color: #d8c99b;
}

.login-error {
  grid-column: 1 / -1;
  margin: 0;
  color: #ffd2c5;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background:
    radial-gradient(circle at 0% 0%, rgba(176, 122, 43, 0.78), transparent 30%),
    radial-gradient(circle at 96% 10%, rgba(22, 91, 65, 0.72), transparent 42%),
    linear-gradient(165deg, #6f4d1e 0%, #152116 32%, var(--sidebar-green) 62%, var(--sidebar-green-deep) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: inset -1px 0 0 rgba(209, 176, 106, 0.16);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 14px;
  border-bottom: 1px solid rgba(209, 176, 106, 0.18);
}

.brand img {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(209, 176, 106, 0.5),
    0 10px 24px rgba(0, 0, 0, 0.22);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 18px;
  color: #fff8df;
}

.brand span {
  color: #d8c99b;
  font-size: 13px;
  margin-top: 2px;
}

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

.nav-item {
  border: 0;
  border-radius: var(--radius);
  padding: 12px 14px;
  text-align: left;
  color: #d9dfd5;
  background: transparent;
}

.nav-item:hover,
.nav-item.active {
  color: #fff8df;
  background:
    linear-gradient(90deg, rgba(176, 122, 43, 0.34), rgba(6, 58, 41, 0.42));
  box-shadow:
    inset 3px 0 0 var(--sidebar-gold-soft),
    inset 0 0 0 1px rgba(209, 176, 106, 0.14);
}

.role-card {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(209, 176, 106, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 248, 223, 0.1), rgba(2, 25, 18, 0.28));
  box-shadow: inset 0 1px 0 rgba(255, 248, 223, 0.08);
}

.role-card span {
  display: block;
  margin-bottom: 8px;
  color: #d8c99b;
  font-size: 12px;
}

.role-card select {
  display: none;
  width: 100%;
  border: 1px solid rgba(209, 176, 106, 0.24);
  border-radius: 6px;
  padding: 9px;
  color: #fff8df;
  background: #073527;
}

.role-card strong,
.role-card small {
  display: block;
}

.role-card strong {
  color: #fff8df;
  font-size: 16px;
}

.role-card small {
  color: #d8c99b;
  margin: 4px 0 12px;
}

.logout-btn {
  width: 100%;
  border: 1px solid rgba(209, 176, 106, 0.28);
  border-radius: var(--radius);
  padding: 9px;
  color: #fff8df;
  background: rgba(255, 248, 223, 0.08);
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-actions input {
  width: min(360px, 34vw);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: #fff;
}

.primary-btn,
.ghost-btn,
.small-btn {
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 11px 15px;
  font-weight: 700;
}

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

.ghost-btn,
.small-btn {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.ghost-btn.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.small-btn {
  padding: 7px 10px;
  font-size: 13px;
}

.compact-btn {
  padding: 7px 10px;
  font-size: 13px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: #f0eee8;
  font-size: 22px;
  line-height: 1;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card,
.panel,
.project-card,
.contact-card,
.archive-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.stat-card {
  padding: 16px;
}

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

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

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

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

.task-project-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  background: #fff;
}

.task-project-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 12px;
}

.task-project-head h3 {
  margin: 8px 0 5px;
  font-size: 18px;
}

.task-project-summary {
  min-width: 132px;
  border-radius: var(--radius);
  padding: 10px;
  text-align: right;
  background: #f7f5f0;
}

.task-project-summary strong,
.task-project-summary span {
  display: block;
}

.task-project-summary strong {
  font-size: 24px;
}

.task-project-summary span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.task-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.task-project-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 96px 116px 132px;
  gap: 10px;
  align-items: center;
  border: 1px solid #ece8df;
  border-radius: var(--radius);
  padding: 10px;
  background: #fbfaf7;
}

.task-main {
  min-width: 0;
}

.task-main strong,
.task-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-meta-pill {
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  text-align: center;
}

.danger-text {
  color: #b73520;
  background: #fff4f1;
}

.task-status-select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 9px;
  background: #fff;
}

.big-screen {
  border-radius: 12px;
  padding: 18px;
  color: #e8f4ff;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 107, 69, 0.24), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(45, 212, 191, 0.22), transparent 32%),
    linear-gradient(135deg, #0b1220 0%, #111827 52%, #151515 100%);
  box-shadow: 0 24px 70px rgba(10, 14, 24, 0.24);
}

.big-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(15, 23, 42, 0.72);
}

.big-hero h2 {
  margin: 0 0 8px;
  font-size: 34px;
}

.big-hero p {
  margin-bottom: 0;
  color: #9fb1c7;
}

.big-clock {
  min-width: 190px;
  border-radius: var(--radius);
  padding: 14px;
  text-align: right;
  background: rgba(255, 255, 255, 0.06);
}

.big-clock strong,
.big-clock span {
  display: block;
}

.big-clock strong {
  font-size: 22px;
}

.big-clock span {
  margin-top: 6px;
  color: #8ea2bb;
}

.big-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.big-kpi {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius);
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.big-kpi span {
  color: var(--kpi-color);
  font-size: 12px;
  font-weight: 800;
}

.big-kpi strong {
  display: block;
  margin: 8px 0 2px;
  color: #fff;
  font-size: 34px;
}

.big-kpi p {
  margin: 0;
  color: #a9bad0;
}

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

.big-panel {
  min-height: 300px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(15, 23, 42, 0.72);
}

.big-panel.span-2 {
  grid-column: span 2;
}

.big-panel h2 {
  color: #fff;
}

.neon-badge {
  border: 1px solid rgba(45, 212, 191, 0.36);
  border-radius: 999px;
  padding: 4px 9px;
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.12);
  font-size: 12px;
  font-weight: 800;
}

.neon-badge.danger {
  color: #ffb199;
  border-color: rgba(255, 107, 69, 0.45);
  background: rgba(255, 107, 69, 0.14);
}

.bar-chart {
  height: 230px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
}

.bar-item {
  min-width: 0;
  text-align: center;
}

.bar-track {
  height: 150px;
  display: flex;
  align-items: end;
  border-radius: 999px;
  padding: 5px;
  background: rgba(148, 163, 184, 0.14);
}

.bar-track i {
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #2dd4bf, #60a5fa);
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.38);
  animation: barRise 700ms ease both;
  animation-delay: var(--bar-delay);
}

.bar-item strong,
.bar-item span {
  display: block;
}

.bar-item strong {
  margin: 8px 0 4px;
  color: #fff;
}

.bar-item span {
  overflow: hidden;
  color: #93a4bb;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.donut-wrap,
.gauge {
  display: grid;
  place-items: center;
  gap: 16px;
}

.donut,
.gauge-ring {
  width: 190px;
  height: 190px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: 0 0 35px rgba(96, 165, 250, 0.18);
}

.donut > div,
.gauge-ring > div {
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: #111827;
}

.donut strong,
.gauge strong {
  color: #fff;
  font-size: 32px;
}

.donut span,
.gauge span {
  color: #8ea2bb;
  font-size: 12px;
}

.chart-legend {
  display: grid;
  gap: 8px;
  width: 100%;
}

.chart-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b7c6d8;
  font-size: 13px;
}

.chart-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.chart-legend.light span {
  color: var(--ink);
}

.locked-panel {
  min-height: 420px;
  display: grid;
  place-items: center;
  text-align: center;
}

.locked-panel h2 {
  font-size: 28px;
  margin-bottom: 10px;
}

.locked-panel p:not(.eyebrow) {
  max-width: 460px;
  color: var(--muted);
}

.finance-grid {
  grid-template-columns: 1fr 1fr;
}

.finance-bars {
  display: grid;
  gap: 12px;
}

.finance-bar-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 82px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.finance-bar-row span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-bar-row div {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #ede9df;
}

.finance-bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #e09b31);
}

.finance-bar-row strong {
  text-align: right;
}

.finance-donut-wrap {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.finance-donut {
  width: 180px;
  height: 180px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.finance-donut > div {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: #fff;
}

.finance-donut strong,
.finance-donut span {
  display: block;
}

.finance-donut strong {
  font-size: 22px;
}

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

.line-chart svg {
  width: 100%;
  height: 220px;
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 100% 44px, 64px 100%;
}

.line-chart circle {
  fill: #0f172a;
  stroke: #2dd4bf;
  stroke-width: 3;
}

.line-labels {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
  color: #8ea2bb;
  font-size: 12px;
}

.gauge p {
  max-width: 260px;
  margin: 0;
  color: #9fb1c7;
  text-align: center;
  font-size: 13px;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 24px;
  gap: 10px;
  align-items: center;
  color: #dbeafe;
}

.rank-row div {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}

.rank-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff6b45, #f59e0b);
}

@keyframes barRise {
  from {
    height: 0;
  }
}

.panel {
  padding: 16px;
  min-width: 0;
}

.panel-head,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel h2,
.section-head h2 {
  margin: 0;
  font-size: 18px;
}

.task-row,
.review-row,
.follow-row,
.archive-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.task-row:first-of-type,
.review-row:first-of-type,
.follow-row:first-of-type,
.archive-row:first-of-type {
  border-top: 0;
}

.task-row strong,
.review-row strong,
.follow-row strong,
.archive-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.follow-row {
  grid-template-columns: 1fr;
}

.follow-row p {
  margin: 7px 0 6px;
  color: var(--ink);
  line-height: 1.55;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  color: #5c271b;
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.green {
  color: #0e5134;
  background: #e9f7ef;
}

.badge.blue {
  color: #173e78;
  background: #eaf2ff;
}

.badge.yellow {
  color: #6d4102;
  background: #fff5df;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.filters select,
.filters input {
  min-width: 160px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 11px;
  background: #fff;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(7, minmax(210px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.lead-kanban {
  grid-template-columns: repeat(7, minmax(240px, 1fr));
}

.kanban-column {
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  padding: 10px;
}

.kanban-column h3 {
  margin: 4px 4px 10px;
  font-size: 14px;
}

.project-card {
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: none;
}

.project-card h4 {
  margin: 8px 0 7px;
  font-size: 15px;
}

.project-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.lead-card-top,
.lead-status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.lead-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.lead-fields span {
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  background: #f4f1eb;
  font-size: 12px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #ebe8e1;
}

.compact-progress {
  max-width: 260px;
  margin-top: 8px;
}

.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.table th,
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

.table th {
  color: var(--muted);
  background: #fbfaf7;
  font-size: 12px;
}

.table tr:last-child td {
  border-bottom: 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 10px;
}

.day-cell {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #fff;
}

.day-cell strong {
  font-size: 13px;
}

.event-pill {
  display: block;
  margin-top: 8px;
  border-radius: 6px;
  padding: 7px;
  color: #fff;
  background: var(--accent);
  font-size: 12px;
}

.event-pill.short-video {
  background: var(--blue);
}

.event-pill.owned {
  background: var(--green);
}

.contacts-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.contact-card,
.archive-card {
  padding: 14px;
  margin-bottom: 10px;
}

.contact-card h3,
.archive-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.customer-history {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 12px 0;
  background: #fbfaf7;
}

.customer-history-head,
.customer-history-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 150px;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
}

.customer-history-head {
  color: var(--muted);
  background: #f1eee7;
  font-size: 12px;
  font-weight: 700;
}

.customer-history-row {
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.customer-history-row strong,
.customer-history-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-history-row span {
  color: var(--muted);
}

.drawer {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: flex-end;
  background: rgba(20, 20, 20, 0.38);
  z-index: 20;
}

.drawer.open {
  display: flex;
}

.drawer-panel {
  width: min(860px, 94vw);
  height: 100%;
  overflow: auto;
  background: var(--bg);
  box-shadow: var(--shadow);
  padding: 22px;
}

.drawer-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 1;
}

.detail-hero {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 14px;
}

.detail-hero h2 {
  margin: 8px 0;
  font-size: 26px;
}

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

.info-box {
  border-radius: var(--radius);
  background: #f7f5f0;
  padding: 11px;
}

.info-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.drawer-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

dialog {
  width: min(760px, 94vw);
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(20, 20, 20, 0.38);
}

.project-form {
  padding: 20px;
}

.dialog-head,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dialog-head {
  margin-bottom: 16px;
}

.dialog-head h2 {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

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

label input,
label select,
label textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
}

.existing-customer-select {
  color: var(--muted);
  background: #fbfaf7;
}

.checkbox-label {
  display: flex;
  align-items: center;
  flex-direction: row;
  color: var(--ink);
}

.checkbox-label input {
  width: auto;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #efc2b6;
  border-radius: var(--radius);
  margin-top: 16px;
  padding: 13px;
  background: #fff4f1;
}

.danger-zone[hidden] {
  display: none;
}

.danger-zone strong {
  display: block;
  color: #8d2d1c;
  margin-bottom: 4px;
}

.danger-zone p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.danger-btn {
  flex: 0 0 auto;
  border: 1px solid #b73520;
  border-radius: var(--radius);
  padding: 10px 13px;
  color: #fff;
  background: #b73520;
  font-weight: 700;
}

.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.detail-actions,
.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.empty {
  color: var(--muted);
  padding: 20px 0;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

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

  .topbar,
  .topbar-actions,
  .dashboard-grid,
  .finance-grid,
  .task-project-head,
  .contacts-layout,
  .drawer-sections,
  .big-hero {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar-actions input {
    width: 100%;
  }

  .task-project-row {
    grid-template-columns: 1fr 1fr;
  }

  .task-project-summary {
    text-align: left;
  }

  .stats-grid,
  .detail-grid,
  .big-kpis,
  .big-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .big-panel.span-2 {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 16px;
  }

  .login-brand,
  .login-form {
    grid-template-columns: 1fr;
    display: grid;
  }

  .nav,
  .stats-grid,
  .form-grid,
  .detail-grid,
  .big-kpis,
  .big-grid,
  .danger-zone {
    grid-template-columns: 1fr;
  }

  .big-panel.span-2 {
    grid-column: span 1;
  }

  .danger-zone {
    align-items: stretch;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .finance-donut-wrap,
  .finance-bar-row,
  .customer-history-head,
  .customer-history-row {
    grid-template-columns: 1fr;
  }

  .finance-bar-row strong {
    text-align: left;
  }
}
