/* =========================================================================
   SHADCN / UI DESIGN SYSTEM - OFFICIAL ZINC PALETTE & COMPONENTS
   ========================================================================= */

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Official shadcn Zinc Theme */
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  
  --popover: 0 0% 100%;
  --popover-foreground: 240 10% 3.9%;
  
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  
  --accent: 240 4.8% 95.9%;
  --accent-foreground: 240 5.9% 10%;
  
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;

  --emerald-50: 151 80% 96%;
  --emerald-500: 152 76% 40%;
  --emerald-600: 153 77% 34%;
  --emerald-700: 154 75% 26%;

  --amber-50: 48 100% 96%;
  --amber-500: 38 92% 50%;
  --amber-600: 32 95% 44%;

  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --ring: 240 5.9% 10%;
  
  --radius: 0.5rem;
  --radius-md: calc(var(--radius) - 2px);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --sidebar-width: 260px;
  --header-height: 60px;
}

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

body {
  font-family: var(--font-sans);
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  overflow-x: hidden;
}

/* =========================================================================
   SHADCN APP LAYOUT (Sidebar + Header + Main)
   ========================================================================= */

.shadcn-app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background-color: #f8fafc;
}

/* Sidebar */
.shadcn-sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background-color: #ffffff;
  border-right: 1px solid hsl(var(--border));
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

/* Desktop Collapsed Sidebar */
.shadcn-app-shell.sidebar-collapsed .shadcn-sidebar {
  margin-left: calc(-1 * var(--sidebar-width));
}

.shadcn-sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-close-btn {
  color: hsl(var(--muted-foreground));
  border-radius: var(--radius-md);
  padding: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.sidebar-close-btn:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.sidebar-backdrop {
  display: none;
}

.sidebar-logo {
  height: 34px;
  width: auto;
  object-fit: contain;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-brand-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.sidebar-brand-sub {
  font-size: 0.72rem;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
  white-space: nowrap;
}

.shadcn-sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-group-label {
  padding: 0 10px 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: hsl(var(--muted-foreground));
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  position: relative;
}

.sidebar-nav-item:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.sidebar-nav-item.active {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-weight: 600;
}

.sidebar-nav-item i, .sidebar-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-nav-item .nav-badge {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.sidebar-nav-item.active .nav-badge {
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.shadcn-sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid hsl(var(--border));
  background-color: #fafafa;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

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

.user-role {
  font-size: 0.7rem;
  color: hsl(var(--muted-foreground));
}

/* Main Area */
.shadcn-main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: hidden;
}

/* Topbar Header */
.shadcn-header {
  height: var(--header-height);
  background-color: #ffffff;
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(8px);
}

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

.header-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
}

.header-breadcrumbs .breadcrumb-sep {
  color: hsl(var(--border));
}

.header-breadcrumbs .breadcrumb-current {
  color: hsl(var(--foreground));
  font-weight: 600;
}

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

.live-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--emerald-700));
  background-color: hsl(var(--emerald-50));
  border: 1px solid #bbf7d0;
  padding: 4px 10px;
  border-radius: 999px;
}

.live-sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: hsl(var(--emerald-500));
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  animation: pulseDot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Content Container */
.shadcn-main-content {
  flex: 1;
  padding: 24px 32px 48px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.shadcn-tab-panel {
  display: none;
  animation: panelFade 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.shadcn-tab-panel.active-panel {
  display: block;
}

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

/* Page Intro Heading */
.page-intro {
  margin-bottom: 24px;
}

.page-intro .eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: hsl(var(--muted-foreground));
  display: block;
  margin-bottom: 4px;
}

.page-intro h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: hsl(var(--foreground));
  margin-bottom: 4px;
}

.page-intro p {
  font-size: 0.88rem;
  color: hsl(var(--muted-foreground));
}

/* =========================================================================
   SHADCN COMPONENTS (Card, Button, Badge, Table, Tabs, Input, Select, etc.)
   ========================================================================= */

/* --- Card --- */
.shadcn-card {
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border-radius: var(--radius-lg);
  border: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  overflow: hidden;
  margin-bottom: 24px;
}

