:root {
  color-scheme: dark;
  --bg: #05080d;
  --panel: rgba(16, 24, 34, 0.72);
  --panel-strong: rgba(24, 34, 48, 0.88);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #f4f7fb;
  --muted: #9ea9b9;
  --dim: #687486;
  --orange: #e97822;
  --orange-2: #ff9b3f;
  --silver: #d9dee8;
  --steel: #9aa8b8;
  --green: #35d07f;
  --red: #ff6464;
  --shadow: rgba(0, 0, 0, 0.38);
  --sidebar-width: 274px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(4, 8, 15, 0.74), rgba(4, 8, 15, 0.96)),
    url("./assets/background-dark.png") center/cover fixed no-repeat,
    var(--bg);
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.mobile-only {
  display: none;
}

.app-shell {
  min-height: 100vh;
  padding:
    max(18px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
}

.login-wrap {
  min-height: calc(100vh - 36px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(440px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(24, 32, 43, 0.88), rgba(12, 18, 27, 0.74));
  box-shadow: 0 28px 80px var(--shadow);
  backdrop-filter: blur(24px);
}

.brand {
  display: grid;
  gap: 8px;
  justify-items: center;
  margin-bottom: 18px;
  text-align: center;
}

.brand img {
  width: min(220px, 74%);
  border-radius: 8px;
}

.version {
  color: var(--orange-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.tab {
  border: 0;
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.tab.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(233, 120, 34, 0.95), rgba(255, 155, 63, 0.82));
}

.form {
  display: grid;
  gap: 10px;
}

.setup-form {
  margin-top: 14px;
}

.setup-panel .tile {
  min-height: 104px;
}

.setup-status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 13px;
  font-weight: 700;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--orange);
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.36);
  outline: none;
}

.input,
.select {
  min-height: 44px;
  padding: 0 12px;
}

.textarea {
  min-height: 112px;
  padding: 12px;
  resize: vertical;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: rgba(255, 155, 63, 0.84);
  box-shadow: 0 0 0 3px rgba(233, 120, 34, 0.20);
}

.primary,
.secondary,
.ghost,
.danger {
  min-height: 42px;
  border-radius: 12px;
  padding: 0 14px;
  font-weight: 850;
}

.primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  box-shadow: 0 10px 26px rgba(233, 120, 34, 0.22);
}

.secondary {
  border: 1px solid rgba(255, 155, 63, 0.38);
  color: #ffd1ab;
  background: rgba(233, 120, 34, 0.12);
}

