:root {
  color-scheme: dark;
  --bg: #10131d;
  --panel: #191e2c;
  --line: #2b3244;
  --text: #eff1f7;
  --muted: #9da8bf;
  --gold: #efc368;
  --pink: #eb8db8;
  --green: #80d8b1;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    15px/1.6 system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
.button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: #252d40;
  color: var(--text);
  border-radius: 9px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
button:hover,
.button:hover {
  border-color: var(--gold);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.primary {
  background: var(--gold);
  color: #251c0b;
  border-color: var(--gold);
  font-weight: 700;
}
.danger {
  color: #ffb3bb;
  border-color: #794350;
  background: #38212b;
}
.sidebar {
  width: 248px;
  position: fixed;
  inset: 0 auto 0 0;
  border-right: 1px solid var(--line);
  padding: 27px 19px;
  background: #141823;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.6px;
}
.brand img {
  width: 54px;
  height: 54px;
}
.brand small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
}
.nav-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: #6d7890;
  margin: 40px 12px 13px;
}
nav a {
  display: block;
  padding: 11px 14px;
  border-radius: 9px;
  margin: 5px 0;
  color: var(--muted);
}
nav a:hover,
nav a.active {
  background: #2d2b27;
  color: var(--gold);
}
.sidebar-footer {
  position: absolute;
  bottom: 25px;
  font-size: 12px;
  color: var(--muted);
}
.sidebar-footer small {
  font-size: 10px;
}
.dot {
  display: inline-block;
  background: var(--green);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
}
.workspace {
  margin-left: 248px;
}
.topbar {
  height: 78px;
  border-bottom: 1px solid var(--line);
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
#account {
  display: flex;
  align-items: center;
  gap: 10px;
}
main {
  max-width: 1500px;
  padding: 36px 40px;
  margin: auto;
}
h1 {
  font-size: 30px;
  letter-spacing: -1px;
  margin: 0 0 8px;
}
h2 {
  font-size: 18px;
  margin: 0 0 17px;
}
h3 {
  font-size: 15px;
}
p {
  margin: 0 0 15px;
}
.muted,
small {
  color: var(--muted);
}
.eyebrow {
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}
.card,
.section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 23px;
}
.card .number {
  font-size: 32px;
  font-weight: 750;
  margin: 9px 0;
}
.card .label {
  color: var(--muted);
  font-size: 12px;
}
.card .hint {
  font-size: 11px;
  color: var(--green);
}
.section {
  margin-bottom: 22px;
}
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}
input,
textarea,
select {
  background: #111724;
  border: 1px solid #343e55;
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  min-width: 0;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #efc36866;
  border-color: var(--gold);
}
textarea {
  width: 100%;
  min-height: 130px;
  resize: vertical;
}
label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin: 12px 0 6px;
}
label input,
label select {
  margin-top: 5px;
  display: block;
  width: 100%;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
th {
  font-weight: 500;
  color: var(--muted);
  font-size: 11px;
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 16px 10px;
  border-bottom: 1px solid #252c3d;
  vertical-align: top;
}
tbody tr:hover {
  background: #202738;
}
td a {
  color: var(--gold);
}
.badge {
  display: inline-block;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  background: #293446;
  color: #b9cbe6;
  white-space: nowrap;
}
.badge.closed,
.badge.completed {
  color: #91dfb9;
  background: #1e3931;
}
.badge.waiting_user {
  color: #d1b4fb;
  background: #342746;
}
.badge.urgent {
  color: #ffabb8;
  background: #452735;
}
.empty {
  padding: 50px;
  text-align: center;
  color: var(--muted);
}
.grid2 {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 22px;
}
.entry {
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
  overflow-wrap: anywhere;
}
.entry pre,
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
}
.entry .who {
  font-size: 12px;
  color: var(--gold);
}
.note {
  border-left: 3px solid var(--pink);
  padding-left: 14px;
}
.json {
  font-family: ui-monospace, monospace;
  min-height: 480px;
  font-size: 13px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}
.form-grid .wide {
  grid-column: 1/-1;
}
.hero {
  padding: 55px 42px;
  background: linear-gradient(120deg, #252638, #1a2131);
  border: 1px solid #42404b;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
}
.hero img {
  width: 165px;
  float: right;
  margin-left: 30px;
}
.hero p {
  max-width: 530px;
}
.hero h1 {
  font-size: 36px;
  margin: 10px 0 20px;
}
.type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 24px;
}
.type-card {
  text-align: left;
  display: block;
  background: var(--panel);
  padding: 22px;
  border-radius: 12px;
}
.type-card strong {
  display: block;
  margin-top: 8px;
}
.type-card small {
  font-size: 11px;
}
.loading {
  padding: 70px;
  color: var(--muted);
  text-align: center;
}
footer {
  padding: 20px 40px;
  color: #748099;
  font-size: 11px;
}
dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 15px;
  width: min(720px, 92vw);
  max-height: 90vh;
  padding: 28px;
}
dialog::backdrop {
  background: #080b13c9;
}
.dialog-x {
  float: right;
  border: 0;
  font-size: 22px;
  background: none;
  padding: 0 4px;
}
#toast {
  position: fixed;
  right: 26px;
  bottom: 25px;
  background: #2e3e35;
  border: 1px solid #547660;
  color: #e7ffef;
  padding: 14px 22px;
  border-radius: 10px;
  max-width: 460px;
  display: none;
  z-index: 100;
}
.error {
  color: #ffb2bd;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.check input {
  width: auto;
}
.bar {
  height: 7px;
  background: #2a3244;
  border-radius: 7px;
  margin: 8px 0 15px;
  overflow: hidden;
}
progress.bar {
  display: block;
  width: 100%;
  appearance: none;
  border: 0;
}
progress.bar::-webkit-progress-bar {
  background: #2a3244;
}
progress.bar::-webkit-progress-value {
  background: var(--gold);
}
progress.bar::-moz-progress-bar {
  background: var(--gold);
}
.home-cards {
  margin-top: 24px;
}
.full-width {
  width: 100%;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
@media (max-width: 1050px) {
  .sidebar {
    width: 190px;
  }
  .workspace {
    margin-left: 190px;
  }
  .brand {
    font-size: 12px;
  }
  .brand img {
    width: 40px;
    height: 40px;
  }
  main {
    padding: 25px;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .type-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 680px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 15px;
  }
  .sidebar-footer,
  .nav-label {
    display: none;
  }
  nav {
    display: flex;
    overflow-x: auto;
  }
  nav a {
    white-space: nowrap;
    font-size: 12px;
    padding: 8px;
  }
  .workspace {
    margin-left: 0;
  }
  .topbar {
    height: 60px;
    padding: 0 20px;
  }
  .topbar > span {
    display: none;
  }
  main {
    padding: 20px;
  }
  .heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .cards {
    gap: 10px;
  }
  .card {
    padding: 16px;
  }
  .hero {
    padding: 25px;
  }
  .hero img {
    width: 85px;
  }
  .hero h1 {
    font-size: 27px;
  }
  .type-grid {
    grid-template-columns: 1fr 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .wide {
    grid-column: auto;
  }
  h1 {
    font-size: 26px;
  }
}
.offline-logo { width: 116px; height: 116px; object-fit: contain; float: right; margin: 0 0 18px 24px; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
