@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@9..40,400;9..40,500;9..40,600&family=Fraunces:ital,opsz,wght@0,9..144,500;0,9..144,600;1,9..144,500&display=swap");
/* Design 3 — fallback; `.theme-atelier` overrides for editorial / warm workspace. */
:root {
  --primary: #b45309;
  --primary-hover: #92400e;
  --primary-soft: rgba(180, 83, 9, 0.12);
  --accent-blue: #0369a1;
  --success: #15803d;
  --warning: #ca8a04;
  --danger: #b91c1c;
  --text: #292524;
  --text-muted: #78716c;
  --border: #e7e5e4;
  --bg: #fafaf9;
  --surface: #ffffff;
  --sidebar-w: 268px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.06);
  --shadow-lg: 0 20px 50px rgba(120, 113, 108, 0.12);
  --font: "DM Sans", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --fz-xs: 0.8125rem;
  --fz-sm: 0.875rem;
  --fz-base: 1rem;
  --fz-lg: 1.1875rem;
  --header-h: 120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--fz-base);
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  font-weight: 500;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 1.45rem;
}
h2 {
  font-size: 1.2rem;
}
h3 {
  font-size: var(--fz-base);
}

/* —— App shell —— */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  color: var(--text);
}
.sidebar__brand svg,
.sidebar__brand img {
  width: 32px;
  height: 32px;
  color: var(--primary);
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.5rem;
}

.nav-section {
  font-size: var(--fz-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem 0.35rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  color: var(--text);
  font-weight: 400;
  font-size: var(--fz-sm);
  margin-bottom: 2px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover {
  background: var(--primary-soft);
  text-decoration: none;
  color: var(--primary);
}
.nav-link.is-active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 500;
}
.nav-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.92;
  stroke-width: 2.25px;
}

.main-wrap {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--header-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 2rem;
  box-shadow: none;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-width: 0;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  padding: 0;
}
.menu-toggle:hover {
  background: var(--bg);
}
.menu-toggle svg {
  width: 40px;
  height: 40px;
}

.page-title {
  font-size: 2.1rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumbs {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}
.breadcrumbs a {
  color: var(--text-muted);
}
.breadcrumbs span {
  margin: 0 0.7rem;
  opacity: 0.5;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.content {
  flex: 1;
  padding: 1.25rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.content--narrow {
  max-width: 960px;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  font-family: inherit;
  font-size: var(--fz-sm);
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn svg {
  width: 16px;
  height: 16px;
}
.btn--primary {
  background: linear-gradient(135deg, var(--primary) 0%, #1abc9c 100%);
  color: #fff;
}
.btn--primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #17a589 100%);
}
.btn--secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn--secondary:hover {
  background: var(--bg);
}
.btn--ghost {
  background: transparent;
  color: var(--primary);
}
.btn--sm {
  padding: 0.3rem 0.65rem;
  font-size: var(--fz-xs);
}

/* —— Cards —— */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: none;
  border: 1px solid var(--border);
  overflow: hidden;
}
.card__pad {
  padding: 1rem 1.1rem;
}
.card__title {
  font-size: var(--fz-xs);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.stat-delta {
  font-size: var(--fz-xs);
  margin-top: 0.35rem;
}
.stat-delta--up {
  color: var(--success);
}
.stat-delta--down {
  color: var(--danger);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.chart-box {
  min-height: 240px;
  position: relative;
}
.chart-box canvas {
  max-height: 220px;
}

/* —— Toolbar —— */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.search-input {
  flex: 1;
  min-width: 160px;
  max-width: 280px;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: var(--fz-sm);
}
.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.select-input {
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: var(--fz-sm);
  background: var(--surface);
}

/* —— Tables —— */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: none;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fz-sm);
}
.data-table th {
  text-align: left;
  padding: 0.65rem 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  background: #fbfcfd;
  border-bottom: 1px solid var(--border);
  border-left: none;
  border-right: none;
  white-space: nowrap;
}
.data-table td {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid #eef1f5;
  border-left: none;
  border-right: none;
  vertical-align: middle;
}
.data-table tbody tr:hover {
  background: #fafbfc;
}
.data-table tbody tr.clickable-row {
  cursor: pointer;
}
.data-table tbody tr.clickable-row:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table a.row-link {
  color: var(--primary);
  font-weight: 500;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: var(--fz-xs);
  font-weight: 500;
}
.badge--success {
  background: rgba(76, 175, 80, 0.12);
  color: #2e7d32;
}
.badge--warn {
  background: rgba(255, 152, 0, 0.15);
  color: #e65100;
}
.badge--muted {
  background: var(--bg);
  color: var(--text-muted);
}
.badge--info {
  background: var(--primary-soft);
  color: var(--primary);
}

/* —— Drop zone —— */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  background: #fafbfc;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 1rem;
}
.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.dropzone__hint {
  font-size: var(--fz-sm);
  color: var(--text-muted);
  margin: 0.35rem 0 0;
}

/* —— Detail layout —— */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 900px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

.meta-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--fz-sm);
}
.meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}
.meta-list li:last-child {
  border-bottom: none;
}
.meta-list .k {
  color: var(--text-muted);
}

