:root {
  --ink: #1f2937;
  --muted: #8b95a7;
  --line: #eef1f5;
  --bg: #f5f7fb;
  --green: #129a72;
  --green-dark: #0e8563;
  --sidebar: #0f1724;
  --side-text: #c5ceda;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
a { color: var(--green); }
h1 { margin: 0; font-size: 1.55rem; font-weight: 700; color: #1c2434; letter-spacing: -0.02em; }
h2 { margin: 0.2rem 0 0; font-size: 0.95rem; font-weight: 700; color: #243044; }
.sub { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.92rem; }

.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px;
  flex: 0 0 248px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.1rem 0.85rem 1rem;
  background: var(--sidebar);
  color: var(--side-text);
}
.logo-plate {
  display: block;
  background: #fff;
  border-radius: 12px;
  padding: 0.55rem 0.55rem 0.25rem;
  margin: 0 0.25rem 1.15rem;
}
.logo-plate img { width: 100%; height: auto; display: block; }
.side-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--side-text);
  text-decoration: none;
  padding: 0.62rem 0.75rem;
  border-radius: 10px;
  margin-bottom: 0.15rem;
  font-size: 0.95rem;
}
.side-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.side-link:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.side-link.active { background: var(--green); color: #fff; }
.side-foot { margin-top: auto; padding: 0.8rem 0.4rem 0; }
.side-user { margin: 0 0 0.35rem 0.35rem; color: #8ea0b8; font-size: 0.82rem; }
.side-logout {
  width: 100%;
  background: transparent;
  color: var(--side-text);
  border: 0;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
}
.side-logout:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }

.content { flex: 1; min-width: 0; background: var(--bg); }
.mobile-bar, .backdrop, .menu-btn { display: none; }
.page { padding: 1.45rem 1.6rem 2.5rem; }
.page.narrow { max-width: 880px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.05rem; }
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.kpi {
  position: relative;
  display: block;
  text-decoration: none;
  background: #fff;
  border-radius: 16px;
  padding: 0.95rem 1rem 0.9rem 1.1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 36, 0.04);
  color: inherit;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent, var(--green));
}
.kpi span { display: block; color: var(--muted); font-size: 0.82rem; }
.kpi strong { display: block; margin-top: 0.2rem; font-size: 1.85rem; letter-spacing: -0.04em; color: #1c2434; line-height: 1; }
.kpi em { display: block; margin-top: 0.4rem; color: #667085; font-style: normal; font-size: 0.78rem; }
.kpi:hover { box-shadow: 0 8px 20px rgba(15, 23, 36, 0.06); }
.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.panel {
  background: #fff;
  border-radius: 16px;
  padding: 1rem 1.1rem 1.1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 36, 0.04);
}
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 0.85rem; }
.panel-head h2 { font-size: 1rem; }
.panel-head p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.8rem; }
.chart-block { margin-bottom: 0.75rem; }
.rings {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}
.ring {
  display: block;
  text-align: center;
  text-decoration: none;
  color: inherit;
  border-radius: 14px;
  padding: 0.35rem 0.2rem 0.55rem;
}
.ring:hover { background: #f7faf8; }
.ring-fig { position: relative; width: 108px; height: 108px; margin: 0 auto 0.35rem; }
.ring-fig svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: #eef2f6; stroke-width: 3.2; }
.ring-value {
  fill: none;
  stroke: var(--c, var(--green));
  stroke-width: 3.2;
  stroke-linecap: round;
}
.ring-fig strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: #1c2434;
}
.ring > span { display: block; font-weight: 700; font-size: 0.88rem; color: #243044; }
.ring > em { display: block; margin-top: 0.15rem; color: var(--muted); font-style: normal; font-size: 0.75rem; }
.request-chart { display: flex; align-items: center; gap: 1rem; min-height: 0; }
.request-fig { width: 132px; height: 132px; flex: 0 0 132px; }
.request-fig strong { font-size: 1.55rem; }
.request-board { margin-bottom: 0.75rem; }
.request-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
}
.request-side { display: grid; gap: 1rem; }
.req-blocks p { margin: 0 0 0.4rem; color: var(--muted); font-size: 0.78rem; }
.req-block {
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  text-decoration: none;
  color: #334155;
  font-size: 0.82rem;
  padding: 0.28rem 0;
}
.req-track {
  display: flex;
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  background: #eef2f6;
}
.req-track i { display: block; height: 100%; }
.req-track i.open { background: #e0a106; }
.req-track i.done { background: #129a72; }
.req-block em { font-style: normal; color: #667085; font-size: 0.78rem; }
.req-list { min-width: 0; }
.req-line {
  display: grid;
  grid-template-columns: 2.6rem 7.4rem minmax(8rem, 11rem) minmax(8rem, 1fr) minmax(0, 1.4fr) 7.2rem;
  gap: 0.55rem;
  align-items: center;
  padding: 0.62rem 0.35rem;
  border-top: 1px solid #f1f4f8;
  text-decoration: none;
  color: inherit;
  font-size: 0.86rem;
}
.req-line:hover { background: #f8faf9; }
.req-line b { color: var(--green); }
.req-place { color: #243044; white-space: nowrap; }
.req-who, .req-text { color: #667085; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-line time { color: #98a2b3; font-size: 0.78rem; text-align: right; }
.req-empty { margin: 0.4rem 0; color: var(--muted); }
.text-link { color: var(--green); text-decoration: none; font-size: 0.88rem; font-weight: 650; }
.text-link:hover { text-decoration: underline; }
.legend { display: grid; gap: 0.55rem; }
.legend a, .legend span {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #334155;
  text-decoration: none;
  font-size: 0.86rem;
}
.legend b { margin-left: auto; font-size: 0.95rem; }
.legend i, .legend.inline i {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 99px;
  flex: 0 0 auto;
}
.legend.inline { display: flex; flex-wrap: wrap; gap: 0.7rem 0.9rem; }
.legend.inline b { margin: 0; }
.chart-scroll { overflow-x: auto; }
.vbars, .covers {
  display: grid;
  grid-template-columns: repeat(14, minmax(28px, 1fr));
  gap: 0.35rem;
  min-width: 560px;
}
.vbar, .cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.vbar-n { height: 1.15rem; font-size: 0.72rem; font-weight: 700; color: #334155; }
.vbar-plot, .cover-plot {
  width: 100%;
  max-width: 46px;
  height: 168px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 10px;
  background: repeating-linear-gradient(to top, transparent 0 41px, #f3f6f9 41px 42px);
}
.vbar-plot i {
  display: block;
  width: 70%;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #5ed4ae 0%, #129a72 100%);
  min-height: 6px;
}
.vbar:hover .vbar-plot i { background: linear-gradient(180deg, #7ae0be, #0e8563); }
.vbar-l { margin-top: 0.4rem; font-size: 0.75rem; font-weight: 700; color: #8b95a7; }
.cover-plot { gap: 3px; align-items: flex-end; padding: 0 2px; }
.cover-plot i { display: block; flex: 1; border-radius: 4px 4px 2px 2px; }
.cover:hover .cover-plot i { filter: brightness(1.08); }
.table-title { margin: 0.35rem 0 0.55rem; }
.dash-table td { white-space: nowrap; }
.bar {
  height: 6px;
  background: #eef2f6;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 0.3rem;
  min-width: 88px;
}
.bar span { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.bar span.pass { background: #e0a106; }
@media (max-width: 1100px) {
  .kpi-row, .rings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-grid, .request-layout { grid-template-columns: 1fr; }
  .request-chart { justify-content: flex-start; }
  .req-list { overflow-x: auto; }
  .req-line { min-width: 760px; }
}
.crumb { margin: 0 0 0.45rem; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--green); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.7rem;
}
.search { flex: 1 1 220px; min-width: 180px; }
.toolbar button { flex: 0 0 auto; }
.toolbar input, .toolbar select {
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 10px;
  padding: 0.62rem 0.8rem;
  color: #334155;
  box-shadow: 0 1px 2px rgba(15, 23, 36, 0.03);
}
.toolbar select { min-width: 132px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(18, 154, 114, 0.18); border-color: #b7e2d4; }

button, .button {
  font: inherit;
  background: var(--green);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 0.62rem 0.95rem;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 650;
}
button:hover, .button:hover { background: var(--green-dark); }
.button.ghost, button.ghost, button.danger {
  background: #fff;
  color: #334155;
  border: 1px solid #e6ebf2;
}
button.danger { color: #b42318; }

#results.is-loading { opacity: 0.45; }
.meta { margin: 0 0 0.65rem; color: var(--muted); font-size: 0.86rem; }
.meta a { color: var(--muted); }

.table-wrap {
  background: #fff;
  border-radius: 14px;
  overflow: auto;
  box-shadow: 0 1px 2px rgba(15, 23, 36, 0.04);
}
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td {
  text-align: left;
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid #f1f4f8;
  vertical-align: middle;
  font-size: 0.92rem;
}
th {
  color: #98a2b3;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: #fff;
  white-space: nowrap;
}
th a.sort,
th button.sort {
  color: #667085;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}
th a.sort:hover,
th button.sort:hover,
th.sorted a.sort,
th.sorted button.sort { color: #0f1724; }
th a.sort .mark,
th button.sort .mark { color: #129a72; font-size: 0.72rem; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #fbfcfd; }
tbody tr:last-child td { border-bottom: 0; }
tr.muted td { color: #a0a8b5; }
tr.empty { cursor: default; }
td.num, th.num { width: 3rem; color: #98a2b3; }
.name { color: var(--green); font-weight: 600; text-decoration: none; }
.name:hover { text-decoration: underline; }
.badge { margin-left: 0.4rem; color: #b42318; font-size: 0.75rem; }
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 650;
  background: #eef2f6;
  color: #334155;
}
.pill.open { background: #fff6e5; color: #9a6700; }
.pill.done { background: #e7f6f1; color: #0f7a56; }
.pill.file { margin-left: 0.35rem; }
.req-row.is-open td:first-child { box-shadow: inset 3px 0 0 #e0a100; }
.req-row.is-done td:first-child { box-shadow: inset 3px 0 0 #129a72; }
.req-name { font-weight: 600; color: #1c2434; }
.req-preview { display: flex; align-items: center; gap: 0.65rem; max-width: 420px; }
.req-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}
.req-thumb {
  width: 52px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 52px;
  background: #e8edf3;
}
.req-when { white-space: nowrap; color: #667085; font-size: 0.84rem; }
.req-card { border-left: 3px solid #e0a100; }
.req-card.is-done { border-left-color: #129a72; }
.req-card-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.req-card-text { margin-top: 0.4rem; color: #334155; font-size: 0.92rem; }

.order-page { max-width: none; }
.order {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 36, 0.04);
}
.order-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.05rem 1.2rem 1rem;
  color: #fff;
}
.order.is-open .order-bar { background: #c9841a; }
.order.is-done .order-bar { background: #0f7a56; }
.order-kicker { margin: 0; font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.9; }
.order-bar h1 { margin: 0.05rem 0 0; color: #fff; font-size: 2rem; line-height: 1; }
.order-when { margin: 0.35rem 0 0; font-size: 0.86rem; opacity: 0.88; }
.order-bar form { margin: 0; }
.order-bar button { background: #fff; color: #1c2434; }
.order-bar button:hover { background: #f4f6f8; }
.order-bar button.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.55); }
.order-bar button.ghost:hover { background: rgba(255, 255, 255, 0.12); }
.order-facts { display: grid; grid-template-columns: 0.7fr 0.9fr 1.6fr; }
.order-facts a {
  display: grid;
  gap: 0.15rem;
  padding: 0.85rem 1.1rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.order-facts a:last-child { border-right: 0; }
.order-facts a:hover { background: #f6fbf9; }
.order-facts span { color: var(--muted); font-size: 0.75rem; }
.order-facts strong { font-size: 1.02rem; color: #1c2434; }
.order-body {
  margin: 0;
  padding: 1.15rem 1.25rem 1.25rem;
  white-space: pre-wrap;
  font-size: 1.2rem;
  line-height: 1.45;
  color: #1c2434;
}
.order-body.is-empty { color: var(--muted); font-size: 1rem; }
.film {
  display: flex;
  gap: 0.6rem;
  padding: 0 1.15rem 1.15rem;
  overflow-x: auto;
}
.shot {
  flex: 1 1 280px;
  width: auto;
  min-width: 220px;
  height: 280px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #101820;
  cursor: zoom-in;
}
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.clip { flex: 1 1 240px; display: grid; gap: 0.35rem; color: #667085; font-size: 0.82rem; align-content: end; }
.clip video { width: 220px; height: 148px; border-radius: 12px; background: #101820; object-fit: cover; }
.clip audio { width: 240px; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(8, 12, 20, 0.88);
  display: grid;
  place-items: center;
  padding: 2rem;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1100px, 100%); max-height: 88vh; border-radius: 12px; }
.lightbox-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  background: #fff;
  color: #1c2434;
  font-size: 1.4rem;
  line-height: 1;
}
.phone { display: block; color: #475569; white-space: nowrap; }
.dash, td { color: #475569; }
.role-form { margin-top: 0.55rem; }
.role-form select { width: 100%; }
td form select { min-width: 9rem; }
.cards { display: none; }

.pager { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.9rem; }
.pager a, .pager .current {
  min-width: 2.1rem;
  text-align: center;
  text-decoration: none;
  background: #fff;
  color: #334155;
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  border: 1px solid #e6ebf2;
}
.pager .current { background: var(--green); color: #fff; border-color: var(--green); }

.card {
  background: #fff;
  border-radius: 14px;
  padding: 1.15rem;
  box-shadow: 0 1px 2px rgba(15, 23, 36, 0.04);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem 1rem; }
.form-grid label, .login-card label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 600;
}
label.wide, .actions.wide, h2.wide { grid-column: 1 / -1; }
input, select, textarea {
  font: inherit;
  border: 1px solid #e6ebf2;
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  background: #fff;
  color: var(--ink);
}
textarea { resize: vertical; min-height: 90px; }
.actions { display: flex; gap: 0.55rem; }
.pick-form { display: flex; flex-direction: column; gap: 0.85rem; }
.pick-fields { display: grid; grid-template-columns: 150px 120px 1fr; gap: 0.7rem; }
.pick-fields label, .pick-body, .pick-date {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 600;
}
.pick-list { display: flex; flex-direction: column; gap: 0.4rem; }
.pick-list p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.pick-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  text-align: left;
  background: #f8fafc;
  color: var(--ink);
  border: 1px solid #e6ebf2;
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
}
.pick-item:hover { background: #f3fbf7; border-color: #b7e2d4; }
.pick-item strong { font-size: 0.95rem; }
.pick-item span, .pick-chosen span { color: #64748b; font-size: 0.86rem; font-weight: 550; }
.pick-chosen {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  background: #f3fbf7;
  border: 1px solid #b7e2d4;
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
}
.pick-chosen strong, .pick-chosen span { display: block; }
.pick-date { max-width: 220px; }
.pick-form > button { align-self: flex-start; }
button:disabled, button:disabled:hover { opacity: 0.45; cursor: default; background: var(--green); }
.alert { padding: 0.7rem 0.8rem; border-radius: 10px; margin: 0 0 0.8rem; background: #fff; }
.alert.ok { color: var(--green-dark); }
.alert.err { color: #b42318; background: #fef3f2; }
.side-note { margin-top: 1rem; color: var(--muted); font-size: 0.9rem; }
.side-note p { margin: 0.25rem 0; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--bg);
}
.login-card { width: min(400px, 100%); }
.login-logo { width: min(260px, 100%); height: auto; }
.login-card h1 { margin: 0.2rem 0 1rem; }
.login-card button { width: 100%; margin-top: 0.4rem; }

@media (max-width: 980px) {
  .toolbar { display: grid; grid-template-columns: 1fr 1fr; }
  .search { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .menu-btn, .mobile-bar { display: flex; }
  .mobile-bar {
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.9rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 6;
  }
  .mobile-bar img { height: 34px; width: auto; }
  .menu-btn { background: var(--sidebar); }
  .sidebar {
    position: fixed;
    z-index: 30;
    transform: translateX(-110%);
    transition: transform 0.16s ease;
  }
  body.nav-open .sidebar { transform: none; }
  .backdrop { position: fixed; inset: 0; background: rgba(8, 12, 20, 0.45); z-index: 25; }
  body.nav-open .backdrop { display: block; }
  .form-grid, .toolbar { grid-template-columns: 1fr; }
  .pick-fields { grid-template-columns: 1fr 1fr; }
  .pick-fields .grow { grid-column: 1 / -1; }
  .page { padding: 1rem; }
  .order-bar { align-items: flex-start; flex-direction: column; }
  .order-facts { grid-template-columns: 1fr 1fr; }
  .order-facts a:last-child { grid-column: 1 / -1; border-right: 0; }
  .table-wrap { display: none; }
  .cards { display: grid; gap: 0.55rem; }
  .person { display: block; text-decoration: none; background: #fff; border-radius: 12px; padding: 0.85rem; }
  .person-name { color: var(--green); font-weight: 700; }
  .person-meta { color: var(--muted); margin-top: 0.25rem; font-size: 0.88rem; }
}
