:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #17202a;
  --muted: #6b7684;
  --line: #dfe5ec;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #0f9f6e;
  --amber: #b7791f;
  --red: #c2413a;
  --shadow: 0 14px 40px rgba(23, 32, 42, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: grid;
  grid-template-columns: 260px 1fr;
}

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

.sidebar {
  min-height: 100vh;
  padding: 22px 18px;
  background: #111827;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #2563eb;
  font-weight: 800;
}

.brand span,
.role-box label,
.eyebrow {
  display: block;
  color: #94a3b8;
  font-size: 12px;
}

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

.nav-item {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  color: #cbd5e1;
  background: transparent;
  text-align: left;
  padding: 0 12px;
  cursor: pointer;
}

.nav-item.active,
.nav-item:hover {
  background: #1f2937;
  color: #fff;
}

.role-box {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.role-box select,
.toolbar select,
.toolbar input,
.form-grid input,
.form-grid select,
.wide-label select,
.wide-label textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

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

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

.topbar h1 {
  margin: 4px 0 0;
  font-size: 30px;
  line-height: 1.15;
}

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

.primary-button,
.icon-button,
.text-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.primary-button {
  min-height: 42px;
  padding: 0 16px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--blue-dark);
}

.icon-button {
  width: 42px;
  height: 42px;
  background: #e8eef7;
  color: var(--ink);
  font-size: 20px;
}

.text-button {
  background: transparent;
  color: var(--blue);
  font-weight: 700;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 1px rgba(23, 32, 42, 0.03);
}

.metric {
  padding: 18px;
}

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

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
}

.work-grid,
.customer-layout,
.ai-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.panel {
  padding: 18px;
}

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

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

.stack-list,
.recommend-list,
.attention-list {
  display: grid;
  gap: 10px;
}

.list-row,
.attention-list div,
.recommend-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.list-row strong,
.recommend-item strong {
  display: block;
}

.list-row span,
.recommend-item span,
.attention-list span {
  color: var(--muted);
  font-size: 13px;
}

.attention-list div {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
}

.attention-list strong {
  font-size: 24px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px 180px;
  gap: 10px;
  margin-bottom: 14px;
}

.table-wrap {
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  background: #f8fafc;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.Available {
  color: var(--green);
  background: #e9f9f2;
}

.Booking,
.Reserved {
  color: var(--amber);
  background: #fff8e1;
}

.Sold {
  color: var(--red);
  background: #feeceb;
}

.Workshop,
.Need-Photo {
  color: #475569;
  background: #eef2f7;
}

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

.row-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 34px;
  padding: 0 12px;
  cursor: pointer;
}

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

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

.form-grid .primary-button {
  align-self: end;
}

.wide-label {
  margin-bottom: 12px;
}

.wide-label textarea {
  min-height: 128px;
  padding-top: 10px;
  resize: vertical;
}

.message-preview {
  white-space: pre-wrap;
  line-height: 1.55;
  color: #243041;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(460px, 100vw);
  height: 100vh;
  transform: translateX(102%);
  transition: transform 180ms ease;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 24px;
  overflow: auto;
  z-index: 10;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 24px;
}

.drawer h2 {
  margin: 20px 0 4px;
}

.photo-panel {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  align-items: center;
  margin: 18px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.photo-placeholder {
  min-height: 92px;
  border: 1px dashed #aab5c3;
  border-radius: 8px;
  background: #eef2f7;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.photo-panel p {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.price-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

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

.price-box strong {
  display: block;
  margin-top: 4px;
}

.markup-tool {
  padding: 14px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.markup-tool input {
  width: 100%;
  min-height: 40px;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}

@media (max-width: 900px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .metric-grid,
  .work-grid,
  .customer-layout,
  .ai-grid,
  .toolbar,
  .form-grid {
    grid-template-columns: 1fr;
  }

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

  .photo-panel {
    grid-template-columns: 1fr;
  }
}
