/* Regosoft Atlas UI - light, operational SaaS theme */
:root {
  --font-sans: Inter, "Segoe UI", Arial, sans-serif;
  --primary: #087f73;
  --primary-hover: #06685f;
  --primary-light: #e7f6f3;
  --primary-soft: #f1faf8;
  --primary-glow: rgba(8, 127, 115, 0.14);
  --success: #138a61;
  --success-hover: #0d704e;
  --success-soft: #eaf8f1;
  --warning: #d97706;
  --warning-hover: #b45309;
  --warning-soft: #fff7e6;
  --danger: #d64545;
  --danger-hover: #b83232;
  --danger-soft: #fff0f0;
  --info: #2563a8;
  --info-soft: #edf5ff;
  --bg-app: #f4f7f8;
  --bg-surface: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-sidebar-hover: #f1f6f6;
  --bg-sidebar-active: #e7f6f3;
  --border-color: #dfe7e9;
  --border-color-hover: #bdcbcf;
  --border-focus: #087f73;
  --text-main: #17282d;
  --text-secondary: #41575e;
  --text-muted: #71858b;
  --text-disabled: #9aabad;
  --text-sidebar: #31464c;
  --text-sidebar-muted: #71858b;
  --shadow-sm: 0 1px 2px rgba(21, 45, 51, 0.04);
  --shadow-md: 0 8px 24px rgba(26, 55, 61, 0.07);
  --shadow-lg: 0 18px 50px rgba(26, 55, 61, 0.1);
  --shadow-glow: none;
  --radius-sm: 5px;
  --radius-md: 7px;
  --radius-lg: 8px;
}