.shadcn-card-header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.shadcn-card-title {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
}

.shadcn-card-description {
  font-size: 0.84rem;
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
}

.shadcn-card-content {
  padding: 0 24px 24px;
}

.shadcn-card-footer {
  padding: 16px 24px;
  border-top: 1px solid hsl(var(--border));
  background-color: #fafafa;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.metric-card {
  background-color: #ffffff;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.metric-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
}

.metric-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-value {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: hsl(var(--foreground));
  line-height: 1.1;
}

.metric-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
}

.trend-up {
  background-color: #ecfdf5;
  color: #059669;
}

.trend-neutral {
  background-color: #f1f5f9;
  color: #475569;
}

.trend-amber {
  background-color: #fffbeb;
  color: #d97706;
}

/* --- Buttons --- */
.shadcn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.shadcn-btn i, .shadcn-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.shadcn-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.shadcn-btn-default {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  box-shadow: var(--shadow-sm);
}
.shadcn-btn-default:hover {
  background-color: hsl(240 5.9% 18%);
}

.shadcn-btn-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}
.shadcn-btn-secondary:hover {
  background-color: hsl(240 4.8% 90%);
}

.shadcn-btn-outline {
  background-color: #ffffff;
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
  box-shadow: var(--shadow-sm);
}
.shadcn-btn-outline:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.shadcn-btn-ghost {
  background-color: transparent;
  color: hsl(var(--foreground));
}
.shadcn-btn-ghost:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.shadcn-btn-destructive {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  box-shadow: var(--shadow-sm);
}
.shadcn-btn-destructive:hover {
  background-color: hsl(0 84.2% 52%);
}

.shadcn-btn-success {
  background-color: #10b981;
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}
.shadcn-btn-success:hover {
  background-color: #059669;
}

/* Button Sizes */
.shadcn-btn-sm {
  height: 32px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.shadcn-btn-md {
  height: 38px;
  padding: 0 14px;
  font-size: 0.85rem;
}

.shadcn-btn-lg {
  height: 44px;
  padding: 0 20px;
  font-size: 0.95rem;
}

.shadcn-btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* LinkedIn Action Button & Link Badge */
.linkedin-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #0a66c2 !important;
  border: 1px solid rgba(10, 102, 194, 0.3) !important;
  background-color: rgba(10, 102, 194, 0.05) !important;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.linkedin-btn:hover {
  background-color: #0a66c2 !important;
  color: #ffffff !important;
  border-color: #0a66c2 !important;
  box-shadow: 0 1px 4px rgba(10, 102, 194, 0.25);
}
.linkedin-btn svg {
  stroke: currentColor;
  flex-shrink: 0;
}

.linkedin-badge-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0a66c2 !important;
  text-decoration: none !important;
  background: rgba(10, 102, 194, 0.08);
  border: 1px solid rgba(10, 102, 194, 0.22);
  padding: 2px 7px;
  border-radius: 6px;
  transition: all 0.15s ease;
  line-height: 1.2;
  white-space: nowrap;
  vertical-align: middle;
}
.linkedin-badge-link:hover {
  background: #0a66c2 !important;
  color: #ffffff !important;
  border-color: #0a66c2 !important;
}
.linkedin-badge-link svg {
  stroke: currentColor;
}

.linkedin-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: rgba(10, 102, 194, 0.1);
  color: #0a66c2 !important;
  border: 1px solid rgba(10, 102, 194, 0.2);
  text-decoration: none !important;
  transition: all 0.15s ease;
  vertical-align: middle;
}
.linkedin-icon-link:hover {
  background: #0a66c2 !important;
  color: #ffffff !important;
  border-color: #0a66c2 !important;
  transform: scale(1.05);
}
.linkedin-icon-link svg {
  stroke: currentColor;
}

/* --- Badges --- */
.shadcn-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  border: 1px solid transparent;
  line-height: 1;
}

