:root {
  color-scheme: light;
  --ink: #14120f;
  --muted: #6b625b;
  --canvas: #f6f1e9;
  --card: #fff7ee;
  --accent: #e0772a;
  --accent-2: #0c4a4a;
  --border: rgba(20, 18, 15, 0.12);
  --shadow: 0 28px 60px rgba(20, 18, 15, 0.18);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f5f2ec;
  --muted: #a1a0a5;
  --canvas: #0f1217;
  --card: #161a21;
  --accent: #f2994a;
  --accent-2: #7de2d1;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 15%, #ffdcb8 0, transparent 45%),
    radial-gradient(circle at 85% 10%, #f1b5b5 0, transparent 50%),
    radial-gradient(circle at 70% 85%, #bfe5d8 0, transparent 45%),
    linear-gradient(150deg, #f5e7d8 0%, #f1e2d0 45%, #f7efe3 100%);
  transition: background 0.3s ease, color 0.3s ease;
}

body,
.card,
.sidebar,
.nav button,
.pill,
.pill-action,
input,
select,
textarea,
.btn {
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 12% 18%, rgba(242, 153, 74, 0.18) 0, transparent 40%),
    radial-gradient(circle at 80% 12%, rgba(125, 226, 209, 0.15) 0, transparent 40%),
    radial-gradient(circle at 70% 80%, rgba(226, 196, 104, 0.12) 0, transparent 42%),
    linear-gradient(160deg, #0d1015 0%, #0b0d12 40%, #0f141b 100%);
}
html[data-theme="dark"] .content {
  background:
    radial-gradient(circle at 20% 20%, rgba(125, 226, 209, 0.08) 0, transparent 30%),
    radial-gradient(circle at 80% 20%, rgba(242, 153, 74, 0.1) 0, transparent 35%),
    linear-gradient(180deg, rgba(22, 26, 33, 0.8), rgba(16, 20, 27, 0.9));
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  position: relative;
}

.sidebar {
  padding: 28px 22px;
  background: var(--card);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: "Fraunces", "Georgia", serif;
  font-weight: 700;
  letter-spacing: 1px;
}

.logo-mark {
  background-image: url("/uploads/03.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: #fff;
  color: transparent;
  text-indent: -9999px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 18px rgba(20, 18, 15, 0.16);
}

.brand-text {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
}

.brand-name {
  font-weight: 700;
  color: var(--ink);
  font-size: 16px;
}

.nav {
  margin-top: 36px;
  display: grid;
  gap: 10px;
}

.nav button {
  background: transparent;
  border: 1px solid transparent;
  padding: 12px 14px;
  border-radius: 14px;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--ink);
}

.nav button.active,
.nav button:hover {
  border-color: rgba(20, 18, 15, 0.2);
  background: #fff;
  box-shadow: 0 12px 24px rgba(20, 18, 15, 0.1);
}

.nav-scrim {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 15, 0.25);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 7;
}

.mobile-close {
  display: none;
}

.content {
  padding: 32px 36px 48px;
  display: grid;
  gap: 24px;
  background: radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.25) 0, transparent 30%),
    radial-gradient(circle at 90% 20%, rgba(224, 119, 42, 0.1) 0, transparent 35%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 247, 238, 0.6));
  border-radius: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 4px 0;
}

.topbar h1 {
  margin: 0;
  font-family: "Fraunces", "Georgia", serif;
  font-size: 32px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 13px;
}

.chip.user-chip {
  padding: 8px 10px;
  gap: 10px;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}
.avatar-sm.placeholder {
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--ink);
  background: rgba(12, 74, 74, 0.1);
}

.avatar-lg {
  width: 86px;
  height: 86px;
  border-radius: 22px;
  object-fit: cover;
  background: rgba(20, 18, 15, 0.06);
  border: 1px solid var(--border);
}

.avatar-lg.placeholder {
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--ink);
  background: rgba(12, 74, 74, 0.1);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(20, 18, 15, 0.12);
}

.icon-bars {
  position: relative;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 999px;
}

.icon-bars::before,
.icon-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 999px;
}

.icon-bars::before {
  top: -6px;
}

.icon-bars::after {
  top: 6px;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.grid.three {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.card {
  background: var(--card);
  border-radius: 22px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.stat {
  font-size: 28px;
  font-weight: 700;
}

.profile-card .profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.avatar-lg {
  width: 86px;
  height: 86px;
  border-radius: 22px;
  object-fit: cover;
  background: rgba(20, 18, 15, 0.06);
  border: 1px solid var(--border);
}
.avatar-lg.placeholder {
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--ink);
  background: rgba(12, 74, 74, 0.1);
}
.avatar-wrap {
  width: 86px;
  height: 86px;
  border-radius: 22px;
  overflow: hidden;
}
.divider {
  height: 1px;
  width: 100%;
  background: var(--border);
  margin: 6px 0;
}

.upload-btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px dashed var(--border);
  cursor: pointer;
  width: fit-content;
  font-weight: 600;
}

.schedule-layout {
  display: grid;
  gap: 18px;
}

.schedule-hero {
  padding: 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(224, 119, 42, 0.16), rgba(12, 74, 74, 0.14));
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.schedule-hero h2 {
  margin: 6px 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 11px;
  color: var(--muted);
}

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

.pill-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 10px 20px rgba(20, 18, 15, 0.08);
}