.preview-box {
  aspect-ratio: 4/3;
  background: linear-gradient(145deg, #eef2f6, #e4e8ee);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--fz-sm);
  border: 1px solid var(--border);
}
.preview-box--file {
  min-height: 280px;
  aspect-ratio: auto;
  padding: 1rem;
  text-align: center;
  font-weight: 500;
  color: var(--text);
  max-width: 100%;
}

/* —— File detail (document.html) —— */
.file-detail__h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}
.file-detail__h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.file-detail__hint {
  margin: 0 0 0.85rem;
  font-size: var(--fz-sm);
}
.file-detail__section {
  margin-bottom: 1rem;
}
.file-detail__actions {
  margin-top: 0.75rem;
}
.file-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1.25rem;
  max-width: 720px;
}
@media (max-width: 640px) {
  .file-info-grid {
    grid-template-columns: 1fr;
  }
}
.file-info-grid .form-row--full {
  grid-column: 1 / -1;
}
.user-detail__h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}
.user-detail__h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.85rem;
}
.user-detail__section {
  margin-bottom: 1rem;
}
.file-status-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: var(--fz-xs);
  font-weight: 600;
  text-transform: capitalize;
}
.file-status-badge--done {
  background: rgba(39, 174, 96, 0.15);
  color: #1e8449;
}
.file-status-badge--progress {
  background: rgba(243, 156, 18, 0.15);
  color: #b9770e;
}
.file-status-badge--default {
  background: var(--bg);
  color: var(--text-muted);
}
.file-task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.65rem;
}
.file-task-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.file-task-card__num {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: var(--fz-xs);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.file-task-card__body {
  flex: 1;
  min-width: 0;
}
.file-task-card__label {
  font-size: var(--fz-sm);
  font-weight: 500;
  line-height: 1.35;
}
.file-task-card__state {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: var(--fz-xs);
  color: var(--text-muted);
  text-transform: capitalize;
}
.file-task-card--running {
  border-color: rgba(22, 160, 133, 0.35);
  background: rgba(22, 160, 133, 0.06);
}
.file-task-card--pending .file-task-card__state {
  color: var(--text-muted);
}
.data-table--file-ops td {
  white-space: nowrap;
}
.data-table--file-ops td:nth-child(6) {
  white-space: normal;
  max-width: 280px;
}
.file-preview-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.file-preview-zoom {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}
.file-preview-zoom__val {
  font-size: var(--fz-sm);
  min-width: 2.5rem;
  text-align: center;
}

/* —— Forms —— */
.form-grid {
  display: grid;
  gap: 0.85rem;
  max-width: 480px;
}
.form-row label,
.form-row__static-label {
  display: block;
  font-size: var(--fz-xs);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: var(--fz-sm);
}
.form-row textarea {
  min-height: 80px;
  resize: vertical;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* —— Auth page —— */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(165deg, #e8f8f4 0%, #f9fbfc 50%, #ffffff 100%);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: none;
  border: 1px solid var(--border);
  padding: 2rem 1.75rem;
}
.auth-card__logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.auth-card__logo svg {
  width: 48px;
  height: 48px;
  color: var(--primary);
}
.auth-card h1 {
  text-align: center;
  margin-bottom: 0.25rem;
}
.auth-card .sub {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fz-sm);
  margin-bottom: 1.5rem;
}

/* —— Modal —— */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.is-open {
  display: flex;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border);
}
.modal__head {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal__head h2 {
  margin: 0;
  font-size: 1rem;
}
.modal__body {
  padding: 1rem 1.15rem;
}
.modal__foot {
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.2rem;
}

/* —— Toast —— */
.toast-wrap {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--text);
  color: #fff;
  padding: 0.65rem 1rem;
  border-radius: 6px;
  font-size: var(--fz-sm);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s ease;
}
.toast--success {
  background: #2e7d32;
}
.toast--warn {
  background: #e65100;
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Sidebar overlay mobile —— */
@media (max-width: 900px) {
  .menu-toggle {
    display: inline-flex;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 35;
  }
  .sidebar-backdrop.is-open {
    display: block;
  }
}

/* —— Utilities —— */
.text-muted {
  color: var(--text-muted);
}
.mt-0 {
  margin-top: 0;
}
.mb-1 {
  margin-bottom: 1rem;
}
.flex {
  display: flex;
}
.gap-sm {
  gap: 0.5rem;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}

.section-title {
  font-size: var(--fz-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}
.stat-card .card__pad {
  padding: 1rem 1.1rem;
}
.stat-card__inner {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}
.stat-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-card__icon svg {
  width: 20px;
  height: 20px;
}
.chart-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.chart-card__head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}
.form-section {
  margin-bottom: 1.15rem;
}
.form-section:last-of-type {
  margin-bottom: 0;
}
.form-section__title {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 0.65rem;
}
.form-grid--2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  max-width: none;
}
@media (max-width: 520px) {
  .form-grid--2col {
    grid-template-columns: 1fr;
  }
}
.form-row--underline input,
.form-row--underline select {
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  padding-left: 0;
  padding-right: 0;
  background: transparent;
}
.form-row--underline input:focus,
.form-row--underline select:focus {
  box-shadow: none;
  border-bottom-color: var(--primary);
}

