/* Hermes Executive AI Assistant — Dark Luxe Design System v2.0 */
:root {
  --bg: #070a11;
  --bg-header: rgba(14, 20, 34, 0.85);
  --bg-card: #0e1424;
  --bg-card-hover: #151d32;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(99, 102, 241, 0.3);
  --border-glow: rgba(99, 102, 241, 0.4);

  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.3);

  --cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.3);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.3);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.3);
  --purple: #a855f7;
  --indigo: #4f46e5;

  --glass-bg: rgba(14, 20, 36, 0.75);
  --glass-border: rgba(255, 255, 255, 0.1);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 12px 36px -10px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 85% 65%, rgba(6, 182, 212, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(168, 85, 247, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 32px;
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 28px;
  height: 28px;
  color: var(--cyan);
  filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.6));
  animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.brand-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.8px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 40%, var(--cyan) 75%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.1);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
  animation: pulseRing 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulseRing {
  0% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  50% { opacity: 0.8; transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Executive Briefing Banner */
.briefing-banner {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.14) 0%, rgba(6, 182, 212, 0.1) 50%, rgba(168, 85, 247, 0.1) 100%);
  border-bottom: 1px solid rgba(99, 102, 241, 0.25);
  padding: 12px 32px;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

.briefing-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.briefing-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--indigo) 100%);
  color: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 10px var(--primary-glow);
  flex-shrink: 0;
}

.briefing-text {
  font-size: 13.5px;
  color: var(--text);
  flex: 1;
  font-weight: 500;
  line-height: 1.5;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%);
  color: white;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.45);
  background: linear-gradient(135deg, #6366f1 0%, #3730a3 100%);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: rotate(45deg);
  transition: 0.5s;
}

.btn-glow:hover::after {
  left: 100%;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-1px);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
}

.btn-glass:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 16px var(--primary-glow);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #b91c1c 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
}

.btn-danger-outline {
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger-outline:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-icon-xs {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-icon-xs:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

/* Sections */
.section {
  padding: 28px 32px;
}

.section-title-bar {
  margin-bottom: 22px;
}

.section-title-bar h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.2px;
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* Accounts Grid */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px;
}

.account-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.account-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: transparent;
  transition: background 0.25s;
}

.account-card:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.account-card.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, var(--bg-card) 100%);
  box-shadow: var(--shadow-glow);
}

.account-card.active::before {
  background: linear-gradient(to bottom, var(--cyan), var(--primary));
}

.account-avatar {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--cyan) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 19px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.account-info {
  flex: 1;
  min-width: 0;
}

.account-email {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.account-status {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.account-delete {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  font-size: 18px;
  border-radius: 6px;
  opacity: 0;
  transition: all 0.2s;
}

.account-card:hover .account-delete {
  opacity: 1;
}

.account-delete:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.12);
}