.ghost {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.danger {
  border: 1px solid rgba(255, 100, 100, 0.42);
  color: #ffd5d5;
  background: rgba(255, 100, 100, 0.12);
}

.notice {
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  white-space: pre-wrap;
}

.notice.good { color: #b8ffd8; border-color: rgba(53, 208, 127, 0.34); }
.notice.warn { color: #ffd2a9; border-color: rgba(255, 155, 63, 0.38); }
.notice.bad { color: #ffd2d2; border-color: rgba(255, 100, 100, 0.40); }

.login-trace {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 155, 63, 0.22);
  border-radius: 12px;
  color: #ffd2a9;
  background: rgba(233, 120, 34, 0.07);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.desktop {
  min-height: calc(100vh - 36px);
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 18px;
  max-width: 1760px;
  margin: 0 auto;
}

.sidebar,
.top-card,
.panel,
.tile,
.quick-card,
.modal-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(24, 32, 43, 0.74), rgba(12, 18, 27, 0.70));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(22px);
}

.sidebar {
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  overflow: auto;
  border-radius: 22px;
  padding: 18px;
}

.side-brand {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.side-brand img {
  width: 150px;
  border-radius: 8px;
}

.side-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-weight: 800;
}

.nav-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--orange-2);
  background: rgba(233, 120, 34, 0.10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.nav-copy strong,
.nav-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-copy small {
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
}

.nav-state {
  color: var(--dim);
  font-size: 11px;
  font-weight: 900;
}

.nav button.active {
  color: #fff;
  background: rgba(233, 120, 34, 0.26);
  box-shadow: inset 0 0 0 1px rgba(255, 155, 63, 0.28);
}

.nav button.locked {
  color: var(--dim);
}

.side-footer {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}

.content {
  min-width: 0;
  display: grid;
  gap: 18px;
  align-content: start;
}

.top-card {
  border-radius: 22px;
  padding: 22px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.top-card h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.05;
}

.accent {
  color: var(--orange-2);
}

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

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
  font-weight: 800;
}

.pill.good { color: #b7ffd6; border-color: rgba(53, 208, 127, 0.32); background: rgba(53, 208, 127, 0.10); }
.pill.warn { color: #ffd1a2; border-color: rgba(255, 155, 63, 0.35); background: rgba(233, 120, 34, 0.10); }
.pill.bad { color: #ffd0d0; border-color: rgba(255, 100, 100, 0.35); background: rgba(255, 100, 100, 0.10); }

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.compact-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.tile {
  min-height: 132px;
  border-radius: 18px;
  padding: 18px;
}

.tile small,
.quick-card small {
  color: var(--muted);
  font-weight: 700;
}

.tile strong {
  display: block;
  margin-top: 16px;
  font-size: 30px;
}

.panel {
  border-radius: 20px;
  padding: 18px;
}

.panel-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel h2 {
  margin: 0;
  font-size: 22px;
}

.two {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.quick-card {
  min-height: 120px;
  border-radius: 16px;
  padding: 14px;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.quick-card:hover,
.tile:hover,
.panel:hover {
  border-color: rgba(255, 155, 63, 0.22);
}

.quick-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 76px rgba(0, 0, 0, 0.34), 0 0 26px rgba(233, 120, 34, 0.10);
}

.quick-card strong {
  display: block;
  margin: 14px 0 6px;
}

.list {
  display: grid;
  gap: 8px;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.row-title {
  font-weight: 850;
}

.row-meta {
  color: var(--muted);
  font-size: 13px;
}

.row-note {
  margin-top: 8px;
  color: var(--silver);
  font-size: 13px;
  line-height: 1.45;
}

.feedback-layout {
  align-items: start;
}

.feedback-thread-list {
  display: grid;
  gap: 12px;
}

.feedback-thread {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.feedback-thread-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.feedback-thread-head h3 {
  margin: 0;
}

.feedback-messages {
  display: grid;
  gap: 8px;
}

.feedback-message {
  max-width: min(680px, 92%);
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  background: rgba(255, 149, 45, 0.13);
}

.feedback-message.nexus {
  justify-self: end;
  background: rgba(44, 179, 255, 0.13);
}

.feedback-message-meta {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.feedback-reply-form {
  margin-top: 4px;
}

.work-row {
  align-items: start;
}

.module-list {
  display: grid;
  gap: 8px;
}

.module-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.ios-settings-shell {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  align-items: start;
}

.ios-settings-grid {
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
}

.favorite-list {
  margin-top: 12px;
}

.switch-row input {
  appearance: none;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.16);
  position: relative;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.24);
}

.switch-row input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.34);
  transition: transform 0.18s ease;
}

.switch-row input:checked {
  border-color: rgba(255, 155, 63, 0.65);
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
}

.switch-row input:checked::after {
  transform: translateX(20px);
}

.settings-card {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
    rgba(8, 14, 23, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  display: grid;
  gap: 6px;
  align-content: start;
}

.settings-card strong {
  color: var(--text);
  font-size: 15px;
}

.settings-card span {
  color: var(--orange-2);
  font-size: 20px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.settings-card small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.company-profile-form {
  gap: 16px;
}

.company-logo-row {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.company-logo-preview {
  min-height: 112px;
  border: 1px dashed rgba(255, 155, 63, 0.40);
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.18);
  color: var(--muted);
  font-weight: 900;
  overflow: hidden;
}

.company-logo-preview img {
  width: 100%;
  height: 112px;
  object-fit: contain;
  padding: 12px;
}

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

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 900;
}

.form-grid label.wide {
  grid-column: 1 / -1;
}

.chat-panel {
  min-height: min(720px, calc(100vh - 112px));
  display: grid;
  grid-template-rows: auto auto minmax(260px, 1fr) auto;
}

.chat-layout {
  grid-template-columns: minmax(260px, 0.55fr) minmax(0, 1.45fr);
}

.chat-room-panel {
  align-self: start;
}

.chat-room-list {
  display: grid;
  gap: 8px;
}

.chat-room {
  width: 100%;
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  text-align: left;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.chat-room:hover,
.chat-room.active {
  border-color: rgba(255, 155, 63, 0.48);
  background: linear-gradient(145deg, rgba(233, 120, 34, 0.20), rgba(255, 255, 255, 0.06));
  box-shadow: 0 16px 35px rgba(233, 120, 34, 0.12), inset 0 0 0 1px rgba(255, 210, 170, 0.10);
}

.chat-room small {
  color: var(--muted);
  font-weight: 800;
}

.participant-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 260px;
  max-height: 52vh;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
}

.chat-bubble {
  width: min(680px, 92%);
  padding: 12px 14px;
  border: 1px solid rgba(255, 155, 63, 0.22);
  border-radius: 16px 16px 16px 6px;
  background: linear-gradient(145deg, rgba(233, 120, 34, 0.16), rgba(255, 255, 255, 0.045));
  line-height: 1.45;
}

.chat-bubble.own {
  margin-left: auto;
  border-radius: 16px 16px 6px 16px;
  background: linear-gradient(145deg, rgba(233, 120, 34, 0.28), rgba(255, 255, 255, 0.06));
}

.chat-form {
  margin-top: 12px;
}

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

.ticket-row {
  align-items: start;
}

.ticket-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.signature-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.good-text {
  color: var(--green);
}

.signature-modal {
  width: min(860px, 100%);
}

.ticket-editor-modal {
  width: min(1040px, 100%);
}

.ticket-detail-grid {
  margin-bottom: 14px;
}

.ticket-editor-actions {
  justify-content: flex-end;
}

.signature-canvas {
  width: 100%;
  height: min(280px, 36vh);
  display: block;
  border: 1px solid rgba(255, 155, 63, 0.34);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(0, 0, 0, 0.38);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  touch-action: none;
}

.conflict-box {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(255, 155, 63, 0.28);
  border-radius: 16px;
  background: rgba(233, 120, 34, 0.07);
}

.conflict-box h3 {
  margin: 0 0 4px;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.compare-grid pre {
  max-height: 180px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.24);
  white-space: pre-wrap;
  font-size: 12px;
}

.empty {
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

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

.inline-form .wide,
.wide {
  grid-column: 1 / -1;
}

.sub-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.sub-panel h3 {
  margin: 0;
  font-size: 18px;
}

.compact-list {
  gap: 8px;
}

.suggestion-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px;
}

.suggestion-chips button {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 139, 36, 0.28);
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--text);
  background: rgba(255, 139, 36, 0.12);
  font-weight: 850;
  cursor: pointer;
}

.quantity-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.quantity-controls button {
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 900;
  cursor: pointer;
}

.quantity-controls strong {
  min-width: 82px;
  text-align: center;
}

.work-ticket-form {
  display: grid;
  gap: 14px;
}

.form-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

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

.check-row strong,
.check-row small {
  display: block;
}

.check-row small {
  margin-top: 2px;
  color: var(--muted);
}

.material-lines {
  display: grid;
  gap: 10px;
}

.material-line {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(100px, 0.35fr) minmax(110px, 0.35fr);
  gap: 10px;
  align-items: end;
}

.tag-row,
.ticket-materials {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.mini-tag,
.ticket-materials span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255, 155, 63, 0.25);
  border-radius: 999px;
  color: #ffd9b6;
  background: rgba(233, 120, 34, 0.10);
  font-size: 12px;
  font-weight: 800;
}

.mini-tag.enabled {
  color: #b7ffd6;
  border-color: rgba(53, 208, 127, 0.34);
  background: rgba(53, 208, 127, 0.10);
}

.module-chip-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.module-chip {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.module-chip strong,
.module-chip small {
  overflow-wrap: anywhere;
}

.module-chip.enabled {
  border-color: rgba(41, 216, 111, 0.28);
  background: rgba(41, 216, 111, 0.08);
}

.module-chip.disabled {
  opacity: 0.68;
}

.module-chip small {
  color: var(--muted);
  font-weight: 900;
}

.module-chip.enabled small {
  color: #b9ffd2;
}

.module-hidden {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.54);
}

.modal-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border-radius: 22px;
  padding: 20px;
}

.recovery-modal {
  width: min(720px, 100%);
}

.recovery-code {
  margin: 16px 0;
  padding: 18px;
  border: 1px solid rgba(255, 147, 51, 0.40);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 139, 31, 0.16), rgba(255, 255, 255, 0.06));
  color: #fff4df;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: clamp(18px, 2.4vw, 28px);
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.45;
  text-align: center;
  overflow-wrap: anywhere;
  box-shadow: 0 0 34px rgba(255, 122, 23, 0.16);
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
}

