:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --ink: #08090b;
  --muted: #686d75;
  --soft: #a8adb5;
  --line: #e1e4e8;
  --navy: #142235;
  --gold: #876613;
  --gold-soft: #fff2c9;
  --green: #20c978;
  --red: #ad2c2c;
  --shadow: 0 20px 60px rgba(16, 24, 40, 0.08);
  --radius: 8px;
  --sidebar: 260px;
}

body.dark-mode {
  --bg: #101318;
  --surface: #171b22;
  --surface-2: #202631;
  --ink: #f4f7fb;
  --muted: #aeb7c5;
  --line: #2b3340;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.45;
  transition: background 180ms ease, color 180ms ease;
}

body:not(.is-authenticated) .sidebar,
body:not(.is-authenticated) .app-shell,
body.is-authenticated .auth-screen {
  display: none;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 480px);
  align-items: center;
  gap: 44px;
  padding: clamp(24px, 6vw, 80px);
  background:
    linear-gradient(135deg, rgba(20, 34, 53, 0.06), transparent 42%),
    linear-gradient(180deg, #fbfbfc, var(--bg));
}

.auth-brand h1 {
  max-width: 720px;
  margin: 10px 0 16px;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 0.94;
}

.auth-brand p:not(.kicker) {
  max-width: 520px;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 600;
}

.auth-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 26px;
  box-shadow: var(--shadow);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf0f3;
  margin-bottom: 24px;
}

.auth-tabs button {
  min-height: 42px;
  border: 0;
  background: transparent;
  color: #3f444b;
  font-weight: 800;
}

.auth-tabs .is-active {
  background: #fff;
  color: var(--gold);
}

.auth-form {
  display: none;
}

.auth-form.is-active {
  display: grid;
  gap: 15px;
}

.auth-form h2 {
  margin: 0;
  font-size: 2rem;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: #303640;
  font-weight: 800;
}

.auth-form input {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 12px;
  outline: 0;
}

.auth-form input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(135, 102, 19, 0.12);
}

.auth-card .black-btn {
  width: 100%;
  min-height: 42px;
}

.user-pill {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sync-pill {
  max-width: 240px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 9px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 800;
}

.sync-pill[data-type="ok"] {
  border-color: rgba(32, 201, 120, 0.28);
  background: rgba(32, 201, 120, 0.1);
  color: #147246;
}

.sync-pill[data-type="warning"] {
  border-color: rgba(135, 102, 19, 0.26);
  background: var(--gold-soft);
  color: var(--gold);
}

.sync-pill[data-type="error"] {
  border-color: rgba(173, 44, 44, 0.26);
  background: rgba(173, 44, 44, 0.08);
  color: var(--red);
}

.search {
  position: relative;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 60;
  display: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.search-results.is-open {
  display: grid;
}

.search-results button,
.haraa-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.search-results button:hover {
  background: var(--surface-2);
}

.haraa-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 10px;
  background: var(--surface);
}

.image-upload-grid,
.image-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.image-upload-grid input {
  margin-top: 8px;
}

.image-preview {
  min-height: 120px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  overflow: hidden;
}

.image-preview img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.check-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: auto;
}

body.dark-mode .sidebar,
body.dark-mode .topbar,
body.dark-mode .panel,
body.dark-mode .auth-card,
body.dark-mode .modal-card,
body.dark-mode .stat-card,
body.dark-mode .customer-row,
body.dark-mode .empty-state {
  background: var(--surface);
  color: var(--ink);
}

body.dark-mode .paper-sheet {
  background:
    linear-gradient(#171b22 31px, #202631 32px),
    var(--surface);
  background-size: 100% 32px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfbfc;
  color: var(--muted);
  padding: 16px;
  font-size: 0.92rem;
  font-weight: 700;
}

.customer-directory {
  display: grid;
  gap: 10px;
}

.customer-row {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  color: inherit;
  text-align: left;
}

.customer-row:hover,
.customer-row.is-active {
  border-color: rgba(135, 102, 19, 0.35);
  background: #fbf7ec;
}

.customer-row strong,
.customer-row small,
.customer-row em {
  display: block;
}

.customer-row small,
.customer-row em {
  color: var(--muted);
  font-size: 0.8rem;
  font-style: normal;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--sidebar);
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #fbfbfc;
  border-right: 1px solid var(--line);
  transition: transform 220ms ease;
}