/* Panel Header & Tabs */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.panel-tabs {
  display: flex;
  gap: 6px;
  background: rgba(11, 15, 26, 0.9);
  padding: 5px;
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow-x: auto;
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.tab:hover .tab-icon {
  transform: scale(1.15);
}

.tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.tab.active {
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, var(--indigo) 100%);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.tab-badge {
  background: var(--danger);
  color: white;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 800;
  animation: badgeBounce 1.5s ease infinite;
}

@keyframes badgeBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.panel-account {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.account-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.dot-online {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

/* Dashboard Tab */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow);
}

.stat-card.warning { border-top: 2px solid var(--warning); }
.stat-card.success { border-top: 2px solid var(--success); }
.stat-card.danger { border-top: 2px solid var(--danger); }
.stat-card.total { border-top: 2px solid var(--primary); }

.stat-icon-wrapper {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.stat-icon-wrapper.total { background: rgba(99, 102, 241, 0.16); color: var(--primary); border: 1px solid rgba(99, 102, 241, 0.3); }
.stat-icon-wrapper.pending { background: rgba(245, 158, 11, 0.16); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.stat-icon-wrapper.archive { background: rgba(16, 185, 129, 0.16); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }
.stat-icon-wrapper.trash { background: rgba(239, 68, 68, 0.16); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }

.stat-number {
  font-size: 28px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 3px;
}

.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s ease;
}

.chart-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.chart-header {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.chart-header h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.bar-label {
  width: 140px;
  flex-shrink: 0;
  color: var(--text-muted);
  font-weight: 500;
}

.bar-track {
  flex: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-value {
  width: 50px;
  text-align: right;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
}

/* Scanner Tab Layout */
.scanner-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 24px;
}

@media (max-width: 960px) {
  .scanner-layout {
    grid-template-columns: 1fr;
  }
}

.filter-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.sidebar-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.filter-group {
  margin-bottom: 16px;
}

.filter-group label {
  display: block;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 7px;
  font-weight: 600;
}

.highlight-group {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 14px;
  border-radius: var(--radius-sm);
}

.highlight-group label {
  color: var(--cyan);
  font-weight: 700;
}

.filter-group input[type="text"],
.filter-group input[type="date"],
.filter-group input[type="number"],
.filter-group select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(7, 10, 17, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: rgba(7, 10, 17, 0.95);
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.filter-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.filter-actions .btn {
  flex: 1;
}

/* Email Tables & Items */
.email-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.email-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.email-item:last-child {
  border-bottom: none;
}

.email-item:hover {
  background: var(--bg-card-hover);
}

.email-item.trashed {
  opacity: 0.45;
}

.email-category {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 105px;
  text-align: center;
  flex-shrink: 0;
}

.cat-business { background: rgba(99, 102, 241, 0.16); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.35); }
.cat-transaction { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.35); }
.cat-newsletter { background: rgba(245, 158, 11, 0.16); color: #fde047; border: 1px solid rgba(245, 158, 11, 0.35); }
.cat-promotion { background: rgba(239, 68, 68, 0.16); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.35); }
.cat-spam { background: rgba(220, 38, 38, 0.25); color: #f87171; border: 1px solid rgba(220, 38, 38, 0.45); }
.cat-notification { background: rgba(168, 85, 247, 0.16); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.35); }
.cat-personal { background: rgba(6, 182, 212, 0.16); color: #67e8f9; border: 1px solid rgba(6, 182, 212, 0.35); }
.cat-unknown { background: rgba(100, 116, 139, 0.16); color: #cbd5e1; border: 1px solid rgba(100, 116, 139, 0.35); }

.email-sender {
  width: 210px;
  flex-shrink: 0;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-subject {
  flex: 1;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-date {
  color: var(--text-dim);
  font-size: 12px;
  flex-shrink: 0;
  width: 105px;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
}

.email-size {
  color: var(--text-dim);
  font-size: 12px;
  flex-shrink: 0;
  width: 75px;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
}

.email-tier {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}

.tier-0 { background: rgba(56, 189, 248, 0.18); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.tier-1 { background: rgba(16, 185, 129, 0.18); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.tier-2 { background: rgba(239, 68, 68, 0.18); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.tier-3 { background: rgba(245, 158, 11, 0.18); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

/* Progress bar */
.progress-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--cyan);
}

.progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--primary), var(--purple));
  border-radius: 4px;
  transition: width 0.3s;
}

/* Results & Approval Header */
.approval-header, .results-header, .rules-header, .domains-header, .audit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
}

.approval-desc, .rules-desc, .domains-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

.approval-actions {
  display: flex;
  gap: 10px;
}

/* Category Quick Filter Buttons */
.category-quick-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.btn-quick-cat {
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-quick-cat:hover {
  color: var(--text);
  border-color: var(--cyan);
  transform: translateY(-1px);
}

.btn-quick-cat.active {
  background: linear-gradient(135deg, var(--cyan) 0%, #0284c7 100%);
  color: #0f172a;
  border-color: var(--cyan);
  font-weight: 800;
  box-shadow: 0 4px 14px var(--cyan-glow);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.pagination button {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  color: #fff;
}

.pagination button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.pagination button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Rules List & Cards */
.rules-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rule-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.rule-card:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
}

/* Quick Preview Drawer */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  justify-content: flex-end;
}

.drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
}

.drawer-panel {
  position: relative;
  width: 560px;
  max-width: 92vw;
  height: 100%;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 48px rgba(0, 0, 0, 0.7);
  z-index: 1;
  animation: slideLeft 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideLeft {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-header {
  padding: 22px 26px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  background: rgba(7, 10, 17, 0.4);
}

.drawer-title-group h3 {
  font-size: 17px;
  font-weight: 800;
  margin-top: 6px;
  line-height: 1.35;
  color: var(--text);
}

.drawer-body {
  padding: 26px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.drawer-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: rgba(7, 10, 17, 0.8);
  padding: 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border: 1px solid var(--border);
}

.ai-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(6, 182, 212, 0.06) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-sm);
  padding: 18px;
}

.ai-box-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 13.5px;
  color: var(--cyan);
  margin-bottom: 10px;
}

.ai-box-body {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.6;
}

.draft-box {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(99, 102, 241, 0.06) 100%);
  border-color: rgba(168, 85, 247, 0.3);
}

.draft-box .ai-box-title {
  color: var(--purple);
}

.email-content-preview {
  background: rgba(7, 10, 17, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  font-size: 13.5px;
  color: var(--text-muted);
}

/* Chat Assistant Drawer Widget */
.chat-drawer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 400px;
  height: 540px;
  max-width: 90vw;
  max-height: 82vh;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  z-index: 1600;
  overflow: hidden;
  animation: slideUpChat 0.25s ease-out;
}

@keyframes slideUpChat {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.chat-header {
  padding: 16px 20px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 14.5px;
  color: var(--text);
}

.chat-messages {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-msg {
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  max-width: 88%;
}

.chat-msg.assistant {
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.25);
  align-self: flex-start;
  color: var(--text);
}

.chat-msg.user {
  background: linear-gradient(135deg, var(--primary) 0%, var(--indigo) 100%);
  color: white;
  align-self: flex-end;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.chat-input-row {
  padding: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  background: rgba(7, 10, 17, 0.6);
}

.chat-input-row input {
  flex: 1;
  padding: 9px 14px;
  background: rgba(7, 10, 17, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13.5px;
}

/* Modals & Toasts */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  animation: modalScale 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-lg {
  max-width: 680px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 18px 0;
}

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  padding: 14px 22px;
  background: rgba(14, 20, 36, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.25s ease-out;
  max-width: 400px;
}

.toast.success { border-color: var(--success); color: #6ee7b7; box-shadow: 0 6px 20px rgba(16, 185, 129, 0.2); }
.toast.error { border-color: var(--danger); color: #fca5a5; box-shadow: 0 6px 20px rgba(239, 68, 68, 0.2); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

/* Global Real-time Progress Tracker Banner */
.global-progress-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: 90%;
  max-width: 660px;
  background: rgba(14, 20, 36, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid var(--cyan);
  border-radius: 14px;
  padding: 16px 22px;
  box-shadow: 0 12px 36px rgba(6, 182, 212, 0.3);
  color: var(--text);
  font-size: 13.5px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.global-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 800;
  color: var(--cyan);
}

.global-progress-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.global-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.global-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--indigo), #a855f7);
  border-radius: 4px;
  transition: width 0.3s ease;
  position: relative;
}

.global-progress-bar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.btn-loading {
  opacity: 0.75;
  cursor: wait !important;
  pointer-events: none !important;
}

.btn-xs-unsub {
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 800;
  color: var(--cyan);
  background: rgba(6, 182, 212, 0.14);
  border: 1px solid var(--cyan);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 6px;
}

.btn-xs-unsub:hover {
  background: var(--cyan);
  color: #0f172a;
  box-shadow: 0 0 10px var(--cyan-glow);
}

/* ---------------------------------------------------------------------------
   Meeting Assistant Styles
   --------------------------------------------------------------------------- */

.meetings-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.meeting-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.meeting-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.meeting-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-glow);
}

.meeting-card.past {
  opacity: 0.75;
}

.meeting-card-time {
  font-size: 12px;
  color: var(--cyan);
  font-weight: 700;
  margin-bottom: 4px;
}

.meeting-card-time span {
  color: var(--text-muted);
  font-weight: 500;
}

.meeting-card-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
  line-height: 1.4;
}

.meeting-card-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.meeting-detail {
  animation: fadeIn 0.3s ease;
}

.recorder-card {
  transition: all 0.2s ease;
}

#recorder-transcript {
  white-space: pre-wrap;
}

/* Tablet optimizations */
@media (max-width: 768px) {
  .meetings-list {
    grid-template-columns: 1fr;
  }

  .header {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .panel-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 6px;
  }

  .tab {
    padding: 10px 14px;
    font-size: 13px;
    white-space: nowrap;
  }

  .meeting-detail-header {
    flex-direction: column;
  }

  #btn-meeting-record,
  #btn-meeting-briefing,
  #btn-meeting-summarize {
    width: 100%;
    justify-content: center;
  }
}

