/* ==========================================================================
   REGOSOFT CONTACT CENTER & PBX - PREMIUM SAAS LIGHT THEME
   ========================================================================== */


:root {
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Theme Accents (Indigo & Slate) */
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-light: #EEF2F6;
  --primary-soft: #F5F3FF;
  --primary-glow: rgba(79, 70, 229, 0.15);

  /* Status Colors */
  --success: #10B981;
  --success-hover: #059669;
  --success-soft: #ECFDF5;
  --warning: #F59E0B;
  --warning-hover: #D97706;
  --warning-soft: #FFFBEB;
  --danger: #EF4444;
  --danger-hover: #DC2626;
  --danger-soft: #FEF2F2;
  --info: #3B82F6;
  --info-soft: #EFF6FF;

  /* Layout Backgrounds & Surfaces (Light SaaS theme) */
  --bg-app: #F8FAFC;            /* Sleek slate light background */
  --bg-surface: #FFFFFF;        /* Clean White Cards/Panels */
  --bg-sidebar: #0F172A;        /* Premium Dark Slate Sidebar */
  --bg-sidebar-hover: #1E293B;  /* Sidebar link hover background */
  --bg-sidebar-active: #334155; /* Sidebar link active background */

  /* Borders & Dividers */
  --border-color: #E2E8F0;      /* Slate-200 */
  --border-color-hover: #CBD5E1;
  --border-focus: #4F46E5;

  /* Text Colors */
  --text-main: #0F172A;         /* Slate 900 */
  --text-muted: #64748B;        /* Slate 600 */
  --text-disabled: #94A3B8;     /* Slate 400 */
  --text-sidebar: #E2E8F0;
  --text-sidebar-muted: #94A3B8;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 8px 30px rgba(79, 70, 229, 0.12);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* ==========================================================================
   RESET & SYSTEM BASE
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

body {
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

/* Inputs & Form Elements */
input, select, textarea, button {
  font-family: inherit;
  font-size: 0.9rem;
  color: inherit;
  outline: none;
}

textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background-color: var(--bg-surface);
  resize: vertical;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

textarea:focus {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-glow), 0 0 0 3px var(--primary-glow);
}

/* Buttons */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  background-color: var(--primary);
  color: #FFFFFF;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

button:hover {
  background-color: var(--primary-hover);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed !important;
}

button.secondary {
  background-color: #FFFFFF;
  color: var(--text-secondary);
  border-color: var(--border-color);
}

button.secondary:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--border-color-hover);
}

button.compact-button {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

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

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

/* ==========================================================================
   LAYOUT: SINGLE PAGE APPLICATION SHELLS
   ========================================================================== */

/* Authentication Shell (Login Page) */
.auth-shell {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  background-color: var(--bg-app);
}

/* Split Visual Pane (Left) */
.auth-visual {
  flex: 1.2;
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
}

.auth-visual::before {
  content: "";
  position: absolute;
  top: -10%;
  right: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.18) 0%, transparent 70%);
  border-radius: 50%;
}

.auth-visual-content {
  max-width: 500px;
  position: relative;
  z-index: 10;
}

.auth-visual-content h2 {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  margin-top: 16px;
  margin-bottom: 16px;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #FFFFFF, #E2E8F0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-visual-content p {
  color: var(--text-sidebar-muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

.product-pill {
  display: inline-flex;
  padding: 6px 14px;
  background-color: rgba(79, 70, 229, 0.2);
  border: 1px solid rgba(79, 70, 229, 0.3);
  color: #A5B4FC;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Login Card Pane (Right) */
.auth-card {
  flex: 0.8;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  background-color: var(--bg-surface);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.02);
  min-width: 420px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 60px;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 1.4rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.brand-logo {
  max-height: 40px;
  object-fit: contain;
}

.auth-brand strong {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.auth-brand span {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Authentication Form */
#auth-login-form {
  max-width: 380px;
  width: 100%;
}

.auth-kicker {
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

#auth-login-form h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 24px;
}

#auth-login-form label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

#auth-login-form input {
  display: block;
  width: 100%;
  height: 44px;
  padding: 10px 14px;
  margin-top: 6px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-app);
  font-weight: 500;
  transition: all var(--transition-fast);
}

#auth-login-form input:focus {
  background-color: var(--bg-surface);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-glow), 0 0 0 3px var(--primary-glow);
}