html { background: var(--bg-app); }
body {
  background: var(--bg-app);
  color: var(--text-main);
  letter-spacing: 0;
}
body:not(#agent-app) .agent-only { display: none !important; }

::selection { background: #bfe9e2; color: #10272b; }
:focus-visible { outline: 3px solid rgba(8, 127, 115, 0.24); outline-offset: 2px; }

/* Authentication */
.auth-shell {
  min-height: 100vh;
  background: #f5f8f8;
}
.auth-visual {
  flex: 1.1;
  justify-content: flex-start;
  padding: clamp(48px, 7vw, 112px);
  color: var(--text-main);
  background-color: #edf7f5;
  background-image:
    linear-gradient(rgba(8,127,115,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8,127,115,.055) 1px, transparent 1px);
  background-size: 36px 36px;
  border-right: 1px solid #d7e7e4;
}
.auth-visual::before {
  width: 420px;
  height: 420px;
  top: auto;
  right: -130px;
  bottom: -150px;
  border: 88px solid rgba(8,127,115,.07);
  background: transparent;
}
.auth-visual-content { max-width: 600px; }
.auth-visual-content::before {
  content: "REGOSOFT / OPERATIONS CLOUD";
  display: block;
  margin-bottom: 44px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .13em;
}
.auth-visual-content h2 {
  max-width: 570px;
  margin: 20px 0 18px;
  color: #17343a;
  background: none;
  -webkit-text-fill-color: currentColor;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
}
.auth-visual-content p { max-width: 520px; color: #506a70; font-size: 17px; }
.product-pill {
  padding: 7px 11px;
  color: #086b62;
  background: #d8f0eb;
  border: 1px solid #b9dfd8;
  border-radius: 5px;
  letter-spacing: .06em;
}
.auth-card {
  flex: .9;
  min-width: 460px;
  padding: clamp(40px, 6vw, 88px);
  box-shadow: none;
}
.auth-card::after {
  content: "Güvenli tenant erişimi  •  TLS korumalı oturum";
  max-width: 390px;
  margin-top: 32px;
  color: var(--text-muted);
  font-size: 12px;
}
.auth-brand { margin-bottom: 72px; }
.brand-mark {
  background: #087f73;
  border-radius: 7px;
  box-shadow: 0 6px 18px rgba(8,127,115,.18);
}
#auth-login-form { max-width: 390px; }
#auth-login-form h1 { font-size: 28px; margin-bottom: 24px; }
#auth-login-form label { margin-bottom: 15px; }
#auth-login-form input { height: 46px; background: #fbfcfc; }
#auth-login-form button[type="submit"] { height: 47px; box-shadow: none; }

/* Main shell */
.app-shell { min-height: 100dvh; }
.sidebar {
  width: 268px;
  color: var(--text-sidebar);
  background: #fff;
  border-right: 1px solid var(--border-color);
  box-shadow: 8px 0 30px rgba(26,55,61,.025);
}
.sidebar .brand {
  height: 76px;
  min-height: 76px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-color);
}
.sidebar .brand::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: auto;
  background: var(--success);
  border: 2px solid #dff5eb;
  border-radius: 50%;
  box-sizing: content-box;
}
.sidebar .brand strong { color: var(--text-main); font-size: 16px; }
.sidebar .brand span { color: var(--text-muted); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.sidebar .brand-logo { max-width: 116px; }
.side-nav { padding: 14px 12px 22px; gap: 3px; scrollbar-color: #cbd7d9 transparent; }
.side-nav::-webkit-scrollbar-thumb { background: #cbd7d9; }
.nav-section-label {
  padding: 16px 10px 7px;
  color: #91a0a4;
  font-size: 10px;
  letter-spacing: .11em;
}
.nav-group { gap: 1px; }
.nav-group-toggle {
  min-height: 41px;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 10px;
  color: #31464c;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 650;
}
.nav-group-toggle::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background: var(--nav-icon, currentColor);
  opacity: .74;
  mask: var(--nav-mask, radial-gradient(circle, #000 0 42%, transparent 46%)) center / contain no-repeat;
  -webkit-mask: var(--nav-mask, radial-gradient(circle, #000 0 42%, transparent 46%)) center / contain no-repeat;
}
.nav-group:nth-of-type(1) { --nav-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 13h8V3H3v10Zm0 8h8v-6H3v6Zm10 0h8V11h-8v10Zm0-18v6h8V3h-8Z'/%3E%3C/svg%3E"); }
.nav-group:nth-of-type(2) { --nav-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 20V10h3v10H5Zm6 0V4h3v16h-3Zm6 0v-7h3v7h-3Z'/%3E%3C/svg%3E"); }
.nav-group:nth-of-type(3) { --nav-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6.6 10.8a15 15 0 0 0 6.6 6.6l2.2-2.2c.3-.3.8-.4 1.2-.3 1.3.4 2.6.6 4 .6.7 0 1.2.5 1.2 1.2v3.5c0 .7-.5 1.2-1.2 1.2C10.3 21.9 2.1 13.7 2.1 3.4c0-.7.5-1.2 1.2-1.2h3.5C7.5 2.2 8 2.7 8 3.4c0 1.4.2 2.7.6 4 .1.4 0 .9-.3 1.2l-1.7 2.2Z'/%3E%3C/svg%3E"); }
.nav-group:nth-of-type(4) { --nav-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M16 11c1.7 0 3-1.3 3-3s-1.3-3-3-3-3 1.3-3 3 1.3 3 3 3ZM8 11c1.7 0 3-1.3 3-3S9.7 5 8 5 5 6.3 5 8s1.3 3 3 3Zm0 2c-2.3 0-7 1.2-7 3.5V19h14v-2.5C15 14.2 10.3 13 8 13Zm8 0c-.3 0-.7 0-1.1.1 1.2.9 2.1 2 2.1 3.4V19h6v-2.5c0-2.3-4.7-3.5-7-3.5Z'/%3E%3C/svg%3E"); }
.nav-group:nth-of-type(5) { --nav-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2Zm0 4-8 5-8-5V6l8 5 8-5v2Z'/%3E%3C/svg%3E"); }
.nav-group:nth-of-type(6) { --nav-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 18c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2ZM1 2v2h2l3.6 7.6-1.4 2.5c-.1.3-.2.6-.2.9 0 1.1.9 2 2 2h12v-2H7.4c-.1 0-.2-.1-.2-.2v-.1l.9-1.7h7.5c.8 0 1.4-.4 1.7-1l3.6-6.5c.1-.2.1-.3.1-.5 0-.6-.4-1-1-1H5.2l-.9-2H1Zm16 16c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2Z'/%3E%3C/svg%3E"); }
.nav-group:nth-of-type(7) { --nav-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2a3 3 0 0 0-3 3v1H7a2 2 0 0 0-2 2v12h14V8a2 2 0 0 0-2-2h-2V5a3 3 0 0 0-3-3Zm-1 3a1 1 0 0 1 2 0v1h-2V5Zm-4 5h10v8H7v-8Z'/%3E%3C/svg%3E"); }
.nav-group:nth-of-type(8) { --nav-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19.4 13a7.5 7.5 0 0 0 .1-1 7.5 7.5 0 0 0-.1-1l2.1-1.6-2-3.4-2.5 1a8 8 0 0 0-1.7-1L15 3.3h-4L10.6 6a8 8 0 0 0-1.7 1l-2.5-1-2 3.4L6.5 11a7.5 7.5 0 0 0-.1 1 7.5 7.5 0 0 0 .1 1l-2.1 1.6 2 3.4 2.5-1a8 8 0 0 0 1.7 1l.4 2.7h4l.4-2.7a8 8 0 0 0 1.7-1l2.5 1 2-3.4L19.4 13ZM13 15.5a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7Z'/%3E%3C/svg%3E"); }
.nav-group-toggle:hover { color: #173c41; background: #f1f6f6; }
.nav-group-toggle[aria-expanded="true"] { color: var(--primary); background: #f1faf8; }
.nav-group-toggle .nav-chevron { margin-left: auto; color: #8fa1a5; }
.nav-group-panel {
  margin: 2px 0 5px 17px;
  padding: 2px 0 3px 20px;
  border-left: 1px solid #dce7e7;
  gap: 1px;
}
.nav-item {
  min-height: 34px;
  padding: 6px 10px;
  color: #61767c;
  border-radius: 5px;
  font-size: 12.5px;
}
.nav-item:hover { color: #183d42; background: #f3f7f7; }
.nav-item.active {
  position: relative;
  padding-left: 10px;
  color: #076d64;
  background: #e8f6f3;
  border-left: 0;
  font-weight: 700;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -22px;
  width: 3px;
  height: 22px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}
.sidebar-footer { padding: 14px 16px; background: #fafcfc; border-top: 1px solid var(--border-color); }
.session-state::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; background: var(--success); border-radius: 50%; }

.workspace { margin-left: 268px; padding: 22px 26px 38px; }
.topbar {
  position: sticky;
  top: 0;
  height: 76px;
  margin: -22px -26px 24px;
  padding: 0 26px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--border-color);
  box-shadow: none;
  backdrop-filter: blur(12px);
}
.topbar-main { min-width: 210px; }
.topbar-main .brand-mark { display: none; }
.topbar-main .eyebrow { color: #5f747a; font-size: 10px; letter-spacing: .1em; }
.topbar-main h1 { font-size: 18px; font-weight: 750; }
.topbar-actions { margin-left: auto; gap: 9px; }
.workspace-switcher { padding: 3px; background: #f2f6f6; border-color: #e2e9ea; border-radius: 7px; }
.workspace-switcher button { min-height: 31px; padding: 4px 10px; color: #5b7076; border: 0; }
.workspace-switcher button:hover { color: var(--primary); background: #fff; }
.user-chip { padding: 4px 11px 4px 5px; background: #fff; border-radius: 7px; }
#user-initials { width: 31px; height: 31px; background: #dcefeb; color: #086c63; border-radius: 5px; }

/* Content */
.view-panel.active { gap: 16px; animation: atlasEnter .2s ease-out; }
@keyframes atlasEnter { from { opacity: 0; transform: translateY(4px); } }
.split-layout { gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.panel, .premium-card {
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.panel:hover, .premium-card:hover { box-shadow: var(--shadow-sm); }
.panel-head, .card-title-bar { min-height: 34px; margin-bottom: 17px; padding-bottom: 13px; border-bottom-color: #e8edef; }
.panel-head h2, .card-title-bar h3 { font-size: 14px; font-weight: 750; }
.panel-copy { color: var(--text-secondary); line-height: 1.65; }
.eyebrow { color: #5e747a; font-size: 10px; letter-spacing: .09em; }
.subsection-title { color: #243b41; font-size: 14px; }
.quick-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

#view-dashboard > .split-layout:first-child { grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); }
#view-dashboard > .split-layout:first-child > .panel:first-child {
  position: relative;
  overflow: hidden;
  min-height: 186px;
  padding: 27px;
  background: #15383d;
  border-color: #15383d;
  color: white;
}
#view-dashboard > .split-layout:first-child > .panel:first-child::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -105px;
  width: 240px;
  height: 240px;
  border: 52px solid rgba(73,190,170,.12);
  border-radius: 50%;
}
#view-dashboard > .split-layout:first-child > .panel:first-child .panel-head { border-bottom-color: rgba(255,255,255,.13); }
#view-dashboard > .split-layout:first-child > .panel:first-child h2 { color: white; font-size: 20px; }
#view-dashboard > .split-layout:first-child > .panel:first-child .panel-copy { max-width: 650px; color: #c7d8da; }
#view-dashboard > .split-layout:first-child > .panel:first-child .secondary { color: #d8eeeb; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); }
#view-dashboard > .split-layout:first-child > .panel:first-child .secondary:hover { color: white; background: rgba(255,255,255,.14); }

.metric-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.metric {
  min-height: 106px;
  justify-content: space-between;
  padding: 15px 16px;
  background: #fbfcfc;
  border-radius: 7px;
  box-shadow: none;
}
.metric::before { content: ""; width: 24px; height: 3px; background: #8ccfc3; border-radius: 3px; }
.metric:hover { transform: none; border-color: #c9d6d8; box-shadow: none; }
.metric span { color: #536a70; font-size: 10px; letter-spacing: .07em; }
.message { color: #5c7278; }
.metric strong { color: #19363b; font-size: 24px; letter-spacing: 0; }
.facts { display: grid; gap: 0; }
.facts > div { padding: 10px 0; border-bottom: 1px solid #edf1f2; }
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: #7a8c91; font-size: 11px; }
.facts dd { color: #213b40; font-size: 13px; font-weight: 700; }

button, .btn, [role="button"] { min-height: 38px; border-radius: 6px; box-shadow: none; }
button:hover { transform: translateY(-1px); }
button:active { transform: translateY(0); }
button.secondary { color: #3f565c; background: #fff; border-color: #d8e1e3; }
button.secondary:hover { color: #086f66; background: #f2f8f7; border-color: #b9cfcc; }
.compact-button { min-height: 33px; }

label { color: #4f646a; font-size: 12px; font-weight: 650; }
input, select, textarea, .premium-input, .premium-select {
  border-color: #d8e2e4;
  border-radius: 6px;
  background: #fbfcfc;
}
label input, label select { height: 41px; background: #fbfcfc; }
input:focus, select:focus, textarea:focus, label input:focus, label select:focus {
  border-color: #55aa9d;
  box-shadow: 0 0 0 3px rgba(8,127,115,.11);
  background: #fff;
}
.stack-form, .onboarding-form { gap: 14px 16px; }
.inline-form { gap: 10px; }

.table-responsive { border-radius: 7px; border-color: #e1e8e9; }
table { font-size: 12.5px; }
th { padding: 11px 14px; color: #6b7f84; background: #f6f9f9; font-size: 10px; letter-spacing: .06em; }
td { padding: 12px 14px; }
tbody tr:hover td { background: #f5faf9; }
.item { padding: 11px 13px; border-radius: 6px; }
.item:hover { border-color: #c3d2d4; box-shadow: none; }
.list.empty { background: #fafcfc; }
.badge { padding: 4px 8px; border-radius: 4px; letter-spacing: .04em; }
.result-box { color: #d0ebe6; background: #18383d; border-radius: 6px; }

/* SaaS operations */
.operations-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding: 4px 2px 2px; }
.operations-heading h2 { margin: 3px 0 5px; color: #17373c; font-size: 24px; }
.operations-heading p:last-child { margin: 0; color: var(--text-secondary); }
.live-system-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 7px 11px; color: #28615a; background: #edf8f5; border: 1px solid #cce7e1; border-radius: 6px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.live-system-pill i { width: 7px; height: 7px; background: #20a87d; border-radius: 50%; box-shadow: 0 0 0 4px rgba(32,168,125,.1); }
.operations-metrics { grid-template-columns: repeat(4, minmax(140px, 1fr)); }
.operations-layout { display: grid; grid-template-columns: minmax(420px, 1.35fr) minmax(300px, .65fr); gap: 16px; align-items: start; }
.operations-layout-balanced { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.operations-config-panel { min-width: 0; }
.form-full { grid-column: 1 / -1; }
.schedule-fieldset { min-width: 0; padding: 14px; border: 1px solid #dfe8e9; border-radius: 7px; }
.schedule-fieldset legend { padding: 0 7px; color: #3e595f; font-size: 12px; font-weight: 750; }
.weekday-picker { display: grid; grid-template-columns: repeat(7, minmax(44px, 1fr)); gap: 6px; }
.weekday-picker label { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 36px; padding: 5px; background: #f5f8f8; border: 1px solid #dce5e6; border-radius: 5px; cursor: pointer; }
.weekday-picker input { width: 15px; height: 15px; margin: 0; }
.time-range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.success-button { color: #fff; background: #168669; border-color: #168669; }
.success-button:hover { background: #116e57; }
.operations-list { display: grid; gap: 8px; }
.operation-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; width: 100%; min-height: 62px; padding: 10px 12px; color: #263f44; text-align: left; background: #fbfcfc; border: 1px solid #e0e8e9; border-radius: 7px; }
button.operation-card:hover, button.operation-card.active { background: #f1f8f7; border-color: #9fc9c2; transform: none; }
.operation-card strong, .operation-card small { display: block; }
.operation-card small { margin-top: 3px; color: #71858a; font-size: 11px; }
.operation-status-dot { width: 8px; height: 8px; margin-right: 10px; background: #a9b8bb; border-radius: 50%; }
.operation-card.active .operation-status-dot { background: #17a776; box-shadow: 0 0 0 4px rgba(23,167,118,.1); }
.operation-card-meta { text-align: right; }
.operation-card-meta b { display: block; font-size: 17px; }
.status-chip { display: inline-flex; padding: 4px 7px; color: #51666b; background: #edf1f2; border-radius: 4px; font-size: 10px; font-weight: 750; text-transform: uppercase; }
.status-running, .status-answered, .status-completed, .status-resolved { color: #146448; background: #e2f5ed; }
.status-failed, .status-abandoned, .status-urgent { color: #9a342f; background: #fbe9e7; }
.status-originating, .status-ringing, .status-open { color: #1c5f83; background: #e7f2f8; }
.status-paused, .status-pending, .status-queued { color: #795d13; background: #fbf3d9; }
.empty-table-cell { padding: 28px; color: #7b8d91; text-align: center; }
.channel-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.channel-pill { display: inline-flex; gap: 7px; padding: 6px 8px; color: #53696e; background: #f2f7f6; border: 1px solid #dae7e5; border-radius: 5px; font-size: 11px; }
.channel-pill b { color: #08776b; text-transform: uppercase; }
.segmented-filter { display: flex; gap: 3px; padding: 3px; background: #f1f5f5; border-radius: 6px; }
.segmented-filter button { min-height: 30px; padding: 4px 9px; color: #52686e; background: transparent; border: 0; }
.segmented-filter button.active { color: #086f66; background: #fff; box-shadow: 0 1px 3px rgba(29,52,57,.1); }
.conversation-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.conversation-card { min-width: 0; padding: 14px; background: #fbfcfc; border: 1px solid #e0e8e9; border-left: 3px solid #9eafb2; border-radius: 7px; }
.conversation-card.priority-high { border-left-color: #dc9c27; }
.conversation-card.priority-urgent { border-left-color: #d34d42; }
.conversation-card header, .conversation-card footer { display: flex; justify-content: space-between; gap: 10px; }
.conversation-card h3 { margin: 12px 0 5px; color: #203c41; font-size: 14px; }
.conversation-card p { min-height: 38px; margin: 0 0 14px; color: #667b80; font-size: 12px; line-height: 1.55; }
.conversation-card footer { color: #7a8c91; font-size: 10px; }
.channel-type { color: #08766b; font-size: 10px; font-weight: 750; text-transform: uppercase; }
.quality-criteria-grid { display: grid; grid-template-columns: repeat(5, minmax(90px, 1fr)); gap: 8px; }
.quality-answer-fields { display: grid; gap: 10px; }
.score-control { display: grid; grid-template-columns: minmax(0, 1fr) 38px; align-items: center; gap: 10px; margin-top: 5px; }
.score-control input { width: 100%; height: auto; }
.score-control output { color: #086f66; font-weight: 800; text-align: right; }
.quality-result { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 12px; background: #fbfcfc; border: 1px solid #e0e8e9; border-radius: 7px; }
.quality-score { display: grid; place-items: center; width: 48px; height: 48px; color: #086f66; background: #e5f4f1; border-radius: 6px; font-size: 18px; font-weight: 850; }
.quality-result p { margin: 4px 0 0; color: #71858a; font-size: 11px; }
.quality-result time { color: #809196; font-size: 10px; }
.readiness-panel { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 18px; align-items: center; }
.readiness-score { display: grid; place-items: center; width: 106px; height: 106px; color: #08776b; background: #edf8f5; border: 8px solid #cdeae4; border-radius: 50%; font-size: 23px; font-weight: 850; }
.readiness-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 7px; }
.readiness-item { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 8px; background: #fafcfc; border: 1px solid #e3eaeb; border-radius: 6px; }
.readiness-icon { display: grid; place-items: center; width: 25px; height: 25px; color: #805f13; background: #fbf0d0; border-radius: 5px; font-weight: 850; }
.readiness-item.complete .readiness-icon { color: #116b4e; background: #ddf3ea; }
.readiness-item strong, .readiness-item small { display: block; }
.readiness-item strong { font-size: 11px; }
.readiness-item small { margin-top: 2px; color: #7c8e92; font-size: 9px; }

/* Agent desktop */
body#agent-app { background: #edf2f3; }
body#agent-app .workspace { margin-left: 0; padding: 14px 18px 22px; }
body#agent-app .topbar { height: 68px; margin: -14px -18px 14px; padding: 0 18px; }
body#agent-app .topbar-main .brand-mark { display: flex; }
body#agent-app .agent-os-content-dashboard { gap: 12px; grid-template-columns: minmax(250px, .82fr) minmax(410px, 1.45fr) minmax(290px, 1fr); }
body#agent-app .premium-card { padding: 16px; }
body#agent-app .agent-os-content-dashboard > .premium-card:first-child {
  position: sticky;
  top: 76px;
  z-index: 35;
  border: 1px solid #d8e3e4 !important;
  border-left: 1px solid #d8e3e4 !important;
  box-shadow: 0 7px 22px rgba(26,55,61,.07) !important;
}
.agent-nav-tabs { padding: 3px; background: #f0f4f4; border-radius: 6px; }
.agent-nav-tabs .tab-btn { height: 32px; border: 0; background: transparent; border-radius: 5px; }
.agent-nav-tabs .tab-btn.active { background: #fff; color: #086f66; box-shadow: 0 1px 3px rgba(25,50,56,.1); }
.agent-call-clock { border-radius: 5px; }
.agent-pane-left, .agent-pane-center, .agent-pane-right { gap: 12px; }
.dialer-badge { border-radius: 4px; }
.dialer-input { background: #f8fbfb; }
.agent-call-actions-premium { gap: 7px; }
.call-btn-premium { min-width: 0; }
.btn-auto-start, .agent-os-primary, .premium-btn-action { background: var(--primary) !important; border-color: var(--primary) !important; box-shadow: none !important; }
.btn-auto-start:hover, .agent-os-primary:hover, .premium-btn-action:hover { background: var(--primary-hover) !important; }
.customer-profile-premium { background: #f6faf9; }
.metric-mini { background: #f6f9f9; border-radius: 6px; }
.agent-script-card { background: #fafcfc; border-radius: 6px; }
.campaign-not-selected .agent-workspace-blur-target { filter: grayscale(.35); opacity: .48; }

/* IVR builder and dense tools */
.ivr-workspace, .flow-workspace, .builder-workspace { background-color: #f8faf9; }
.ivr-node, .flow-node, .builder-node { border-radius: 7px !important; box-shadow: 0 5px 16px rgba(26,55,61,.08) !important; }
.chip-picker, .tabs-nav-bar { border-radius: 7px; }

/* Responsive */
@media (max-width: 1360px) {
  body#agent-app .agent-os-content-dashboard { grid-template-columns: minmax(250px,.85fr) minmax(430px,1.4fr); }
  body#agent-app .agent-pane-right { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 1120px) {
  .workspace { margin-left: 0; padding: 18px; }
  .topbar { margin: -18px -18px 18px; padding: 0 18px; }
  .sidebar { transform: translateX(-100%); box-shadow: 18px 0 50px rgba(19,42,48,.16); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { background: rgba(22,43,48,.32); backdrop-filter: blur(2px); }
  .mobile-menu-button { display: inline-flex; width: 38px; padding: 0; font-size: 0; }
  .mobile-menu-button { position: relative; color: transparent !important; overflow: hidden; }
  .mobile-menu-button::before { content: "☰"; color: #31464c; font-size: 19px; line-height: 1; }
  .workspace-switcher { display: none; }
  #view-dashboard > .split-layout:first-child { grid-template-columns: 1fr; }
  .operations-layout { grid-template-columns: 1fr; }
  .operations-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body#agent-app .topbar-actions > #logout-button,
  body#agent-app .topbar-actions > .user-chip { display: none; }
  body#agent-app .agent-os-content-dashboard > .premium-card:first-child {
    flex-direction: column;
    align-items: stretch !important;
    gap: 12px;
  }
  body#agent-app .agent-os-content-dashboard > .premium-card:first-child > div {
    flex-wrap: wrap;
    gap: 10px !important;
  }
  body#agent-app .agent-nav-tabs { flex: 1 1 480px; overflow-x: auto; }
}
@media (max-width: 820px) {
  .auth-card { min-width: 0; }
  .topbar { min-height: 66px; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
  .topbar-main { flex: 1; min-width: 180px; }
  .topbar-actions { width: auto; margin-top: 0; }
  .user-chip div { display: none; }
  .stack-form, .onboarding-form, .inline-form { grid-template-columns: 1fr; }
  .panel, .premium-card { padding: 16px; }
  .operations-heading { align-items: flex-start; flex-direction: column; }
  .quality-criteria-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weekday-picker { grid-template-columns: repeat(4, minmax(44px, 1fr)); }
  .readiness-panel { grid-template-columns: 1fr; }
  .readiness-score { width: 84px; height: 84px; border-width: 6px; }
  body#agent-app .agent-os-content-dashboard { display: flex; flex-direction: column; }
  body#agent-app .agent-pane-right { display: flex; }
  body#agent-app .topbar-agent-metrics { display: none !important; }
  body#agent-app .agent-os-content-dashboard > .premium-card:first-child { position: static; flex-direction: column; align-items: stretch !important; gap: 12px; }
  body#agent-app .agent-os-content-dashboard > .premium-card:first-child > div { flex-wrap: wrap; gap: 10px !important; }
  .agent-nav-tabs { width: 100%; overflow-x: auto; }
}
@media (max-width: 560px) {
  .workspace { padding: 12px; }
  .topbar { margin: -12px -12px 12px; padding: 10px 12px; }
  .topbar-main h1 { font-size: 15px; }
  .topbar-actions > .secondary { display: none; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .operations-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .time-range, .quality-criteria-grid { grid-template-columns: 1fr; }
  .weekday-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .segmented-filter { width: 100%; overflow-x: auto; }
  .segmented-filter button { flex: 1 0 auto; }
  .conversation-grid { grid-template-columns: 1fr; }
  .quality-result { grid-template-columns: 46px minmax(0, 1fr); }
  .quality-result time { grid-column: 2; }
  .metric { min-height: 96px; padding: 13px; }
  .metric strong { font-size: 20px; }
  .panel-head, .card-title-bar { align-items: flex-start; }
  .panel-head .inline-form { width: 100%; }
  .phone-fab { right: 12px; bottom: 12px; }
  .phone-dock-panel { right: 12px; bottom: 76px; width: calc(100vw - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* End-user form builders */
.campaign-script-builder-shell {
  display: grid;
  gap: 12px;
  padding: 15px;
  background: #f8fbfa;
  border: 1px solid #dce7e6;
  border-radius: 7px;
}
.campaign-script-builder-head,
.campaign-script-step > header,
.campaign-script-step-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.campaign-script-builder-head { justify-content: space-between; }
.campaign-script-builder-head strong,
.campaign-script-builder-head span { display: block; }
.campaign-script-builder-head strong { color: #213b40; font-size: 13px; }
.campaign-script-builder-head span,
.campaign-script-builder-shell > small { margin-top: 3px; color: #72868a; font-size: 10px; }
.campaign-script-builder { display: grid; gap: 10px; }

.settings-summary {
  white-space: pre-line;
  line-height: 1.8;
}
.campaign-script-step {
  display: grid;
  gap: 12px;
  padding: 13px;
  background: #fff;
  border: 1px solid #dfe8e8;
  border-left: 3px solid #3ca895;
  border-radius: 6px;
}
.campaign-script-step > header > span {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  color: #087268;
  background: #e5f4f1;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
}
.campaign-script-step > header > input { min-width: 160px; flex: 1; height: 36px; font-weight: 750; }
.campaign-script-step-actions { margin-left: auto; }
.campaign-choice-list { display: grid; gap: 7px; padding-top: 10px; border-top: 1px solid #edf1f2; }
.campaign-choice-list > strong { color: #536a70; font-size: 11px; }
.campaign-choice-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) minmax(150px, .8fr) auto;
  gap: 7px;
  align-items: center;
}
.campaign-choice-row input,
.campaign-choice-row select { height: 36px; }

.field-builder-row {
  align-items: start;
}
.field-options {
  display: grid;
  gap: 7px;
  min-width: 240px;
}
.field-options > span { color: #4f646a; font-size: 12px; font-weight: 650; }
.field-options.is-muted { display: none; }
.field-option-list { display: grid; gap: 6px; }
.field-option-row { display: grid; grid-template-columns: minmax(130px, 1fr) auto; gap: 6px; }
.field-option-row input { height: 36px; }

/* IVR flow studio */
.ivr-builder-panel { padding: 0; overflow: hidden; }
.ivr-builder-panel > .panel-head { margin: 0; padding: 18px 20px; background: #fff; }
.ivr-builder-panel > .stack-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 0 20px 20px; }
.ivr-builder-panel .vbx-flow-builder { grid-column: 1 / -1; }
.vbx-flow-builder {
  grid-template-columns: 224px minmax(420px, 1fr) 310px;
  min-height: 690px;
  background: #fff;
  border-color: #d9e4e4;
  border-radius: 7px;
  box-shadow: 0 7px 24px rgba(27, 55, 60, .07);
}
.vbx-flow-toolbox,
.vbx-settings-panel {
  padding: 14px;
  background: #f7faf9;
}
.vbx-toolbox-heading { margin-bottom: 12px; }
.vbx-toolbox-heading h3 { margin: 0; color: #213b40; font-size: 13px; }
.vbx-toolbox-heading span { display: block; margin-top: 4px; color: #74878b; font-size: 10px; line-height: 1.45; }
.vbx-flow-toolbox { display: flex; flex-direction: column; gap: 6px; border-right-color: #dce6e6; }
.vbx-settings-panel { border-left-color: #dce6e6; }
.vbx-applet-item {
  display: grid;
  justify-items: start;
  width: 100%;
  min-height: 52px;
  padding: 9px 10px 9px 37px;
  position: relative;
  color: #294248;
  text-align: left;
  background: #fff;
  border: 1px solid #dce6e6;
  border-radius: 6px;
}
.vbx-applet-item::before {
  content: "+";
  position: absolute;
  left: 10px;
  top: 14px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: #08766b;
  background: #e4f3f0;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 800;
}
.vbx-applet-item strong { font-size: 11px; }
.vbx-applet-item small { margin-top: 2px; color: #7b8d91; font-size: 9px; }
.vbx-applet-item:hover { color: #075f57; background: #f1f8f7; border-color: #a9cec8; transform: none; }
.vbx-flowline-wrap { min-width: 0; background: #f4f8f7; }
.vbx-flowbar {
  min-height: 54px;
  padding: 10px 15px;
  background: #fff;
  border-bottom: 1px solid #dce6e6;
}
.vbx-flowline {
  min-height: 634px;
  padding: 30px 20px 70px;
  overflow: auto;
  background-color: #f4f8f7;
  background-image: radial-gradient(#cbd9d7 1px, transparent 1px);
  background-size: 18px 18px;
}
.vbx-flow-instances { width: min(100%, 520px); margin: 0 auto; }
.vbx-flow-instance {
  width: 100%;
  min-height: 78px;
  padding: 12px 14px;
  color: #294148;
  text-align: left;
  background: #fff;
  border: 1px solid #d5e0e0;
  border-left: 4px solid #5aa99c;
  border-radius: 6px;
  box-shadow: 0 4px 13px rgba(30, 59, 64, .07);
}
.vbx-flow-instance:hover,
.vbx-flow-instance.selected { background: #fff; border-color: #63aa9f; box-shadow: 0 0 0 3px rgba(35, 147, 131, .11), 0 5px 15px rgba(30, 59, 64, .08); transform: none; }
.vbx-flow-instance .vbx-applet-name { color: #08756a; }
.vbx-flow-instance strong { margin-top: 4px; color: #213a40; }
.vbx-flow-instance small { margin-top: 4px; color: #6f8388; }
.vbx-flow-start { border-left-color: #2874a6; }
.vbx-flow-rail { min-height: 42px; }
.vbx-flow-rail > span { background: #9eb8b4; }
.vbx-flow-rail button { width: 26px; height: 26px; min-height: 26px; padding: 0; color: #08756a; background: #fff; border-color: #a9c6c1; border-radius: 50%; }
.vbx-menu-branches { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); width: min(100%, 620px); }
.vbx-menu-choice { min-height: 54px; background: #fff; border-color: #d6e3e2; }
.vbx-settings-form { display: grid; gap: 11px; }
.vbx-settings-form label { display: grid; gap: 5px; }
.vbx-choice-editor {
  display: grid;
  gap: 8px;
  padding: 11px;
  background: #fff;
  border: 1px solid #dfe8e8;
  border-radius: 6px;
}
.vbx-choice-row { display: grid; gap: 7px; padding-bottom: 9px; border-bottom: 1px solid #edf1f2; }
.vbx-inline-audio-drop {
  padding: 11px;
  color: #365057;
  background: #eef7f5;
  border: 1px dashed #8ebdb5;
  border-radius: 6px;
  cursor: pointer;
}
.vbx-inline-audio-drop.drag-over { background: #e1f3ef; border-color: #168d7d; }
.vbx-inline-audio-drop input { height: auto; padding: 7px; background: #fff; }
.vbx-inline-audio-drop small { color: #71858a; font-size: 9px; line-height: 1.45; }
.vbx-settings-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding-top: 3px; }
.ivr-builder-panel .upload-dropzone { min-height: 80px; }
.ivr-builder-panel > .message,
.ivr-builder-panel > .list { margin-right: 20px; margin-left: 20px; }

@media (max-width: 1280px) {
  .vbx-flow-builder { grid-template-columns: 190px minmax(390px, 1fr) 280px; }
  .vbx-applet-item { padding-left: 34px; }
}
@media (max-width: 1080px) {
  .vbx-flow-builder { grid-template-columns: 190px minmax(0, 1fr); }
  .vbx-settings-panel { grid-column: 1 / -1; border-top: 1px solid #dce6e6; border-left: 0; }
  .vbx-settings-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vbx-choice-editor, .vbx-settings-actions, .vbx-inline-audio-drop { grid-column: 1 / -1; }
  .campaign-choice-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .campaign-script-step > header { align-items: flex-start; flex-wrap: wrap; }
  .campaign-script-step-actions { width: 100%; margin-left: 35px; overflow-x: auto; }
  .campaign-choice-row { grid-template-columns: 1fr; }
  .vbx-flow-builder { display: flex; flex-direction: column; min-height: 0; }
  .vbx-flow-toolbox { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 310px; border-right: 0; border-bottom: 1px solid #dce6e6; }
  .vbx-toolbox-heading { grid-column: 1 / -1; }
  .vbx-applet-item { min-height: 58px; }
  .vbx-flowline { min-height: 520px; padding: 24px 12px 50px; }
  .vbx-settings-form { grid-template-columns: 1fr; }
  .ivr-builder-panel > .stack-form { grid-template-columns: 1fr; padding: 0 12px 16px; }
  .ivr-builder-panel > .panel-head { padding: 15px 12px; }
}
