/* DeepFlow Enterprise SaaS — Auth, Workspaces, AI Studio, Client Sign-Off & MCP Agent Bridge */

/* Light-dismiss dialog backdrop polish */
.dfd-dialog::backdrop, .local-dialog::backdrop {
  background: rgb(15 34 28 / 46%);
  backdrop-filter: blur(2px);
}

/* Auth Screen */
.auth-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  background: #f5f7f3;
}
.auth-panel {
  display: grid;
  place-items: center;
  padding: clamp(24px, 4vw, 56px);
}
.auth-card {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid #d7e1d7;
  border-radius: 16px;
  padding: clamp(24px, 3.2vw, 36px);
  box-shadow: 0 14px 44px rgb(20 56 42 / 7%);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: #16392d;
  font-size: 22px;
  font-weight: 720;
  letter-spacing: -0.9px;
}
.auth-brand img { width: 32px; height: 32px; display: block; }
.auth-brand .auth-pill {
  margin-left: auto;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e7f3eb;
  color: #1c5f43;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: #eff4ef;
  border-radius: 10px;
  margin-bottom: 20px;
}
.auth-tabs button {
  border: 0;
  background: transparent;
  color: #53685c;
  font-size: 14px;
  font-weight: 620;
  padding: 9px 12px;
  border-radius: 7px;
  min-height: 38px;
}
.auth-tabs button[aria-selected="true"] {
  background: #fff;
  color: #194433;
  box-shadow: 0 1px 3px rgb(16 44 32 / 10%);
}
.auth-heading { margin: 0 0 6px; font-size: 22px; font-weight: 680; letter-spacing: -0.6px; color: #193127; }
.auth-sub { margin: 0 0 18px; font-size: 14px; color: #5e7065; line-height: 1.45; }
.auth-form { display: grid; gap: 14px; }
.auth-field { display: grid; gap: 5px; }
.auth-field label { font-size: 13px; font-weight: 620; color: #243b30; }
.auth-field input {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid #c4d2c7;
  border-radius: 9px;
  font-size: 15px;
  color: #1a3026;
  background: #fff;
}
.auth-field input:focus { border-color: #1e6e50; outline: 2px solid #2b8c6930; outline-offset: 0; }
.auth-pw-wrap { position: relative; display: flex; align-items: center; }
.auth-pw-wrap input { padding-right: 68px; }
.auth-pw-toggle {
  position: absolute;
  right: 6px;
  border: 0;
  background: transparent;
  color: #416553;
  font-size: 12px;
  font-weight: 640;
  padding: 6px 9px;
  border-radius: 6px;
}
.auth-pw-toggle:hover { background: #edf4ee; }
.auth-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fdf0ee;
  border: 1px solid #e9c2bc;
  color: #8f332b;
  font-size: 13px;
  line-height: 1.4;
}
.auth-error:empty { display: none; }
.auth-submit {
  width: 100%;
  min-height: 44px;
  border: 1px solid #1c5c41;
  background: #1d5d42;
  color: #fff;
  font-size: 15px;
  font-weight: 640;
  border-radius: 9px;
  margin-top: 4px;
}
.auth-submit:hover:not(:disabled) { background: #144a33; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  color: #77877d;
  font-size: 12px;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: #dfe7e0; }
.auth-quick {
  width: 100%;
  min-height: 40px;
  border: 1px solid #c6d5c9;
  background: #f5faf6;
  color: #1e523c;
  font-size: 13px;
  font-weight: 620;
  border-radius: 9px;
}
.auth-quick:hover { background: #e8f3eb; }
.auth-showcase {
  background: linear-gradient(155deg, #12362b 0%, #1a4b3c 55%, #113027 100%);
  color: #e9f3ec;
  padding: clamp(32px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
}
.auth-showcase h2 {
  margin: 0;
  font-size: clamp(26px, 2.8vw, 38px);
  line-height: 1.15;
  letter-spacing: -1.1px;
  color: #fff;
}
.auth-showcase > p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #c2d8ca;
  max-width: 48ch;
}
.auth-pillars { display: grid; gap: 14px; }
.auth-pillar {
  padding: 15px 17px;
  border-radius: 12px;
  background: rgb(255 255 255 / 7%);
  border: 1px solid rgb(255 255 255 / 12%);
}
.auth-pillar strong { display: block; font-size: 14px; color: #e2f9d7; margin-bottom: 4px; }
.auth-pillar span { font-size: 13px; color: #c4d7ca; line-height: 1.45; }
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-showcase { padding: 28px 20px; }
}

/* Sidebar SaaS enhancements */
.rail-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #c5e8ce;
  background: #224a3b;
  border: 1px solid #3c6756;
  border-radius: 6px;
  padding: 5px 9px;
  margin: 0 2px 10px;
  width: calc(100% - 4px);
  text-align: left;
}
.rail-ai-badge:hover { background: #2c5b49; color: #fff; }
.rail-ai-dot { width: 7px; height: 7px; border-radius: 50%; background: #6ee09c; flex: none; }
.rail-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 10px 6px 6px;
  border-top: 1px solid #405949;
  margin-top: 12px;
  border-radius: 7px;
}
.rail-profile-btn:hover { background: #26483b; }
.rail-profile-btn > div { min-width: 0; flex: 1; }
.rail-profile-btn strong { font-size: 13px; font-weight: 600; display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rail-profile-btn small { display: block; font-size: 11px; color: #b7c9ba; margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Project Client & Approval Bar */
.client-meta-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 10px 0 0;
  font-size: 12px;
  color: #54685c;
}
.client-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef4ef;
  border: 1px solid #d6e2d7;
  color: #2b4e3b;
  font-weight: 560;
}
.client-chip.approved { background: #e1f3e6; border-color: #b7dfc3; color: #195d3c; }
.client-chip.dev { background: #e8f1fb; border-color: #c2daf2; color: #24558a; }
.client-chip.warn { background: #fef4df; border-color: #ebd4a2; color: #875b17; }
.client-action-link {
  border: 0;
  background: transparent;
  color: #1c6348;
  font-size: 12px;
  font-weight: 620;
  padding: 2px 4px;
  border-radius: 4px;
}
.client-action-link:hover { text-decoration: underline; }
.card-art.vehicle-release { background-color: #e8f3ee; color: #1c6348; }
.card-art.lolc-vrs-detailed { background-color: #e4f2eb; color: #15593f; }

/* Step Inspector — Client Sign-Off & Dev Status Cards */
.dfv-signoff-box, .dfv-dev-box {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 9px;
  border: 1px solid #d9e4db;
  background: #f8fbf8;
  display: grid;
  gap: 8px;
}
.dfv-signoff-box.is-approved { background: #eef8f1; border-color: #b8dfc4; }
.dfv-signoff-box.is-changes { background: #fff6ea; border-color: #ebd0a3; }
.dfv-signoff-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 650;
  color: #284537;
}
.dfv-signoff-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.dfv-pill-btn {
  border: 1px solid #c7d6ca;
  background: #fff;
  color: #2c4a3a;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 6px;
}
.dfv-pill-btn:hover { background: #edf4ee; }
.dfv-pill-btn.approve { background: #1e6446; border-color: #1e6446; color: #fff; }
.dfv-pill-btn.approve:hover { background: #154e36; }
.dfv-pill-btn.warn { color: #8c5514; border-color: #e4c68e; background: #fff9eb; }
.dfv-spec-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #dde5de;
  display: grid;
  gap: 8px;
}
.dfv-spec-item { display: grid; gap: 2px; }
.dfv-spec-item strong { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: #5f7267; }
.dfv-spec-item p { font-size: 13px; line-height: 1.45; color: #2b4036; white-space: pre-wrap; }
.dfv-spec-item code { font-size: 12px; background: #f2f6f2; padding: 3px 6px; border-radius: 5px; color: #244737; word-break: break-word; }

/* Comment badges (Internal vs Shared, AI Agent, Resolved) */
.dfv-badge-inline {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 620;
}
.dfv-badge-inline.internal { background: #f4edf9; color: #674489; border: 1px solid #dccbe9; }
.dfv-badge-inline.shared { background: #eaf5ee; color: #216143; border: 1px solid #c6e2d0; }
.dfv-badge-inline.agent { background: #e8f1fb; color: #25588c; border: 1px solid #bfd6f0; }
.dfv-badge-inline.resolved { background: #edf1ee; color: #5c6e63; }
.dfv-comment.is-resolved { opacity: 0.72; }
.dfv-comment-tools { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.dfv-mini-link { border: 0; background: transparent; color: #28654a; font-size: 12px; font-weight: 600; padding: 2px 0; }
.dfv-mini-link:hover { text-decoration: underline; }

/* AI Studio & Agent Bridge Pages */
.saas-page { max-width: 1080px; margin: 0 auto; display: grid; gap: 20px; padding-bottom: 32px; }
.saas-subtabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: #edf2ec;
  border: 1px solid #d7e1d7;
  border-radius: 10px;
  width: fit-content;
}
.saas-subtabs button {
  border: 0;
  background: transparent;
  color: #4f6457;
  font-size: 13px;
  font-weight: 620;
  padding: 8px 14px;
  border-radius: 7px;
}
.saas-subtabs button.active {
  background: #fff;
  color: #194c36;
  box-shadow: 0 1px 3px rgb(15 44 30 / 10%);
}
.saas-card {
  background: #fff;
  border: 1px solid #d8e2d8;
  border-radius: 12px;
  padding: 20px 22px;
  display: grid;
  gap: 14px;
}
.saas-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.saas-card-head h3 { margin: 0; font-size: 17px; font-weight: 660; color: #1b3429; letter-spacing: -0.3px; }
.saas-card-head p { margin: 4px 0 0; font-size: 13px; color: #5f7066; line-height: 1.45; }
.saas-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.saas-dropzone {
  border: 1.5px dashed #aec5b4;
  border-radius: 11px;
  padding: 20px;
  background: #f7fbf7;
  display: grid;
  gap: 10px;
  justify-items: start;
}
.saas-dropzone.is-over { background: #e8f4ec; border-color: #1f6b4d; }
.saas-textarea {
  width: 100%;
  min-height: 120px;
  padding: 11px 12px;
  border: 1px solid #cad6cb;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: #1e3328;
  resize: vertical;
}
.saas-input {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid #cad6cb;
  border-radius: 8px;
  font-size: 14px;
  color: #1e3328;
  background: #fff;
}
.saas-score-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.saas-score-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 740;
  flex: none;
  background: #e6f4ea;
  color: #185c3d;
  border: 4px solid #3c9868;
}
.saas-score-ring.mid { background: #fff5df; color: #8c5a12; border-color: #d69c35; }
.saas-score-ring.low { background: #fdeeea; color: #94322a; border-color: #c85349; }
.saas-finding {
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px solid #e0e8e0;
  background: #fafcfa;
  display: grid;
  gap: 5px;
}
.saas-finding.critical { border-left: 4px solid #be4138; background: #fff9f8; }
.saas-finding.warning { border-left: 4px solid #cc8b24; background: #fffcf5; }
.saas-finding.info { border-left: 4px solid #3576a8; background: #f7fbff; }
.saas-finding-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.saas-sev {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
}
.saas-sev.critical { background: #fae5e3; color: #9c2e26; }
.saas-sev.warning { background: #fdf0d5; color: #8c5a10; }
.saas-sev.info { background: #e4f0fb; color: #245a8a; }
.saas-question-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e1e9e1;
  border-radius: 8px;
  background: #fbfdfb;
  font-size: 13.5px;
  line-height: 1.45;
}
.saas-code-block {
  position: relative;
  background: #142620;
  color: #d9efe1;
  border-radius: 9px;
  padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
  margin: 0;
}
.saas-progress-track {
  height: 10px;
  border-radius: 999px;
  background: #e6eee7;
  overflow: hidden;
  display: flex;
}
.saas-progress-fill { height: 100%; background: #21734e; transition: width 0.25s ease; }
.saas-progress-fill.dev { background: #2b70b0; }
.saas-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.saas-table th, .saas-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid #e6ede6;
  vertical-align: top;
}
.saas-table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; color: #5b6d62; background: #f6f9f6; }
.saas-method {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e5f3ea;
  color: #1a5c3c;
}
.saas-token-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 13px;
  border: 1px solid #dfe8e0;
  border-radius: 9px;
  background: #fafcfa;
}
.saas-feed-item {
  padding: 11px 13px;
  border-left: 3px solid #2b7a58;
  background: #f8fbf9;
  border-radius: 0 8px 8px 0;
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.saas-muted { color: #607267; font-size: 13px; }
.saas-inline-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.saas-modal-wide { width: min(620px, calc(100vw - 32px)); }

/* Executive Dashboard KPIs & Spotlight */
.saas-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.saas-kpi {
  background: #fff;
  border: 1px solid #d7e1d7;
  border-radius: 12px;
  padding: 16px 18px;
  display: grid;
  gap: 6px;
}
.saas-kpi span { font-size: 12px; font-weight: 600; color: #5f7267; text-transform: uppercase; letter-spacing: 0.5px; }
.saas-kpi strong { font-size: 28px; font-weight: 700; color: #193e2e; letter-spacing: -0.8px; line-height: 1.1; }
.saas-spotlight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 20px;
  margin-bottom: 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ebf6ee 0%, #f4faf5 100%);
  border: 1px solid #b9dac3;
}
.saas-spotlight strong { display: block; font-size: 15px; color: #174431; }
.saas-spotlight p { margin: 4px 0 0; font-size: 13.5px; color: #4a6355; }

/* Built-In AI App Builder Multi-File Code Explorer */
.saas-code-explorer {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.saas-file-tree {
  display: grid;
  gap: 3px;
  padding: 6px;
  border: 1px solid #dae4db;
  border-radius: 9px;
  background: #f7faf7;
}
.saas-file-tree button {
  border: 0;
  background: transparent;
  text-align: left;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #355042;
  padding: 8px 10px;
  border-radius: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.saas-file-tree button:hover { background: #e8f2ea; }
.saas-file-tree button.active { background: #1e5c41; color: #fff; font-weight: 600; }
@media (max-width: 760px) {
  .saas-code-explorer { grid-template-columns: 1fr; }
}