.pill-icon {
  font-size: 14px;
}

.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 247, 238, 0.75));
  backdrop-filter: blur(8px);
}

.shift-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.shift-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(20, 18, 15, 0.02);
}

.shift-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pill.tiny {
  padding: 4px 8px;
  font-size: 11px;
}

.pill.amount {
  background: rgba(224, 119, 42, 0.12);
  color: var(--accent);
}

.grid.two.slim {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.grid.two.tall,
.grid.three.tall {
  align-items: start;
}

.form-grid.mini {
  gap: 8px;
}
.muted {
  color: var(--muted);
}

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

.form-grid label {
  font-size: 13px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 14px;
  font-family: inherit;
}

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

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.small {
  padding: 8px 12px;
  font-size: 13px;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 16px 32px rgba(224, 119, 42, 0.35);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
}

.btn:hover {
  transform: translateY(-2px);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th,
.table td {
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid rgba(20, 18, 15, 0.08);
}

html[data-theme="dark"] .table th,
html[data-theme="dark"] .table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.login-grid {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 420px;
  gap: 26px;
  align-items: stretch;
  position: relative;
}

.login-hero {
  position: relative;
  padding: 32px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(224, 119, 42, 0.18), rgba(12, 74, 74, 0.16));
  border: 1px solid var(--border);
  box-shadow: 0 24px 48px rgba(20, 18, 15, 0.12);
  overflow: hidden;
  display: grid;
  gap: 14px;
}

.login-hero > * {
  position: relative;
  z-index: 1;
}

.login-hero h1 {
  margin: 6px 0 8px;
  font-size: 34px;
  line-height: 1.15;
}

.login-hero-copy {
  margin: 0;
  color: var(--muted);
  max-width: 540px;
}

.login-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0;
}

.login-tags span {
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
}

.login-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.stat-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  box-shadow: 0 14px 28px rgba(20, 18, 15, 0.1);
}

.login-blob {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 214, 170, 0.8), transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(125, 226, 209, 0.7), transparent 40%),
    radial-gradient(circle at 60% 80%, rgba(240, 167, 152, 0.5), transparent 45%);
  filter: blur(20px);
  opacity: 0.7;
  pointer-events: none;
}

.login-card {
  width: 100%;
  padding: 30px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 26px 60px rgba(20, 18, 15, 0.18);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 10%, rgba(224, 119, 42, 0.12), transparent 45%);
  pointer-events: none;
}

.login-card h2 {
  margin: 0;
  font-family: "Fraunces", "Georgia", serif;
  font-size: 26px;
}

.login-card .hint {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}

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

.login-logo-img {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: 0 10px 20px rgba(20, 18, 15, 0.18);
  background: #fff;
}

.inbox-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
}

.thread-list {
  border-right: 1px solid var(--border);
  max-height: 520px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.thread-item {
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.thread-item.active,
.thread-item:hover {
  background: rgba(224, 119, 42, 0.08);
  border-color: rgba(224, 119, 42, 0.3);
  transform: translateY(-1px);
}

.thread-title {
  font-weight: 700;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-left: 6px;
  background: var(--muted);
  box-shadow: 0 0 0 2px rgba(20, 18, 15, 0.05);
}

.status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.status-dot.offline {
  background: #cbd5e1;
}

.thread-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(12, 74, 74, 0.12);
  border: 1px solid var(--border);
  font-weight: 700;
}

.thread-meta {
  display: grid;
  gap: 2px;
}

.message-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding-right: 8px;
}

.message {
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
  max-width: 80%;
}

.message.self {
  margin-left: auto;
  background: rgba(224, 119, 42, 0.15);
  border-color: rgba(224, 119, 42, 0.4);
}

.msg-attachment {
  display: inline-flex;
  margin-top: 8px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  max-width: 220px;
}

.msg-attachment img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
}

.chat-hub {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 14px;
}

.chat-list {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  background: var(--card);
  box-shadow: 0 16px 30px rgba(20, 18, 15, 0.1);
  height: fit-content;
  position: sticky;
  top: 12px;
}

.thread-sep {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 6px 0 2px;
}

.chat-stage {
  min-height: 520px;
}

.chat-pane {
  display: grid;
  gap: 12px;
  height: 100%;
  background: radial-gradient(circle at 12% 20%, rgba(224, 119, 42, 0.06), transparent 40%), #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(20, 18, 15, 0.12);
}

.chat-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-pane-head .btn.small {
  padding: 8px 10px;
}

.message-rail {
  background: rgba(20, 18, 15, 0.02);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 10px;
  max-height: 380px;
  overflow: auto;
}

