:root {
  --bg: #05070a;
  --surface: #0f111a;
  --surface-glass: rgba(255, 255, 255, 0.03);
  --text: #ffffff;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(99, 102, 241, 0.4);
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.5);
  --accent-hover: #818cf8;
  --success: #10b981;
  --error: #ef4444;
  --radius: 16px;
  --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --sidebar-bg: #080b11;
  --topbar-bg: rgba(15, 17, 26, 0.8);
  --header-text: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  --input-bg: rgba(0, 0, 0, 0.2);
  --brand-primary: #818cf8;
  --brand-primary-rgb: 129, 140, 248;
  --brand-secondary: #fbbf24;
  --brand-secondary-rgb: 251, 191, 36;
  --sidebar-header: var(--brand-primary);
  --sidebar-active-bg: rgba(var(--brand-secondary-rgb), 0.1);
  --sidebar-active-border: var(--brand-secondary);
}

.light-theme {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.8);
  --text: #0f172a;
  --text-muted: #64748b;
  --border: rgba(0, 0, 0, 0.1);
  --border-glow: rgba(99, 102, 241, 0.3);
  --accent: #4f46e5;
  --accent-glow: rgba(79, 70, 229, 0.3);
  --accent-hover: #4338ca;
  --success: #059669;
  --error: #dc2626;
  --shadow-premium: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  --sidebar-bg: #ffffff;
  --topbar-bg: rgba(255, 255, 255, 0.8);
  --header-text: linear-gradient(135deg, #0f172a 0%, #475569 100%);
  --input-bg: #f1f5f9;
  --brand-primary: #021061;
  --brand-primary-rgb: 2, 16, 97;
  --brand-secondary: #542410;
  --brand-secondary-rgb: 84, 36, 16;
  --sidebar-header: var(--brand-primary);
  --sidebar-active-bg: rgba(var(--brand-secondary-rgb), 0.08);
  --sidebar-active-border: var(--brand-secondary);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  color: var(--text);
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.glass-card {
  background: var(--surface-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px;
  box-shadow: var(--shadow-premium);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 16px;
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: var(--header-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

p {
  color: var(--text-muted);
  line-height: 1.6;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text);
  margin-bottom: 20px;
  font-size: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

button {
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

button::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

button:hover::after {
  left: 100%;
}

button:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.light-theme .btn-secondary {
  background: #f1f5f9;
  color: #0f172a;
}

.light-theme .btn-secondary:hover {
  background: #e2e8f0;
  color: var(--accent);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 12px;
  font-size: 14px;
}

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.alert {
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 14px;
  font-weight: 500;
}

.alert.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.alert.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
  position: relative;
  z-index: 10;
}

.auth-logo-top {
  position: fixed;
  top: 32px;
  left: 32px;
  z-index: 100;
  pointer-events: none;
}

.auth-logo-top img {
  height: 100px;
  width: auto;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

@media (max-width: 768px) {
  .auth-logo-top {
    top: 24px;
    left: 24px;
  }
  .auth-logo-top img {
    height: 80px;
  }
}

.auth-card {
  width: 100%;
  max-width: 480px;
}

.auth-header {
  text-align: center;
  margin-bottom: 40px;
}

.auth-header h2 {
  font-size: 34px;
  margin-bottom: 12px;
  background: linear-gradient(to right, #021061, #542410);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-card button {
  background: #021061;
  box-shadow: 0 10px 20px rgba(var(--brand-primary-rgb), 0.3);
}

.auth-card button:hover {
  background: #021061;
  box-shadow: 0 15px 30px rgba(var(--brand-primary-rgb), 0.4);
}

.auth-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  font-size: 14px;
}

.auth-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.auth-links a:hover {
  color: var(--accent);
}

.seed-info {
  margin-top: 40px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.seed-info code {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Custom File Upload */
.file-upload-wrapper {
  position: relative;
  width: 100%;
}

.file-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 2px dashed var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.file-upload-label:hover,
.file-upload-input:focus+.file-upload-label {
  background: rgba(99, 102, 241, 0.05);
  border-color: var(--accent);
}

.upload-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.upload-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.upload-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.file-name-display {
  font-size: 14px;
  margin-top: 8px;
  word-break: break-all;
}

/* Background Decoration */
.bg-decor {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.blob {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  filter: blur(100px);
  opacity: 0.4;
  animation: blob-move 20s infinite alternate;
}

.blob-1 {
  top: -10%;
  left: -10%;
  background: radial-gradient(circle, rgba(var(--brand-primary-rgb), 0.4) 0%, transparent 70%);
}

.blob-2 {
  bottom: -10%;
  right: -10%;
  background: radial-gradient(circle, rgba(84, 36, 16, 0.3) 0%, transparent 70%);
}

@keyframes blob-move {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(50px, 50px) scale(1.1);
  }
}

/* App Shell Layout */
.app-body {
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg);
  background-image:
    radial-gradient(at 0% 0%, rgba(var(--brand-primary-rgb), 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(84, 36, 16, 0.1) 0px, transparent 50%);
}

.auth-body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--bg);
  background-image:
    radial-gradient(at 0% 0%, rgba(var(--brand-primary-rgb), 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(84, 36, 16, 0.1) 0px, transparent 50%);
}

.app-layout {
  display: flex;
  height: 100vh;
}

/* Sidebar */
.app-sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
}

.sidebar-header {
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 800;
  color: var(--brand-primary);
  letter-spacing: -0.04em;
}

.logo-icon {
  color: var(--accent);
  fill: rgba(99, 102, 241, 0.2);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section {
  font-size: 11px;
  font-weight: 800;
  color: var(--sidebar-header);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 16px 0 8px 12px;
  opacity: 0.7;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: #475569; /* Slightly darker muted text for light theme */
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.light-theme .nav-item {
  color: var(--brand-primary);
}

.nav-item i {
  width: 18px;
  height: 18px;
  color: var(--brand-secondary) !important;
  opacity: 0.9;
  transition: transform 0.2s;
}

.nav-item:hover i {
  transform: translateX(2px);
  opacity: 1;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
  color: var(--brand-primary);
  background: var(--sidebar-active-bg);
  border-left: 3px solid var(--sidebar-active-border);
  padding-left: 9px;
  font-weight: 700;
}

.light-theme .nav-item.active {
  border-left-color: var(--brand-primary);
}

.nav-item.active i {
  color: #542410 !important;
  opacity: 1;
}

.light-theme .nav-item.active i {
  color: #542410 !important;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

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

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, #ec4899 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.user-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.user-info .name {
  font-size: 13px;
  font-weight: 600;
}

.user-info .role {
  font-size: 11px;
  color: var(--text-muted);
}

.logout-btn {
  color: var(--text-muted);
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
}

.logout-btn:hover {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Mobile Menu Toggle - strictly hidden on desktop */
.mobile-menu-toggle.icon-btn {
  display: none;
}

/* Main Content Area */
/* Main Content Area */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.filter-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  align-items: flex-end;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-glass);
}

.filter-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.filter-group label {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Task Section Premium Styling */
.task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.task-form-container {
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@media (max-width: 768px) {
  .task-grid {
    grid-template-columns: 1fr;
  }
}

.tasks-empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.tasks-empty-state i {
  display: block;
  font-size: 32px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.table-premium {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-premium th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.table-premium td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.table-premium tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.task-title-cell {
  font-weight: 600;
  color: var(--text);
}

.task-completed .task-title-cell {
  text-decoration: line-through;
  opacity: 0.5;
}

/* Button & Input refinements */
.btn-premium {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.btn-premium-primary {
  background: var(--accent);
  color: #fff;
}

.btn-premium-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 15px var(--accent-glow);
}

.btn-premium-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-premium-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Topbar */
.app-topbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
}

.page-title {
  font-size: 20px;
  margin: 0;
  background: none;
  -webkit-text-fill-color: var(--text);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  gap: 16px;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  box-shadow: none;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transform: translateY(0);
}

/* Scrollable Content */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

.topbar-panels {
  position: relative;
}

.icon-btn--has-badge {
  position: relative;
}

.icon-btn-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--error);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--topbar-bg);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  pointer-events: none;
  line-height: 1;
}

.notifications-panel {
  position: absolute;
  top: 18px;
  right: 32px;
  width: min(420px, calc(100vw - 32px));
  max-height: 70vh;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-premium);
  z-index: 120;
}

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

.topbar-panel-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.02em;
}

.topbar-panel-header p {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.topbar-panel-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.topbar-panel-close:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
  transform: rotate(90deg);
}

.notification-list {
  display: flex;
  flex-direction: column;
  max-height: calc(70vh - 86px);
  overflow-y: auto;
}

.notification-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  align-items: start;
  padding: 20px 24px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: all 0.2s ease;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background: rgba(99, 102, 241, 0.05);
  transform: translateX(4px);
}

.notification-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent);
}

.notification-item--warning .notification-icon {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.notification-item--danger .notification-icon {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.notification-item--success .notification-icon {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.notification-copy strong {
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.notification-copy span {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.notification-copy small {
  font-size: 12px;
  margin-top: 4px;
  color: var(--text-muted);
  opacity: 0.8;
  font-weight: 500;
}

.topbar-empty-state {
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  color: var(--text-muted);
}

.topbar-empty-state i {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.global-search-modal[hidden] {
  display: none;
}

.global-search-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 72px 20px 20px;
}

.global-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 10, 0.76);
  backdrop-filter: blur(10px);
}

.global-search-dialog {
  position: relative;
  width: min(760px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-premium);
  overflow: hidden;
}

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

.global-search-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--input-bg);
}

.global-search-field i {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.global-search-field input {
  margin: 0;
  padding: 16px 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.global-search-field input:focus {
  background: transparent;
  box-shadow: none;
}

.global-search-body {
  padding: 0 20px 20px;
}

.global-search-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 60vh;
  overflow-y: auto;
}

.search-result-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.search-result-item:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.05);
  transform: translateY(-1px);
}

.search-result-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent);
}

