:root {
  --ink: #101828;
  --muted: #667085;
  --surface: #ffffff;
  --soft: #f6f8fb;
  --line: #d9e1ec;
  --navy: #111827;
  --teal: #08786f;
  --gold: #f4c95d;
  --coral: #ff685d;
  --blue: #4f7cff;
  --radius: 8px;
  --shadow: 0 20px 50px rgba(16, 24, 40, 0.1);
}

* {
  box-sizing: border-box;
}

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

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

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  color: #d9e1ec;
  background: var(--navy);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
  color: #ffffff;
  font-weight: 900;
}

.app-brand span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  color: var(--navy);
  background: var(--gold);
}

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

.app-sidebar nav a {
  border-radius: var(--radius);
  padding: 12px 14px;
  color: #d9e1ec;
  font-weight: 800;
}

.app-sidebar nav a.active,
.app-sidebar nav a:hover {
  color: var(--navy);
  background: var(--gold);
}

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

.app-topbar,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.app-topbar {
  margin-bottom: 24px;
}

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

.eyebrow {
  display: inline-flex;
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 16px;
  font-weight: 900;
  cursor: pointer;
}

.btn-primary {
  color: #071917;
  background: var(--gold);
}

.btn-secondary {
  color: #ffffff;
  background: var(--teal);
}

.btn-light {
  color: var(--ink);
  background: #ffffff;
  border-color: var(--line);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric-card,
.panel-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 20px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.metric-card strong {
  display: block;
  margin: 8px 0;
  font-size: clamp(1.7rem, 4vw, 2.45rem);
  line-height: 1;
}

.metric-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) 1.18fr;
  gap: 18px;
  align-items: start;
}

.workspace-grid > *,
.panel-card,
.table-wrap {
  min-width: 0;
}

.panel-card {
  padding: 22px;
  margin-bottom: 18px;
}

.panel-heading {
  margin-bottom: 18px;
}

.status-pill,
.order-status,
.user-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  color: #07504a;
  background: #dff7f3;
  font-size: 0.82rem;
  font-weight: 900;
}

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

.order-form label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 0.92rem;
  font-weight: 900;
}

.full-field {
  grid-column: 1 / -1;
}

.order-form input,
.order-form select,
.order-form textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #ffffff;
  padding: 0 12px;
}

.order-form textarea {
  min-height: 110px;
  padding-top: 12px;
  resize: vertical;
}

.order-form input:focus,
.order-form select:focus,
.order-form textarea:focus {
  outline: 3px solid rgba(8, 120, 111, 0.14);
  border-color: var(--teal);
}

.form-message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--teal);
  font-weight: 900;
}

.form-message.error {
  color: #c24135;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #ffffff;
}

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

th {
  color: #344054;
  background: var(--soft);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

td strong {
  color: var(--ink);
}

.link-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 0 8px;
}

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

  .app-sidebar {
    position: static;
    height: auto;
  }

  .app-sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .app-main,
  .app-sidebar {
    padding: 18px;
  }

  .app-topbar,
  .panel-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions,
  .btn {
    width: 100%;
  }

  .app-sidebar nav,
  .order-form {
    grid-template-columns: 1fr;
  }

  .panel-card,
  .metric-card {
    padding: 16px;
  }
}