/* Samsung DeX / large tablet landscape */
@media (min-width: 1200px) and (min-height: 700px) {
  .meetings-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Touch-friendly targets */
button, .tab, .meeting-card, .email-item, .btn-quick-cat {
  min-height: 44px;
}

/* PWA standalone mode padding for notches/system bars */
@media (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* S Pen color picker active state */
[data-spen-color].active {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary);
  transform: scale(1.1);
}

/* Samsung DeX desktop-like layout */
body.samsung-dex .header {
  padding: 10px 24px;
}
body.samsung-dex .meetings-list {
  grid-template-columns: repeat(3, 1fr);
}
body.samsung-dex #meeting-detail-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
body.samsung-dex #meeting-detail-panel > .meeting-detail-header,
body.samsung-dex #meeting-detail-panel > #meeting-recorder-box,
body.samsung-dex #meeting-detail-panel > #meeting-spen-box,
body.samsung-dex #meeting-detail-panel > #meeting-summary-box,
body.samsung-dex #meeting-detail-panel > #meeting-action-items-box,
body.samsung-dex #meeting-detail-panel > #meeting-briefing-box {
  grid-column: 1 / -1;
}

/* Tablet landscape optimizations */
body.tablet-mode .meetings-list {
  grid-template-columns: repeat(2, 1fr);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   v8 — Unified Inbox & multi-account UI
   ========================================================================= */
.btn-danger {
  background: #ef4444;
  color: #fff;
  border: none;
}
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }

.account-edit {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 26px; height: 26px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  margin-left: 4px;
}
.account-edit:hover { color: var(--text); border-color: var(--indigo); }

/* Unified inbox rows */
.inbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: default;
  transition: background 0.15s;
}
.inbox-row:hover { background: rgba(255,255,255,0.03); }
.inbox-row.selected { background: rgba(99,102,241,0.12); }
.inbox-row input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; }
.inbox-account-chip {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.inbox-main { flex: 1; min-width: 0; }
.inbox-row-header {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 3px;
}
.inbox-sender { font-weight: 600; font-size: 13px; }
.inbox-date { margin-left: auto; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.inbox-unread-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #3b82f6; display: inline-block;
}
.inbox-importance { color: #f59e0b; font-size: 11px; }
.inbox-subject {
  font-size: 14px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 2px;
}
.inbox-snippet {
  font-size: 12px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.inbox-acct-label {
  font-size: 10px; color: var(--text-muted);
  margin-top: 4px; opacity: 0.7;
}