.search-result-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.search-result-type {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Dashboard Components */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

.stats-card {
  grid-column: span 4;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.manager-dashboard-grid .manager-stat-card {
  grid-column: span 3;
}

.manager-dashboard-grid .manager-main-chart {
  grid-column: span 8;
  margin-bottom: 0;
}

.manager-dashboard-grid .manager-side-chart {
  grid-column: span 4;
  margin-bottom: 0;
}

.manager-dashboard-grid .manager-half-chart {
  grid-column: span 6;
  margin-bottom: 0;
}

.stats-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.stats-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #ec4899);
  opacity: 0;
  transition: opacity 0.2s;
}

.stats-card:hover::before {
  opacity: 1;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.stat-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.stat-trend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.trend-up {
  color: var(--success);
}

.trend-down {
  color: var(--error);
}

.trend-neutral {
  color: var(--text-muted);
}

.stat-trend i {
  width: 14px;
  height: 14px;
}

/* Dashboard Sections */
.chart-section {
  grid-column: span 8;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.activity-section {
  grid-column: span 4;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

/* Data Tables inside Dashboard */
.data-table-container {
  grid-column: span 12;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin-top: 24px;
}

.data-table-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

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

.data-table th {
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 16px 24px;
  color: var(--text);
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.2s;
}

.data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
}

.status-new {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-contacted {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-won {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-lost {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* --------------------------------- 
 * PREMIUM EMAIL HISTORY UI STYLES
 * --------------------------------- */
.email-tabs {
  display: flex !important;
  gap: 12px !important;
  border: none !important;
  padding-bottom: 0 !important;
  margin-bottom: 32px !important;
}

.email-tab {
  flex: 1;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'DM Sans', sans-serif;
  text-align: center;
  box-shadow: var(--shadow-small);
}

.email-tab:hover {
  background: var(--surface-glass);
  color: var(--text);
  transform: translateY(-2px);
  border-color: var(--accent);
}

.email-tab.active {
  background: #800000;
  border-color: #800000;
  color: #ffffff;
  box-shadow: 0 8px 20px -4px rgba(128, 0, 0, 0.4);
}

.email-card {
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  position: relative;
  transition: all 0.3s ease;
  margin-bottom: 20px;
}

.email-card:hover {
  transform: translateX(-4px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-premium);
}

.email-card::before {
  content: '';
  position: absolute;
  top: 15%;
  right: 0;
  height: 70%;
  width: 5px;
  border-radius: 4px 0 0 4px;
  background: #800000;
  box-shadow: -2px 0 8px rgba(128, 0, 0, 0.3);
}

.email-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.email-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  background: none;
  -webkit-text-fill-color: var(--text);
}

.email-date {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
}

.email-body-snippet {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 16px 0 28px 0;
  max-width: 90%;
}

.email-card-footer {
  display: flex;
  gap: 40px;
  align-items: flex-end;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.email-meta-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.meta-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.recipient-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recipient {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #800000;
  font-weight: 600;
  margin-bottom: 4px;
}

.light-theme .recipient {
  color: #800000;
}

.recipient i {
  width: 12px;
  height: 12px;
}

.email-action {
  margin-left: auto;
  align-self: flex-end;
}

.btn-resend {
  background: rgba(128, 0, 0, 0.1);
  color: #800000;
  border: 1px solid rgba(128, 0, 0, 0.2);
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-resend:hover {
  background: #800000;
  color: #ffffff;
  transform: scale(1.05);
}

.btn-resend i {
  width: 16px;
  height: 16px;
}

.timeline-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-small);
}

.timeline-header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: rgba(128, 0, 0, 0.03);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.timeline-body {
  padding: 8px 0;
}

.timeline-item {
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.timeline-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.timeline-item.active {
  color: #800000;
  background: rgba(128, 0, 0, 0.05);
  border-left-color: #800000;
}

.report-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.report-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--surface);
  font-weight: 700;
  transition: all 0.2s ease;
}

.report-tab:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.report-tab.active {
  color: #fff;
  background: #800000;
  border-color: #800000;
  box-shadow: 0 8px 20px -4px rgba(128, 0, 0, 0.35);
}

.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.report-card-header,
.report-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.report-card-title {
  margin: 0 0 8px;
  font-size: 28px;
  background: none;
  -webkit-text-fill-color: var(--text);
  color: var(--text);
}

.report-card-copy {
  margin: 0;
  font-size: 14px;
}

.sent-report-shell {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.report-export-btn,
.report-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  font-weight: 700;
}

.report-export-btn:hover,
.report-reset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.report-export-btn i,
.report-reset-btn i {
  width: 16px;
  height: 16px;
}

.report-filters {
  display: flex;
  justify-content: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.report-filter-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.report-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.report-pill.active {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
}

.report-pill select {
  width: auto;
  margin: 0;
  padding: 0 28px 0 0;
  border: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 4px center;
  color: inherit;
  font: inherit;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.report-pill:hover select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.report-pill i {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.8;
}

.report-pill:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.05);
}

.sent-metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.sent-metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  min-height: 110px;
}

.sent-metric-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}

.sent-metric-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.sent-metric-label i {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.report-empty-state {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
}

.report-empty-state h3 {
  margin: 0;
  font-size: 24px;
  background: none;
  -webkit-text-fill-color: var(--text);
  color: var(--text);
}

.report-empty-state p {
  margin: 0;
  max-width: 420px;
}

.report-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
}

.report-empty-icon i {
  width: 32px;
  height: 32px;
}

.lead-email-modal[hidden] {
  display: none;
}

.lead-email-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lead-email-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 10, 0.68);
  backdrop-filter: blur(6px);
}

.lead-email-modal__dialog {
  position: relative;
  width: min(100%, 560px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-premium);
}

.lead-email-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.lead-email-recipient {
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 20px;
}

.lead-email-recipient__name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.lead-email-recipient__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 14px;
}

