/* ==========================================================================
   Nedarim-Connect Stylesheet
   Modern Glassmorphic Dark-Light Hybrid UI with Hebrew RTL First Design
   ========================================================================== */

:root {
  --bg-main: #0c1017;
  --bg-sidebar: #131b26;
  --bg-panel: rgba(22, 31, 46, 0.75);
  --bg-card: rgba(30, 41, 59, 0.6);
  --bg-hover: rgba(51, 65, 85, 0.5);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.25);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  
  --whatsapp: #25d366;
  --whatsapp-hover: #1ebd5a;
  --whatsapp-bg: rgba(37, 211, 102, 0.15);

  --wa-chat-bg: #0b141a;
  --wa-bubble-in: #202c33;
  --wa-bubble-out: #005c4b;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 4px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.4);

  --bottom-nav-height: 62px;
  --mobile-header-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Heebo', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100dvh;
  direction: rtl;
  overflow-x: hidden;
}

/* App Layout */
.app-layout {
  display: flex;
  min-height: 100dvh;
  width: 100%;
}

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 995;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.sidebar-top-bar .brand {
  margin-bottom: 0;
}

.btn-close-sidebar {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  font-size: 16px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-close-sidebar:hover, .btn-close-sidebar:active {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding: 0 8px;
}

.brand-icon {
  font-size: 28px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-text h2 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: right;
  width: 100%;
}

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

.nav-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.nav-badge {
  margin-right: auto;
  background: var(--bg-hover);
  color: var(--text-main);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.nav-item.active .nav-badge {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

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

.mode-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

/* Main Content */
.main-content {
  flex-grow: 1;
  padding: 32px 40px;
  overflow-y: auto;
  max-height: 100vh;
}

/* Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.header-title h1 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 4px;
}

.header-title p {
  color: var(--text-muted);
  font-size: 14.5px;
}

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

.sync-status {
  color: var(--text-dim);
  font-size: 13px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-whatsapp {
  background: var(--whatsapp);
  color: #0b141a;
  font-weight: 700;
}

.btn-whatsapp:hover {
  background: var(--whatsapp-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
}

.card-primary::before { background: var(--primary); }
.card-danger::before { background: var(--danger); }
.card-success::before { background: var(--success); }
.card-whatsapp::before { background: var(--whatsapp); }

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kpi-title {
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
}

.kpi-icon {
  font-size: 20px;
}

.kpi-value {
  font-size: 32px;
  font-weight: 800;
  font-family: 'Rubik', sans-serif;
  letter-spacing: -0.5px;
}

.kpi-sub {
  color: var(--text-dim);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  margin-top: 4px;
}

.kpi-sub strong {
  color: var(--text-main);
}

/* Panels */
.panel {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

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

.panel-header h3 {
  font-size: 17px;
  font-weight: 700;
}

.panel-body {
  padding: 24px;
}

.grid-2-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

/* Failure Categories List */
.failure-categories-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.failure-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.cat-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cat-icon {
  font-size: 22px;
}

.cat-title {
  font-size: 14.5px;
  font-weight: 600;
}

.cat-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Quick Actions Box */
.quick-actions-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.action-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.action-desc strong {
  display: block;
  font-size: 14.5px;
  margin-bottom: 4px;
}

.action-desc p {
  color: var(--text-muted);
  font-size: 13px;
}

/* Tables */
.table-container {
  overflow-x: auto;
}

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

.data-table th {
  padding: 14px 20px;
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  user-select: none;
}

.sortable-th {
  cursor: pointer;
  transition: all 0.2s ease;
}

.sortable-th:hover {
  background: rgba(59, 130, 246, 0.15);
  color: var(--text-main);
}

.sortable-th.sorted-asc,
.sortable-th.sorted-desc {
  background: rgba(99, 102, 241, 0.18);
  color: var(--primary);
  font-weight: 700;
}

.th-content {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.sort-icon {
  font-size: 11px;
  opacity: 0.45;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.sortable-th:hover .sort-icon {
  opacity: 0.9;
}

.sortable-th.sorted-asc .sort-icon,
.sortable-th.sorted-desc .sort-icon {
  opacity: 1;
  color: var(--primary);
}

.header-summary-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  white-space: nowrap;
}

.data-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

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

/* Pagination Bar */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13.5px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-page {
  padding: 6px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.btn-page:hover:not(:disabled) {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

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

.btn-page.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.badge-primary { background: var(--primary-glow); color: var(--primary); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-whatsapp { background: var(--whatsapp-bg); color: var(--whatsapp); }
.badge-category {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
  font-weight: 600;
}

/* Tabs system */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

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

/* Filter Controls */
.filter-controls {
  display: flex;
  gap: 12px;
  flex-grow: 1;
  flex-wrap: wrap;
}

.form-input, .form-select, .form-textarea {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
}

.form-textarea {
  width: 100%;
  font-family: inherit;
  resize: vertical;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

/* WhatsApp Interactive Simulator */
.simulator-wrapper {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 28px;
  height: calc(100vh - 160px);
}

.simulator-sidebar {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.simulator-sidebar-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-threads-list {
  overflow-y: auto;
  flex-grow: 1;
}

.chat-thread-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s ease;
}

.chat-thread-item:hover {
  background: var(--bg-hover);
}

.chat-thread-item.active {
  background: rgba(59, 130, 246, 0.15);
  border-right: 3px solid var(--primary);
}

.thread-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.thread-info {
  flex-grow: 1;
  overflow: hidden;
}

.thread-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.thread-name {
  font-weight: 700;
  font-size: 14.5px;
}

.thread-time {
  font-size: 11px;
  color: var(--text-dim);
}

.thread-snippet {
  color: var(--text-muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Phone Mockup */
.phone-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone-mockup {
  width: 400px;
  height: 680px;
  background: #111b21;
  border: 12px solid #2a3942;
  border-radius: 44px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.phone-speaker {
  width: 70px;
  height: 4px;
  background: #4b5563;
  border-radius: 4px;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.phone-camera {
  width: 10px;
  height: 10px;
  background: #1f2937;
  border-radius: 50%;
  position: absolute;
  top: 6px;
  left: calc(50% + 50px);
  z-index: 10;
}

/* Inside WhatsApp Screen */
.wa-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--wa-chat-bg);
}

.wa-header {
  background: #202c33;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.wa-avatar {
  font-size: 24px;
}

.wa-contact-info {
  flex-grow: 1;
}

.wa-contact-info strong {
  display: block;
  font-size: 15px;
  color: #e9edef;
}

.wa-contact-info span {
  font-size: 12px;
  color: #8696a0;
}

.wa-header-actions {
  display: flex;
  gap: 14px;
  color: #aebac1;
  font-size: 16px;
}

.wa-body {
  flex-grow: 1;
  padding: 20px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 0);
  background-size: 24px 24px;
}

.wa-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: #8696a0;
  font-size: 14px;
  padding: 20px;
}

.wa-bubble {
  max-width: 88%;
  background: var(--wa-bubble-out);
  color: #e9edef;
  padding: 12px 14px;
  border-radius: 12px 12px 2px 12px;
  align-self: flex-start;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
  position: relative;
}

.wa-bubble-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 11px;
  color: #8696a0;
}

.wa-link-btn {
  display: block;
  margin-top: 10px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  text-align: center;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s;
}

.wa-link-btn:hover {
  background: rgba(255,255,255,0.25);
}

.wa-sim-bar {
  background: #1f2937;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
}

.sim-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--warning);
  margin-bottom: 8px;
}

.sim-btn-group {
  display: flex;
  gap: 8px;
}

/* Crosscheck Cards Grid */
.crosscheck-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
  padding: 24px;
}

.crosscheck-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.crosscheck-card.resolved {
  border-right: 4px solid var(--success);
}

.crosscheck-card.pending {
  border-right: 4px solid var(--warning);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.toast {
  background: var(--bg-sidebar);
  color: #fff;
  border: 1px solid var(--border-color);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.3s ease-out;
}

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

/* Pulse animation */
.pulse {
  animation: pulseAnim 2s infinite;
}

@keyframes pulseAnim {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); box-shadow: 0 0 10px var(--whatsapp); }
  100% { transform: scale(1); }
}

/* ==========================================================
   Authentication Overlay, Passkeys, and User Profile Styles
   ========================================================== */

.auth-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.auth-card {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 44px 36px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 30px rgba(99, 102, 241, 0.15);
  text-align: center;
  animation: authCardEntrance 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.auth-header {
  margin-bottom: 32px;
}

.auth-logo {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 16px;
  box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
}

.auth-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.auth-header p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.google-btn-wrapper {
  display: flex;
  justify-content: center;
  margin: 16px 0 24px;
}

.btn-google {
  width: 100%;
  padding: 14px 22px;
  background: #ffffff;
  color: #1f2937;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.btn-google:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px -5px rgba(0, 0, 0, 0.4);
  background: #f8fafc;
}

.btn-google:active {
  transform: translateY(0);
}

.google-icon {
  width: 22px;
  height: 22px;
}

.auth-error-msg {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--danger);
  color: #fca5a5;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 16px;
  text-align: right;
  line-height: 1.4;
}

.auth-footer {
  margin-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
  color: var(--text-muted);
  font-size: 12px;
}

/* User Profile Badge in Sidebar */
.user-profile-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.user-info {
  display: flex;
  flex-direction: column;
  text-align: right;
  overflow: hidden;
}

.user-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-email {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.btn-logout {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.1);
}

/* ==========================================================
   Mobile Top Bar & Mobile Bottom Navigation Bar Styles
   ========================================================== */

.mobile-top-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  height: var(--mobile-header-height);
  padding: 0 16px;
  background: rgba(19, 27, 38, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.btn-menu-toggle {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 10px;
  transition: all 0.2s ease;
}

.btn-menu-toggle:active {
  background: var(--bg-hover);
  transform: scale(0.95);
}

.hamburger-line {
  width: 20px;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-brand-icon {
  font-size: 18px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.mobile-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.mobile-brand-title {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}

.mobile-brand-sub {
  font-size: 11px;
  color: #60a5fa;
  font-weight: 600;
}

.mobile-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-mobile-sync {
  background: var(--primary-glow);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: var(--primary);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-mobile-sync:active {
  transform: scale(0.92);
  background: var(--primary);
  color: #fff;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 980;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 8px 0;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  height: 100%;
  text-decoration: none;
}

.bottom-nav-icon {
  font-size: 18px;
  margin-bottom: 2px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav-label {
  font-size: 11px;
  font-weight: 600;
  transition: color 0.2s ease;
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item.active .bottom-nav-label {
  color: #fff;
  font-weight: 700;
}

.bottom-nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  width: 28px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 2px 10px var(--primary);
}

.bottom-nav-badge {
  position: absolute;
  top: -4px;
  right: -10px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 10px;
  line-height: 1.2;
  min-width: 16px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.bottom-nav-badge.badge-success {
  background: var(--success);
}

/* ==========================================================
   Table Action Buttons, Badges and Micro-UI
   ========================================================== */

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
  min-height: 38px;
}

.btn-action.btn-wa {
  background: #25d366;
  color: #0b141a;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.btn-action.btn-wa:hover, .btn-action.btn-wa:active {
  background: #1ebd5a;
  transform: translateY(-1px);
}

.btn-action.btn-retry {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

.btn-action.btn-retry:hover, .btn-action.btn-retry:active {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

.btn-action.btn-link {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-action.btn-link:hover, .btn-action.btn-link:active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.2);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.status-open {
  background: var(--danger-bg);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-pill.status-resolved {
  background: var(--success-bg);
  color: #86efac;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.status-recovered {
  background: var(--primary-glow);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* New status pill types */
.status-pill.status-needs-phone {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-pill.status-completed {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-pill.status-frozen {
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.status-pill.status-superseded {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.25);
}

/* Highlight row for NEEDS_CONTACT_INFO */
.failure-row-needs_contact_info {
  background: rgba(245, 158, 11, 0.04) !important;
}

/* ============================================================
   Informational Section Styles (COMPLETED / FROZEN / SUPERSEDED)
   ============================================================ */
.informational-section {
  margin-top: 20px;
  padding: 20px 24px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.informational-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.informational-subtitle {
  font-size: 13px;
  margin-bottom: 16px;
}

.info-group {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
}

.info-section-completed { border-color: rgba(16, 185, 129, 0.2); }
.info-section-frozen    { border-color: rgba(99, 102, 241, 0.2); }
.info-section-superseded{ border-color: rgba(100, 116, 139, 0.2); }

.info-group-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(30, 41, 59, 0.5);
  border-bottom: 1px solid var(--border-color);
}

.info-group-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.info-group-header > div {
  flex-grow: 1;
}

.info-group-header strong {
  font-size: 14px;
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}

.info-group-hint {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.info-group-rows {
  padding: 8px 0;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
}

.info-row:last-child {
  border-bottom: none;
}

.info-row-name {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-grow: 1;
}

.info-row-name strong {
  font-size: 14px;
}

.info-row-detail {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 2px;
}

.info-row-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

.btn-wa-small {
  background: var(--whatsapp-bg);
  color: var(--whatsapp);
  border: 1px solid rgba(37, 211, 102, 0.25);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-wa-small:hover {
  background: rgba(37, 211, 102, 0.25);
}

.btn-sm-resolve, .btn-resolve {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-sm-resolve:hover, .btn-resolve:hover {
  background: rgba(16, 185, 129, 0.2);
}

.badge-info {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.cell-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 3px;
}

.cell-label {
  display: none;
}

.crosscheck-match-box {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12.5px;
  color: #86efac;
  line-height: 1.4;
}

.font-sm { font-size: 12.5px; }
.font-xs { font-size: 11.5px; }
.text-danger { color: #f87171; }
.text-success { color: #4ade80; }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-5 { padding-top: 24px; padding-bottom: 24px; }

/* Failure Category Badges */
.badge-expired { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-limit { background: rgba(245, 158, 11, 0.2); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-blocked { background: rgba(168, 85, 247, 0.2); color: #d8b4fe; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-masav { background: rgba(59, 130, 246, 0.2); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-general { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }

/* Crosscheck Card Inner Rows */
.crosscheck-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.crosscheck-card-header h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.crosscheck-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
}

/* ==========================================================
   RESPONSIVE MEDIA QUERIES (Mobile-First Polish)
   ========================================================== */

/* Tablet & Large Mobile (<= 1024px) */
@media (max-width: 1024px) {
  .app-layout {
    flex-direction: column;
  }

  /* Off-Canvas Sidebar Drawer */
  .sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 85vw);
    height: 100dvh;
    z-index: 1000;
    transform: translateX(100%);
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.6);
    overflow-y: auto;
  }

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

  .btn-close-sidebar {
    display: flex;
  }

  /* Show Mobile Top Bar */
  .mobile-top-bar {
    display: flex;
  }

  /* Show Mobile Bottom Navigation */
  .mobile-bottom-nav {
    display: flex;
  }

  .main-content {
    padding: 16px 16px calc(var(--bottom-nav-height) + var(--safe-bottom) + 24px) 16px;
    max-height: none;
    overflow-y: visible;
    width: 100%;
  }

  .top-header {
    margin-bottom: 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .top-header .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
  }

  .grid-2-cols {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .crosscheck-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    padding: 16px;
    gap: 16px;
  }

  /* Form layouts */
  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Floating Toast position on mobile */
  .toast-container {
    bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 12px);
    left: 16px;
    right: 16px;
  }

  .toast {
    width: 100%;
    justify-content: center;
  }
}

/* Smartphone screens (<= 768px) */
@media (max-width: 768px) {
  .header-title h1 {
    font-size: 22px;
  }

  .header-title p {
    font-size: 13px;
  }

  .btn {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 14px;
  }

  .btn-sm {
    min-height: 38px;
    padding: 8px 14px;
  }

  .panel-header {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .panel-header button {
    width: 100%;
  }

  .panel-body {
    padding: 16px;
  }

  .filter-controls {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .form-input, .form-select, .form-textarea {
    width: 100%;
    min-height: 44px;
    font-size: 16px !important; /* Critical: stops iOS Safari auto-zoom on focus */
  }

  .header-summary-badge {
    width: 100%;
    justify-content: space-between;
    box-sizing: border-box;
  }

  .quick-actions-box .action-item {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .quick-actions-box .action-item button {
    width: 100%;
  }

  /* ==========================================================
     Responsive Data Tables to Native Mobile Cards
     ========================================================== */

  .table-container {
    padding: 0;
    overflow-x: visible;
  }

  .data-table {
    display: block;
    width: 100%;
    border: none;
  }

  .data-table thead {
    display: none; /* Hide traditional table header on phone screens */
  }

  .data-table tbody {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
  }

  .data-table tbody tr {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, border-color 0.2s ease;
  }

  .data-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(255, 255, 255, 0.15);
  }

  .data-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    border-bottom: none;
    font-size: 14px;
    width: 100%;
  }

  .cell-label {
    display: inline-block;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
    margin-left: 8px;
    flex-shrink: 0;
  }

  /* First row in mobile card (Name + Amount header) */
  .data-table tbody tr td:first-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
    font-size: 15px;
  }

  /* Table action buttons in mobile card view */
  .data-table tbody tr td:last-child {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 12px;
    margin-top: 4px;
  }

  .table-actions {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .table-actions .btn-action {
    flex: 1;
    min-height: 44px;
    font-size: 13.5px;
    justify-content: center;
  }

  /* Touch optimizations */
  .failure-cat-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .failure-cat-item .cat-stats {
    justify-content: space-between;
    width: 100%;
  }

  /* Auth Card adjustments for small screens */
  .auth-overlay {
    padding: 16px;
  }

  .auth-card {
    padding: 32px 20px;
    max-width: 100%;
  }

  .auth-logo {
    width: 54px;
    height: 54px;
    font-size: 26px;
    border-radius: 14px;
  }

  .auth-header h2 {
    font-size: 20px;
  }

  .btn-google {
    min-height: 48px;
    font-size: 14.5px;
  }
}

/* Extra Small Phones (<= 480px) */
@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .kpi-card {
    padding: 16px;
  }

  .kpi-value {
    font-size: 26px;
  }

  .crosscheck-cards-grid {
    padding: 12px;
    gap: 12px;
  }

  .crosscheck-card {
    padding: 16px;
  }

  .bottom-nav-label {
    font-size: 10px;
  }
}

/* ==========================================================
   Donors Accordion & Multi-Level Hierarchy Styles
   ========================================================== */

.donors-accordion-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}

.donor-accordion-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.donor-accordion-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}

.donor-header-bar {
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: rgba(30, 41, 59, 0.4);
  user-select: none;
  transition: background 0.2s ease;
}

.donor-header-bar:hover {
  background: rgba(59, 130, 246, 0.08);
}

.donor-main-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.donor-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.donor-name-box h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.donor-meta-text {
  font-size: 13px;
  color: var(--text-muted);
}

.donor-stats-summary {
  display: flex;
  align-items: center;
  gap: 20px;
}

.donor-kpi-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.donor-kpi-label {
  font-size: 11.5px;
  color: var(--text-dim);
}

.donor-kpi-val {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
}

.expand-chevron {
  font-size: 14px;
  color: var(--text-muted);
  transition: transform 0.25s ease;
  margin-right: 8px;
}

.donor-accordion-card.open .expand-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

/* Donor Body (Standing Orders List Level) */
.donor-accordion-body {
  display: none;
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.4);
}

.donor-accordion-card.open .donor-accordion-body {
  display: block;
}

.keva-periods-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.keva-periods-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Individual Keva Period Item */
.keva-period-item {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.keva-period-header {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: rgba(30, 41, 59, 0.6);
  transition: background 0.15s ease;
}

.keva-period-header:hover {
  background: rgba(99, 102, 241, 0.12);
}

.keva-period-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.keva-period-dates {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-main);
}

.keva-period-amount {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--success);
  background: var(--success-bg);
  padding: 2px 10px;
  border-radius: 12px;
}

.keva-period-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}

.keva-period-body {
  display: none;
  padding: 16px 18px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

.keva-period-item.open .keva-period-body {
  display: block;
}

/* ==========================================================
   Minimalist Cockpit Styles (v2.1)
   ========================================================== */

.kpi-compact-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-mini-card {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.kpi-mini-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
}

.kpi-mini-card.danger::before { background: var(--danger); }
.kpi-mini-card.success::before { background: var(--success); }
.kpi-mini-card.recovery::before { background: var(--whatsapp); }

.kpi-mini-icon {
  font-size: 26px;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  flex-shrink: 0;
}

.kpi-mini-data {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
}

.kpi-mini-label {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.kpi-mini-values {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.kpi-mini-values strong {
  font-size: 24px;
  font-weight: 800;
  font-family: 'Rubik', sans-serif;
  color: var(--text-main);
}

.kpi-mini-sub {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.status-open { background: var(--danger-bg); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.status-pill.status-needs-phone { background: var(--warning-bg); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.3); }
.status-pill.status-resolved { background: var(--success-bg); color: #86efac; border: 1px solid rgba(16, 185, 129, 0.3); }
.status-pill.status-recovered { background: var(--whatsapp-bg); color: #86efac; border: 1px solid rgba(37, 211, 102, 0.3); }
.status-pill.status-completed { background: rgba(59, 130, 246, 0.15); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.3); }
.status-pill.status-frozen { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }
.status-pill.status-superseded { background: rgba(168, 85, 247, 0.15); color: #d8b4fe; border: 1px solid rgba(168, 85, 247, 0.3); }

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-action.btn-wa {
  background: var(--whatsapp);
  color: #0b141a;
  font-weight: 700;
}

.btn-action.btn-wa:hover {
  background: var(--whatsapp-hover);
  transform: translateY(-1px);
}

.btn-action.btn-retry {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.btn-action.btn-retry:hover {
  background: var(--primary);
  color: #fff;
}

.btn-action.btn-link {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-action.btn-link:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.btn-action.btn-resolve {
  background: rgba(16, 185, 129, 0.15);
  color: #86efac;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-action.btn-resolve:hover {
  background: var(--success);
  color: #fff;
}

@media (max-width: 768px) {
  .kpi-compact-strip {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}