#auth-login-form button[type="submit"] {
  width: 100%;
  height: 46px;
  margin-top: 12px;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}

#auth-login-form button[type="submit"]:hover {
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

/* Auth Mode Class Toggles */
body.needs-auth .app-shell,
body.is-authenticated .auth-shell {
  display: none !important;
}

body.is-authenticated .app-shell {
  display: flex;
}

/* ==========================================================================
   APP SHELL: SIDEBAR & WORKSPACE SYSTEM
   ========================================================================== */

.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Backdrop for Mobile Sidebar Drawer */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 900;
}

/* Sidebar Styling (Premium Koyu Slate Sidebar) */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 260px;
  background-color: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar .brand {
  height: 70px;
  min-height: 70px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 12px;
}

.sidebar .brand-mark {
  width: 32px;
  height: 32px;
  font-size: 1.15rem;
  border-radius: 6px;
}

.sidebar .brand strong {
  color: #FFFFFF;
  font-size: 1.1rem;
  font-weight: 800;
}

.sidebar .brand span {
  font-size: 0.72rem;
  color: var(--text-sidebar-muted);
  display: block;
}

/* Navigation List inside Sidebar */
.side-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Custom Webkit scrollbar for Koyu Sidebar */
.side-nav::-webkit-scrollbar {
  width: 4px;
}
.side-nav::-webkit-scrollbar-track {
  background: transparent;
}
.side-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
}

/* Sidebar Section Headers */
.nav-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-sidebar-muted);
  padding: 14px 12px 6px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Sidebar Navigation Toggles (Accordion Action) */
.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 38px;
  background: transparent;
  border: 0;
  color: var(--text-sidebar);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-group-toggle:hover {
  background-color: var(--bg-sidebar-hover);
  color: #FFFFFF;
}

.nav-group-toggle .nav-chevron {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-sidebar-muted);
  transition: transform var(--transition-fast);
}

.nav-group-toggle[aria-expanded="true"] .nav-chevron {
  transform: rotate(90deg);
}

/* Accordion Nav Panel */
.nav-group-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  margin-left: 18px;
  margin-top: 2px;
  margin-bottom: 4px;
  transition: all var(--transition-fast);
}

/* Nav Item (Individual Link) */
.nav-item {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-sidebar-muted);
  font-weight: 500;
  font-size: 0.84rem;
  transition: all var(--transition-fast);
}

.nav-item:hover {
  background-color: var(--bg-sidebar-hover);
  color: #FFFFFF;
}

.nav-item.active {
  background-color: var(--bg-sidebar-active);
  color: #FFFFFF;
  font-weight: 600;
  border-left: 2px solid var(--primary);
  padding-left: 10px;
}

/* Sidebar Footer (Status & Logout) */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background-color: rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.session-state {
  display: block;
  font-size: 0.75rem;
  color: var(--text-sidebar-muted);
  word-break: break-all;
}

/* Right-side Workspace Container */
.workspace {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 24px;
  min-width: 0; /* Important for flex-child grid layouts */
  transition: margin var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
}

/* Workspace Topbar header */
.topbar {
  display: flex;
  align-items: center;
  height: 70px;
  margin: -24px -24px 24px -24px;
  padding: 0 24px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  z-index: 50;
  gap: 16px;
}

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

.topbar-main h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.topbar-main .eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1px;
}

.topbar-main .brand-mark {
  width: 34px;
  height: 34px;
  font-size: 1.1rem;
}

/* Mobile Toggle Hamburger Button */
.mobile-menu-button {
  display: none;
}

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