.lead-email-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lead-email-form select {
  margin-bottom: 16px;
}

.lead-email-preview {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 14px;
}

.lead-email-preview__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 700;
}

.lead-email-preview__value {
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.lead-email-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

.lead-email-actions .report-reset-btn,
.lead-email-actions button {
  width: auto;
}

/* Specific input overrides for filter-bar */
.filter-bar input {
  transition: all 0.3s ease;
  border: 1px solid var(--border) !important;
}

.filter-bar input:focus {
  border-color: var(--accent) !important;
  background: var(--surface) !important;
  box-shadow: 0 0 0 4px var(--accent-glow) !important;
}

/* Responsive Layout Updates */
@media (max-width: 1024px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    z-index: 1001;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
  }

  .app-sidebar.active {
    left: 0;
  }

  .mobile-menu-toggle {
    display: flex;
    margin-right: 12px;
  }

  .app-topbar {
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 900;
  }

  .content-area {
    padding: 24px 16px;
  }
}

@media (max-width: 768px) {
  .dashboard-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .manager-dashboard-grid .manager-stat-card,
  .manager-dashboard-grid .manager-main-chart,
  .manager-dashboard-grid .manager-side-chart,
  .manager-dashboard-grid .manager-half-chart {
    grid-column: span 1;
  }

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

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 16px;
  }

  .filter-group {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group input,
  .filter-group select,
  .filter-btn-group,
  .bulk-actions-bar {
    width: 100%;
  }

  .bulk-actions-bar {
    flex-wrap: wrap;
    height: auto;
    padding: 16px;
    gap: 12px;
  }

  .notifications-panel {
    width: calc(100vw - 32px);
    right: 16px;
    top: 12px;
  }

  .topbar-right {
    gap: 8px;
  }

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

  /* Table Responsiveness */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
  }

  .premium-table {
    min-width: 600px;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 20px;
  }

  .topbar-right .icon-btn {
    width: 36px;
    height: 36px;
  }

  .topbar-right .icon-btn i {
    width: 18px;
    height: 18px;
  }
}