.bar {
  height: 100%;
  width: var(--value, 0%);
  background: linear-gradient(90deg, var(--orange), var(--green));
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--orange-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.panel-subhead {
  color: var(--silver);
  font-size: 14px;
  font-weight: 900;
}

.compact-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.icon-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.calendar-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.calendar-main {
  min-height: 620px;
}

.calendar-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.calendar-toolbar h2 {
  text-transform: capitalize;
}

.calendar-weekdays,
.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  gap: 6px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.calendar-month-grid {
  gap: 7px;
}

.calendar-day {
  min-height: 86px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 6px;
  align-content: start;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 10px;
  color: var(--text);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(0, 0, 0, 0.16);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.calendar-day:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 155, 63, 0.32);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22), 0 0 22px rgba(233, 120, 34, 0.10);
}

.calendar-day.outside {
  opacity: 0.46;
}

.calendar-day.today {
  border-color: rgba(255, 155, 63, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 155, 63, 0.18);
}

.calendar-day.selected {
  background:
    linear-gradient(145deg, rgba(233, 120, 34, 0.24), rgba(255, 255, 255, 0.045)),
    rgba(0, 0, 0, 0.22);
  border-color: rgba(255, 155, 63, 0.64);
  box-shadow: 0 0 0 1px rgba(255, 155, 63, 0.18), 0 22px 44px rgba(233, 120, 34, 0.12);
}