/* Workspace Switcher in Header */
.workspace-switcher {
  display: flex;
  gap: 6px;
  background-color: var(--bg-app);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.workspace-switcher button {
  min-height: 32px;
  padding: 4px 12px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.workspace-switcher button:hover {
  background-color: rgba(79, 70, 229, 0.05);
  color: var(--primary);
}

.workspace-switcher button.active {
  background-color: var(--bg-surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* User Profil Chip */
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
}

#user-initials {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 50%;
}

.user-chip div {
  line-height: 1.25;
}

.user-chip strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip small {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Isolated view state (hides sidebar & topbar brand when agent desktop runs) */
body.agent-isolated .sidebar,
body.agent-isolated .sidebar-backdrop {
  display: none !important;
}

body.agent-isolated .workspace {
  margin-left: 0 !important;
  padding: 12px;
}

body.agent-isolated .topbar {
  margin: -12px -12px 12px -12px;
  padding: 0 16px;
  height: 60px;
}

/* ==========================================================================
   VIEW PANELS: TOGGLING & CONTAINER LAYOUTS
   ========================================================================== */

.view-panel {
  display: none !important;
  width: 100%;
}

.view-panel.active {
  display: flex !important;
  flex-direction: column;
  gap: 20px;
  animation: viewFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Grid splits for dashboard and sub-pages */
.split-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
}

.split-layout.single-active {
  grid-template-columns: 1fr !important;
}

/* Metric Cards Grid */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* Metrics Dashboard Cards */
.metric {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.metric::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background-color: var(--border-color);
  transition: background-color var(--transition-fast);
}

.metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric:hover::after {
  background-color: var(--primary);
}

.metric span {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric strong {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.metric-mini {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-app);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.metric-mini span {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
}

.metric-mini strong {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

/* ==========================================================================
   COMPONENTS: CARDS, FORMS, TABLES
   ========================================================================== */

/* Standard white box cards (SaaS Panel) */
.panel, .premium-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast);
}

.panel:hover, .premium-card:hover {
  box-shadow: var(--shadow-md);
}

/* Head of Cards containing title and actions */
.panel-head, .card-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.panel-head h2, .card-title-bar h3 {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.panel-copy {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Forms layout inside panels */
.inline-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  width: 100%;
}

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

/* Form inputs & fields */
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

label input, label select {
  height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-app);
  font-weight: 500;
  transition: all var(--transition-fast);
}

label input:focus, label select:focus {
  background-color: var(--bg-surface);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-glow), 0 0 0 3px var(--primary-glow);
}

.checkbox-label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  height: 16px;
  width: 16px;
  cursor: pointer;
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-top: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

th {
  background-color: var(--bg-app);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: var(--primary-light);
}

/* Log Display & Results boxes */
.result-box {
  width: 100%;
  padding: 14px;
  background-color: var(--bg-sidebar);
  color: #A5B4FC;
  border-radius: var(--radius-md);
  font-family: monospace;
  font-size: 0.8rem;
  overflow: auto;
  white-space: pre-wrap;
  margin-top: 12px;
}

/* Status Indicators */
.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}
.status-available, .status-ready, .status-online { background-color: var(--success); }
.status-busy, .status-offline, .status-error { background-color: var(--danger); }
.status-break, .status-away { background-color: var(--warning); }
.status-acw, .status-after_call_work { background-color: var(--info); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--primary-light);
  color: var(--primary);
}

.badge[data-mode="online"], .badge.state-active {
  background-color: var(--success-soft);
  color: var(--success);
}

.badge[data-mode="offline"], .badge.state-waiting {
  background-color: var(--danger-soft);
  color: var(--danger);
}

/* Item lists for lists that have dynamically generated elements */
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  gap: 16px;
  transition: all var(--transition-fast);
}

.item:hover {
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-sm);
}

.item div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item strong {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.item span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.item .item-actions {
  display: flex;
  flex-direction: row;
  gap: 6px;
}

.list.empty {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background-color: var(--bg-app);
  font-size: 0.85rem;
}

/* messages */
.message, .message-alert-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.message.error, .message-alert-text.error {
  color: var(--danger);
  font-weight: 600;
}

/* ==========================================================================
   WEBRTC INTEGRATION: SOFTPHONE & DIALPADS
   ========================================================================== */

/* Global Floating Softphone widget */
.global-softphone {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 850;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* Floating Action Button for softphone */
.phone-fab {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 54px;
  padding: 0 20px;
  background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-full);
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.4);
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.phone-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(79, 70, 229, 0.5);
}