/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-new { background: rgba(59, 130, 246, 0.1); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.2); }
.status-contacted { background: rgba(99, 102, 241, 0.1); color: #6366f1; border: 1px solid rgba(99, 102, 241, 0.2); }
.status-qualified { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; border: 1px solid rgba(139, 92, 246, 0.2); }
.status-proposal { background: rgba(245, 158, 11, 0.1); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }
.status-won { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); }
.status-lost { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }

/* Temperature Badges */
.temp-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.temp-hot { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }
.temp-warm { background: rgba(245, 158, 11, 0.1); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }
.temp-cold { background: rgba(59, 130, 246, 0.1); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.2); }



/* Icon Button Base */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-glass);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.icon-btn i {
  width: 20px;
  height: 20px;
}

.icon-btn:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.icon-btn.btn-premium-primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.icon-btn.btn-premium-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  box-shadow: 0 0 15px var(--accent-glow);
}



/* Professional Form Grid System */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  width: 100%;
}

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

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

.form-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.form-group input, 
.form-group select, 
.form-group textarea {
  width: 100%;
  box-sizing: border-box;
}



/* Premium Select Styling */
.premium-select {
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 16px !important;
  padding-right: 40px !important;
}

.light-theme .premium-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgba(0,0,0,0.4)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}



