/* =====================================================================
   ALLY CLINIC AI — Modern Healthcare Management System Design System
   Theme: Light, Sober & Crisp Medical SaaS
   Brand Colors: Primary #00188C | Secondary #0031D4
   ===================================================================== */

:root {
  /* Brand Palette */
  --primary: #00188C;
  --primary-hover: #00126E;
  --primary-light: #EEF2FF;
  --primary-tint: rgba(0, 24, 140, 0.08);

  --secondary: #0031D4;
  --secondary-hover: #0026A8;
  --secondary-light: #E0E7FF;
  --secondary-tint: rgba(0, 49, 212, 0.08);

  --accent-gradient: linear-gradient(135deg, #00188C 0%, #0031D4 100%);
  --accent-gradient-subtle: linear-gradient(135deg, rgba(0, 24, 140, 0.05) 0%, rgba(0, 49, 212, 0.08) 100%);

  /* Neutral Surfaces (Sober Light Theme) */
  --bg-app: #F8FAFC;
  --bg-sidebar: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-muted: #F8FAFC;
  --bg-input: #FFFFFF;
  --bg-hover: #F1F5F9;

  /* Borders & Dividers */
  --border-subtle: #E2E8F0;
  --border-medium: #CBD5E1;
  --border-focus: #0031D4;

  /* Typography Colors */
  --text-main: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-inverse: #FFFFFF;

  /* Feedback & State Colors */
  --success: #059669;
  --success-light: #ECFDF5;
  --success-border: #A7F3D0;
  
  --warning: #D97706;
  --warning-light: #FFFBEB;
  --warning-border: #FDE68A;

  --danger: #DC2626;
  --danger-hover: #B91C1C;
  --danger-light: #FEF2F2;
  --danger-border: #FECACA;

  --info: #0284C7;
  --info-light: #F0F9FF;
  --info-border: #BAE6FD;

  /* Layout & Geometry */
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --sidebar-width: 270px;
  --header-height: 72px;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows (Elevations) */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.2);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =====================================================================
   Base Reset & Global Styles
   ===================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.5;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* =====================================================================
   App Layout
   ===================================================================== */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* =====================================================================
   Sidebar Navigation
   ===================================================================== */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.sidebar-header {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 24, 140, 0.25);
  flex-shrink: 0;
}

.brand-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 600;
  background-color: var(--secondary-light);
  color: var(--secondary);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* System Status Pill inside Sidebar */
.sidebar-status-box {
  margin: 16px 18px 8px 18px;
  padding: 10px 14px;
  background-color: var(--bg-card-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.status-dot.online {
  background-color: var(--success);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.status-dot.offline {
  background-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.status-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.status-tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: #E2E8F0;
  color: var(--text-secondary);
}

/* Sidebar Navigation Items */
.sidebar-nav {
  flex: 1;
  padding: 12px 14px;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 8px 12px 6px 12px;
}

.sidebar-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.88rem;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.nav-link-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link svg {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.nav-link:hover {
  background-color: var(--bg-hover);
  color: var(--text-main);
}

.nav-link:hover svg {
  color: var(--primary);
}

.nav-link.active {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  border-color: rgba(0, 24, 140, 0.12);
}

.nav-link.active svg {
  color: var(--primary);
}

.nav-count-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background-color: #E2E8F0;
  color: var(--text-secondary);
}

.nav-link.active .nav-count-badge {
  background-color: var(--primary);
  color: #FFFFFF;
}

/* Sidebar Footer Profile / Info */
.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-sidebar);
}

.user-profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.user-details {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* =====================================================================
   Main Content Area & Top Header
   ===================================================================== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  background-color: var(--bg-app);
}

/* Top Header */
.content-header {
  height: var(--header-height);
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left {
  display: flex;
  flex-direction: column;
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 2px;
  font-weight: 500;
}

.header-breadcrumb span.current {
  color: var(--text-secondary);
  font-weight: 600;
}

.header-title-area h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Header Search */
.header-search {
  position: relative;
  width: 280px;
}

.header-search input,
.header-search input[type="text"] {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 40px !important;
  background-color: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.header-search input:focus,
.header-search input[type="text"]:focus {
  outline: none;
  border-color: var(--secondary);
  background-color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(0, 49, 212, 0.1);
}

.header-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 16px;
  height: 16px;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-subtle);
  padding: 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-main);
}

/* =====================================================================
   KPI Summary Metric Strip
   ===================================================================== */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 24px 32px 0 32px;
}