.brand {
  padding: 42px 24px 28px;
}

.brand h1 {
  margin: 0;
  max-width: 180px;
  font-size: 1.55rem;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.brand p,
.kicker {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 20px 16px;
}

.nav-item {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 0;
  border-right: 4px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #3f444b;
  padding: 0 12px;
  text-align: left;
  font-weight: 600;
}

.nav-item:hover,
.nav-item.is-active {
  background: #fbf7ec;
  border-right-color: var(--gold);
  color: var(--gold);
}

.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  border: 2px solid currentColor;
  border-radius: 4px;
  position: relative;
}

.icon.grid::before,
.icon.grid::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
}

.icon.users {
  border-radius: 50%;
}

.icon.users::after {
  content: "";
  position: absolute;
  left: -5px;
  right: -5px;
  bottom: -8px;
  height: 8px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 12px 12px;
}

.icon.ruler {
  height: 13px;
  margin-top: 2px;
}

.icon.bag::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: -7px;
  height: 7px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.icon.receipt::before,
.icon.chart::before,
.icon.gear::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.sidebar-bottom {
  display: grid;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 26px 18px 32px;
}

.new-order,
.black-btn {
  border: 0;
  border-radius: 7px;
  background: #000;
  color: #fff;
  padding: 11px 16px;
  font-weight: 800;
  font-size: 0.92rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.sidebar-bottom a {
  color: #4c525a;
  font-size: 0.9rem;
  font-weight: 600;
}

.app-shell {
  min-height: 100vh;
  margin-left: var(--sidebar);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 24px;
  background: rgba(250, 251, 252, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: #111;
}

.search {
  width: min(440px, 42vw);
  height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: #f0f1f3;
  border-radius: 7px;
}

.search span {
  width: 16px;
  height: 16px;
  border: 2px solid #4b5058;
  border-radius: 50%;
  position: relative;
}

.search span::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 7px;
  height: 2px;
  background: #4b5058;
  transform: rotate(45deg);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ghost-icon {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  border-bottom: 2px solid #1f242b;
  border-radius: 50%;
  position: relative;
}

.ghost-icon::after {
  content: "";
  position: absolute;
  top: -2px;
  right: 2px;
  width: 7px;
  height: 7px;
  background: #c92c2c;
  border-radius: 50%;
}

.ghost-icon.message {
  border: 2px solid #1f242b;
  border-radius: 2px;
}

.ghost-icon.message::after {
  display: none;
}

.primary-small {
  border: 0;
  border-radius: 7px;
  background: var(--gold);
  color: #fff;
  padding: 10px 18px;
  font-weight: 800;
  font-size: 0.9rem;
}

.avatar,
.mini-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
}

.avatar {
  width: 42px;
  height: 42px;
}

.content {
  padding: 30px 28px 52px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: rise 260ms ease;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
}

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

h2 {
  margin-bottom: 4px;
  font-size: clamp(2rem, 3vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.32rem;
  letter-spacing: -0.02em;
}

.page-head p,
.panel p {
  color: var(--muted);
}

.head-actions,
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.outline-btn,
.muted-btn,
.tabs button {
  border: 1px solid #cfd4db;
  border-radius: 7px;
  background: #fff;
  color: #20242a;
  min-height: 40px;
  padding: 9px 14px;
  font-weight: 700;
  font-size: 0.9rem;
}

.muted-btn {
  width: 100%;
  background: #eef0f2;
  border: 0;
}

.tabs {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #edf0f3;
}

.tabs button {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.tabs .is-active {
  background: #fff;
}

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

.panel,
.stat-card,
.dark-card,
.order-card,
.fabric-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
}

.stat-card {
  min-height: 156px;
  padding: 20px;
  position: relative;
}

.stat-card p {
  margin: 18px 0 2px;
  color: #4d535c;
  font-weight: 700;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  font-size: 1.9rem;
  line-height: 1.15;
}

.stat-card em {
  position: absolute;
  top: 26px;
  right: 18px;
  max-width: 110px;
  text-align: right;
  color: var(--gold);
  font-style: normal;
  font-weight: 700;
}

.danger,
.red {
  color: var(--red) !important;
}

.stat-icon {
  width: 42px;
  height: 42px;
  display: inline-block;
  border-radius: 6px;
  background: #e8eaed;
}

.stat-icon.navy {
  background: var(--navy);
}

.stat-icon.sand,
.mini-avatar.gold {
  background: #ffdc81;
  color: #755409;
}

.stat-icon.bronze {
  background: var(--gold);
}

.dash-grid {
  display: grid;
  grid-template-columns: 2fr 0.95fr;
  gap: 28px;
}

.panel {
  padding: 26px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.panel-title a {
  color: var(--gold);
  font-weight: 700;
}

.legend {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4f555e;
}

.legend span,
.legend b {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #000;
}

.legend b {
  background: var(--gold);
}

.bar-chart {
  height: 260px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 22px;
  margin-top: 46px;
  padding: 0 18px;
  background: linear-gradient(180deg, #f5f1e8, #fff);
}

.bar-chart i {
  height: var(--h);
  background: linear-gradient(180deg, #d7d7d5, #ececea);
  border-radius: 5px 5px 0 0;
}

.bar-chart .accent {
  background: var(--gold);
}

.bar-chart .outline {
  background: #f4ead2;
  border: 2px dashed var(--gold);
}

.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 16px 18px 0;
  text-align: center;
  color: #5c626b;
}

.progress-panel {
  grid-row: span 1;
}

.timeline {
  list-style: none;
  margin: 26px 0 0;
  padding: 0 0 0 24px;
  border-left: 2px solid #e0e3e7;
}

.timeline li {
  position: relative;
  margin-bottom: 28px;
  padding-left: 28px;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -35px;
  top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e6e8eb;
  border: 2px solid #fff;
}

.timeline .done::before {
  background: var(--gold);
}

.timeline .active::before {
  background: var(--gold-soft);
  border-color: var(--gold);
}

.timeline span,
small {
  display: block;
  color: var(--muted);
}

.table-panel {
  grid-column: span 1;
}

.invoices-list {
  grid-column: span 1;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 18px 0;
  border-top: 1px solid #eef0f3;
  text-align: left;
}

th {
  color: #59606a;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td:first-child {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
}

.mini-avatar {
  width: 38px;
  height: 38px;
  font-size: 0.85rem;
}

mark {
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  padding: 5px 9px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

mark.gray {
  background: #e8eaed;
  color: #686d75;
}

.invoice-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 15px 0;
}

.invoice-row span {
  width: 44px;
  height: 44px;
  border-radius: 5px;
  background: #eef0f2;
}

.invoice-row em {
  grid-column: 3;
  color: var(--gold);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-hero {
  display: grid;
  grid-template-columns: 150px 1fr auto auto;
  gap: 32px;
  align-items: center;
  margin-bottom: 38px;
}

.photo {
  width: 150px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 4px solid #fff;
  border-radius: 22px;
  background: #c9c9c9;
  box-shadow: var(--shadow);
}

.profile-hero h2 {
  font-size: clamp(3rem, 5vw, 4.5rem);
}

.meta {
  color: var(--muted);
  font-weight: 600;
}

.vip {
  border-radius: 12px;
  background: #ffd479;
  color: var(--gold);
  padding: 12px 18px;
  font-weight: 800;
}

.profile-actions {
  display: grid;
  gap: 14px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 26px;
}

.measurements {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 34px;
  margin-top: 30px;
}

.measurements span {
  color: #8c9198;
  font-weight: 700;
  text-transform: uppercase;
}

.measurements strong {
  display: block;
  margin-top: 4px;
  font-size: 2.1rem;
  font-weight: 500;
}

.measurements small {
  display: inline;
  margin-left: 4px;
  font-size: 1rem;
}

.style-card,
.update-card {
  display: grid;
  gap: 14px;
}

.style-card p {
  margin: 0;
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  background: #f1f2f4;
  padding: 16px;
  color: #2d3239;
  font-style: italic;
}

.order-history {
  grid-column: 1;
}

.history-item {
  display: grid;
  grid-template-columns: 54px 1fr auto auto;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
  border-radius: 10px;
  background: #f7f8fa;
  padding: 22px;
}

.history-item span {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #fbf1d2;
}

.update-card {
  align-self: start;
  background: #dcf8e9;
  border-color: #bceccf;
}

.whatsapp-btn {
  border: 0;
  border-radius: 7px;
  background: #20d66f;
  color: #fff;
  padding: 14px 18px;
  font-weight: 800;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 26px;
}

.dark-card {
  padding: 30px;
  background: var(--navy);
  color: #fff;
}

.dark-card p,
.dark-card small {
  color: #aeb8c5;
}

.dark-card strong {
  display: block;
  font-size: 3rem;
}

.dark-card span {
  color: #42d69d;
  font-weight: 700;
}

.progress {
  height: 5px;
  margin: 80px 0 10px;
  border-radius: 99px;
  background: #39485a;
}

.progress i {
  display: block;
  width: 88%;
  height: 100%;
  border-radius: inherit;
  background: #f2c467;
}

.fabric {
  min-height: 170px;
  display: flex;
  align-items: end;
  margin: 18px -26px -26px;
  padding: 26px;
  background:
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.76)),
    repeating-linear-gradient(135deg, #17120b 0 8px, #050505 8px 16px);
  color: #fff;
}

.curve-card {
  grid-column: span 2;
}

.curve-card svg {
  width: 100%;
  height: 300px;
  margin-top: 20px;
}

.curve-card path {
  fill: none;
  stroke: #d6ad5f;
  stroke-width: 3;
}

.curve-card .fill {
  fill: rgba(214, 173, 95, 0.16);
  stroke: none;
}

.category-card p {
  display: flex;
  justify-content: space-between;
}

.category-card i {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 50%;
  background: var(--gold);
}

.category-card .black {
  background: #000;
}

.abstract-shape {
  height: 190px;
  display: grid;
  place-items: center;
  margin: 28px 0;
  background:
    linear-gradient(135deg, transparent 30%, var(--gold) 31% 36%, transparent 37%),
    linear-gradient(18deg, transparent 45%, #000 46% 50%, transparent 51%),
    #f0f1f3;
}

.abstract-shape b {
  font-size: 1.5rem;
}

.team-card {
  grid-column: 1 / -1;
}

.team-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 26px;
}

.team-list div {
  display: grid;
  place-items: center;
  gap: 6px;
  border-radius: 8px;
  background: #eef0f2;
  padding: 24px;
  text-align: center;
}

.team-list span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #222;
  color: #fff;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
}

.lane h3 {
  display: flex;
  justify-content: space-between;
  color: #242a31;
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lane h3 span {
  border-radius: 99px;
  background: #e5e7eb;
  padding: 2px 8px;
}

.order-card {
  margin-top: 24px;
  padding: 24px;
}

.order-card small {
  display: inline-block;
  border-radius: 3px;
  background: #fff7df;
  color: var(--gold);
  padding: 5px 8px;
}

.order-card h4 {
  margin: 22px 0 4px;
  font-size: 1.25rem;
}

.order-card footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #eef0f3;
  margin-top: 20px;
  padding-top: 16px;
}

.top-line {
  border-top: 5px solid var(--gold);
}

.thin-progress {
  height: 5px;
  margin: 20px -24px 0;
  background: #f0f1f3;
}

.thin-progress i {
  display: block;
  width: 78%;
  height: 100%;
  background: var(--gold);
}

.blueprint-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 26px;
}

.blueprint {
  min-height: 720px;
  position: relative;
  background:
    linear-gradient(rgba(0, 0, 0, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.025) 1px, transparent 1px),
    #fffefb;
  background-size: 22px 22px;
  overflow: hidden;
}

.body-outline {
  position: absolute;
  inset: 130px 28% 95px;
  border: 2px dashed #e0dcd3;
  border-radius: 48% 48% 28% 28%;
}

.measure-tag {
  position: absolute;
  border: 1px solid #d4d7dc;
  background: #fff;
  padding: 8px 16px;
  font-weight: 800;
  font-size: 1.2rem;
}

.shoulder { left: 24%; top: 235px; }
.neck { left: 47%; top: 190px; }
.chest { left: 45%; top: 275px; }
.waist { left: 47%; top: 345px; }
.sleeve { left: 20%; top: 300px; }

.note-card {
  position: absolute;
  left: 32px;
  bottom: 34px;
  width: 290px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  padding: 20px;
  box-shadow: var(--shadow);
}

.note-card p {
  margin-bottom: 0;
  font-style: italic;
  color: #2f343b;
}

.measure-side {
  display: grid;
  gap: 26px;
}

.metrics-card div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
}

.metrics-card div + div {
  border-top: 1px solid #eef0f3;
}

.metrics-card strong {
  font-size: 1.7rem;
}

.track {
  height: 7px;
  border-radius: 99px;
  background: #e1e3e7;
}

.track i {
  display: block;
  width: 72%;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #d52d2d);
}

.track.stable i {
  width: 92%;
  background: var(--gold);
}

blockquote {
  margin: 26px 0 0;
  border-left: 4px solid var(--gold);
  background: #fffaf0;
  padding: 20px;
}

.fabric-card {
  min-height: 220px;
  display: grid;
  align-content: end;
  padding: 26px;
  color: #fff;
  background:
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.85)),
    repeating-linear-gradient(120deg, #101820 0 9px, #050608 9px 18px);
}