.phone-fab-icon {
  font-size: 1.2rem;
}

.phone-fab span {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.phone-fab small {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.7);
}

.phone-fab .badge {
  background-color: #FFFFFF;
  color: var(--primary);
  margin-left: 8px;
}

/* Floating phone drawer overlay */
/* Floating phone drawer overlay */
.phone-dock-panel {
  width: 250px;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.03);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: panelSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes panelSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.phone-dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.phone-dock-head strong {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.phone-dock-head .eyebrow {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

/* Phone digital display wrapper */
.phone-display-wrapper {
  position: relative;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
}

.phone-display-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background-color: #FFFFFF;
}

.phone-display {
  width: 100%;
  height: 38px;
  border: none;
  background: transparent;
  padding: 0 54px 0 12px;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: left;
  letter-spacing: 0.02em;
  color: var(--text-main);
  outline: none;
}

.phone-display::placeholder {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-disabled);
}

.phone-display-tools {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 2px;
  z-index: 2;
}

.phone-tool-btn {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.phone-tool-btn svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.phone-tool-btn:hover {
  background-color: rgba(226, 232, 240, 0.8);
  color: var(--text-main);
}

.phone-tool-btn:active {
  transform: scale(0.9);
}

/* 3x4 phone numeric keypad */
.phone-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  justify-items: center;
  margin: 4px 0;
}

.phone-keypad button {
  width: 38px;
  height: 38px;
  min-height: auto;
  border-radius: 50%;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
}

.phone-keypad button span {
  display: none !important; /* Hide alphabet subtitles for a clean iOS feel */
}

.phone-keypad button:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px var(--primary-glow);
}

.phone-keypad button:active {
  transform: scale(0.92);
}

/* Action button bar inside phone drawer */
.phone-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.phone-icon-button {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: #FFFFFF;
  flex: none;
}

.phone-icon-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.phone-icon-button.call-btn {
  background-color: var(--success);
}

.phone-icon-button.call-btn:hover {
  background-color: var(--success-hover);
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.phone-icon-button.answer-btn {
  background-color: var(--info);
}

.phone-icon-button.answer-btn:hover {
  background-color: #2563EB;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.phone-icon-button.mute-btn {
  background-color: var(--bg-app);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.phone-icon-button.mute-btn:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.08);
}

.phone-icon-button.danger-button {
  background-color: var(--danger);
}

.phone-icon-button.danger-button:hover {
  background-color: var(--danger-hover);
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.phone-icon-button:active {
  transform: scale(0.95) !important;
}

.phone-dock-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
}


/* ==========================================================================
   IVR FLOW BUILDER GRAPHICAL CANVAS
   ========================================================================== */

.vbx-flow-builder {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  min-height: 600px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.vbx-flow-toolbox, .vbx-settings-panel {
  background-color: var(--bg-app);
  padding: 16px;
  overflow-y: auto;
}

.vbx-flow-toolbox { border-right: 1px solid var(--border-color); }
.vbx-settings-panel { border-left: 1px solid var(--border-color); }

.vbx-flowline-wrap {
  flex: 1;
  background-color: #0F172A; /* Visual contrasts: Koyu Slate Workspace for Node editing */
  display: flex;
  flex-direction: column;
}

.vbx-flowbar {
  background-color: #1E293B;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  color: #FFFFFF;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.vbx-flowbar strong { font-size: 0.9rem; font-weight: 700; }

.vbx-flowline {
  flex: 1;
  padding: 40px;
  overflow: auto;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 0),
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 0);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  display: flex;
  justify-content: center;
}

