:root {
  --color-primary: #183b5b;
  --color-primary-strong: #0f2940;
  --color-accent: #c9a84c;
  --color-surface: #ffffff;
  --color-page: #f5f7fa;
  --color-border: #e5e7eb;
  --text-primary: #1f2933;
  --text-secondary: #667085;
  --radius-sm: 6px;
  --radius-md: 8px;
}

body {
  margin: 0;
  background: #f5f7fa;
  color: #1f2933;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei",
    sans-serif;
}

* {
  box-sizing: border-box;
}

#root {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}

.sidebar {
  padding: 24px;
  background: #1a3a5c;
  color: #fff;
}

.sidebar strong {
  display: block;
  margin-bottom: 28px;
  font-size: 22px;
}

.sidebar a {
  display: block;
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.sidebar a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.workspace__header,
.panel-heading,
.account-panel,
.toolbar,
.inline-form,
.progress-form {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.workspace__header,
.panel-heading,
.account-panel {
  justify-content: space-between;
}

.workspace__header {
  align-items: end;
  margin-bottom: 20px;
}

.workspace__header p,
.panel p {
  max-width: 520px;
  color: #667085;
  line-height: 1.7;
}

.workspace__header h1,
.panel h2 {
  margin: 12px 0;
  color: #1a3a5c;
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(201, 168, 76, 0.16);
  color: #8a6d1d;
  font-size: 13px;
  font-weight: 700;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.stats article,
.panel,
.notice {
  padding: 20px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.stats span {
  display: block;
  color: #667085;
}

.stats strong {
  display: block;
  margin-top: 8px;
  color: #1a3a5c;
  font-size: 28px;
}

.panel {
  margin-top: 16px;
}

.materials {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.requirement-box {
  margin: 12px 0 16px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.requirement-box ul {
  margin: 8px 0 0;
  padding-left: 20px;
  color: #475467;
  line-height: 1.7;
}

.requirement-group strong {
  display: block;
  margin: 8px 0;
  color: #1a3a5c;
}

.requirement-group + .requirement-group {
  margin-top: 12px;
}

.materials h3 {
  margin: 0 0 12px;
  color: #1a3a5c;
}

.notice {
  margin-bottom: 16px;
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.notice--error {
  border-color: #fecaca;
  background: #fff7f7;
  color: #991b1b;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}

th {
  color: #667085;
}

tr.is-selected {
  background: #f8fafc;
}

button,
input,
select {
  border-radius: 6px;
  font: inherit;
}

button {
  border: 0;
  padding: 10px 16px;
  background: #1a3a5c;
  color: #fff;
  cursor: pointer;
}

button:hover {
  background: #244d77;
}

.link-button {
  padding: 0;
  background: transparent;
  color: #1a3a5c;
  font-weight: 700;
}

input,
select {
  min-width: 180px;
  border: 1px solid #d0d5dd;
  padding: 10px 12px;
  color: #1f2933;
  background: #fff;
}

label {
  color: #667085;
}

.settings-form {
  display: grid;
  gap: 18px;
}

.settings-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #f8fafc;
}

.settings-group strong {
  grid-column: 1 / -1;
  color: var(--color-primary);
}

.settings-options {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

@media (max-width: 860px) {
  #root {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .workspace {
    padding: 20px;
  }

  .workspace__header,
  .panel-heading,
  .account-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  input,
  select,
  button {
    width: 100%;
  }
}

/* Unified operations console surface overrides */
body { background: var(--color-page); color: var(--text-primary); }
.sidebar { position: sticky; top: 0; height: 100vh; background: linear-gradient(180deg, var(--color-primary-strong), var(--color-primary)); }
.workspace { max-width: 1440px; padding: 32px clamp(20px, 4vw, 56px); }
.stats article, .panel, .notice { box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05); }
.panel:hover { border-color: #cbd9e5; }
button { transition: background 160ms ease, transform 160ms ease; }
button:hover { transform: translateY(-1px); }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(201, 168, 76, 0.35); outline-offset: 2px; }
@media (max-width: 860px) { .sidebar { position: static; height: auto; } }
.row-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.row-actions button { white-space: nowrap; }
td input[data-field], td textarea[data-field] { width: 100%; min-width: 120px; box-sizing: border-box; }
td textarea[data-field="requirements"] { min-width: 220px; line-height: 1.45; }
.service-create-form { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 10px; margin: 18px 0 22px; padding: 16px; border: 1px solid #d9e3ea; background: #f7fafb; }
.service-create-form strong { grid-column: 1 / -1; color: var(--color-primary-strong); }
.service-create-form textarea { min-height: 42px; }
.service-create-form button { justify-self: start; }
@media (max-width: 900px) { .service-create-form { grid-template-columns: repeat(2, minmax(140px, 1fr)); } }
@media (max-width: 600px) { .service-create-form { grid-template-columns: 1fr; } }