.kpi-card {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.kpi-info {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.kpi-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.kpi-subtext {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon.blue {
  background-color: var(--primary-light);
  color: var(--primary);
}

.kpi-icon.indigo {
  background-color: var(--secondary-light);
  color: var(--secondary);
}

.kpi-icon.emerald {
  background-color: var(--success-light);
  color: var(--success);
}

.kpi-icon.amber {
  background-color: var(--warning-light);
  color: var(--warning);
}

/* =====================================================================
   Content Views & Container
   ===================================================================== */
.content-view-container {
  padding: 24px 32px 48px 32px;
  flex: 1;
}

.content-view {
  display: none;
  animation: fadeIn 0.25s ease-out forwards;
}

.content-view.active {
  display: block;
}

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

/* =====================================================================
   Card Components & Design Tokens
   ===================================================================== */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #FFFFFF;
}

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

.card-header-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-card-muted);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Section Action Header */
.view-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.view-top-title h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.view-top-title p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

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

/* =====================================================================
   Buttons System
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1.2;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #FFFFFF;
  box-shadow: 0 2px 4px rgba(0, 24, 140, 0.15);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #00126E 0%, #0026A8 100%);
  box-shadow: 0 4px 8px rgba(0, 24, 140, 0.25);
  transform: translateY(-1px);
}

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

.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-hover);
  border-color: #94A3B8;
}

.btn-tertiary {
  background-color: transparent;
  color: var(--text-secondary);
}

.btn-tertiary:hover:not(:disabled) {
  background-color: var(--bg-hover);
  color: var(--text-main);
}

.btn-danger {
  background-color: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger-border);
}

.btn-danger:hover:not(:disabled) {
  background-color: var(--danger);
  color: #FFFFFF;
  border-color: var(--danger);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
  gap: 6px;
}

.btn-icon-only {
  padding: 7px;
  border-radius: var(--radius-sm);
}

/* =====================================================================
   Forms, Inputs & Grid
   ===================================================================== */
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.col-span-2 {
  grid-column: span 2;
}

.form-group.col-span-3 {
  grid-column: span 3;
}

label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

label .label-hint {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
}

input[type="text"],
input[type="url"],
input[type="number"],
input[type="time"],
select,
textarea {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

textarea {
  height: auto;
  min-height: 80px;
  padding: 10px 14px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(0, 49, 212, 0.12);
  background-color: #FFFFFF;
}

input::placeholder,
textarea::placeholder {
  color: #94A3B8;
}

.input-with-icon {
  position: relative;
}

.input-with-icon input,
.input-with-icon input[type="text"] {
  padding-left: 40px !important;
}

.input-with-icon svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input-append-wrapper {
  display: flex;
  align-items: center;
  background-color: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.input-append-wrapper:focus-within {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(0, 49, 212, 0.12);
}

.input-append-wrapper input {
  border: none !important;
  box-shadow: none !important;
}

.input-append-wrapper span.append-text {
  padding: 0 14px;
  background-color: var(--bg-hover);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  height: 100%;
  display: flex;
  align-items: center;
  border-left: 1px solid var(--border-subtle);
  white-space: nowrap;
}

/* Custom Toggle Switch */
.switch-container {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-toggle {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #CBD5E1;
  transition: var(--transition-fast);
  border-radius: var(--radius-full);
}

.slider-toggle:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: var(--transition-fast);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .slider-toggle {
  background-color: var(--primary);
}

input:checked + .slider-toggle:before {
  transform: translateX(20px);
}

.switch-label {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-main);
}

/* =====================================================================
   Data Tables
   ===================================================================== */
.table-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background-color: #FFFFFF;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.table-toolbar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.table-search {
  position: relative;
  width: 280px;
}

.table-search input,
.table-search input[type="text"] {
  height: 36px;
  padding: 0 12px 0 38px !important;
  font-size: 0.82rem;
}

.table-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 15px;
  height: 15px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table thead {
  background-color: var(--bg-card-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  padding: 12px 18px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
  background-color: var(--bg-app);
}

.data-table td {
  padding: 14px 18px;
  font-size: 0.84rem;
  color: var(--text-main);
  vertical-align: middle;
}

.data-table td.text-right {
  text-align: right;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 600;
}

.badge-active {
  background-color: var(--success-light);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-inactive {
  background-color: #F1F5F9;
  color: var(--text-muted);
  border: 1px solid #E2E8F0;
}

.badge-specialty {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(0, 24, 140, 0.15);
}

.badge-time {
  background-color: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.badge-channel {
  background-color: var(--secondary-light);
  color: var(--secondary);
  border: 1px solid rgba(0, 49, 212, 0.15);
}

/* Empty State */
.empty-state {
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--bg-hover);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.empty-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 320px;
}

/* =====================================================================
   Doctor Availability Weekly Manager
   ===================================================================== */
.weekly-calendar-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.weekday-card {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 140px 1fr auto;
  align-items: center;
  gap: 16px;
  transition: all var(--transition-fast);
}

.weekday-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-xs);
}

.weekday-card.day-disabled {
  opacity: 0.55;
  background-color: var(--bg-card-muted);
}

.day-info {
  display: flex;
  flex-direction: column;
}

.day-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.day-status {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.slots-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.slot-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(0, 24, 140, 0.15);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
}

.btn-remove-slot {
  background: none;
  border: none;
  color: var(--primary);
  opacity: 0.7;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 2px;
}

.btn-remove-slot:hover {
  opacity: 1;
  background-color: rgba(0, 24, 140, 0.1);
}

.inline-slot-editor {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #FFFFFF;
  border: 1px solid var(--secondary);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  box-shadow: 0 0 0 3px rgba(0, 49, 212, 0.1);
}

.inline-slot-editor input[type="time"] {
  height: 28px;
  padding: 0 4px;
  font-size: 0.78rem;
  border: 1px solid var(--border-medium);
  border-radius: 4px;
}

.inline-slot-editor span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-inline-save,
.btn-inline-cancel {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.btn-inline-save {
  background-color: var(--success);
  color: #FFFFFF;
}

.btn-inline-cancel {
  background-color: var(--bg-hover);
  color: var(--text-secondary);
}

/* =====================================================================
   Follow-up Automation Pipeline (Visual Timeline)
   ===================================================================== */
.followup-pipeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  padding-left: 20px;
}

.followup-pipeline::before {
  content: '';
  position: absolute;
  left: 38px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  background-color: var(--border-subtle);
  z-index: 1;
}

.followup-step-card {
  position: relative;
  z-index: 2;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 40px 1.2fr 1.2fr auto;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.followup-step-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.step-order-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 24, 140, 0.2);
}

.step-delay-box,
.step-channel-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* =====================================================================
   Reminder Cadence Manager
   ===================================================================== */
.reminder-tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.reminder-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--secondary-light);
  color: var(--secondary);
  border: 1px solid rgba(0, 49, 212, 0.2);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.reminder-chip .btn-remove-tag {
  background: none;
  border: none;
  color: var(--secondary);
  opacity: 0.7;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 50%;
}