/* —— Dashboard extras (infographics) —— */
.grid-stats--five {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.grid-infographics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.chart-box--donut {
  min-height: 220px;
}
.chart-box--spark {
  min-height: 72px;
}
.spark-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.spark-label {
  font-size: var(--fz-xs);
  margin: 0 0 0.35rem;
}
@media (max-width: 520px) {
  .spark-row {
    grid-template-columns: 1fr;
  }
}

/* —— Design 3: airy, soft cards —— */
.content {
  padding: 1.35rem 1.5rem 2rem;
}
.card {
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.grid-stats {
  gap: 1.2rem;
}
.stat-value {
  font-size: 1.6rem;
}
.sidebar__nav .nav-link {
  border-radius: 8px;
}

/* —— Design 3 · Atelier (warm paper, right rail, display type) —— */
.theme-atelier {
  --primary: #c2410c;
  --primary-hover: #9a3412;
  --primary-soft: rgba(194, 65, 12, 0.12);
  --accent-blue: #0c4a6e;
  --success: #166534;
  --warning: #a16207;
  --danger: #991b1b;
  --text: #1c1917;
  --text-muted: #78716c;
  --border: #e7e5e4;
  --bg: #f5f0e8;
  --surface: #fffdf8;
  --sidebar-w: 280px;
  --radius: 22px;
  --shadow: 0 2px 8px rgba(28, 25, 23, 0.04);
  --shadow-lg: 0 24px 60px rgba(87, 83, 78, 0.1);
  --font: "DM Sans", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --fz-xs: 0.8125rem;
  --fz-sm: 0.875rem;
  --fz-base: 1rem;
  --fz-lg: 1.1875rem;
  --header-h: 128px;
}
.theme-atelier .app-shell {
  flex-direction: row-reverse;
}
@media (max-width: 900px) {
  .theme-atelier .app-shell {
    flex-direction: row;
  }
}
.theme-atelier .sidebar {
  border-right: none;
  border-left: 1px solid var(--border);
  background: linear-gradient(200deg, #ffffff 0%, #fff7ed 45%, #faf5f0 100%);
  box-shadow: -12px 0 40px rgba(120, 113, 108, 0.07);
}
.theme-atelier .sidebar__brand {
  border-bottom: 2px solid #f5f5f4;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.theme-atelier .nav-link {
  border-radius: 12px;
  padding: 0.6rem 0.85rem;
  border-right: 4px solid transparent;
  border-left: none;
}
.theme-atelier .nav-link.is-active {
  background: rgba(194, 65, 12, 0.1);
  border-right-color: var(--primary);
  font-weight: 600;
}
.theme-atelier .topbar {
  background: #fffdf8;
  border-bottom: 2px solid #e7e5e4;
}
.theme-atelier .page-title {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #292524;
}
.theme-atelier .breadcrumbs {
  font-size: var(--fz-sm);
  font-style: italic;
  color: #a8a29e;
}
.theme-atelier .content--atelier {
  background: linear-gradient(180deg, transparent 0%, rgba(255, 247, 237, 0.35) 100%), var(--bg);
}
.theme-atelier .card {
  border-radius: var(--radius);
  border: 1px solid rgba(231, 229, 228, 0.9);
  box-shadow: var(--shadow-lg);
}
.theme-atelier .stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: #1c1917;
}
.theme-atelier .stat-card__icon {
  background: rgba(194, 65, 12, 0.1);
  color: var(--primary);
  border-radius: 14px;
}
.theme-atelier .btn--primary {
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(194, 65, 12, 0.25);
}
.theme-atelier .data-table th {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: #57534e;
}
.theme-atelier .section-title {
  font-family: var(--font-display);
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 1.05rem;
  color: #44403c;
}

.atelier-hero {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 3px double #e7e5e4;
}
.atelier-hero__eyebrow {
  margin: 0 0 0.35rem;
  font-size: var(--fz-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #a8a29e;
}
.atelier-hero__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  font-weight: 600;
  line-height: 1.2;
  color: #1c1917;
  letter-spacing: -0.03em;
}
.atelier-hero__lead {
  margin: 0;
  max-width: 42rem;
  font-size: var(--fz-lg);
  line-height: 1.55;
}

.atelier-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.5rem;
}
@media (max-width: 900px) {
  .atelier-columns {
    grid-template-columns: 1fr;
  }
}

.atelier-rail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.atelier-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 3px solid #fed7aa;
  margin-left: 0.5rem;
}
.atelier-timeline li {
  position: relative;
  padding: 0.35rem 0 0.85rem 1.1rem;
  font-size: var(--fz-sm);
  color: var(--text-muted);
}
.atelier-timeline li::before {
  content: "";
  position: absolute;
  left: -0.55rem;
  top: 0.45rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px #fff7ed;
}
.atelier-timeline strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.atelier-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 720px) {
  .atelier-kpi-row {
    grid-template-columns: 1fr;
  }
}