.vbx-flow-instances {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* IVR Graph Nodes */
.vbx-flow-instance {
  width: 200px;
  min-height: 80px;
  background-color: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
  transition: all var(--transition-fast);
  cursor: grab;
}

.vbx-flow-instance:hover,
.vbx-flow-instance.selected {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.25), 0 12px 24px rgba(0, 0, 0, 0.3);
}

.vbx-flow-instance strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px 10px 2px 10px;
  color: var(--text-main);
}

.vbx-flow-instance small {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0 10px 10px 10px;
  line-height: 1.3;
}

/* Block Accent headers */
.vbx-flow-start { width: 170px; min-height: 60px; }
.vbx-flow-start .vbx-applet-name { background-color: var(--primary); color: #FFFFFF; }

.vbx-play-block .vbx-applet-name { background-color: #EEF2F6; color: #475569; }
.vbx-transfer-block .vbx-applet-name { background-color: var(--success-soft); color: var(--success); }
.vbx-menu-block .vbx-applet-name { background-color: var(--warning-soft); color: var(--warning); }
.vbx-voice-block .vbx-applet-name { background-color: var(--info-soft); color: var(--info); }
.vbx-record-block .vbx-applet-name { background-color: #F8FAFC; color: #64748B; }
.vbx-hangup-block .vbx-applet-name { background-color: var(--danger-soft); color: var(--danger); }
.vbx-answer-block .vbx-applet-name { background-color: var(--success-soft); color: var(--success); }

/* Connector Rail paths */
.vbx-flow-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.vbx-flow-rail span {
  width: 2px;
  height: 20px;
  background-color: rgba(255, 255, 255, 0.15);
}

.vbx-flow-rail button {
  width: 24px;
  height: 24px;
  min-height: 24px;
  border-radius: 50%;
  padding: 0;
  background-color: #334155;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  font-size: 0.9rem;
}

.vbx-flow-rail button:hover {
  background-color: var(--primary);
  border-color: var(--primary-hover);
}

/* Branch columns */
.vbx-flow-branches {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  position: relative;
}

.vbx-flow-column {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Option tools for building custom attributes */
.vbx-applet-item {
  width: 100%;
  min-height: 36px;
  padding: 8px 12px;
  background-color: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
}

.vbx-applet-item:hover {
  border-color: var(--border-color-hover);
  background-color: var(--primary-light);
  color: var(--primary);
}

.vbx-menu-branches {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 500px;
  margin-top: 10px;
}

.vbx-menu-choice {
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  height: auto;
  min-height: auto;
}

.vbx-menu-choice strong {
  color: var(--warning);
  margin-right: 4px;
}

.vbx-flow-empty {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
  text-align: center;
  padding: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  max-width: 250px;
}

.vbx-choice-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.vbx-choice-row {
  display: flex;
  gap: 8px;
  align-items: center;
  background-color: var(--bg-app);
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.vbx-choice-row select {
  height: 34px;
  flex: 1;
}

/* ==========================================================================
   AGENT DESKTOP MODULE: PREMIUM 3-COLUMN CALL WORKSPACE
   ========================================================================== */

/* Full view container grid */
.agent-os-content-dashboard {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(440px, 1.3fr) minmax(320px, 0.85fr);
  gap: 16px;
  width: 100%;
}

.agent-pane-left, .agent-pane-center, .agent-pane-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Softphone display input inside workspace console */
.softphone-display-area {
  background-color: var(--bg-app);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 14px;
}

.dialer-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

.dialer-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.dialer-input-wrapper .input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-disabled);
}

.dialer-input {
  width: 100%;
  height: 44px;
  padding: 8px 12px 8px 36px;
  font-size: 1.15rem;
  font-weight: 700;
  background-color: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  letter-spacing: 0.02em;
}

.dialer-input:focus {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-glow), 0 0 0 3px var(--primary-glow);
}

/* Softphone Buttons Grid controls */
.dialer-grid-controls {
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: 8px;
  margin-bottom: 8px;
}

.btn-dial {
  height: 42px;
  background: linear-gradient(135deg, var(--success) 0%, var(--success-hover) 100%);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.btn-dial:hover {
  background: var(--success-hover);
}

.btn-preview {
  height: 42px;
  background-color: #FFFFFF;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-preview:hover {
  background-color: var(--primary-light);
}

.dialer-auto-group {
  display: flex;
  gap: 8px;
}

.btn-auto-start {
  flex: 1;
  height: 42px;
  background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
}

.btn-auto-stop {
  flex: 1;
  height: 42px;
  background-color: var(--danger);
}

.btn-auto-stop:hover {
  background-color: var(--danger-hover);
}

/* Active call control button array */
.active-call-console {
  border-top: 1px solid var(--border-color);
  margin-top: 16px;
  padding-top: 14px;
}

.section-divider {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-disabled);
  margin-bottom: 10px;
}

.agent-call-actions-premium {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.call-btn-premium {
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-app);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0;
  min-height: auto;
}

.call-btn-premium .icon {
  font-size: 1.15rem;
  margin-bottom: 2px;
}

.call-btn-premium:hover {
  background-color: var(--primary-light);
  border-color: var(--border-color-hover);
  color: var(--primary);
}

.call-btn-premium.active, .call-btn-premium.active-mute {
  background-color: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.call-btn-premium.call-btn-danger {
  background-color: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}

.call-btn-premium.call-btn-danger:hover {
  background-color: var(--danger);
  color: #FFFFFF;
}

.message-display-box {
  margin-top: 14px;
  background-color: var(--bg-app);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

.mic-status-pill {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.mic-status-pill[data-mode="ready"] {
  color: var(--success);
}

.message-text {
  font-size: 0.8rem;
  font-weight: 500;
}

/* Call duration dashboard clock widget */
.agent-call-clock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
}

.agent-call-clock strong {
  color: var(--danger);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.agent-mini-metrics-premium {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
}

/* Customer details card profile view */
.customer-avatar-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.customer-avatar-circle {
  position: relative;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
  color: #FFFFFF;
  font-size: 1.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
}

.customer-avatar-circle .status-indicator-ring {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background-color: var(--success);
  border: 2px solid #FFFFFF;
  border-radius: 50%;
}

.customer-profile-titles h2 {
  font-size: 1.15rem;
  font-weight: 800;
}

.customer-profile-titles .profile-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* CRM Input grids inside center workspace profile card */
.customer-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-cell .cell-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-cell .profile-select {
  height: 38px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 10px;
  background-color: var(--bg-app);
  font-weight: 600;
  font-size: 0.85rem;
}

.detail-cell .profile-select:focus {
  background-color: #FFFFFF;
  border-color: var(--border-focus);
}

.custom-fields-box {
  margin-top: 18px;
}

.custom-field-summary-premium {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.custom-field-summary-premium.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.8rem;
  background-color: var(--bg-app);
}

.notes-box {
  margin-top: 18px;
}

.premium-textarea {
  width: 100%;
  height: 80px;
  border-radius: var(--radius-md);
  border-color: var(--border-color);
  background-color: var(--bg-app);
  font-size: 0.85rem;
}

.premium-textarea:focus {
  background-color: #FFFFFF;
}

/* Action forms tabs inside workspace card */
.action-workspace-card {
  padding: 16px;
}

.agent-action-tabs {
  position: relative;
}

.agent-action-tabs input[type="radio"] {
  display: none;
}

.tabs-nav-bar {
  display: flex;
  gap: 4px;
  background-color: var(--bg-app);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 14px;
}

.tabs-nav-bar label {
  flex: 1;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.tabs-nav-bar label:hover {
  background-color: rgba(79, 70, 229, 0.05);
  color: var(--primary);
}

/* Dynamic Tab pane show rules */
#tab-wrapup-radio:checked ~ .tabs-nav-bar label[for="tab-wrapup-radio"],
#tab-appointment-radio:checked ~ .tabs-nav-bar label[for="tab-appointment-radio"],
#tab-email-radio:checked ~ .tabs-nav-bar label[for="tab-email-radio"] {
  background-color: var(--bg-surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.tabs-panels-content {
  min-height: 120px;
}

.tab-pane-panel {
  display: none;
  flex-direction: column;
}

#tab-wrapup-radio:checked ~ .tabs-panels-content #pane-wrapup,
#tab-appointment-radio:checked ~ .tabs-appointment-content #pane-appointment, /* for agent.html tab bindings */
#tab-appointment-radio:checked ~ .tabs-panels-content #pane-appointment,
#tab-email-radio:checked ~ .tabs-panels-content #pane-email {
  display: flex;
}

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

.form-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid-cell, .form-full-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-grid-cell input, .form-grid-cell select, .form-full-cell input {
  height: 38px;
}

.btn-submit-action {
  height: 42px;
  background-color: var(--primary);
  font-size: 0.88rem;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
}

.btn-submit-action:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.btn-secondary-submit {
  background-color: var(--success);
}
.btn-secondary-submit:hover {
  background-color: var(--success-hover);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-tertiary-submit {
  background-color: var(--info);
}
.btn-tertiary-submit:hover {
  background-color: var(--info-hover);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.info-help-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.email-workspace-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checklist-section {
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: var(--radius-md);
}

.checklist-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.check-item {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.check-item input {
  width: 14px;
  height: 14px;
}

.check-item span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.wrapup-status-alert {
  margin-top: 14px;
  padding: 10px 12px;
  background-color: var(--primary-soft);
  border-radius: var(--radius-sm);
}

.message-alert-text {
  font-size: 0.78rem;
  color: var(--primary);
  margin: 0;
  font-weight: 500;
}

/* Call Script steps interactive view */
.agent-script-steps-premium {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agent-script-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-app);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.agent-script-card p {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 12px;
}

.agent-script-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.agent-script-options button {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
  background-color: #FFFFFF;
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: none;
}

.agent-script-options button:hover {
  background-color: var(--primary);
  color: #FFFFFF;
}

.hopper-compact-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.hopper-lead-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.hopper-lead-item.active {
  border-color: var(--primary);
  background-color: var(--primary-soft);
  font-weight: 600;
}

/* Blur targets when campaign not chosen yet */
.campaign-not-selected .agent-workspace-blur-target {
  filter: blur(4px);
  pointer-events: none;
  opacity: 0.6;
}

/* Tab bar inside Agent Desktop */
.agent-nav-tabs {
  display: flex;
  gap: 4px;
}

.agent-nav-tabs .tab-btn {
  height: 34px;
  padding: 0 12px;
  background-color: var(--bg-app);
  color: var(--text-secondary);
  font-size: 0.8rem;
  border-radius: var(--radius-md);
  box-shadow: none;
  border: 1px solid var(--border-color);
}

.agent-nav-tabs .tab-btn:hover {
  background-color: rgba(79, 70, 229, 0.05);
  color: var(--primary);
}

.agent-nav-tabs .tab-btn.active {
  background-color: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Custom layout rules for Agent dashboard panels */
.agent-os-page {
  animation: viewFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   MEDIA QUERIES & RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (max-width: 1200px) {
  .agent-os-content-dashboard {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1120px) {
  /* Workspace offset reset */
  .workspace {
    margin-left: 0;
    padding: 16px;
  }

  /* Hamburger toggle icon display */
  .mobile-menu-button {
    display: inline-flex;
  }

  /* Sidebar Drawer styling */
  .sidebar {
    transform: translateX(-100%);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  /* Split layout column wraps */
  .split-layout {
    grid-template-columns: 1fr !important;
  }

  .topbar {
    margin: -16px -16px 16px -16px;
    padding: 0 16px;
  }
}

@media (max-width: 768px) {
  .auth-shell {
    flex-direction: column;
  }

  .auth-visual {
    display: none;
  }

  .auth-card {
    flex: 1;
    padding: 40px 20px;
    min-width: 0;
  }

  .stack-form, .onboarding-form, .customer-details-grid, .form-row-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    height: auto;
    padding: 16px;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
    margin-top: 10px;
  }

  .workspace-switcher {
    width: 100%;
    justify-content: space-around;
  }

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