.reminder-chip .btn-remove-tag:hover {
  opacity: 1;
  background-color: rgba(0, 49, 212, 0.15);
}

.presets-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.preset-btn {
  background-color: #FFFFFF;
  border: 1px dashed var(--border-medium);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

/* =====================================================================
   Modals & Overlays
   ===================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-card {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-card.modal-lg {
  max-width: 780px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #FFFFFF;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-card-muted);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* =====================================================================
   Toast Notifications
   ===================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  min-width: 300px;
  max-width: 440px;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.success {
  border-left: 4px solid var(--success);
  color: var(--text-main);
}

.toast.success svg {
  color: var(--success);
}

.toast.error {
  border-left: 4px solid var(--danger);
  color: var(--text-main);
}

.toast.error svg {
  color: var(--danger);
}

.toast.info {
  border-left: 4px solid var(--info);
  color: var(--text-main);
}

.toast.info svg {
  color: var(--info);
}

.toast span {
  font-size: 0.84rem;
  font-weight: 500;
}

/* =====================================================================
   Loading Spinner
   ===================================================================== */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

.spinner.spinner-dark {
  border-color: rgba(0, 24, 140, 0.2);
  border-top-color: var(--primary);
}

.hidden {
  display: none !important;
}

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

/* =====================================================================
   Responsive Media Queries
   ===================================================================== */
@media (max-width: 1200px) {
  .content-header {
    padding: 0 24px;
  }
  .kpi-strip {
    padding: 20px 24px 0 24px;
    gap: 14px;
  }
  .content-view-container {
    padding: 20px 24px 40px 24px;
  }
  .header-search {
    width: 220px;
  }
}

@media (max-width: 1024px) {
  .kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .view-top-bar {
    flex-direction: row;
    align-items: center;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-modal);
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .content-header {
    padding: 0 16px;
  }

  .header-search {
    display: none;
  }

  .kpi-strip {
    grid-template-columns: 1fr;
    padding: 16px 16px 0 16px;
  }

  .content-view-container {
    padding: 16px;
  }

  .view-top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .view-actions-right {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }

  .form-group.col-span-2,
  .form-group.col-span-3 {
    grid-column: span 1;
  }

  .weekday-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .followup-step-card {
    grid-template-columns: 1fr;
  }

  .followup-pipeline::before {
    display: none;
  }
}

/* ========================================= */
/* LOGIN OVERLAY                             */
/* ========================================= */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-app);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-brand svg {
  margin-bottom: 16px;
}

.login-brand h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.login-brand p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

#btn-logout:hover {
  background: var(--bg-app) !important;
  color: var(--primary) !important;
}