.fabric-card p {
  color: #b7bec8;
}

.measurement-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 360px;
  gap: 26px;
  align-items: start;
}

.paper-sheet {
  position: relative;
  min-height: 660px;
  border: 1px solid #cad3e4;
  border-radius: 8px;
  background:
    linear-gradient(#ffffff 31px, #eef2fa 32px),
    #fff;
  background-size: 100% 32px;
  padding: 34px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.invoice-stamp {
  position: absolute;
  top: 36px;
  right: -28px;
  color: #254f9b;
  font-size: clamp(2.8rem, 7vw, 6rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  opacity: 0.18;
  transform: rotate(90deg);
  transform-origin: center;
  white-space: nowrap;
}

.paper-head,
.paper-lines {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  max-width: 760px;
}

.paper-lines {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 24px;
}

.paper-sheet label {
  color: #254f9b;
  font-weight: 800;
}

.paper-sheet input,
.paper-sheet textarea,
.modal-card input,
.modal-card textarea,
.modal-card select {
  width: 100%;
  border: 0;
  border-bottom: 2px solid #254f9b;
  background: transparent;
  color: #111;
  padding: 8px 4px;
  outline: 0;
}

.letter-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(9, minmax(50px, 1fr));
  border: 2px solid #254f9b;
  margin-top: 42px;
  max-width: 820px;
}

.letter-grid label {
  display: grid;
  grid-template-rows: 32px 48px;
  border-right: 2px solid #254f9b;
  border-bottom: 2px solid #254f9b;
  text-align: center;
}

.letter-grid label:nth-child(9n) {
  border-right: 0;
}

.letter-grid label:nth-child(n + 10) {
  border-bottom: 0;
}

.letter-grid span {
  display: grid;
  place-items: center;
  border-bottom: 2px solid #254f9b;
  color: #254f9b;
  font-weight: 800;
}

.letter-grid input {
  border: 0;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
}

.letter-grid .empty-cell {
  background: #f7f9fd;
}

.letter-grid .empty-cell span {
  color: transparent;
}

.signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px;
  margin-top: 46px;
  max-width: 760px;
}

.measurement-side {
  display: grid;
  gap: 16px;
}

.saved-measures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.saved-measures span {
  border-radius: 6px;
  background: #eef2fa;
  padding: 10px;
  color: #254f9b;
  font-weight: 800;
  text-align: center;
}

.billing-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.85fr 0.75fr;
  gap: 26px;
}