.calendar-day-number {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 950;
}

.calendar-day.today .calendar-day-number {
  color: #fff;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
}

.calendar-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-content: start;
}

.calendar-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--orange-2);
  box-shadow: 0 0 10px rgba(255, 155, 63, 0.45);
}

.calendar-dot.vacation { background: #60a5ff; box-shadow: 0 0 10px rgba(96, 165, 255, 0.38); }
.calendar-dot.sick { background: var(--red); box-shadow: 0 0 10px rgba(255, 100, 100, 0.38); }
.calendar-dot.manual { background: var(--silver); box-shadow: 0 0 10px rgba(217, 222, 232, 0.28); }
.calendar-dot.work { background: var(--orange-2); }

.calendar-day small {
  color: var(--muted);
  font-weight: 900;
}

.calendar-agenda {
  min-height: 620px;
}

.calendar-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.calendar-filter {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  font-weight: 900;
}

.calendar-filter.active {
  color: #fff;
  border-color: rgba(255, 155, 63, 0.44);
  background: rgba(233, 120, 34, 0.20);
}

.calendar-agenda-list {
  display: grid;
  gap: 9px;
}

.calendar-event {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.calendar-event.work { border-color: rgba(255, 155, 63, 0.28); }
.calendar-event.vacation { border-color: rgba(96, 165, 255, 0.26); }
.calendar-event.sick { border-color: rgba(255, 100, 100, 0.30); }
.calendar-event.manual { border-color: rgba(217, 222, 232, 0.18); }

.calendar-event-time {
  width: 52px;
  min-height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--orange-2);
  background: rgba(233, 120, 34, 0.12);
  font-size: 12px;
  font-weight: 950;
}

.calendar-event-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.calendar-event-body strong {
  font-size: 15px;
}

.calendar-event-body span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

@media (max-width: 1100px) {
  .grid,
  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-chip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .material-line {
    grid-template-columns: 1fr 0.42fr 0.42fr;
  }

  .two {
    grid-template-columns: 1fr;
  }

  .calendar-shell {
    grid-template-columns: 1fr;
  }

  .calendar-main,
  .calendar-agenda {
    min-height: auto;
  }
}

@media (max-width: 1180px) {
  .app-shell {
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .desktop {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .top-card,
  .panel {
    border-radius: 18px;
    padding: 14px;
  }

  .sidebar {
    display: none;
  }

  .mobile-bar {
    position: sticky;
    top: max(10px, env(safe-area-inset-top));
    z-index: 20;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 62px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(24, 32, 43, 0.90), rgba(12, 18, 27, 0.80));
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.30);
    backdrop-filter: blur(24px);
  }

  .mobile-menu-button {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 155, 63, 0.32);
    border-radius: 14px;
    background: rgba(233, 120, 34, 0.14);
  }

  .mobile-menu-button span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #fff;
  }

  .mobile-bar-title {
    min-width: 0;
    display: grid;
    gap: 2px;
  }

  .mobile-bar-title strong,
  .mobile-bar-title small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-bar-title small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .mobile-bar .pill {
    min-height: 30px;
    padding: 0 10px;
    font-size: 0;
  }

  .mobile-bar .pill::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 12px currentColor;
  }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid !important;
    align-items: end;
    justify-items: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.46);
    backdrop-filter: blur(12px);
  }

  .mobile-menu {
    width: min(560px, calc(100vw - 24px));
    max-height: min(82vh, 720px);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(24, 32, 43, 0.96), rgba(10, 15, 23, 0.94));
    box-shadow: 0 -24px 74px rgba(0, 0, 0, 0.48);
  }

  .mobile-menu-scroll {
    min-height: 0;
    overflow: auto;
    display: grid;
    gap: 14px;
    padding-right: 2px;
  }

  .mobile-menu-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
  }

  .mobile-menu-head strong {
    display: block;
    font-size: 22px;
  }

  .mobile-menu-head small {
    color: var(--muted);
    font-weight: 800;
  }

  .mobile-menu-group h3 {
    margin: 0 0 8px;
    color: var(--orange-2);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
  }

  .mobile-menu-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-menu-list button {
    min-height: 76px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.055);
    text-align: left;
    font-weight: 900;
  }

  .mobile-menu-list button.active {
    border-color: rgba(255, 155, 63, 0.52);
    background: linear-gradient(135deg, rgba(233, 120, 34, 0.30), rgba(255, 255, 255, 0.055));
    box-shadow: 0 0 22px rgba(233, 120, 34, 0.14);
  }

  .mobile-menu-list small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.25;
  }

  .mobile-only {
    display: inline-flex;
  }

  .ios-settings-shell {
    grid-template-columns: 1fr;
  }

  .side-brand {
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .side-brand img {
    width: 104px;
  }

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

  .nav button {
    min-height: 40px;
  }

  .top-card {
    display: grid;
    align-items: start;
  }

  .pill-row {
    justify-content: flex-start;
  }

  .calendar-day {
    min-height: 72px;
    padding: 8px;
    border-radius: 13px;
  }

  .calendar-event {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding:
      max(10px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }

  .mobile-bar {
    top: max(6px, env(safe-area-inset-top));
    min-height: 56px;
    padding: 7px 8px;
    border-radius: 16px;
  }

  .mobile-menu-button {
    width: 42px;
    height: 42px;
  }

  .content {
    min-width: 0;
  }

  .chat-room-panel,
  .chat-panel {
    min-width: 0;
    overflow: hidden;
  }

  .login-wrap {
    min-height: calc(100vh - 20px);
  }

  .top-card {
    display: grid;
  }

  .grid,
  .quick-grid,
  .module-chip-grid,
  .inline-form,
  .check-grid,
  .nav {
    grid-template-columns: 1fr;
  }

  .ticket-editor-modal {
    padding: 14px;
  }

  .material-line {
    grid-template-columns: 1fr;
  }

  .tile {
    min-height: 108px;
  }

  .row {
    grid-template-columns: 1fr;
  }

  .compare-grid {
    grid-template-columns: 1fr;
  }

  .ticket-actions,
  .button-row {
    justify-content: stretch;
  }

  .ticket-actions > *,
  .button-row > * {
    flex: 1 1 150px;
  }

  .calendar-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-weekdays {
    font-size: 11px;
  }

  .calendar-month-grid {
    gap: 4px;
  }

  .calendar-day {
    min-height: 58px;
    gap: 3px;
    padding: 6px;
  }

  .calendar-day-number {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .calendar-dot {
    width: 7px;
    height: 7px;
  }
}

.mobile-bar,
.mobile-menu-backdrop {
  display: none;
}

@media (max-width: 1180px) {
  .mobile-bar {
    display: grid !important;
  }

  .mobile-menu-backdrop {
    display: grid !important;
  }
}

.active-row {
  border-color: rgba(255, 139, 36, 0.58);
  background: linear-gradient(135deg, rgba(255, 139, 36, 0.16), rgba(255, 255, 255, 0.05));
  box-shadow: 0 0 0 1px rgba(255, 139, 36, 0.12), 0 18px 38px rgba(255, 115, 16, 0.12);
}

.check-button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #d6dde8;
  font-weight: 900;
  cursor: pointer;
}

.check-button.done {
  border-color: rgba(71, 218, 116, 0.55);
  background: rgba(71, 218, 116, 0.18);
  color: #bfffd0;
}

.plain-row-button {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.segmented-status {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.segmented-status button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.segmented-status button.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 139, 36, 0.94), rgba(190, 96, 30, 0.82));
  box-shadow: 0 10px 24px rgba(255, 119, 23, 0.22);
}