.atelier-chart-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chart-box--atelier-tall {
  min-height: 280px;
}
.chart-box--atelier-tall canvas {
  max-height: 260px;
}

.theme-atelier .auth-page {
  background: linear-gradient(145deg, #fff7ed 0%, #f5f0e8 40%, #e7e5e4 100%);
}
.theme-atelier .auth-card {
  border-radius: 24px;
  border: 1px solid #e7e5e4;
}
.theme-atelier .auth-card h1 {
  font-family: var(--font-display);
}
.theme-atelier .chart-card__head h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: #44403c;
}

/* Operation detail (shared structure with design1) */
.operation-detail__head {
  margin-bottom: 1rem;
}
.operation-detail__bc {
  font-size: var(--fz-sm);
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.operation-detail__bc a {
  color: var(--text-muted);
}
.operation-detail__bc a:hover {
  color: var(--primary);
}
.operation-detail__bc .bc-sep {
  margin: 0 0.35rem;
  opacity: 0.7;
}
.operation-detail__h1 {
  margin-bottom: 0;
}
.theme-atelier .operation-detail__h1 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  color: #1c1917;
}
.assignment-hint {
  display: block;
  margin-top: 0.65rem;
  font-size: var(--fz-xs);
  color: var(--text-muted);
  line-height: 1.45;
}
.saved-data-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fffdfb;
  overflow: hidden;
}
.saved-data-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 0.75rem 1rem;
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-size: var(--fz-sm);
  align-items: start;
}
.saved-data-row:last-child {
  border-bottom: none;
}
.saved-data-key {
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
  word-break: break-word;
}
.saved-data-value {
  color: var(--text);
  word-break: break-word;
}
.operation-source-link {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #e7e5e4;
  background: #fff;
  color: var(--primary);
  font-weight: 600;
  font-size: var(--fz-sm);
  text-decoration: none;
}
.operation-source-link:hover {
  background: rgba(194, 65, 12, 0.08);
  text-decoration: none;
}
@media (max-width: 560px) {
  .saved-data-row {
    grid-template-columns: 1fr;
  }
}

