:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI Variable Text", "Segoe UI", sans-serif;
  background: #080808;
  color: #fafafa;
  font-synthesis: none;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: #080808;
}

button, input, a { font: inherit; }

button, .button {
  min-height: 36px;
  border: 1px solid #343434;
  border-radius: 6px;
  background: #242424;
  color: #fafafa;
  padding: 0 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.link { text-decoration: none; display: inline-flex; align-items: center; }

button:hover, .button:hover { background: #2e2e2e; }
button:active, .button:active { background: #202020; }
button:disabled { cursor: not-allowed; opacity: 0.45; }

:focus-visible {
  outline: 2px solid #7698fd;
  outline-offset: 2px;
}

.quiet {
  min-height: 32px;
  border-color: transparent;
  background: transparent;
  color: #aeaeae;
  padding: 0 10px;
  font-weight: 500;
}

.login {
  min-height: 100vh;
  width: min(100% - 40px, 360px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 14px;
}

.login h1 {
  margin: 20px 0 0;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.login > p {
  margin: 7px 0 28px;
  color: #808080;
  font-size: 13px;
}

form { width: 100%; }

label {
  display: block;
  margin-bottom: 8px;
  color: #aeaeae;
  font-size: 12px;
}

input {
  width: 100%;
  height: 42px;
  border: 1px solid #343434;
  border-radius: 7px;
  background: #161616;
  color: #fafafa;
  padding: 0 12px;
}

form button { width: 100%; margin-top: 12px; height: 42px; }

output {
  display: block;
  min-height: 18px;
  margin-top: 12px;
  color: #aeaeae;
  font-size: 12px;
  text-align: center;
}

.dashboard {
  width: min(100% - 48px, 1080px);
  margin: 0 auto;
  padding-bottom: 56px;
}

header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #242424;
}

.brand { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.brand img { width: 24px; height: 24px; border-radius: 6px; }

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 48px 0 28px;
}

h1, h2, p { margin: 0; }
.page-heading h1 { font-size: 25px; letter-spacing: -0.025em; }
.page-heading p { margin-top: 8px; color: #808080; font-size: 13px; }
.heading-actions { display: flex; align-items: center; gap: 8px; }

.panel {
  border: 1px solid #2e2e2e;
  border-radius: 10px;
  background: #161616;
  overflow: hidden;
}

.panel-heading {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid #292929;
}

.panel-heading h2 { font-size: 13px; font-weight: 650; }
.panel-heading span { color: #808080; font-size: 11px; }

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.row {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid #242424;
}

.row:last-child { border-bottom: 0; }
.row strong { display: block; font-size: 12px; font-weight: 600; }
.row small { display: block; margin-top: 5px; color: #808080; font-size: 11px; }
.row-actions { display: flex; gap: 6px; }
.row-actions button { min-height: 30px; padding: 0 10px; font-size: 11px; }

.empty { padding: 24px 16px; color: #808080; font-size: 12px; }

.download-panel {
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px;
}

.download-product { display: flex; align-items: center; gap: 14px; }
.download-product img { width: 52px; height: 52px; border-radius: 11px; }
.download-product h2 { font-size: 14px; }
.download-product p { margin-top: 6px; color: #808080; font-size: 11px; }

.chat-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 16px;
  height: calc(100vh - 96px);
  padding: 16px 0;
}

.chat-sessions, .chat-thread { min-height: 0; }
.chat-sessions .rows { max-height: calc(100% - 50px); overflow: auto; }
.chat-session { width: 100%; min-height: 54px; border: 0; border-radius: 0; justify-content: flex-start; text-align: left; background: transparent; color: #aeaeae; }
.chat-session:hover { background: #242424; color: #fafafa; }
.chat-thread { display: grid; grid-template-rows: 50px 1fr auto; }
.chat-messages { min-height: 0; overflow: auto; padding: 20px; }
.message { max-width: 76%; margin-bottom: 14px; padding: 10px 12px; border-radius: 8px; background: #242424; color: #e8e8e8; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.message.remote { margin-left: auto; background: #2e2e2e; }
.message small { display: block; margin-top: 6px; color: #808080; font-size: 10px; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px; border-top: 1px solid #292929; }
.chat-form textarea { min-height: 44px; max-height: 120px; resize: vertical; border: 1px solid #343434; border-radius: 7px; background: #1c1c1c; color: #fafafa; padding: 11px 12px; }
.chat-form button { width: auto; margin: 0; height: 44px; }

.calendar-toolbar { height: 76px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.calendar-toolbar h1 { font-size: 18px; }
.calendar-toolbar > button { justify-self: end; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-weekdays { color: #808080; font-size: 10px; text-align: right; }
.calendar-weekdays span { padding: 8px; }
.calendar-grid { border-left: 1px solid #292929; border-top: 1px solid #292929; }
.calendar-day { min-height: 112px; padding: 8px; border-right: 1px solid #292929; border-bottom: 1px solid #292929; background: #101010; }
.calendar-day.outside { background: #0b0b0b; color: #606060; }
.calendar-day.today { box-shadow: inset 0 2px #aeaeae; }
.day-number { display: block; text-align: right; color: #aeaeae; font-size: 11px; }
.calendar-event { width: 100%; min-height: 26px; margin-top: 5px; padding: 4px 6px; border: 0; border-radius: 5px; background: #242424; justify-content: flex-start; overflow: hidden; color: #e8e8e8; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
dialog { width: min(420px, calc(100% - 32px)); border: 1px solid #343434; border-radius: 10px; background: #161616; color: #fafafa; padding: 0; }
dialog::backdrop { background: rgba(0, 0, 0, 0.72); }
dialog form { padding: 22px; }
dialog h2 { margin-bottom: 20px; font-size: 16px; }
dialog label { margin-top: 14px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; }
.checkbox-label input { width: 16px; height: 16px; }
dialog select { width: 100%; height: 38px; border: 1px solid #343434; border-radius: 6px; background: #1c1c1c; color: #fafafa; padding: 0 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

@media (max-width: 720px) {
  .dashboard { width: min(100% - 28px, 1080px); }
  .page-heading { align-items: flex-start; flex-direction: column; padding-top: 32px; }
  .columns { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-sessions { max-height: 220px; }
  .chat-thread { min-height: 560px; }
}