/* Admin UI Cleanup Utilities */
.admin-actions-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.select-sm {
  padding: 6px 10px !important;
  font-size: 13px !important;
  border-radius: 8px !important;
  height: 36px !important;
  background-position: right 10px center !important;
}

.btn-sm {
  padding: 6px 14px !important;
  font-size: 11px !important;
  border-radius: 8px !important;
  height: 36px !important;
  min-height: 36px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

.mailbox-multi-select {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  border-radius: 10px;
  padding: 8px;
  color: var(--text);
  font-size: 13px;
  width: 100%;
  outline: none;
}

.mailbox-multi-select option {
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 2px;
}

.mailbox-multi-select option:checked {
  background: var(--accent) !important;
  color: #fff;
}


/* Premium Responsive Utilities */
.page-container-premium {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

@media (max-width: 768px) {
  .page-container-premium {
    padding: 16px;
  }
}

.grid-responsive {
  display: grid;
  gap: 20px;
}

.grid-3-col { grid-template-columns: repeat(3, 1fr); }
.grid-2-col { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 1024px) {
  .grid-3-col { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-3-col, .grid-2-col { grid-template-columns: 1fr; }
}

/* Specific Component Responsiveness */
@media (max-width: 1200px) {
  .sent-metric-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .sent-metric-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .bulk-actions-bar-premium {
    flex-wrap: wrap;
    height: auto !important;
    padding: 16px !important;
    border-radius: 24px !important;
    bottom: 16px !important;
    width: calc(100% - 32px) !important;
    max-width: 500px;
  }
  
  .bulk-actions-bar-premium form {
    width: 100%;
    flex-direction: column;
  }
  
  .bulk-actions-bar-premium select, 
  .bulk-actions-bar-premium button {
    width: 100% !important;
  }
}

@media (max-width: 480px) {
  .sent-metric-grid {
    grid-template-columns: 1fr !important;
  }
  
  .kanban-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px;
  }
  
  .kanban-header .btn-primary {
    width: 100%;
    justify-content: center;
  }
}

/* --- Premium Global Components --- 

.page-container-premium {
    padding: 32px;
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.card-premium {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card-premium:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--brand-primary-rgb), 0.2);
    box-shadow: 0 20px 40px rgba(var(--brand-primary-rgb), 0.1);
}

.premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.premium-table th {
    background: rgba(var(--brand-primary-rgb), 0.05);
    padding: 16px 20px;
    text-align: left;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brand-primary);
    border-bottom: 1px solid var(--border);
}

.premium-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
    color: var(--text);
    transition: all 0.2s;
}

.premium-table tr:hover td {
    background: rgba(var(--brand-primary-rgb), 0.02);
}

.btn-premium {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-premium-primary {
    background: linear-gradient(135deg, var(--brand-primary), #0a1b80);
    color: #fff;
    box-shadow: 0 8px 16px rgba(var(--brand-primary-rgb), 0.25);
}

.btn-premium-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(var(--brand-primary-rgb), 0.35);
}

.btn-premium-outline {
    background: transparent;
    border: 1px solid var(--brand-primary);
    color: var(--brand-primary);
}

.btn-premium-outline:hover {
    background: rgba(var(--brand-primary-rgb), 0.05);
    transform: translateY(-2px);
}

.status-badge-premium {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-badge-premium.hot { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.status-badge-premium.warm { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.status-badge-premium.cold { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }

.section-header-premium {
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.section-header-premium h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    margin: 0;
}

.input-premium {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 14px;
    transition: all 0.2s;
    outline: none;
}

.input-premium:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(var(--brand-primary-rgb), 0.1);
    background: rgba(255, 255, 255, 0.04);
}

.app-main,
.content-area,
.page-container-premium,
.header-title-group,
.profile-main-column,
.profile-sidebar {
    min-width: 0;
}

.section-header-premium .header-title-group p {
    max-width: 72ch;
}

@media (max-width: 1200px) {
    .profile-layout-grid,
    .details-grid-responsive,
    .create-user-form-grid {
        grid-template-columns: 1fr !important;
    }

    .profile-sidebar {
        order: -1;
    }

    .grid-4-col {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 1024px) {
    .app-body {
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }

    .app-layout {
        min-height: 100vh;
        height: auto;
    }

    .app-main {
        min-width: 0;
        overflow-x: hidden;
    }

    .content-area {
        padding: 20px 16px 32px;
    }

    .page-container-premium {
        padding: 24px 0;
    }

    .section-header-premium {
        align-items: flex-start;
    }

    .section-header-premium .header-title-group {
        width: 100%;
    }

    .section-header-premium .header-title-group p {
        margin-left: 0 !important;
    }

    .profile-layout-grid,
    .details-grid-responsive,
    .roles-form-bundle,
    .create-user-form-grid {
        grid-template-columns: 1fr !important;
    }

    .kanban-board-premium {
        gap: 16px !important;
    }

    .kanban-column-premium {
        flex: 0 0 300px !important;
    }

    .upload-card-premium {
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
  .auth-container {
        padding: 16px;
    }

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

    .auth-logo-top {
        left: 50% !important;
        transform: translateX(-50%) !important;
        top: 24px !important;
    }

    .auth-logo-top img {
        height: 72px !important;
    }

    .app-topbar {
        min-height: 70px;
        height: auto;
        padding: 12px 16px;
    }

    .topbar-left,
    .topbar-right {
        min-width: 0;
    }

    .topbar-left {
        gap: 10px;
    }

    .page-title {
        font-size: 22px;
        line-height: 1.2;
    }

    .section-header-premium {
        gap: 12px;
    }

    .section-header-premium h1 {
        font-size: 24px;
        line-height: 1.15;
    }

    .section-header-premium h1 > div:first-child {
        width: 40px !important;
        height: 40px !important;
        border-radius: 12px !important;
    }

    .section-header-premium h1 > div:first-child i {
        width: 20px !important;
        height: 20px !important;
    }

    .card-premium,
    .glass-card {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    .profile-layout-grid,
    .details-grid-responsive,
    .task-grid,
    .grid-4-col,
    .create-user-form-grid {
        grid-template-columns: 1fr !important;
    }

    .kanban-column-premium {
        flex: 0 0 min(84vw, 300px) !important;
    }

    .admin-users-table,
    .premium-table {
        min-width: 720px;
    }

    .admin-stack-form {
        min-width: 220px;
    }

    .report-tab {
        min-width: 0;
        flex: 1 1 calc(50% - 6px);
        padding: 10px 14px;
    }

    .report-card {
        padding: 18px;
    }

    .report-card-header,
    .report-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .report-card-title {
        font-size: 24px;
    }

    .data-table {
        min-width: 520px;
    }
}

@media (max-width: 600px) {
    .page-container-premium {
        padding: 16px 0;
    }

    .content-area {
        padding: 16px 12px 24px;
    }

    .section-header-premium h1 {
        font-size: 22px;
    }

    .section-header-premium .btn-premium,
    .section-header-premium .btn-secondary,
    .section-header-premium .action-btn-premium {
        width: auto;
    }

    .kanban-column-premium {
        flex: 0 0 88vw !important;
    }

    .table-responsive {
        margin: 0 -12px;
        padding: 0 12px;
    }

    .report-tabs {
        gap: 8px;
    }

    .report-tab {
        flex-basis: 100%;
    }
}