.billing-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-content: start;
}

.billing-stats .collection {
  grid-column: span 2;
}

.money-card strong,
.collection strong {
  display: block;
  font-size: 2rem;
}

.transaction-card {
  grid-column: span 1;
}

.transaction-card table td:first-child {
  display: table-cell;
}

.invoice-preview {
  grid-column: 1 / span 2;
  min-height: 620px;
  padding: 44px;
}

.invoice-address {
  margin: 70px 0 60px;
}

.invoice-address b,
.invoice-address span {
  display: block;
}

.invoice-preview footer {
  display: flex;
  justify-content: flex-end;
  gap: 52px;
  border-top: 1px solid #eef0f3;
  margin-top: 50px;
  padding-top: 26px;
  font-size: 1.2rem;
}

.payment-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.pay-method {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  font-weight: 800;
}

.pay-method.active {
  border-color: var(--gold);
  background: #fffaf0;
}

.fab {
  position: fixed;
  right: 34px;
  bottom: 34px;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 14px;
  background: #000;
  color: #fff;
  font-size: 2rem;
  box-shadow: var(--shadow);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(8, 9, 11, 0.46);
}

.modal.is-open {
  display: grid;
}

.modal-card {
  position: relative;
  width: min(980px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border-radius: 12px;
  background: #fff;
  padding: 30px;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f0f1f3;
  font-weight: 800;
}

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

.garment-quantities {
  grid-column: 1 / -1;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.garment-quantities legend {
  padding: 0 6px;
  color: #303640;
  font-weight: 800;
}

.garment-quantities p {
  margin: 0 0 12px;
  color: #68707b;
  font-size: 0.9rem;
}

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

.garment-quantity-grid label {
  margin: 0;
}

.modal-card label {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  color: #303640;
  font-weight: 800;
}

.modal-card input,
.modal-card textarea,
.modal-card select {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
}

.modal-measure-block {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}

.modal-measure-block.paper-sheet {
  min-height: auto;
  padding: 30px;
  box-shadow: none;
}

.modal-measure-block h3 {
  margin: 0;
  font-size: 1rem;
  color: #254f9b;
  font-weight: 800;
}

.modal-lines {
  max-width: none;
  margin-top: 0;
}

.modal-letter-grid {
  max-width: none;
  margin-top: 0;
}

.modal-letter-grid label {
  min-width: 42px;
}

.modal-measure-block .paper-lines label,
.modal-measure-block .letter-grid label {
  color: #254f9b;
}

.modal-measure-block .paper-lines input,
.modal-measure-block .letter-grid input {
  border: 0;
  border-radius: 0;
  border-bottom: 2px solid #254f9b;
  color: #111;
}

.modal-measure-block .letter-grid input {
  border-bottom: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.form-status {
  min-height: 22px;
  color: var(--gold);
  font-weight: 800;
}

.form-status[data-type="error"] {
  color: var(--red);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .stats-grid,
  .analytics-grid,
  .kanban,
  .team-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .dash-grid,
  .profile-grid,
  .blueprint-grid,
  .billing-grid {
    grid-template-columns: 1fr;
  }

  .curve-card,
  .team-card,
  .invoice-preview,
  .billing-stats .collection {
    grid-column: auto;
  }
}

@media (max-width: 840px) {
  :root {
    --sidebar: 0px;
  }

  .auth-screen {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 28px 16px;
  }

  .auth-brand h1 {
    font-size: 3rem;
  }

  .auth-card {
    padding: 20px;
  }

  .sidebar {
    width: 280px;
    transform: translateX(-100%);
    box-shadow: var(--shadow);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .menu-btn {
    display: block;
  }

  .topbar {
    padding: 10px 14px;
  }

  .search {
    width: 100%;
  }

  .top-actions {
    gap: 8px;
  }

  .ghost-icon,
  .avatar {
    display: none;
  }

  .primary-small {
    padding: 10px 12px;
    white-space: nowrap;
  }

  .content {
    padding: 24px 14px 80px;
  }

  .page-head,
  .profile-hero {
    display: grid;
    grid-template-columns: 1fr;
  }

  .profile-hero h2 {
    font-size: 2.7rem;
  }

  .photo {
    width: 124px;
  }

  .stats-grid,
  .analytics-grid,
  .kanban,
  .team-list,
  .measurements,
  .billing-stats {
    grid-template-columns: 1fr;
  }

  .bar-chart {
    gap: 10px;
    padding: 0 8px;
  }

  .panel {
    padding: 20px;
  }

  .history-item,
  .billing-grid,
  .invoice-row {
    grid-template-columns: 1fr;
  }

  .blueprint {
    min-height: 580px;
  }

  .measurement-workspace,
  .paper-head,
  .paper-lines,
  .signatures,
  .form-grid {
    grid-template-columns: 1fr;
  }

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

  .letter-grid {
    grid-template-columns: repeat(9, minmax(40px, 1fr));
    overflow-x: auto;
  }

  .letter-grid label {
    min-width: 44px;
  }

  .invoice-stamp {
    font-size: 2.2rem;
    right: -80px;
  }

  .measure-tag {
    font-size: 0.95rem;
    padding: 6px 10px;
  }

  .note-card {
    width: calc(100% - 44px);
    left: 22px;
  }

  table {
    font-size: 0.88rem;
  }

  th,
  td {
    padding: 12px 0;
  }
}
