@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&display=swap');

:root {
  --bg: #dfe2e9;
  --surface: #f4f6fb;
  --surface-soft: #edf0f7;
  --line: #d8dce7;
  --line-soft: #e2e6ef;
  --text: #141925;
  --muted: #8b90a1;
  --primary: #1a73ff;
  --primary-soft: #dfeaff;
  --green: #35bb85;
  --yellow: #f2bf3b;
  --orange: #ff9f57;
  --danger: #ff5d62;
  --shadow: 0 22px 60px rgba(28, 38, 62, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 15% 15%, #eef2fb 0%, #d8dde9 45%, #d3d9e6 100%);
}

#app {
  min-height: 100vh;
  padding: 16px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px;
  background:
    radial-gradient(circle at 80% 12%, rgba(30, 120, 255, 0.2), transparent 28%),
    radial-gradient(circle at 10% 70%, rgba(53, 187, 133, 0.16), transparent 24%),
    linear-gradient(160deg, #e9edf7, #d6dde9);
}

.auth-card {
  width: min(460px, 100%);
  background: #f7f9ff;
  border: 1px solid #d7deeb;
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 28px;
  display: grid;
  gap: 14px;
}

.auth-brand {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(140deg, #0568f7, #318cff);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 800;
}

.auth-card h1 {
  margin: 0;
  font-size: 32px;
}

.auth-card p {
  margin: 0;
  color: #71798d;
}

.auth-modes {
  display: flex;
  gap: 8px;
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: #5f6679;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}

.chip.active {
  border-color: transparent;
  background: var(--primary);
  color: #fff;
}

.auth-form {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.auth-form label {
  display: grid;
  gap: 4px;
  font-weight: 600;
  color: #5f6679;
  font-size: 14px;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d1d7e5;
  border-radius: 12px;
  padding: 11px 12px;
  background: #eff3fa;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #95b8ff;
}

textarea {
  resize: vertical;
}

button {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(24, 105, 255, 0.3);
}

.primary:hover {
  background: #0965ef;
}

.secondary {
  background: #e7edf9;
  border: 1px solid #d2dbed;
  color: #4f5e80;
}

.secondary:hover {
  background: #dde6f7;
}

.danger {
  background: #ffe8ea;
  border: 1px solid #f1c0c6;
  color: #c7444f;
}

.danger:hover {
  background: #ffdce0;
}

.client-shell {
  min-height: calc(100vh - 32px);
  display: grid;
  grid-template-columns: 288px 1fr;
  background: var(--surface);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #eef1f7, #eceff6 60%, #eef0f7);
  color: var(--text);
  padding: 26px 22px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 18px;
}

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

.logo {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 28px;
  background: linear-gradient(145deg, #0b69f4, #197cff);
  color: #fff;
}

.brand-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

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

.user-tile {
  padding: 12px;
  border-radius: 14px;
  background: transparent;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.user-tile strong {
  display: block;
  font-size: 24px;
}

.user-tile span {
  display: block;
  font-size: 20px;
  color: #646c7f;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #4c566a, #8790a4);
  color: white;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.side-caption {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-top: 8px;
}

.menu {
  display: grid;
  gap: 4px;
  align-content: start;
}

.menu-btn {
  text-align: left;
  border-radius: 12px;
  background: transparent;
  color: #5f6679;
  border: 0;
  border-left: 4px solid transparent;
  padding: 12px 12px;
  height: 48px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 16px;
  transition: all 200ms ease;
}

.menu-btn:hover {
  background: #dfe6f5;
  color: #2f3a4e;
}

.menu-btn.active {
  border-left-color: var(--primary);
  color: var(--primary);
  background: #d9e4f8;
}

.sidebar-actions {
  display: grid;
  gap: 8px;
}

.workspace {
  padding: 24px;
  overflow: auto;
}

.toolbar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  color: var(--text);
}

.toolbar h1 {
  margin: 0;
  font-size: 40px;
  letter-spacing: -0.02em;
}

.toolbar p {
  margin: 8px 0 0;
  color: #6f7789;
  font-size: 22px;
}

.toolbar-badges {
  display: flex;
  align-items: center;
  gap: 10px;
}

.role-badge {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.content-area {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
}

.grid {
  display: grid;
  gap: 14px;
}

.metrics {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.metric-card {
  background: #f8f9fd;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  padding: 14px;
  display: grid;
  gap: 8px;
}

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

.metric-card strong {
  font-size: 30px;
}

.metric-card.wide {
  grid-column: span 2;
}

.split {
  grid-template-columns: minmax(300px, 0.95fr) minmax(420px, 1.25fr);
  margin-top: 14px;
}

.panel {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  padding: 18px;
}

.panel h3,
.panel h4 {
  margin: 0 0 12px;
}

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

.panel-head h3 {
  margin: 0;
  font-size: 28px;
}

.list-stack {
  display: grid;
  gap: 8px;
}

.list-row {
  border: 0;
  width: 100%;
  border-left: 4px solid transparent;
  border-radius: 11px;
  background: transparent;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 10px;
  text-align: left;
  color: #2b3347;
  cursor: pointer;
  transition: all 150ms;
}

.list-row:hover {
  background: #e6ebf7;
}

.list-row.selected {
  background: #d5e1f4;
  border-left-color: var(--primary);
}

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

.list-row span {
  font-size: 18px;
}

.row-main {
  border: none;
  padding: 0;
  margin: 0;
  text-align: left;
  background: transparent;
  display: contents;
  cursor: pointer;
}

.order-layout .order-list {
  align-self: start;
}

.order-layout .order-list select {
  min-width: 142px;
}

.order-detail-wrap {
  display: grid;
  gap: 10px;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

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

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.empty-inline {
  color: var(--muted);
}

.stack-form {
  display: grid;
  gap: 12px;
}

.inline-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(80px, 1fr));
  gap: 10px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  text-align: left;
  color: #5c6988;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  padding: 9px 6px;
}

tbody td {
  border-bottom: 1px solid var(--line-soft);
  padding: 9px 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  white-space: nowrap;
}

.status-draft {
  background: #d4d8de;
  color: #787d8d;
}

.status-assigned {
  background: #f8ddbd;
  color: #f0881b;
}

.status-progress {
  background: #cde3ff;
  color: #2977de;
}

.status-review {
  background: #feeabf;
  color: #d49d18;
}

.status-payment {
  background: #cbeecf;
  color: #2ba866;
}

.status-completed {
  background: #cbeecf;
  color: #2ba866;
}

.notice {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  border-radius: 13px;
  padding: 10px 14px;
  border: 1px solid;
  font-weight: 600;
  box-shadow: 0 16px 36px rgba(30, 39, 58, 0.25);
}

.notice.ok {
  background: #ecf8ef;
  border-color: #bfe7cc;
  color: #24794f;
}

.notice.error {
  background: #ffedf0;
  border-color: #f6c0c8;
  color: #be3e4c;
}

.empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

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

.muted {
  color: var(--muted);
}

.muted-row {
  background: #f8f9fd;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.photo-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #f8faff;
  transition: border-color 150ms, box-shadow 150ms;
}

.photo-card:hover {
  border-color: #b4c4e4;
  box-shadow: 0 4px 12px rgba(28, 38, 62, 0.08);
}

.photo-preview {
  aspect-ratio: 4 / 3;
  background: #d9deea;
}

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

.photo-preview.placeholder {
  display: grid;
  place-items: center;
  color: #7a8295;
  font-size: 13px;
}

.photo-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
}

.photo-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 10px 10px;
}

.photo-actions .accept {
  background: #e4f7ea;
  border: 1px solid #b9e7cd;
  color: #1f8a52;
  border-radius: 10px;
}

.photo-actions .reject {
  background: #ffe8ea;
  border: 1px solid #f1c0c6;
  color: #c7444f;
  border-radius: 10px;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
}

.kv-grid div {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #f8f9fd;
  padding: 10px;
  display: grid;
  gap: 4px;
}

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

.tips {
  margin: 0;
  padding-left: 18px;
  color: #40506e;
  display: grid;
  gap: 10px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(26, 115, 255, 0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.mobile-nav {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(242, 245, 251, 0.96);
  border: 1px solid var(--line);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  z-index: 50;
}

.mobile-nav button {
  flex: 1;
  background: transparent;
  color: #667087;
  border-radius: 12px;
  font-size: 12px;
  padding: 8px 4px;
  display: grid;
  gap: 4px;
  justify-items: center;
}

.mobile-nav button.active {
  background: #dce8ff;
  color: var(--primary);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1580px) {
  .brand-title {
    font-size: 30px;
  }

  .user-tile strong {
    font-size: 22px;
  }

  .user-tile span {
    font-size: 18px;
  }

  .toolbar h1,
  .panel-head h3 {
    font-size: 32px;
  }

  .list-row strong {
    font-size: 20px;
  }

  .list-row span {
    font-size: 16px;
  }
}

@media (max-width: 1120px) {
  #app {
    padding: 0;
  }

  .client-shell {
    grid-template-columns: 1fr;
    border-radius: 0;
    min-height: 100vh;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    padding: 16px 16px 84px;
  }

  .toolbar h1 {
    font-size: 22px;
  }

  .toolbar p {
    font-size: 14px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .metric-card.wide {
    grid-column: span 2;
  }

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

  .mobile-nav {
    display: grid;
  }
}

@media (max-width: 640px) {
  .auth-card {
    padding: 18px;
  }

  .toolbar {
    align-items: center;
  }

  .toolbar p {
    display: none;
  }

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

  .metric-card.wide {
    grid-column: span 1;
  }

  .detail-grid,
  .kv-grid,
  .inline-fields {
    grid-template-columns: 1fr;
  }

  .list-row strong {
    font-size: 17px;
  }

  .list-row span {
    font-size: 12px;
  }

  .badge {
    font-size: 11px;
    padding: 4px 8px;
  }

  .notice {
    left: 12px;
    right: 12px;
    bottom: 80px;
  }
}