/* —— Tasks list (tasks.html) —— */
.tasks-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.tasks-page-h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-family: var(--font-display);
}
.task-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.task-stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  box-shadow: var(--shadow);
  text-align: center;
}
.task-stat-tile__label {
  font-size: var(--fz-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  margin-bottom: 0.25rem;
}
.task-stat-tile__value {
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.task-filters-card {
  margin-bottom: 1rem;
}
.task-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.tasks-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.tasks-pagination__info {
  flex: 1;
  text-align: center;
  min-width: 200px;
}
.task-status-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: var(--fz-xs);
  font-weight: 600;
  text-transform: lowercase;
  color: #fff;
}
.task-status-badge--completed {
  background: #2e7d32;
}
.task-status-badge--processing {
  background: #1565c0;
}
.task-status-badge--failed {
  background: #c62828;
}
.task-status-badge--pending {
  background: #6d6d6d;
}
.task-status-badge--cancelled {
  background: #757575;
}
.theme-atelier .task-stat-tile {
  background: #fffdfb;
}

/* —— System hub (system.html) —— */
.system-page__header {
  margin-bottom: 1.25rem;
}
.system-page__title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  font-family: var(--font-display);
}
.system-page__subtitle {
  margin: 0;
  font-size: var(--fz-sm);
  line-height: 1.45;
}
.system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}
.system-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  padding: 1rem 1.1rem;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.system-card:hover {
  border-color: rgba(194, 65, 12, 0.35);
  box-shadow: 0 4px 14px rgba(68, 64, 60, 0.08);
}
.system-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.system-card__icon {
  flex-shrink: 0;
  font-size: 1.5rem;
  line-height: 1;
}
.system-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.system-card__title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}
.system-card__desc {
  font-size: var(--fz-sm);
  line-height: 1.35;
  margin: 0;
}
.system-card__arrow {
  flex-shrink: 0;
  font-size: 1.1rem;
  color: var(--text-muted);
}
.theme-atelier .system-card {
  background: #fffdfb;
}
.theme-atelier .system-card:hover {
  border-color: rgba(194, 65, 12, 0.45);
}

/* —— Global chrome: utility header + footer —— */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.header-stack {
  position: sticky;
  top: 0;
  z-index: 24;
  flex-shrink: 0;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(68, 64, 60, 0.08);
}