.message-bubble {
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
  max-width: 100%;
  box-shadow: 0 10px 20px rgba(20, 18, 15, 0.06);
}

.message-bubble.self {
  margin-left: auto;
  background: rgba(224, 119, 42, 0.08);
  border-color: rgba(224, 119, 42, 0.4);
}

.chat-input-left {
  display: grid;
  gap: 8px;
}

.attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  width: fit-content;
}

.icon-paperclip {
  width: 14px;
  height: 14px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  border-top-color: transparent;
  border-left-color: transparent;
  transform: rotate(-45deg);
  display: inline-block;
}

.attachment-preview {
  position: relative;
  width: 120px;
  height: 90px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 10px 20px rgba(20, 18, 15, 0.08);
}

.attachment-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.attachment-preview button {
  position: absolute;
  top: 4px;
  right: 4px;
  border: none;
  background: rgba(20, 18, 15, 0.7);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
}

.msg-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
}

.msg-body {
  white-space: pre-wrap;
}

.chat-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 12px 26px rgba(20, 18, 15, 0.08);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(12, 74, 74, 0.12);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 600;
}

.flag-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.flag-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(20, 18, 15, 0.04);
}

.flag-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(12, 74, 74, 0.04);
  cursor: pointer;
}

details[open] .flag-summary {
  background: rgba(224, 119, 42, 0.08);
}

html[data-theme="dark"] .sidebar {
  background: rgba(22, 26, 33, 0.82);
}

html[data-theme="dark"] .card {
  background: #161a21;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .glass {
  background: linear-gradient(180deg, rgba(34, 39, 48, 0.9), rgba(28, 32, 40, 0.82));
}

html[data-theme="dark"] .nav button.active,
html[data-theme="dark"] .nav button:hover {
  background: #1e2631;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: #11151c;
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

html[data-theme="dark"] .pill {
  background: rgba(125, 226, 209, 0.12);
  color: var(--accent-2);
}

html[data-theme="dark"] .pill-action {
  background: #1b2028;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .schedule-hero {
  background: linear-gradient(135deg, rgba(242, 153, 74, 0.14), rgba(23, 101, 101, 0.16));
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .table {
  background: transparent;
}

html[data-theme="dark"] .shift-row {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .message {
  background: #1d222c;
}

html[data-theme="dark"] .message.self {
  background: rgba(242, 153, 74, 0.15);
  border-color: rgba(242, 153, 74, 0.4);
}

html[data-theme="dark"] .login-hero {
  background: linear-gradient(135deg, rgba(242, 153, 74, 0.1), rgba(125, 226, 209, 0.12));
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .login-tags span,
html[data-theme="dark"] .stat-card {
  background: rgba(22, 26, 33, 0.92);
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .logo-mark {
  background-color: #0f141b;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .chat-pane {
  background: linear-gradient(180deg, rgba(34, 39, 48, 0.92), rgba(24, 28, 36, 0.94));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .message-rail {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .message-bubble {
  background: #1d222c;
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .message-bubble.self {
  background: rgba(242, 153, 74, 0.12);
  border-color: rgba(242, 153, 74, 0.32);
}

html[data-theme="dark"] .chat-input {
  background: rgba(24, 28, 36, 0.92);
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .attach-btn {
  background: rgba(22, 26, 33, 0.92);
  border-color: rgba(255, 255, 255, 0.08);
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, 86vw);
    transform: translateX(-110%);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    z-index: 8;
    border-right: 1px solid var(--border);
    border-bottom: none;
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 22px 52px rgba(20, 18, 15, 0.25);
  }

  .mobile-close {
    display: inline-flex;
    justify-content: center;
    margin: 14px 0 6px;
  }

  .nav-scrim.show {
    opacity: 1;
    pointer-events: auto;
  }

  .icon-btn {
    display: inline-flex;
  }

  .content {
    padding: 18px 18px 32px;
    border-radius: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
    position: relative;
  }

  .chip {
    width: 100%;
    justify-content: flex-start;
  }

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

  .card {
    padding: 16px 16px;
    border-radius: 16px;
  }

  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .inbox-layout {
    grid-template-columns: 1fr;
  }

  .thread-list {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
  }

  .message-list {
    max-height: 320px;
  }

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

  .login-hero {
    order: 2;
  }
}

@media (max-width: 640px) {
  .topbar h1 {
    font-size: 26px;
  }

  .nav button {
    padding: 10px 12px;
  }

  .card h3 {
    font-size: 16px;
  }

  .stat {
    font-size: 24px;
  }

  .form-grid label {
    font-size: 12px;
  }

  .form-grid input,
  .form-grid select,
  .form-grid textarea {
    padding: 10px;
    font-size: 13px;
  }

  .login-card {
    padding: 24px;
  }

  .login-hero h1 {
    font-size: 28px;
  }

  .login-stats {
    grid-template-columns: 1fr;
  }

  .chip {
    font-size: 12px;
  }
}