.shadcn-badge-default {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.shadcn-badge-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.shadcn-badge-outline {
  background-color: transparent;
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}

.shadcn-badge-success {
  background-color: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.shadcn-badge-warning {
  background-color: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

.shadcn-badge-destructive {
  background-color: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

/* --- Data Table --- */
.shadcn-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid hsl(var(--border));
  background-color: #ffffff;
}

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

.shadcn-table thead {
  background-color: #f8fafc;
  border-bottom: 1px solid hsl(var(--border));
}

.shadcn-table th {
  padding: 12px 16px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.shadcn-table tbody tr {
  border-bottom: 1px solid hsl(var(--border));
  transition: background-color 0.15s ease;
}

.shadcn-table tbody tr:last-child {
  border-bottom: none;
}

.shadcn-table tbody tr:hover {
  background-color: #f8fafc;
}

.shadcn-table tbody tr.row-selected {
  background-color: #f0fdf4;
}

.shadcn-table td {
  padding: 14px 16px;
  color: hsl(var(--foreground));
  vertical-align: middle;
}

/* Attendee Table Item Layout */
.attendee-cell-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.attendee-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.attendee-meta {
  display: flex;
  flex-direction: column;
}

.attendee-meta strong {
  font-size: 0.88rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.attendee-meta small {
  font-size: 0.74rem;
  color: hsl(var(--muted-foreground));
}

/* Delivery Channel Pills */
.delivery-indicators {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.delivery-pill {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  border: 1px solid transparent;
}
.delivery-pill.sent { background: #ecfdf5; border-color: #a7f3d0; color: #059669; }
.delivery-pill.failed { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.delivery-pill.pending { background: #f1f5f9; border-color: #e2e8f0; color: #94a3b8; }

/* --- Forms & Inputs --- */
.shadcn-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

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

.shadcn-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.shadcn-input, .shadcn-select, .shadcn-textarea {
  height: 38px;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid hsl(var(--input));
  background-color: #ffffff;
  padding: 0 12px;
  font-size: 0.85rem;
  font-family: inherit;
  color: hsl(var(--foreground));
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.shadcn-input:focus, .shadcn-select:focus, .shadcn-textarea:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px rgba(24, 24, 27, 0.1);
}

.shadcn-textarea {
  height: auto;
  min-height: 80px;
  padding: 8px 12px;
}

.shadcn-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid hsl(var(--border));
  cursor: pointer;
  accent-color: hsl(var(--primary));
}

/* --- Toolbar & Filter Bar --- */
.shadcn-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
}

.search-input-wrapper {
  position: relative;
  max-width: 320px;
  width: 100%;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: hsl(var(--muted-foreground));
  pointer-events: none;
}

.search-input-wrapper .shadcn-input {
  padding-left: 34px;
}

/* Segmented Tabs Control */
.shadcn-segmented {
  display: inline-flex;
  align-items: center;
  background-color: #f1f5f9;
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
}

.segmented-btn {
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.segmented-btn:hover {
  color: #0f172a;
}

.segmented-btn.active {
  background-color: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Floating Bulk Action Bar */
.shadcn-bulk-bar {
  position: sticky;
  bottom: 24px;
  z-index: 50;
  margin-top: 16px;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-radius: var(--radius-lg);
  padding: 12px 20px;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  animation: slideUpFloat 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.bulk-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- Sonner Toaster (Floating Notifications) --- */
.shadcn-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.shadcn-toast {
  pointer-events: auto;
  min-width: 320px;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}
.toast-success .toast-icon { color: #10b981; }
.toast-error .toast-icon { color: #ef4444; }
.toast-info .toast-icon { color: #3b82f6; }

.toast-body {
  flex: 1;
}

.toast-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 2px;
}

.toast-desc {
  font-size: 0.78rem;
  color: hsl(var(--muted-foreground));
}

/* --- Settings Radio Cards --- */
.channel-radio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.channel-radio-card {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.channel-radio-card:hover {
  border-color: hsl(var(--foreground));
  background-color: hsl(var(--muted));
}

.channel-radio-card.active {
  border-color: hsl(var(--primary));
  background-color: #fafafa;
  box-shadow: 0 0 0 2px rgba(24, 24, 27, 0.1);
}

.channel-radio-card input {
  display: none;
}

.channel-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.channel-card-top strong {
  font-size: 0.88rem;
  color: hsl(var(--foreground));
}

.channel-card-desc {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

/* --- Login Screen --- */
.shadcn-login-screen {
  position: fixed;
  inset: 0;
  background-color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999;
}

.shadcn-login-card {
  width: 100%;
  max-width: 400px;
  background-color: #ffffff;
  border-radius: var(--radius-xl);
  border: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-xl);
  padding: 32px 28px;
}

/* Responsive */
@media (max-width: 1024px) {
  .shadcn-sidebar {
    position: fixed;
    top: 0;
    left: -290px;
    margin-left: 0 !important;
    height: 100vh;
    box-shadow: none;
    z-index: 90;
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
  }

  .shadcn-sidebar.sidebar-open {
    left: 0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: 80;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

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

  .shadcn-main-content {
    padding: 18px 16px 36px;
  }
}

/* =========================================================================
   EMAIL TEMPLATE STUDIO COMPONENT STYLES
   ========================================================================= */

.template-editor-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.template-tabs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid hsl(var(--border));
  padding-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.template-nav-pills {
  display: inline-flex;
  gap: 6px;
  background-color: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
}

.template-nav-btn {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.template-nav-btn:hover {
  color: #0f172a;
}

.template-nav-btn.active {
  background-color: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.template-tag-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
}

.tag-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  font-family: var(--font-mono, monospace);
  font-size: 0.74rem;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tag-pill-btn:hover {
  background-color: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.template-dual-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

@media (max-width: 1024px) {
  .template-dual-view {
    grid-template-columns: 1fr;
  }
}

.template-code-box {
  display: flex;
  flex-direction: column;
  height: 620px;
}

.template-textarea {
  flex: 1;
  width: 100%;
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  line-height: 1.5;
  background-color: #090d16;
  color: #e2e8f0;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  padding: 14px;
  resize: vertical;
  outline: none;
  tab-size: 2;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.template-textarea:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.template-preview-box {
  display: flex;
  flex-direction: column;
  height: 620px;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  background-color: #f8fafc;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.template-preview-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background-color: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
}

.template-preview-iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  background-color: #ffffff;
}

/* Animation utilities */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.animate-spin {
  animation: spin 0.8s linear infinite !important;
  display: inline-block;
}

/* =========================================================================
   SHADCN DIALOG / MODAL COMPONENT STYLES
   ========================================================================= */

.shadcn-dialog-backdrop,
.shadcn-dialog-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.shadcn-dialog-backdrop[style*="display: none"],
.shadcn-dialog-overlay[style*="display: none"] {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.shadcn-dialog-backdrop[style*="display: flex"],
.shadcn-dialog-overlay[style*="display: flex"],
.shadcn-dialog-backdrop.open,
.shadcn-dialog-overlay.open {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.shadcn-dialog {
  width: 100%;
  max-width: 640px;
  background-color: #ffffff;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(1) translateY(0);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 100000;
}

.shadcn-dialog-backdrop.open .shadcn-dialog,
.shadcn-dialog-overlay.open .shadcn-dialog,
.shadcn-dialog-backdrop[style*="display: flex"] .shadcn-dialog,
.shadcn-dialog-overlay[style*="display: flex"] .shadcn-dialog {
  transform: scale(1) translateY(0);
}

.shadcn-dialog-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.shadcn-dialog-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.shadcn-dialog-footer {
  padding: 14px 24px;
  border-top: 1px solid hsl(var(--border));
  background-color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.criteria-match-preview {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.criteria-match-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

.criteria-match-item strong {
  color: hsl(var(--foreground));
}

.criteria-match-item small {
  color: hsl(var(--muted-foreground));
}

.preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:hover {
  background-color: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

/* Minimalist Lookup Row */
.minimal-lookup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background-color: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
}

.minimal-lookup-row:hover {
  background-color: #f8fafc;
  border-color: #64748b;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.07);
}

/* Expandable Lookup Card Component */
.lookup-expandable-card {
  background-color: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transition: all 0.15s ease;
}

.lookup-expandable-card:hover {
  border-color: #64748b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.lookup-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  background-color: #ffffff;
}

.lookup-summary-bar:hover {
  background-color: #f8fafc;
}

.lookup-details-drawer {
  display: none;
  padding: 14px 18px;
  background-color: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.lookup-expandable-card.expanded .lookup-details-drawer {
  display: block;
}

.lookup-expandable-card.expanded .chevron-icon {
  transform: rotate(180deg);
}

.chevron-icon {
  transition: transform 0.2s ease;
  color: #94a3b8;
}

/* ==========================================================================
   LIVE ATTENDANCE RADAR & REAL-TIME STREAM STYLES
   ========================================================================== */

.live-radar-container {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1.5px solid #334155;
  border-radius: var(--radius-lg);
  color: #ffffff;
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

.radar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.radar-live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulsing-radar-dot {
  width: 10px;
  height: 10px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseBeacon 1.8s infinite;
  display: inline-block;
}

.pulsing-radar-dot.is-alert {
  background-color: #ef4444;
  animation: pulseBeaconRed 1.2s infinite;
}

@keyframes pulseBeacon {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulseBeaconRed {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.8); }
  70% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.radar-idle-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  color: #94a3b8;
  font-size: 0.84rem;
}

.radar-active-card {
  background: #ffffff;
  color: #0f172a;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  border-left: 5px solid #10b981;
  animation: slideInRadar 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  position: relative;
  overflow: hidden;
}

.radar-active-card.status-rejected {
  border-left-color: #ef4444;
  background: #fff5f5;
}

.radar-active-card.status-duplicate {
  border-left-color: #f59e0b;
  background: #fffdf5;
}

@keyframes slideInRadar {
  0% { opacity: 0; transform: translateY(-10px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.scan-countdown-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #10b981;
  width: 100%;
  animation: countdownShrink 10s linear forwards;
}

.radar-active-card.status-rejected .scan-countdown-bar {
  background: #ef4444;
}

.radar-active-card.status-duplicate .scan-countdown-bar {
  background: #f59e0b;
}

@keyframes countdownShrink {
  from { width: 100%; }
  to { width: 0%; }
}

.attendance-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* Dual Light/Dark Brand Logo */
.logo-dark-mode {
  display: none !important;
}
.logo-light-mode {
  display: inline-block !important;
}

@media (prefers-color-scheme: dark) {
  .logo-light-mode {
    display: none !important;
  }
  .logo-dark-mode {
    display: inline-block !important;
  }
}

[data-theme="dark"] .logo-light-mode {
  display: none !important;
}
[data-theme="dark"] .logo-dark-mode {
  display: inline-block !important;
}

/* =========================================================================
   COMPANY DIRECTORY & BREAKDOWN COMPONENT STYLES
   ========================================================================= */

.company-group-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.company-group-card:hover {
  border-color: hsl(var(--ring) / 0.3);
  box-shadow: var(--shadow-md);
}

.company-group-card.expanded {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 16px -2px rgba(99, 102, 241, 0.1);
}

.company-card-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  background: hsl(var(--card));
  transition: background-color 0.15s ease;
}

.company-card-header:hover {
  background: hsl(var(--secondary) / 0.6);
}

.company-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.company-icon-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(59, 130, 246, 0.15));
  color: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.company-info-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.company-name-heading {
  font-size: 1.05rem;
  font-weight: 800;
  color: hsl(var(--foreground));
  margin: 0;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.company-badges-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.company-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.company-badge-total {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.company-badge-approved {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.company-badge-pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.company-badge-rejected {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.company-badge-attended {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

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

.company-expand-chevron {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: hsl(var(--muted-foreground));
}

.company-group-card.expanded .company-expand-chevron {
  transform: rotate(180deg);
  color: #4f46e5;
}

.company-people-container {
  display: none;
  padding: 0 20px 20px 20px;
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  animation: fadeInDown 0.2s ease-out;
}

.company-group-card.expanded .company-people-container {
  display: block;
}

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

.company-delegate-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  font-weight: 700;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid hsl(var(--border));
}

.company-delegate-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.company-status-approved {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.company-status-pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.company-status-rejected {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}



