@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ===== Auth Modal (overlay) ===== */

.authModal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

:root {
  --bg: #f7faff;
  --surface: rgba(255, 255, 255, 0.62);
  --surface-muted: rgba(255, 255, 255, 0.46);
  --surface-strong: rgba(255, 255, 255, 0.82);
  --text: #142033;
  --muted: #697586;
  --line: rgba(40, 56, 82, 0.11);
  --border: rgba(255, 255, 255, 0.74);
  --border-hover: rgba(10, 132, 255, 0.34);
  --accent: #0a84ff;
  --accent-strong: #006edb;
  --accent-soft: rgba(10, 132, 255, 0.11);
  --cyan: #0f9fb5;
  --cyan-soft: rgba(15, 159, 181, 0.1);
  --green: #1f9d55;
  --amber: #b7791f;
  --amber-soft: rgba(245, 158, 11, 0.13);
  --danger: #d92d20;
  --shadow: 0 24px 70px rgba(36, 52, 78, 0.14);
  --shadow-soft: 0 10px 28px rgba(36, 52, 78, 0.1);
  --radius: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(241, 247, 255, 0.94) 46%, rgba(248, 252, 255, 0.98) 100%),
    linear-gradient(180deg, rgba(219, 235, 255, 0.8), rgba(255, 255, 255, 0));
  background-attachment: fixed;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(10, 132, 255, 0.08), rgba(255, 255, 255, 0) 35%),
    linear-gradient(180deg, rgba(105, 145, 214, 0.08), rgba(255, 255, 255, 0) 42%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 72%);
}

h1,
h2,
h3,
strong,
.brand strong {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.22s ease,
    border-color 0.22s ease,
    color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(10, 132, 255, 0.26);
  outline-offset: 2px;
}

.appShell {
  display: grid;
  grid-template-columns: 260px minmax(420px, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 20px;
  height: 100vh;
  min-height: 0;
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden;
}

.appShell.hasGeneratedFiles {
  grid-template-columns: 260px minmax(420px, 1fr) minmax(380px, 480px);
}

.sidebar,
.mainColumn,
.rightRail {
  min-width: 0;
}

.sidebar,
.chatPanel,
.reviewPanel,
.installPanel,
.composer,
.utilityPanel {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 20px;
  border-radius: var(--radius);
}

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

.brandRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notifBellWrap {
  position: relative;
  flex-shrink: 0;
}

.notifBell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: 1px dashed rgba(40, 56, 82, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.5);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.notifBell:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.notifBell span {
  letter-spacing: 0.01em;
}

.notifBadge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  font-style: normal;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(217, 45, 32, 0.4);
}

.notifDropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  width: 100%;
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-strong);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--shadow);
  z-index: 100;
}

.notifItem {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.notifItem:hover {
  background: rgba(10, 132, 255, 0.06);
}

.notifItem.unread {
  background: rgba(10, 132, 255, 0.08);
}

.notifItemIcon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(10, 132, 255, 0.1);
  color: var(--accent);
  flex-shrink: 0;
}