.chrome-bar {
  border-bottom: 1px solid var(--border);
  background: #fff;
  padding: 0 2rem;
  min-height: 84px;
  display: flex;
  align-items: center;
}
.chrome-bar__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.chrome-bar__suite {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-left: 0;
  flex-shrink: 0;
}
.chrome-bar__suite a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}
.chrome-bar__suite a:hover {
  color: var(--primary);
  text-decoration: none;
}
.chrome-bar__sep {
  margin: 0 0.3rem;
  opacity: 0.45;
}
.chrome-bar__search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 280px;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 64px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
}
.chrome-bar__search-ico {
  display: flex;
  color: var(--text-muted);
  padding-left: 0.7rem;
}
.chrome-bar__search-ico svg {
  width: 32px;
  height: 32px;
}
.chrome-bar__search {
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1.25rem;
  color: var(--text);
  min-width: 0;
  padding: 0 1rem 0 0.5rem;
  outline: none;
}
.chrome-bar__search::placeholder {
  color: var(--text-muted);
}
.chrome-bar__tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  margin-left: auto;
}
.chrome-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: background 0.12s, color 0.12s;
}
.chrome-icon-btn:hover {
  background: rgba(194, 65, 12, 0.1);
  color: var(--text);
}
.chrome-icon-btn svg {
  width: 40px;
  height: 40px;
}
.chrome-icon-btn--dense {
  width: 68px;
  height: 68px;
}
.chrome-icon-btn--dense svg {
  width: 36px;
  height: 36px;
}
.chrome-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 999px;
  background: #b45309;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 32px;
  text-align: center;
}
.chrome-avatar {
  width: 68px;
  height: 68px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: linear-gradient(135deg, #c2410c, #ea580c);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: 0.5rem;
  flex-shrink: 0;
}
.chrome-avatar span {
  display: block;
  line-height: 64px;
  text-align: center;
}

.app-footer-stack {
  margin-top: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.app-footer-util {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.9rem 2rem;
  background: #faf6f1;
  border-top: 1px solid var(--border);
  font-size: 1.25rem;
}
.app-footer-util__left,
.app-footer-util__right {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
}
.app-footer-util__link {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  font: inherit;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
}
.app-footer-util__link:hover {
  background: rgba(194, 65, 12, 0.1);
  color: var(--primary);
}
.app-footer-util__link svg {
  width: 32px;
  height: 32px;
}
.app-footer-util__mid {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  max-width: 1040px;
  margin: 0 auto;
}
.app-footer-util__mid-ico {
  color: var(--text-muted);
  display: flex;
}
.app-footer-util__mid-ico svg {
  width: 32px;
  height: 32px;
}
.app-footer-util__hint {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 1.3rem;
  font-size: 1.125rem;
  color: var(--text-muted);
  background: #fffdfb;
}

.cookie-consent {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  padding: 1.3rem 2rem;
  background: #0a0a0a;
  color: #e5e5e5;
  font-size: 1.125rem;
  line-height: 1.45;
}
.cookie-consent[hidden] {
  display: none !important;
}
.cookie-consent__text {
  margin: 0;
  flex: 1;
  min-width: 360px;
  max-width: 720px;
}
.cookie-consent__text a {
  color: #7cb7ff;
  text-decoration: underline;
}
.cookie-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.cookie-consent__btn {
  padding: 0.8rem 1.7rem;
  border-radius: 8px;
  border: 1px solid #4f8fff;
  background: transparent;
  color: #7cb7ff;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
}
.cookie-consent__btn:hover {
  background: rgba(127, 183, 255, 0.12);
}
.cookie-consent__btn--primary {
  border-color: #7cb7ff;
}

@media (max-width: 720px) {
  .chrome-bar__suite {
    display: none;
  }
  .chrome-bar__search-wrap {
    max-width: none;
    order: 3;
    width: 100%;
    margin: 0.5rem 0 0;
  }
  .chrome-bar__inner {
    justify-content: space-between;
  }
  .app-footer-util__mid {
    display: none;
  }
  .cookie-consent {
    flex-direction: column;
    align-items: stretch;
  }
}

.theme-atelier .header-stack {
  background: linear-gradient(180deg, #fffdfb 0%, #f4faf7 100%);
}
.theme-atelier .chrome-bar {
  background: linear-gradient(180deg, #f4faf7 0%, #eef8f4 100%);
  border-bottom-color: #e7e5e4;
}
.theme-atelier .chrome-bar__search-wrap {
  background: #fffdfb;
  border-color: #e7e5e4;
}
.theme-atelier .app-footer-util {
  background: #f5f0e8;
  border-top-color: #e7e5e4;
}
/* —— Detail pages: entity header + key/value board (company, user, document, operation) —— */
.content--detail {
  max-width: 920px;
  margin: 0 auto;
}
.content--profile {
  max-width: 1100px;
  margin: 0 auto;
}
.entity-card {
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.entity-card--tight {
  margin-bottom: 0;
  height: 100%;
}
.entity-card__pad {
  padding: 1.25rem 1.35rem;
}
.entity-hero {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.entity-hero__media {
  flex-shrink: 0;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  overflow: hidden;
  line-height: 0;
}
.entity-hero__media--logo img,
.entity-hero__media--doc img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  display: block;
}
.entity-hero__media--user {
  border-radius: 50%;
}
.entity-hero__media--user img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  display: block;
}
.entity-hero__text {
  min-width: 0;
  flex: 1;
}
.entity-hero__eyebrow {
  font-size: var(--fz-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.35rem;
}
.entity-hero__title {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  line-height: 1.25;
  color: var(--text);
  word-break: break-word;
}
.entity-hero__title--file {
  font-size: 1.15rem;
}
.entity-hero__sub {
  margin: 0 0 0.65rem;
  font-size: var(--fz-sm);
}
.entity-section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}
.entity-section-title--sm {
  font-size: 0.75rem;
  margin-bottom: 0.65rem;
}
.entity-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: var(--fz-xs);
  font-weight: 600;
}
.entity-badge--success {
  background: rgba(46, 125, 50, 0.12);
  color: #2e7d32;
}
.entity-badge--warn {
  background: rgba(245, 124, 0, 0.12);
  color: #e65100;
}
.entity-badge--muted {
  background: var(--bg);
  color: var(--text-muted);
}
.kv-board {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.kv-board--plain {
  border-radius: 8px;
}
.kv-row {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
  gap: 0.65rem 1rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.kv-row:last-child {
  border-bottom: none;
}
.kv-row--full {
  grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
}
.kv-row__label {
  font-size: var(--fz-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kv-row__field input,
.kv-row__field textarea {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: var(--fz-sm);
  background: #fafbfc;
  color: var(--text);
}
.kv-row__field textarea {
  min-height: 64px;
  resize: vertical;
}
.kv-row__field--inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.kv-inline-input {
  max-width: 220px;
  flex: 1;
  min-width: 140px;
}
.entity-actions {
  margin-top: 1rem;
}
@media (max-width: 640px) {
  .kv-row,
  .kv-row--full {
    grid-template-columns: 1fr;
  }
  .entity-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .entity-hero__text {
    text-align: center;
  }
}

/* —— Company page: upload files —— */
.company-upload-card {
  margin-bottom: 1.25rem;
}
.company-upload-card__title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.company-upload-card__hint {
  margin: 0 0 1rem;
  font-size: var(--fz-sm);
  line-height: 1.5;
  max-width: 42rem;
}
.company-upload-form__group {
  margin-bottom: 1rem;
}
.company-upload-form__label {
  display: block;
  font-size: var(--fz-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.45rem;
}
.doc-type-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.doc-type-btn {
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
  font-size: var(--fz-sm);
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.doc-type-btn:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  color: var(--primary);
}
.doc-type-btn.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.doc-type-btn--auto.is-active {
  box-shadow: 0 0 0 2px var(--primary-soft);
}
.company-upload-file {
  display: block;
  width: 100%;
  max-width: 28rem;
  padding: 0.55rem 0.65rem;
  font-size: var(--fz-sm);
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-family: inherit;
}
.company-upload-form .btn--primary {
  margin-top: 0.25rem;
}

.profile-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 720px) {
  .profile-split {
    grid-template-columns: 1fr;
  }
}

/* —— Profile (Zoho-style) —— */
.profile-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 860px) {
  .profile-shell {
    grid-template-columns: 1fr;
  }
  .profile-rail {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .profile-rail__nav {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 0.35rem;
  }
}
.profile-rail {
  position: sticky;
  top: 5.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.profile-rail__user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.profile-rail__avatar {
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  line-height: 0;
}
.profile-rail__avatar img {
  display: block;
}
.profile-rail__meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: var(--fz-sm);
  min-width: 0;
}
.profile-rail__meta strong {
  font-weight: 600;
  color: var(--text);
}
.profile-rail__nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.profile-rail__link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  font-size: var(--fz-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}
.profile-rail__link:hover {
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
}
.profile-rail__link.is-active {
  background: rgba(21, 101, 192, 0.1);
  color: var(--primary);
}
.profile-rail__link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.profile-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.profile-hero {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}
.profile-hero__bg {
  height: 88px;
  background: linear-gradient(110deg, #1565c0 0%, #42a5f5 42%, #7e57c2 100%);
}
.profile-hero__body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  padding: 0 1.25rem 1.25rem;
  margin-top: -48px;
}
.profile-hero__avatar {
  border-radius: 16px;
  border: 4px solid var(--surface);
  overflow: hidden;
  line-height: 0;
  box-shadow: var(--shadow-lg);
}
.profile-hero__avatar img {
  display: block;
}
.profile-hero__text {
  flex: 1;
  min-width: 200px;
  padding-bottom: 0.15rem;
}
.profile-hero__name {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.profile-hero__email {
  margin: 0 0 0.65rem;
  font-size: var(--fz-sm);
}
.profile-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.profile-hero__actions {
  margin-left: auto;
  padding-bottom: 0.25rem;
}
.profile-panel__lead {
  margin: -0.25rem 0 1rem;
  font-size: var(--fz-sm);
}

/* —— System marketplace cards —— */
.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.market-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.15s, border-color 0.15s;
}
.market-card:hover {
  border-color: rgba(21, 101, 192, 0.35);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
  transform: translateY(-2px);
}
.market-card__visual {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.market-card__visual--1 {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}
.market-card__visual--2 {
  background: linear-gradient(135deg, #fff8e1 0%, #ffe082 100%);
}
.market-card__visual--3 {
  background: linear-gradient(135deg, #e8f5e9 0%, #a5d6a7 100%);
}
.market-card__visual--4 {
  background: linear-gradient(135deg, #f3e5f5 0%, #ce93d8 100%);
}
.market-card__emoji {
  font-size: 2.25rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}
.market-card__body {
  padding: 0.85rem 1.1rem 0.25rem;
  flex: 1;
}
.market-card__tag {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  margin-bottom: 0.45rem;
}
.market-card__title {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.market-card__desc {
  margin: 0;
  font-size: var(--fz-sm);
  line-height: 1.45;
}
.market-card__footer {
  padding: 0.65rem 1.1rem 1rem;
}
.market-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  justify-content: center;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
  font-size: var(--fz-sm);
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.market-card__cta:hover {
  background: var(--primary-soft);
  border-color: rgba(21, 101, 192, 0.35);
}
.market-card__cta svg {
  width: 16px;
  height: 16px;
}

.theme-atelier .entity-hero {
  border-bottom-color: #e7e5e4;
}
.theme-atelier .entity-hero__title,
.theme-atelier .profile-hero__name,
.theme-atelier .market-card__title {
  font-family: var(--font-display);
}
.theme-atelier .kv-row__field input,
.theme-atelier .kv-row__field textarea {
  background: #fffdfb;
}
.theme-atelier .market-card {
  box-shadow: 0 2px 12px rgba(68, 64, 60, 0.06);
}