.task-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.task-photo {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.task-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.small-danger {
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(180, 40, 40, 0.16);
  color: #ffc8c8;
  font-weight: 800;
  cursor: pointer;
}

.upload-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 18px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 139, 36, 0.42);
  background: rgba(255, 139, 36, 0.08);
  color: #ffd7b8;
  font-weight: 850;
  cursor: pointer;
}

.upload-row input {
  max-width: 280px;
}

.icon-only {
  width: 42px;
  min-width: 42px;
  padding: 0;
  font-size: 26px;
  line-height: 1;
}

@media (max-width: 820px) {
  .desktop {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .top-card h1 {
    font-size: clamp(24px, 8vw, 34px);
  }
}

@media (max-width: 640px) {
  .content {
    gap: 12px;
  }

  .top-card {
    display: none;
  }

  .panel {
    padding: 14px;
  }

  .panel-head {
    display: grid;
    align-items: start;
  }

  .panel h2 {
    font-size: 20px;
  }

  .tile {
    min-height: 108px;
    padding: 14px;
  }

  .tile strong {
    margin-top: 10px;
    font-size: 26px;
  }

  .quick-card {
    min-height: 92px;
  }

  .mobile-menu-list {
    grid-template-columns: 1fr;
  }

  .chat-layout,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    min-height: auto;
  }

  .chat-list {
    max-height: 44vh;
  }

  .settings-grid,
  .form-grid,
  .company-logo-row {
    grid-template-columns: 1fr;
  }

  .settings-card {
    min-height: 94px;
  }
}
.button-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