.notifItem strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.notifItem p {
  margin: 2px 0 4px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.notifTime {
  font-size: 11px;
  color: var(--muted);
  opacity: 0.7;
}

.notifEmpty {
  margin: 0;
  padding: 24px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.brandMark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(145deg, #59b7ff 0%, var(--accent) 52%, #006bd6 100%);
  box-shadow: 0 12px 24px rgba(10, 132, 255, 0.24);
}

.brandLogo {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

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

.brand strong {
  display: block;
  color: #111827;
  font-size: 16px;
  font-weight: 800;
}

.brand span {
  display: block;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.navList button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #586579;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
}

.navList .newChatButton {
  border: 1px solid rgba(10, 132, 255, 0.22);
  color: #ffffff;
  background: linear-gradient(180deg, #2d9cff 0%, var(--accent) 45%, var(--accent-strong) 100%);
  box-shadow: 0 12px 24px rgba(10, 132, 255, 0.24);
  font-weight: 700;
}

.navList .newChatButton:hover {
  background: linear-gradient(180deg, #47a8ff 0%, #0a84ff 45%, #0066cc 100%);
  box-shadow: 0 14px 28px rgba(10, 132, 255, 0.3);
  transform: translateY(-1px);
  color: #ffffff;
  border-color: rgba(10, 132, 255, 0.22);
}

.navList .prdChatButton {
  margin-top: 4px;
}

/* Active state untuk newChatButton (mode gas aktif) */
.navList .newChatButton.active {
  background: linear-gradient(180deg, #1a8aff 0%, #0066dd 45%, #004faa 100%);
  box-shadow: 0 14px 28px rgba(10, 132, 255, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-color: rgba(10, 132, 255, 0.4);
  transform: none;
}

/* Active state untuk prdChatButton (mode prd aktif) */
.navList .prdChatButton.active {
  color: #7c3aed;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(237, 233, 254, 0.85));
  border-color: rgba(124, 58, 237, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 8px rgba(124, 58, 237, 0.12);
  font-weight: 700;
}

.navList .prdChatButton.active svg {
  color: #7c3aed;
}

.navList button.active,
.navList button:hover {
  color: #0f5fb7;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(232, 243, 255, 0.72));
  border-color: rgba(10, 132, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), var(--shadow-soft);
}

.navList button.active {
  color: var(--accent-strong);
}

.sidebarFooter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.mainColumn {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 16px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.chatPanel,
.reviewPanel,
.installPanel,
.composer,
.utilityPanel {
  border-radius: var(--radius);
}

.chatPanel:hover,
.reviewPanel:hover,
.installPanel:hover,
.composer:hover,
.utilityPanel:hover {
  border-color: rgba(10, 132, 255, 0.22);
}

.chatPanel {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  overflow: hidden;
}

.utilityPanel {
  height: calc(100vh - 40px);
  min-height: 0;
  padding: 28px;
  overflow-y: auto;
}

.utilityHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.utilityHeader h1,
.chatHeader h1 {
  margin: 0;
  color: #111827;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}

.utilityHeader p,
.chatHeader p {
  max-width: 640px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.historyList,
.templateGrid,
.instructionList {
  margin-top: 20px;
}

.historyList {
  display: grid;
  gap: 12px;
}

.historyItem,
.templateItem,
.instructionList li,
.step,
.setupBox,
.warningBox,
.infoBand,
.messageBody {
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.54);
  box-shadow: 0 10px 30px rgba(36, 52, 78, 0.08);
  backdrop-filter: blur(16px) saturate(165%);
  -webkit-backdrop-filter: blur(16px) saturate(165%);
}

.historyItem {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 18px;
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.historyItem:hover,
.templateItem:hover {
  border-color: var(--border-hover);
  background: rgba(239, 247, 255, 0.84);
  transform: translateY(-2px);
}

.historyItem span {
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.historyItem strong,
.templateItem strong {
  color: #111827;
  font-size: 16px;
  font-weight: 700;
}

.historyItem p,
.templateItem p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

.templateItem {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  min-height: 190px;
  padding: 20px;
  border-radius: var(--radius);
}

.templateItem .primaryButton {
  width: 100%;
}

.instructionList {
  display: grid;
  gap: 12px;
  padding: 0;
  list-style: none;
  counter-reset: instructions;
}

.instructionList li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  counter-increment: instructions;
}

.instructionList li::before {
  content: counter(instructions);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(145deg, #59b7ff, var(--accent));
  box-shadow: 0 8px 18px rgba(10, 132, 255, 0.22);
  font-size: 13px;
  font-weight: 800;
}

.infoBand {
  margin-top: 20px;
  padding: 16px;
  border-color: rgba(10, 132, 255, 0.2);
  border-radius: var(--radius);
  color: #25415f;
  background: rgba(232, 243, 255, 0.76);
  font-size: 13px;
  line-height: 1.6;
}

.infoBand code {
  padding: 2px 6px;
  border: 1px solid rgba(10, 132, 255, 0.12);
  border-radius: 6px;
  color: #075ba8;
  background: rgba(255, 255, 255, 0.78);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.chatHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--line);
}

.statusBadge {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid rgba(10, 132, 255, 0.18);
  border-radius: 999px;
  color: #075ba8;
  background: rgba(232, 243, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 700;
}

.statusBadgeGenerating {
  border-color: rgba(10, 132, 255, 0.28);
  color: #064f93;
  background: rgba(217, 239, 255, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 4px rgba(10, 132, 255, 0.08);
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  padding: 24px 28px;
  overflow-y: auto;
}

.message {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 14px;
  align-items: flex-start;
  max-width: min(96%, 900px);
}

.message.user {
  grid-template-columns: minmax(0, 1fr) 36px;
  align-self: flex-end;
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(145deg, #59b7ff, var(--accent));
  box-shadow: 0 12px 24px rgba(10, 132, 255, 0.2);
}

.message.user .avatar {
  grid-column: 2;
  grid-row: 1;
  color: #49627f;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 20px rgba(36, 52, 78, 0.08);
}

.messageBody {
  padding: 16px 20px;
  border-radius: 18px 18px 18px 6px;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
}

.prdActions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  border-top: 1px dashed rgba(40, 56, 82, 0.1);
  padding-top: 10px;
}

.prdActions button {
  font-size: 11px !important;
  min-height: 28px !important;
  padding: 0 8px !important;
  font-weight: 600 !important;
}

.userActions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  border-top: 1px dashed rgba(40, 56, 82, 0.1);
  padding-top: 10px;
}

.userActions button {
  font-size: 11px !important;
  min-height: 28px !important;
  padding: 0 8px !important;
  font-weight: 600 !important;
}

.message.user .messageBody {
  grid-column: 1;
  grid-row: 1;
  background: linear-gradient(180deg, rgba(236, 247, 255, 0.9), rgba(218, 238, 255, 0.86));
  border-color: rgba(10, 132, 255, 0.22);
  border-radius: 18px 18px 6px 18px;
  text-align: right;
}

.messageRole {
  margin-bottom: 6px;
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.msgTime {
  color: var(--muted);
  font-weight: 500;
  text-transform: none;
  font-size: 10px;
  margin-left: 6px;
  letter-spacing: normal;
}

.message.user .messageRole {
  color: var(--accent-strong);
}

.messageBody p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.thinkingBlock {
  position: relative;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(126, 87, 194, 0.16);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(247, 244, 255, 0.9), rgba(242, 248, 255, 0.72));
  box-shadow: 0 14px 28px rgba(93, 64, 155, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.thinkingBlock summary {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #6b4bb8;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}

.thinkingBlock summary::-webkit-details-marker {
  display: none;
}

.thinkingText {
  max-height: 180px;
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(126, 87, 194, 0.13);
  color: #445064;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1.55;
  overflow: auto;
  white-space: pre-wrap;
}

.markdownContent {
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.markdownContent p {
  margin: 0 0 8px;
}

.markdownContent p:last-child {
  margin-bottom: 0;
}

.markdownContent strong {
  color: #111827;
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  font-weight: 700;
}

.markdownContent em {
  color: #374151;
  font-style: italic;
}

.markdownContent ol,
.markdownContent ul {
  margin: 8px 0;
  padding-left: 24px;
}

.markdownContent li {
  margin: 4px 0;
  line-height: 1.5;
}

.markdownContent ol {
  list-style: decimal;
}

.markdownContent ul {
  list-style: disc;
}

.markdownContent code {
  padding: 2px 6px;
  border: 1px solid rgba(10, 132, 255, 0.12);
  border-radius: 6px;
  color: #075ba8;
  background: rgba(255, 255, 255, 0.78);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.markdownContent pre {
  margin: 10px 0;
  padding: 14px;
  border: 1px solid rgba(40, 56, 82, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(250, 252, 255, 0.88);
  overflow-x: auto;
}

.markdownContent pre code {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  line-height: 1.7;
}

.markdownContent h1,
.markdownContent h2,
.markdownContent h3 {
  margin: 12px 0 6px;
  color: #111827;
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
}

.markdownContent h1 {
  font-size: 20px;
  font-weight: 800;
}

.markdownContent h2 {
  font-size: 17px;
  font-weight: 700;
}

.markdownContent h3 {
  font-size: 15px;
  font-weight: 700;
}

.markdownContent a {
  color: var(--accent);
  text-decoration: underline;
}

.markdownContent blockquote {
  margin: 8px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--accent);
  background: rgba(232, 243, 255, 0.6);
  border-radius: 6px;
}

.composer {
  padding: 16px;
}

.attachmentList {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.attachmentChip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 34px;
  padding: 6px 8px 6px 10px;
  border: 1px solid rgba(10, 132, 255, 0.18);
  border-radius: 999px;
  color: #25415f;
  background: rgba(232, 243, 255, 0.78);
  box-shadow: 0 8px 18px rgba(36, 52, 78, 0.06);
  font-size: 12px;
  font-weight: 700;
}

.attachmentChip span {
  overflow: hidden;
  max-width: 220px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachmentChip small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.attachmentChip button {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #5c6f86;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.attachmentChip button:hover {
  color: var(--danger);
  background: rgba(255, 241, 240, 0.94);
}

.composer textarea {
  display: block;
  width: 100%;
  min-height: 84px;
  resize: vertical;
  padding: 14px;
  border: 1px solid rgba(40, 56, 82, 0.12);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  font-size: 14px;
  line-height: 1.5;
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    background-color 0.22s ease;
}

.composer textarea::placeholder,
.installPanel input::placeholder {
  color: #8a98aa;
}

.composer textarea:focus,
.installPanel input:focus {
  border-color: rgba(10, 132, 255, 0.48);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.1);
}

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

.composerTools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.fileInput {
  display: none;
}

.fileError {
  margin-top: 10px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.4;
}

.composerFooter span,
.helperLine {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.primaryButton,
.ghostButton,
.quickLinks a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.primaryButton {
  flex: 0 0 auto;
  padding: 0 18px;
  border: 1px solid rgba(0, 110, 219, 0.2);
  color: #ffffff;
  background: linear-gradient(180deg, #2d9cff 0%, var(--accent) 45%, var(--accent-strong) 100%);
  box-shadow: 0 12px 24px rgba(10, 132, 255, 0.24);
}

.primaryButton:hover {
  background: linear-gradient(180deg, #47a8ff 0%, #0a84ff 45%, #0066cc 100%);
  box-shadow: 0 14px 28px rgba(10, 132, 255, 0.3);
  transform: translateY(-1px);
}

.primaryButton:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  box-shadow: none;
  transform: none;
}

.ghostButton {
  padding: 0 14px;
  border: 1px solid rgba(40, 56, 82, 0.12);
  color: #25415f;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 8px 20px rgba(36, 52, 78, 0.07);
}

.ghostButton:hover {
  border-color: var(--border-hover);
  color: var(--accent-strong);
  background: rgba(235, 246, 255, 0.92);
}

.ghostButton.compact {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.ghostButton.danger {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}

.ghostButton.danger:hover {
  color: var(--danger);
  background: rgba(254, 242, 242, 0.9);
  border-color: rgba(239, 68, 68, 0.4);
}

.primaryButton.compact {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.rightRail {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.reviewPanel,
.installPanel {
  min-height: 0;
  height: 100%;
}

.reviewPanel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  padding: 20px;
  overflow: hidden;
}

.installPanel {
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
}

.panelHeading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panelHeading.tight {
  margin-bottom: 14px;
}

.panelKicker {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.panelHeading h2 {
  margin: 0;
  color: #111827;
  font-size: 18px;
  font-weight: 800;
}

.tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-right: 16px;
}

.tabsLeft {
  display: flex;
  gap: 8px;
}

.tabItem {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
}

.tabItem button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(40, 56, 82, 0.11);
  border-radius: 999px;
  color: #667085;
  background: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.tabItem button.active,
.tabItem button:hover {
  color: var(--accent-strong);
  border-color: rgba(10, 132, 255, 0.24);
  background: rgba(232, 243, 255, 0.86);
}

.codeBlockWrap {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  border: 1px solid rgba(40, 56, 82, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(250, 252, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.codeToolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px 10px 14px;
  border-bottom: 1px solid rgba(40, 56, 82, 0.1);
  color: #26364d;
  background: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  font-weight: 800;
}

.codeFileMeta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.codeFileMeta span {
  overflow: hidden;
  color: #142033;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codeFileMeta small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.codeToolbarActions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.codeBlock {
  min-height: 0;
  overflow: auto;
  color: #123657;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px;
  line-height: 1.7;
  counter-reset: code-line;
}

.codeLine {
  display: grid;
  grid-template-columns: 44px minmax(max-content, 1fr);
  min-width: max-content;
}

.codeLine:first-child {
  padding-top: 12px;
}

.codeLine:last-child {
  padding-bottom: 12px;
}

.codeLine:hover {
  background: rgba(10, 132, 255, 0.06);
}

.lineNumber {
  position: sticky;
  left: 0;
  z-index: 1;
  padding: 0 10px 0 12px;
  color: #9aa8ba;
  background: rgba(250, 252, 255, 0.94);
  border-right: 1px solid rgba(40, 56, 82, 0.08);
  text-align: right;
  user-select: none;
}

.codeLine code {
  display: block;
  padding: 0 16px;
  white-space: pre;
  color: #123657;
}

.warningBox,
.setupBox {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius-sm);
  color: #5f4a12;
  background: var(--amber-soft);
  font-size: 13px;
  line-height: 1.5;
}

.warningCompact {
  padding: 0;
  overflow: hidden;
}

.warningTitle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--amber);
  font-weight: 800;
}

.warningCompact .warningTitle {
  min-height: 38px;
  margin-bottom: 0;
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
}

.warningCompact .warningTitle::-webkit-details-marker {
  display: none;
}

.warningCompact .warningTitle small {
  min-width: 0;
  overflow: hidden;
  color: rgba(95, 74, 18, 0.78);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warningCompact[open] .warningTitle {
  border-bottom: 1px solid rgba(214, 140, 31, 0.18);
}

.warningBox ul,
.setupBox ul {
  margin: 0;
  padding-left: 20px;
}

.warningCompact ul {
  padding: 10px 14px 12px 34px;
}

.warningBox li+li,
.setupBox li+li {
  margin-top: 6px;
}

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

.quickLinks a {
  min-width: 0;
  padding: 0 12px;
  border: 1px solid rgba(10, 132, 255, 0.18);
  color: var(--accent-strong);
  background: rgba(232, 243, 255, 0.72);
  box-shadow: 0 8px 20px rgba(36, 52, 78, 0.07);
  font-size: 12px;
}

.quickLinks a:hover {
  border-color: var(--border-hover);
  background: rgba(221, 239, 255, 0.9);
  transform: translateY(-1px);
}

.fieldLabel {
  margin-bottom: 8px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.installPanel input[type="text"],
.installPanel input:not([type]) {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(40, 56, 82, 0.12);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    background-color 0.22s ease;
}

.checklist {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.step {
  display: grid;
  grid-template-columns: 20px 20px minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.5;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.step:hover {
  border-color: rgba(10, 132, 255, 0.26);
  background: rgba(235, 246, 255, 0.82);
}

.step input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.stepIcon {
  margin-top: 2px;
  color: #8a98aa;
}

.step.checked {
  color: #17324d;
  border-color: rgba(31, 157, 85, 0.24);
  background: rgba(232, 248, 238, 0.84);
}

.step.checked .stepIcon {
  color: var(--green);
}

.setupBox {
  border-color: rgba(40, 56, 82, 0.1);
  color: #2f4055;
  background: rgba(255, 255, 255, 0.56);
}

.setupBox strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-strong);
}

.errorBanner {
  padding: 12px 16px;
  border: 1px solid rgba(217, 45, 32, 0.18);
  border-radius: var(--radius);
  color: var(--danger);
  background: rgba(255, 241, 240, 0.86);
  box-shadow: var(--shadow-soft);
  font-size: 13px;
}

.quotaErrorBanner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(254, 243, 199, 0.9);
  color: #b45309;
}

.quotaErrorBanner span {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.topupButton {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  font-size: 12px;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}

.topupButton:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.3);
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #ffffff;
}


.contextBanner {
  padding: 12px 16px;
  border: 1px solid rgba(10, 132, 255, 0.18);
  border-radius: var(--radius);
  color: #075ba8;
  background: rgba(232, 243, 255, 0.84);
  box-shadow: var(--shadow-soft);
  font-size: 13px;
  line-height: 1.5;
}

.generationBanner {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(10, 132, 255, 0.18);
  border-radius: var(--radius);
  color: #075ba8;
  background: rgba(232, 243, 255, 0.86);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
}

.generationBanner strong,
.generationBanner span {
  display: block;
}

.generationBanner strong {
  color: #064f93;
  font-size: 13px;
  font-weight: 800;
}

.generationBanner span {
  margin-top: 2px;
  color: rgba(7, 91, 168, 0.76);
  font-size: 12px;
  line-height: 1.4;
}

.progressDots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.progressDots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  animation: dotPulse 1.1s ease-in-out infinite;
}

.progressDots span:nth-child(2) {
  animation-delay: 0.16s;
}

.progressDots span:nth-child(3) {
  animation-delay: 0.32s;
}

.spin {
  animation: spin 0.9s linear infinite;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(90, 111, 138, 0.32);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(10, 132, 255, 0.42);
  background-clip: padding-box;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes dotPulse {

  0%,
  80%,
  100% {
    opacity: 0.38;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 1180px) {
  .appShell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .appShell.hasGeneratedFiles {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .rightRail {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.75fr);
    grid-template-rows: minmax(440px, 1fr);
    height: auto;
    min-height: 0;
  }

  .utilityPanel {
    height: auto;
    min-height: 560px;
  }
}

@media (max-width: 820px) {
  .appShell {
    display: flex;
    flex-direction: column;
    padding: 10px;
  }

  .sidebar {
    gap: 16px;
    padding: 18px;
  }

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

  .navList button {
    min-height: 46px;
  }

  .mainColumn {
    height: auto;
    min-height: 720px;
  }

  .rightRail {
    display: flex;
    flex-direction: column;
    height: auto;
  }

  .reviewPanel {
    min-height: 520px;
  }

  .utilityHeader,
  .chatHeader,
  .composerFooter {
    align-items: stretch;
    flex-direction: column;
  }

  .chatHeader,
  .messages {
    padding-right: 18px;
    padding-left: 18px;
  }

  .message {
    max-width: 100%;
  }

  .messageBody {
    padding: 14px 16px;
  }

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

  .composerTools .ghostButton {
    width: 100%;
  }

  .attachmentChip span {
    max-width: 230px;
  }

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

  .statusBadge {
    align-self: flex-start;
  }

  .primaryButton {
    width: 100%;
  }

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

/* ===== Auth Pages ===== */

.authPage {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: stretch;
  min-height: 100vh;
  padding: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(241, 247, 255, 0.94) 46%, rgba(248, 252, 255, 0.98) 100%),
    linear-gradient(180deg, rgba(219, 235, 255, 0.8), rgba(255, 255, 255, 0));
}

.authFormSide {
  position: relative;
  display: grid;
  place-items: center;
  padding: 32px 24px;
  overflow: hidden;
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(10, 132, 255, 0.12) 0%, rgba(10, 132, 255, 0) 55%),
    radial-gradient(80% 60% at 0% 100%, rgba(15, 159, 181, 0.1) 0%, rgba(15, 159, 181, 0) 50%),
    linear-gradient(160deg, rgba(248, 252, 255, 0.98) 0%, rgba(241, 247, 255, 0.95) 100%);
}

.authFormSide::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -120px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(10, 132, 255, 0.14) 0%, rgba(10, 132, 255, 0) 70%);
  pointer-events: none;
}

.authFormSide::after {
  content: "";
  position: absolute;
  bottom: -140px;
  left: -100px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 159, 181, 0.12) 0%, rgba(15, 159, 181, 0) 70%);
  pointer-events: none;
}

.authHero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 40px;
  color: #ffffff;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(89, 183, 255, 0.55) 0%, rgba(10, 132, 255, 0) 55%),
    radial-gradient(120% 90% at 100% 100%, rgba(0, 107, 214, 0.65) 0%, rgba(10, 132, 255, 0) 55%),
    linear-gradient(150deg, #0a84ff 0%, #006edb 52%, #004cab 100%);
  overflow: hidden;
}

.authHero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.14) 0, transparent 38%),
    radial-gradient(circle at 82% 88%, rgba(255, 255, 255, 0.1) 0, transparent 42%);
}

.authHero::after {
  content: "</>";
  position: absolute;
  right: -18px;
  bottom: -42px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 220px;
  font-weight: 700;
  line-height: 1;
  color: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.authHeroTop {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.authHeroLogo {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}

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

.authHeroBrand strong {
  display: block;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
}

.authHeroBrand span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.authHeroBody {
  position: relative;
  z-index: 1;
  max-width: 460px;
}

.authHeroBody h2 {
  margin: 0 0 14px;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.authHeroBody>p {
  margin: 0 0 28px;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
}

.authHeroFeatures {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.authHeroFeatures li {
  display: flex;
  align-items: center;
  gap: 14px;
}

.authHeroIcon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.authHeroIcon svg {
  display: block;
}

.authHeroFeatures strong {
  display: block;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.authHeroFeatures span {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
}

.authHeroFoot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
}

.authHeroFoot strong {
  font-family: 'Outfit', system-ui, sans-serif;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 700;
}

@media (max-width: 880px) {
  .authPage {
    grid-template-columns: 1fr;
  }

  .authHero {
    display: none;
  }
}

.authCard {
  width: 100%;
  max-width: 420px;
  padding: 36px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.authCard.wide {
  max-width: 780px;
}

.authBrand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.authBrand .brandMark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(145deg, #59b7ff 0%, var(--accent) 52%, #006bd6 100%);
  box-shadow: 0 12px 24px rgba(10, 132, 255, 0.24);
}

.authBrand .brandLogo {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

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

.authBrand strong {
  display: block;
  color: #111827;
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 800;
}

.authBrand span {
  display: block;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.authCard h1 {
  margin: 0 0 4px;
  color: #111827;
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  font-size: 24px;
  font-weight: 800;
}

.authSub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.authCard form {
  display: grid;
  gap: 12px;
}

.authCard .cf-turnstile {
  display: flex;
  justify-content: center;
  margin: 4px 0;
}

.authCard label {
  color: #374151;
  font-size: 13px;
  font-weight: 700;
}

.authCard input[type="text"],
.authCard input[type="email"],
.authCard input[type="password"] {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(40, 56, 82, 0.14);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.authCard input:focus {
  border-color: rgba(10, 132, 255, 0.48);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.1);
}

.authCard .primaryButton {
  margin-top: 4px;
  width: 100%;
}

.authError {
  padding: 12px 14px;
  border: 1px solid rgba(217, 45, 32, 0.18);
  border-radius: var(--radius-sm);
  color: var(--danger);
  background: rgba(255, 241, 240, 0.86);
  font-size: 13px;
}

.authFooter {
  margin-top: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.authFooter a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.authFooter a:hover {
  text-decoration: underline;
}

.authLoading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 0;
  color: var(--muted);
  font-size: 14px;
}

/* ===== Admin Page ===== */

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

.adminHeader h1 {
  margin: 0;
  font-size: 20px;
}

.adminTabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  background: rgba(40, 56, 82, 0.05);
  border-radius: var(--radius-sm);
}

.adminTab {
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.adminTab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
}

.adminTab.active {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 4px 12px rgba(10, 132, 255, 0.22);
}

.reportList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reportCard {
  padding: 16px;
  border: 1px solid rgba(40, 56, 82, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.6);
  transition: border-color 0.2s;
}

.reportCard.open {
  border-left: 3px solid var(--danger);
}

.reportCardHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.reportCardHeader strong {
  display: block;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
}

.reportMeta {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.reportDesc {
  margin: 8px 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #374151;
  white-space: pre-wrap;
}

.adminTableWrap {
  overflow-x: auto;
  border: 1px solid rgba(40, 56, 82, 0.1);
  border-radius: var(--radius-sm);
}

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

.adminTable th {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(40, 56, 82, 0.1);
  color: #374151;
  background: rgba(250, 252, 255, 0.88);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}

.adminTable td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(40, 56, 82, 0.06);
  color: var(--text);
  line-height: 1.4;
}

.adminTable tr:hover td {
  background: rgba(232, 243, 255, 0.4);
}

.roleBadge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.roleBadge.admin {
  color: #075ba8;
  background: rgba(10, 132, 255, 0.12);
}

.roleBadge.user {
  color: #667085;
  background: rgba(40, 56, 82, 0.08);
}

.adminActions {
  display: flex;
  gap: 6px;
}

.adminActions .ghostButton.compact {
  min-height: 30px;
  padding: 0 8px;
}

.adminActions .ghostButton.danger {
  color: var(--danger);
}

.adminActions .ghostButton.danger:hover {
  background: rgba(255, 241, 240, 0.94);
}

/* ===== User Menu ===== */

.quotaWidget {
  margin-top: auto;
  padding: 16px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(40, 56, 82, 0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.quotaWidget:hover {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(10, 132, 255, 0.1);
}

.quotaWidgetHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
}

.quotaWidgetHeader span {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-weight: 600;
}

.quotaWidgetHeader strong {
  color: #111827;
  font-weight: 800;
}

.quotaWidgetTrack {
  height: 6px;
  background: rgba(40, 56, 82, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.quotaWidgetFill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease, background 0.3s ease;
}

.quotaWidgetMeta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.quotaWidgetBtn {
  width: 100%;
  padding: 8px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.quotaWidget:hover .quotaWidgetBtn {
  background: var(--accent-strong);
}

.sidebarFooterActions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.voucherBtn,
.reportBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: 1px dashed rgba(10, 132, 255, 0.35);
  border-radius: var(--radius-sm);
  color: var(--accent-strong);
  background: rgba(10, 132, 255, 0.06);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.reportBtn {
  border-color: rgba(217, 45, 32, 0.3);
  color: var(--danger);
  background: rgba(217, 45, 32, 0.05);
}

.voucherBtn:hover,
.reportBtn:hover {
  border-color: var(--accent);
  background: rgba(10, 132, 255, 0.12);
  transform: translateY(-1px);
}

.reportBtn:hover {
  border-color: var(--danger);
  background: rgba(217, 45, 32, 0.1);
}

.voucherBtn span,
.reportBtn span {
  letter-spacing: 0.01em;
}

.userMenu {
  position: relative;
  margin-top: 12px;
}

.userMenuButton {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid rgba(40, 56, 82, 0.1);
  border-radius: var(--radius-sm);
  color: #374151;
  background: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.userMenuButton:hover {
  border-color: var(--border-hover);
  background: rgba(235, 246, 255, 0.82);
}

.userMenuDropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  margin-bottom: 6px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  z-index: 10;
}

.userMenuDropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  color: #374151;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.userMenuDropdown button:hover {
  background: rgba(232, 243, 255, 0.78);
  color: var(--accent-strong);
}

.userMenuDropdown button.danger {
  color: var(--danger);
}

.userMenuDropdown button.danger:hover {
  background: rgba(255, 241, 240, 0.86);
}

.userMenuSection {
  display: grid;
  gap: 8px;
  padding: 9px 10px;
  border-top: 1px solid rgba(40, 56, 82, 0.08);
  border-bottom: 1px solid rgba(40, 56, 82, 0.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.displayModeToggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.userMenuDropdown .displayModeToggle button {
  justify-content: center;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid rgba(40, 56, 82, 0.1);
  background: rgba(255, 255, 255, 0.48);
  font-size: 11px;
}

.userMenuDropdown .displayModeToggle button.active {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.inlineFiles {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.inlineFilesHeader,
.inlineFileCard summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inlineFilesHeader strong,
.inlineFileCard summary span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.inlineFileCard {
  border: 1px solid rgba(40, 56, 82, 0.12);
  border-radius: 14px;
  background: rgba(250, 252, 255, 0.9);
  overflow: hidden;
}

.inlineFileCard summary {
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.inlineFileCard summary::-webkit-details-marker {
  display: none;
}

.inlineFileCard summary b {
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--accent-strong);
  background: rgba(232, 243, 255, 0.95);
  font-size: 10px;
}

.inlineCodeBlock {
  max-height: 420px;
  border-top: 1px solid rgba(40, 56, 82, 0.1);
  color: #123657;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1.65;
  overflow: auto;
}

.inlineCodeLine {
  display: grid;
  grid-template-columns: 42px minmax(max-content, 1fr);
  min-width: max-content;
}

.inlineCodeLine span {
  position: sticky;
  left: 0;
  padding: 0 9px;
  color: #9aa8ba;
  background: rgba(250, 252, 255, 0.96);
  border-right: 1px solid rgba(40, 56, 82, 0.08);
  text-align: right;
  user-select: none;
}

.inlineCodeLine code {
  padding: 0 14px;
  white-space: pre;
}

/* File History Panel */
.fileHistoryPanel {
  margin-top: 12px;
  border: 1px solid rgba(40, 56, 82, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  overflow: hidden;
}

.fileHistoryHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(240, 245, 252, 0.6);
  border-bottom: 1px solid rgba(40, 56, 82, 0.08);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-strong);
}

.fileHistoryHeader small {
  color: #6b7a8c;
  font-weight: 400;
}

.fileHistoryEmpty {
  padding: 20px;
  text-align: center;
  color: #6b7a8c;
  font-size: 13px;
}

.fileHistoryList {
  max-height: 240px;
  overflow-y: auto;
}

.fileHistoryItem {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid rgba(40, 56, 82, 0.06);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  color: #25415f;
  transition: background 0.15s;
}

.fileHistoryItem:last-child {
  border-bottom: none;
}

.fileHistoryItem:hover {
  background: rgba(240, 245, 252, 0.5);
}

.fileHistoryItem.active {
  background: rgba(235, 246, 255, 0.8);
}

.fileHistoryItem small {
  margin-left: auto;
  color: #8a99ab;
  font-size: 11px;
  white-space: nowrap;
}

.versionBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(40, 56, 82, 0.08);
  font-size: 11px;
  font-weight: 600;
  color: #455a73;
}

.fileHistoryItem.active .versionBadge {
  background: var(--accent-strong);
  color: #fff;
}

.previewBlock {
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  overflow: hidden;
  min-height: 400px;
}