/**
 * WORKPULSE ADMIN PANEL — DESIGN SYSTEM
 * Attio-inspired clean light theme, micro-interactions, responsive layout, enterprise SaaS styling.
 */

:root {
  /* Surface & Background */
  --bg-app: #f8f9fb;
  --bg-card: #ffffff;
  --bg-card-subtle: #f9fafb;
  --bg-hover: #f3f5f8;
  --bg-active: #eef2f6;

  /* Text & Typography */
  --text-main: #181d27;
  --text-secondary: #414651;
  --text-muted: #667085;
  --text-subtle: #858d9d;
  --text-disabled: #9ea5b3;

  /* Borders & Dividers */
  --border-light: #eaedf2;
  --border-card: #e4e7ec;
  --border-strong: #d0d5dd;
  --border-focus: #3b66de;

  /* Brand Accents */
  --brand-primary: #2b59c3;
  --brand-primary-hover: #22479e;
  --brand-subtle: #eff4fe;
  --brand-border: #cdd9fb;

  /* Semantic Accents */
  --color-green: #039855;
  --color-green-bg: #ecfdf3;
  --color-green-border: #a6f4c5;
  --color-green-text: #027a48;

  --color-amber: #d97706;
  --color-amber-bg: #fffaeb;
  --color-amber-border: #fedf89;
  --color-amber-text: #b54708;

  --color-rose: #d92d20;
  --color-rose-bg: #fef3f2;
  --color-rose-border: #fecdca;
  --color-rose-text: #b42318;

  --color-purple: #6941c6;
  --color-purple-bg: #f9f5ff;
  --color-purple-border: #e9d7fe;
  --color-purple-text: #5925dc;

  --color-blue: #1570ef;
  --color-blue-bg: #eff8ff;
  --color-blue-border: #b2ddff;
  --color-blue-text: #175cd3;

  --color-teal: #0e9384;
  --color-teal-bg: #f0fdf9;
  --color-teal-border: #99f6e0;
  --color-teal-text: #0a6c61;

  /* Layout Measurements */
  --sidebar-width: 256px;
  --sidebar-collapsed-width: 72px;
  --topbar-height: 64px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.1), 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 8px -2px rgba(16, 24, 40, 0.1), 0 2px 4px -2px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 24px -4px rgba(16, 24, 40, 0.12), 0 4px 6px -2px rgba(16, 24, 40, 0.04);
  --shadow-modal: 0 24px 60px -12px rgba(16, 24, 40, 0.25);

  /* Fonts */
  --font-body: 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Manrope', 'DM Sans', sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* App Shell Layout */
.app-shell {
  min-height: 100vh;
  display: flex;
  position: relative;
}

/* ==========================================================================
   SIDEBAR COMPONENT
   ========================================================================== */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background-color: #ffffff;
  border-right: 1px solid var(--border-card);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
  height: var(--topbar-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

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

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #3b66de 0%, #1e45aa 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(43, 89, 195, 0.3);
  flex-shrink: 0;
}

.brand-mark svg {
  width: 18px;
  height: 18px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
  overflow: hidden;
}

.brand-text strong {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.5px;
  color: var(--text-main);
  line-height: 1.1;
}

.brand-text small {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-subtle);
}

.sidebar-collapse-toggle {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-subtle);
  border-radius: var(--radius-sm);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.sidebar-collapse-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
  color: var(--text-main);
}

.sidebar-collapse-toggle svg {
  width: 16px;
  height: 16px;
}

/* Workspace selector card */
.workspace-card {
  margin: 12px 12px 8px;
  padding: 8px 10px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: default;
  transition: background 0.15s ease;
}

.ws-avatar {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: #f0f4fe;
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ws-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.ws-info strong {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-info small {
  font-size: 10px;
  color: var(--text-muted);
}

.ws-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f2f4f7;
  color: var(--text-muted);
}

/* Sidebar Navigation Items */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 10px 16px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border-card);
  border-radius: 2px;
}

.nav-group {
  margin-bottom: 16px;
}

.nav-label {
  display: block;
  padding: 6px 8px 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-subtle);
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s ease;
  position: relative;
  white-space: nowrap;
}

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

.nav-link.active {
  background: var(--brand-subtle);
  color: var(--brand-primary);
  font-weight: 600;
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.nav-icon svg {
  width: 17px;
  height: 17px;
}

.nav-link:hover .nav-icon {
  color: var(--text-secondary);
}

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

.nav-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}

.nav-badge.amber {
  background: var(--color-amber-bg);
  color: var(--color-amber-text);
  border: 1px solid var(--color-amber-border);
}

.nav-badge.blue {
  background: var(--color-blue-bg);
  color: var(--color-blue-text);
  border: 1px solid var(--color-blue-border);
}

.nav-badge.green {
  background: var(--color-green-bg);
  color: var(--color-green-text);
  border: 1px solid var(--color-green-border);
}

.nav-badge.gray {
  background: #f2f4f7;
  color: var(--text-muted);
}

/* Sidebar Footer */
.sidebar-footer {
  border-top: 1px solid var(--border-light);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #ffffff;
  flex-shrink: 0;
}

.help-box {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.help-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #eaedf2;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.help-icon svg {
  width: 14px;
  height: 14px;
}

.help-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.help-text strong {
  font-size: 11px;
  color: var(--text-main);
}

.help-text small {
  font-size: 10px;
  color: var(--text-subtle);
}

.help-link {
  color: var(--text-muted);
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 4px;
}

.help-link:hover {
  color: var(--brand-primary);
}

.admin-profile-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 4px 4px;
}

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

.admin-details strong {
  font-size: 11px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-details small {
  font-size: 10px;
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-more-btn {
  background: transparent;
  border: 0;
  color: var(--text-subtle);
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
}

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

.profile-more-btn svg {
  width: 16px;
  height: 16px;
}

/* Collapsed Desktop Sidebar Mode */
.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .workspace-card,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .nav-text,
.sidebar-collapsed .nav-badge,
.sidebar-collapsed .help-box,
.sidebar-collapsed .admin-details,
.sidebar-collapsed .profile-more-btn {
  display: none !important;
}

.sidebar-collapsed .sidebar-header {
  padding: 0 14px;
  justify-content: center;
}

.sidebar-collapsed .sidebar-collapse-toggle {
  display: none;
}

.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 10px 0;
}

.sidebar-collapsed .main {
  margin-left: var(--sidebar-collapsed-width);
}

/* ==========================================================================
   TOPBAR COMPONENT
   ========================================================================== */
.main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  transition: margin-left 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.topbar {
  height: var(--topbar-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-card);
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

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

.menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.menu-btn svg {
  width: 18px;
  height: 18px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.crumb-root {
  font-weight: 500;
  color: var(--text-muted);
}

.crumb-sep {
  color: var(--border-strong);
  font-size: 11px;
}

.crumb-parent {
  color: var(--text-muted);
}

.crumb-current {
  color: var(--text-main);
  font-weight: 600;
}

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

/* Search Trigger button */
.search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  width: 250px;
  padding: 0 10px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-subtle);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.search-trigger:hover {
  background: #ffffff;
  border-color: var(--border-strong);
  color: var(--text-secondary);
}

.search-icon {
  width: 15px;
  height: 15px;
  color: var(--text-subtle);
  flex-shrink: 0;
}

.search-placeholder {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-kbd {
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text-muted);
  box-shadow: var(--shadow-xs);
}

.header-badge-demo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 12px;
  background: #f4f6fa;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-primary);
  display: inline-block;
}

.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
  color: var(--text-main);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.notif-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--color-rose);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  min-width: 15px;
  height: 15px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  padding: 0 3px;
  line-height: 1;
  border: 2px solid #ffffff;
}

.topbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border-card);
}

/* User pill button in header */
.user-pill-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid transparent;
  padding: 3px 6px 3px 3px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.15s ease;
}

.user-pill-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.user-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.user-meta strong {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}

.user-meta small {
  font-size: 10px;
  color: var(--text-muted);
}

.chevron-icon {
  width: 14px;
  height: 14px;
  color: var(--text-subtle);
  transition: transform 0.15s ease;
}

/* Popover & Dropdown Container */
.popover-container {
  position: relative;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: dropdownIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.notif-panel {
  width: 360px;
}

.panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.panel-header h4 {
  margin: 0 0 2px;
  font-size: 13px;
  font-family: var(--font-heading);
  font-weight: 700;
}

.panel-header small {
  font-size: 10px;
  color: var(--text-muted);
}

.text-link-btn {
  background: none;
  border: 0;
  color: var(--brand-primary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.text-link-btn:hover {
  text-decoration: underline;
}

.notif-list {
  max-height: 320px;
  overflow-y: auto;
}

.notif-item {
  padding: 12px 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s ease;
}

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

.notif-item.unread {
  background: #fcfdfe;
}

.notif-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 13px;
  flex-shrink: 0;
}

.notif-content {
  flex: 1;
}

.notif-content p {
  margin: 0 0 4px;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.notif-content p strong {
  color: var(--text-main);
}

.notif-time {
  font-size: 10px;
  color: var(--text-subtle);
}

.panel-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border-light);
  text-align: center;
  background: var(--bg-card-subtle);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.panel-footer-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-primary);
}

.profile-panel {
  width: 240px;
  padding: 8px 0;
}

.profile-header {
  padding: 10px 14px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-header .avatar.lg {
  width: 38px;
  height: 38px;
  font-size: 13px;
}

.profile-header strong {
  display: block;
  font-size: 12px;
  color: var(--text-main);
}

.profile-header small {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.role-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--color-purple-bg);
  color: var(--color-purple-text);
  font-size: 9px;
  font-weight: 600;
}

.menu-divider {
  height: 1px;
  background: var(--border-light);
  margin: 6px 0;
}

.menu-list {
  display: flex;
  flex-direction: column;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.menu-item svg {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

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

.menu-item:hover svg {
  color: var(--text-main);
}

.profile-footer {
  padding: 4px 10px 2px;
}

.demo-signout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.demo-signout-btn:hover {
  background: var(--color-rose-bg);
  border-color: var(--color-rose-border);
  color: var(--color-rose-text);
}

.demo-signout-btn svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   MAIN CONTENT AREA & PAGE HEADER
   ========================================================================== */
.content {
  padding: 24px 28px 48px;
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.heading-left {
  flex: 1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--brand-primary);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.page-heading h1 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.6px;
  color: var(--text-main);
  margin: 0 0 6px;
  line-height: 1.2;
}

.page-heading p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

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

/* Notice / Banner */
.notice-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--brand-subtle);
  border: 1px solid var(--brand-border);
  color: var(--text-secondary);
  font-size: 11px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.notice-banner.warning {
  background: var(--color-amber-bg);
  border-color: var(--color-amber-border);
  color: var(--color-amber-text);
}

.notice-banner.info {
  background: var(--color-blue-bg);
  border-color: var(--color-blue-border);
  color: var(--color-blue-text);
}

.notice-icon {
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.notice-banner p {
  margin: 0;
  flex: 1;
}

.notice-close {
  background: none;
  border: 0;
  color: inherit;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.7;
}

.notice-close:hover {
  opacity: 1;
}

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-card);
  background: #ffffff;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}

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

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(43, 89, 195, 0.2);
}

.btn.primary:hover {
  background: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
  color: #ffffff;
}

.btn.secondary {
  background: #ffffff;
  border-color: var(--border-card);
  color: var(--text-secondary);
}

.btn.danger {
  background: var(--color-rose);
  border-color: var(--color-rose);
  color: #ffffff;
}

.btn.danger:hover {
  background: #b42318;
  border-color: #b42318;
}

.btn.sm {
  height: 30px;
  padding: 0 10px;
  font-size: 11px;
}

.btn.subtle {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.btn.subtle:hover {
  background: var(--bg-hover);
}

.btn svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   SUMMARY STAT CARDS
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.stat-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

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

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-size: 14px;
}

.stat-icon svg {
  width: 16px;
  height: 16px;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--text-main);
  margin-bottom: 8px;
  line-height: 1.1;
}

.stat-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-subtle);
  margin-top: auto;
}

.stat-footer .badge-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
}

.stat-footer .badge-trend.up {
  color: var(--color-green-text);
}

.stat-footer .badge-trend.down {
  color: var(--color-rose-text);
}

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

/* ==========================================================================
   INTERACTIVE DASHBOARD ELEMENTS & HOVER SYSTEM
   ========================================================================== */
.stat-card.clickable {
  cursor: pointer;
  position: relative;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.stat-card.clickable:hover {
  transform: translateY(-3px);
  border-color: var(--brand-primary);
  box-shadow: 0 10px 24px -6px rgba(43, 89, 195, 0.16), var(--shadow-sm);
}

.stat-card.clickable:active {
  transform: translateY(-1px);
}

.stat-card-cue {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-primary);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  margin-left: auto;
}

.stat-card.clickable:hover .stat-card-cue {
  opacity: 1;
  transform: translateX(0);
}

.bar-column {
  cursor: pointer;
  border-radius: 8px;
  padding: 4px 6px;
  transition: all 0.15s ease;
  position: relative;
}

.bar-column:hover, .bar-column.active {
  background: rgba(43, 89, 195, 0.08);
}

.bar-column:hover .bar-present, .bar-column.active .bar-present {
  filter: brightness(1.15);
  box-shadow: 0 0 12px rgba(43, 89, 195, 0.45);
}

.breakdown-row.clickable {
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin: 0 -10px;
  transition: all 0.15s ease;
}

.breakdown-row.clickable:hover {
  background: var(--bg-hover);
  transform: translateX(4px);
}

.activity-event-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all 0.15s ease;
  cursor: pointer;
}

.activity-event-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
  transform: translateX(4px);
  box-shadow: var(--shadow-xs);
}

.team-snapshot-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--bg-card-subtle);
  border-bottom: 1px solid var(--border-light);
}

.team-filter-pill {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.team-filter-pill:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.team-filter-pill.active {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

.dash-period-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
  min-width: 190px;
  z-index: 1000;
  display: none;
  flex-direction: column;
}

.dash-period-dropdown.show {
  display: flex !important;
}

.dash-period-dropdown[hidden] {
  display: none !important;
}

.dash-period-item {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.1s ease, color 0.1s ease;
}

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

.dash-period-item.active {
  color: var(--brand-primary);
  font-weight: 700;
  background: rgba(43, 89, 195, 0.06);
}

.chart-day-callout {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
}

.clickable-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.clickable-row:hover {
  background-color: var(--bg-hover) !important;
}

.quick-action-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid var(--border-card);
  background: #ffffff;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-action-pill-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: rgba(43, 89, 195, 0.06);
}

/* ==========================================================================
   PANEL CONTAINER (CARDS)
   ========================================================================== */
.panel {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  margin-bottom: 22px;
  overflow: hidden;
}

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

.panel-title-area h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-main);
  margin: 0 0 2px;
}

.panel-title-area p {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

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

/* Two-column dashboard layout */
.two-col-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

/* ==========================================================================
   CHARTS & VISUALIZATIONS
   ========================================================================== */
.chart-container {
  padding: 16px 20px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 11px;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.attendance-chart {
  height: 200px;
  display: flex;
  gap: 12px;
}

.chart-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 24px;
  font-size: 10px;
  color: var(--text-subtle);
  width: 28px;
  text-align: right;
}

.chart-bars-wrap {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: space-around;
  border-bottom: 1px solid var(--border-light);
}

.chart-grid-lines {
  position: absolute;
  inset: 0 0 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.chart-grid-lines span {
  border-top: 1px dashed #edf0f5;
  width: 100%;
}

.bar-column {
  position: relative;
  z-index: 1;
  width: 10%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.bar-stack {
  height: calc(100% - 24px);
  width: 75%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
}

.bar-present {
  background: linear-gradient(180deg, #537be8 0%, #2b59c3 100%);
  border-radius: 4px 4px 1px 1px;
  transition: height 0.3s ease;
}

.bar-absent {
  background: #eaecf0;
  border-radius: 3px;
  transition: height 0.3s ease;
}

.bar-day-label {
  height: 24px;
  display: flex;
  align-items: flex-end;
  font-size: 10px;
  color: var(--text-muted);
}

/* Donut widget */
.donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 16px;
}

.donut-svg-box {
  width: 150px;
  height: 150px;
  position: relative;
  display: grid;
  place-items: center;
}

.donut-svg-box svg {
  transform: rotate(-9deg);
}

.donut-center-info {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.donut-center-info strong {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
}

.donut-center-info small {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
}

.breakdown-list {
  border-top: 1px solid var(--border-light);
  padding: 14px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
}

.breakdown-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.breakdown-badge span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.breakdown-stats {
  font-weight: 600;
  color: var(--text-main);
}

.breakdown-stats small {
  color: var(--text-subtle);
  font-weight: 400;
  margin-left: 4px;
}

/* ==========================================================================
   TOOLBARS, SEARCH, AND FILTERS
   ========================================================================== */
.table-toolbar {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-light);
  background: #ffffff;
  flex-wrap: wrap;
}

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

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0 10px;
  background: #ffffff;
  min-width: 220px;
  transition: all 0.15s ease;
}

.search-input-wrap:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(43, 89, 195, 0.12);
}

.search-input-wrap svg {
  width: 15px;
  height: 15px;
  color: var(--text-subtle);
}

.search-input-wrap input {
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 11px;
  color: var(--text-main);
  width: 100%;
}

.search-input-wrap input::placeholder {
  color: var(--text-subtle);
}

.filter-select {
  height: 36px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  background: #ffffff;
  padding: 0 10px;
  color: var(--text-secondary);
  font-size: 11px;
  outline: 0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(43, 89, 195, 0.12);
}

/* ==========================================================================
   DATA TABLES
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: var(--border-card);
  border-radius: 3px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 12px;
}

.data-table th {
  text-align: left;
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-card);
  user-select: none;
}

.data-table th.sortable {
  cursor: pointer;
}

.data-table th.sortable:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

.data-table th svg {
  width: 12px;
  height: 12px;
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.1s ease;
}

.data-table tbody tr:hover {
  background: #fbfcfd;
}

.data-table tbody tr.row-selected {
  background: var(--brand-subtle);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

/* Checkbox column */
.col-check {
  width: 40px;
  padding-left: 18px !important;
  padding-right: 8px !important;
}

.col-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--brand-primary);
  cursor: pointer;
  margin: 0;
}

/* Person / Avatar Table Cell */
.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-meta-text {
  display: flex;
  flex-direction: column;
}

.user-meta-text strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}

.user-meta-text small {
  font-size: 10px;
  color: var(--text-muted);
}

/* Avatars */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}

.avatar.sm {
  width: 26px;
  height: 26px;
  font-size: 9px;
}

.avatar.lg {
  width: 44px;
  height: 44px;
  font-size: 14px;
}

.avatar.xl {
  width: 58px;
  height: 58px;
  font-size: 18px;
}

.avatar.purple { background: var(--color-purple-bg); color: var(--color-purple-text); }
.avatar.blue   { background: var(--color-blue-bg); color: var(--color-blue-text); }
.avatar.green  { background: var(--color-green-bg); color: var(--color-green-text); }
.avatar.amber  { background: var(--color-amber-bg); color: var(--color-amber-text); }
.avatar.teal   { background: var(--color-teal-bg); color: var(--color-teal-text); }
.avatar.pink   { background: #ffe8f0; color: #b64f78; }
.avatar.orange { background: #ffead9; color: #b96b28; }
.avatar.red    { background: var(--color-rose-bg); color: var(--color-rose-text); }
.avatar.gray   { background: #f2f4f7; color: var(--text-secondary); }

/* Badges & Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
}

.pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.pill.p-green {
  background: var(--color-green-bg);
  color: var(--color-green-text);
  border: 1px solid var(--color-green-border);
}

.pill.p-amber {
  background: var(--color-amber-bg);
  color: var(--color-amber-text);
  border: 1px solid var(--color-amber-border);
}

.pill.p-rose {
  background: var(--color-rose-bg);
  color: var(--color-rose-text);
  border: 1px solid var(--color-rose-border);
}

.pill.p-blue {
  background: var(--color-blue-bg);
  color: var(--color-blue-text);
  border: 1px solid var(--color-blue-border);
}

.pill.p-purple {
  background: var(--color-purple-bg);
  color: var(--color-purple-text);
  border: 1px solid var(--color-purple-border);
}

.pill.p-gray {
  background: #f2f4f7;
  color: var(--text-muted);
  border: 1px solid var(--border-card);
}

/* Action button cells */
.action-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-btn {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

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

.action-btn.view {
  color: var(--brand-primary);
}

.action-btn.edit {
  color: var(--brand-primary);
}

.action-btn.deactivate {
  color: var(--color-amber-text);
}

.action-btn.reactivate {
  color: var(--color-green-text);
}

.action-btn svg {
  width: 12px;
  height: 12px;
}

/* Table Footer & Pagination */
.table-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
  background: #ffffff;
  flex-wrap: wrap;
}

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

.page-btn {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  min-width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
}

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

.page-btn.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
  font-weight: 600;
}

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

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

.empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  display: grid;
  place-items: center;
  color: var(--text-subtle);
  margin-bottom: 12px;
}

.empty-icon svg {
  width: 24px;
  height: 24px;
}

.empty-state h4 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 4px;
}

.empty-state p {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 360px;
  margin: 0 0 16px;
}

/* ==========================================================================
   MODALS & DIALOGS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.45);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
  animation: fadeIn 0.15s ease;
}

.modal-backdrop[hidden] {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  width: min(640px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-dialog.modal-sm {
  width: min(480px, 100%);
}

.modal-dialog.modal-lg {
  width: min(840px, 100%);
}

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

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-header-text h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text-main);
  margin: 0 0 3px;
}

.modal-header-text p {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

.modal-close-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-subtle);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

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

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
}

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

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

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

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group label span.req {
  color: var(--color-rose);
  margin-left: 2px;
}

.form-control {
  height: 38px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0 11px;
  font-size: 12px;
  color: var(--text-main);
  background: #ffffff;
  outline: 0;
  transition: all 0.15s ease;
  width: 100%;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(43, 89, 195, 0.12);
}

textarea.form-control {
  height: auto;
  min-height: 80px;
  padding: 10px 11px;
  resize: vertical;
}

.form-hint {
  font-size: 10px;
  color: var(--text-subtle);
}

/* ==========================================================================
   SLIDE-OVER DETAIL DRAWERS
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.4);
  backdrop-filter: blur(2px);
  z-index: 1050;
  animation: fadeIn 0.15s ease;
}

.drawer-backdrop[hidden] {
  display: none !important;
}

.slide-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(580px, 100vw);
  background: #ffffff;
  box-shadow: var(--shadow-modal);
  border-left: 1px solid var(--border-card);
  display: flex;
  flex-direction: column;
  z-index: 1060;
  animation: drawerSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes drawerSlide {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: #ffffff;
  flex-shrink: 0;
}

.drawer-eyebrow {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--brand-primary);
  text-transform: uppercase;
}

.drawer-header h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text-main);
  margin: 3px 0 0;
}

.drawer-close-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-subtle);
  width: 30px;
  height: 30px;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

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

.drawer-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.drawer-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-card-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* Tabs inside drawers or panels */
.sub-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border-light);
  padding: 0 24px;
  background: #ffffff;
}

.sub-tab-btn {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sub-tab-btn:hover {
  color: var(--text-main);
}

.sub-tab-btn.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

/* Detail list grid */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
  margin-bottom: 24px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-item span.lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-item span.val {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
}

/* ==========================================================================
   COMMAND PALETTE MODAL (CTRL+K)
   ========================================================================== */
.command-palette-box {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  width: min(600px, 100%);
  overflow: hidden;
  animation: modalSlideUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.cmd-input-wrap {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
}

.cmd-icon {
  width: 18px;
  height: 18px;
  color: var(--text-subtle);
  flex-shrink: 0;
}

.cmd-input-wrap input {
  flex: 1;
  border: 0;
  outline: 0;
  font-size: 13px;
  color: var(--text-main);
}

.cmd-esc {
  font-size: 9px;
  font-weight: 700;
  background: #f2f4f7;
  border: 1px solid var(--border-card);
  border-radius: 4px;
  padding: 2px 5px;
  color: var(--text-subtle);
}

.cmd-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px 10px;
}

.cmd-section-label {
  padding: 8px 10px 4px;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-subtle);
  letter-spacing: 0.8px;
}

.cmd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-secondary);
  transition: all 0.1s ease;
  cursor: pointer;
}

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

.cmd-item-icon {
  width: 20px;
  text-align: center;
  font-size: 14px;
}

.cmd-item-name {
  flex: 1;
  font-weight: 500;
}

.cmd-item-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f2f4f7;
  color: var(--text-muted);
}

.cmd-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-card-subtle);
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 10px;
  color: var(--text-subtle);
}

.cmd-footer kbd {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 9px;
}

/* ==========================================================================
   TOAST NOTIFICATION COMPONENT
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 380px;
}

.toast {
  pointer-events: auto;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: var(--text-main);
  animation: toastIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.toast.removing {
  opacity: 0;
  transform: translateY(-8px);
}

.toast-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
}

.toast-icon.success { background: var(--color-green-bg); color: var(--color-green-text); }
.toast-icon.warning { background: var(--color-amber-bg); color: var(--color-amber-text); }
.toast-icon.error   { background: var(--color-rose-bg); color: var(--color-rose-text); }
.toast-icon.info    { background: var(--color-blue-bg); color: var(--color-blue-text); }

.toast-content {
  flex: 1;
}

.toast-content strong {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.toast-content p {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.toast-close {
  background: transparent;
  border: 0;
  color: var(--text-subtle);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.toast-close:hover {
  color: var(--text-main);
}

/* ==========================================================================
   DIGITAL ID CARD & STUDIO STYLES
   ========================================================================== */
.id-card-studio-dialog {
  max-width: 820px;
  width: 95%;
  transition: max-width 0.25s ease;
}

.id-card-studio-dialog.dual-mode {
  max-width: 980px;
}

.id-card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
}

.id-card-toolbar .toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.id-card-toolbar .toolbar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-subtle);
  letter-spacing: 0.5px;
}

.id-card-toolbar .toolbar-actions {
  margin-left: auto;
}

.id-card-stage {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: flex-start;
  padding: 24px;
  background: #eaecf0;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  min-height: 560px;
  transition: all 0.3s ease;
}

.id-badge-card {
  width: 330px;
  min-height: 520px;
  border-radius: 18px;
  padding: 16px 18px;
  position: relative;
  box-shadow: 0 20px 40px -15px rgba(16, 24, 40, 0.25), 0 0 0 1px rgba(16, 24, 40, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: var(--font-body);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: linear-gradient(165deg, #ffffff 0%, #f9fafb 50%, #eef2f6 100%);
  color: #101828;
}

.id-badge-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--brand-primary), #6366f1);
}

/* Dark Theme */
.id-badge-card.theme-dark {
  background: linear-gradient(165deg, #161b26 0%, #0f131a 50%, #090c10 100%);
  color: #f8fafc;
  border: 1px solid #334155;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(56, 189, 248, 0.2);
}

.id-badge-card.theme-dark::before {
  background: linear-gradient(90deg, #38bdf8, #818cf8);
}

/* ==========================================================================
   DM TECH STUDIO — OFFICIAL REFERENCE CARD STYLES
   ========================================================================== */
.id-badge-card.theme-tech-studio {
  width: 340px;
  min-height: 540px;
  border-radius: 22px;
  padding: 16px 18px;
  position: relative;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 20px 45px -12px rgba(0, 102, 255, 0.2), 0 0 0 1px rgba(0, 102, 255, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: var(--font-body);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.id-badge-card.theme-tech-studio::before {
  display: none !important;
}

/* Background Artwork: Blue Swoosh & Navy Corner */
.card-bg-artwork {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.blue-swoosh-wave {
  position: absolute;
  top: -45px;
  right: -60px;
  width: 250px;
  height: 380px;
  background: linear-gradient(145deg, #0077ff 0%, #0052cc 60%, #003db3 100%);
  border-radius: 48% 52% 40% 60% / 55% 45% 55% 45%;
  transform: rotate(-25deg);
  opacity: 0.95;
  box-shadow: inset 0 0 40px rgba(255,255,255,0.22);
}

.dm-watermark-emblem {
  position: absolute;
  top: 140px;
  right: 15px;
  width: 140px;
  height: 140px;
  color: rgba(255, 255, 255, 0.16);
  transform: rotate(-15deg);
  pointer-events: none;
}

.navy-bottom-swoosh {
  position: absolute;
  bottom: -40px;
  right: -50px;
  width: 210px;
  height: 230px;
  background: linear-gradient(135deg, #0d162d 0%, #060a16 100%);
  border-radius: 55% 45% 40% 60% / 50% 60% 40% 50%;
  transform: rotate(10deg);
  box-shadow: -5px -5px 25px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 20px;
}

.vertical-strip-text {
  position: absolute;
  bottom: 95px;
  right: 12px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(148, 163, 184, 0.85);
  text-transform: uppercase;
  z-index: 3;
}

/* Ensure all content sits above the background artwork */
.id-badge-card.theme-tech-studio > *:not(.card-bg-artwork) {
  position: relative;
  z-index: 2;
}

/* Header with Brand & Tagline */
.id-card-header-studio {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: -2px;
  margin-bottom: 8px;
}

.id-card-header-studio .id-badge-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.id-card-header-studio .id-brand-logo {
  height: 28px;
  width: auto;
  max-width: 195px;
  object-fit: contain;
}

.brand-tagline {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #64748b;
  text-transform: uppercase;
}

/* Centered Photo Section with Frosted Glass Plate */
.id-photo-plate-wrap {
  display: flex;
  justify-content: center;
  margin: 4px 0 10px 0;
}

.id-photo-plate-wrap .id-photo-frame {
  width: 145px;
  height: 155px;
  border-radius: 20px;
  border: 3.5px solid #ffffff;
  box-shadow: 0 10px 25px -4px rgba(0, 102, 255, 0.22), 0 0 0 1px rgba(0,0,0,0.04);
  overflow: hidden;
  position: relative;
  background: #e2e8f0;
}

.id-photo-plate-wrap .id-photo-frame .id-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Name & Role Section */
.id-name-section {
  text-align: center;
  margin-bottom: 12px;
}

.id-person-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 3px 0;
  line-height: 1.2;
}

.id-person-desig {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: #475569;
  text-transform: uppercase;
}

.id-blue-accent-bar {
  width: 38px;
  height: 3px;
  background: #0066FF;
  border-radius: 2px;
  margin: 6px auto 0 auto;
}

/* 4 Left Info Stack Rows */
.id-info-stack {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
  padding: 0 4px;
  max-width: 215px;
}

.id-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.id-icon-badge {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #0066FF;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 6px rgba(0, 102, 255, 0.28);
}

.id-info-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.id-info-meta .lbl {
  font-size: 7.5px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.6px;
  line-height: 1.1;
  text-transform: uppercase;
}

.id-info-meta .val {
  font-size: 11px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bottom Footer: Motto & QR Code */
.id-card-footer-studio {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
}

.id-motto-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.motto-text {
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #475569;
  text-transform: uppercase;
}

.motto-text .highlight {
  color: #0066FF;
}

.motto-underline {
  width: 32px;
  height: 2.5px;
  background: #0066FF;
  border-radius: 2px;
}

.id-qr-holder {
  width: 50px;
  height: 50px;
  background: #ffffff;
  border-radius: 8px;
  padding: 3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.id-qr-holder .id-qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Dark Theme Overrides for Tech Studio Card */
.id-badge-card.theme-dark.theme-tech-studio {
  background: #0c1222;
  color: #f8fafc;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.id-badge-card.theme-dark.theme-tech-studio .brand-tagline {
  color: #94a3b8;
}

.id-badge-card.theme-dark.theme-tech-studio .id-photo-plate-wrap .id-photo-frame {
  border-color: #1e293b;
  box-shadow: 0 10px 25px -4px rgba(56, 189, 248, 0.3);
}

.id-badge-card.theme-dark.theme-tech-studio .id-person-name {
  color: #ffffff;
}

.id-badge-card.theme-dark.theme-tech-studio .id-person-desig {
  color: #94a3b8;
}

.id-badge-card.theme-dark.theme-tech-studio .id-info-meta .lbl {
  color: #94a3b8;
}

.id-badge-card.theme-dark.theme-tech-studio .id-info-meta .val {
  color: #ffffff;
}

.id-badge-card.theme-dark.theme-tech-studio .motto-text {
  color: #94a3b8;
}

.id-badge-card.theme-dark.theme-tech-studio .motto-text .highlight {
  color: #38bdf8;
}

.id-badge-card.theme-dark.theme-tech-studio .id-qr-holder {
  background: #ffffff;
}

/* Lanyard Slot Cutout */
.id-badge-slot-outer {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.id-badge-slot {
  width: 48px;
  height: 9px;
  background: #d0d5dd;
  border-radius: 5px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.28);
  border: 1px solid #98a2b3;
}

.id-badge-card.theme-dark .id-badge-slot {
  background: #1e293b;
  border-color: #475569;
}

/* Brand Header */
.id-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
}

.id-badge-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.id-brand-logo {
  height: 32px;
  width: auto;
  max-width: 205px;
  object-fit: contain;
  display: block;
}

.id-back-brand-logo {
  height: 26px;
  width: auto;
  max-width: 175px;
  object-fit: contain;
  display: block;
  margin: 0 auto 6px;
}

.id-badge-card.theme-dark .light-mode-logo {
  display: none !important;
}

.id-badge-card.theme-dark .dark-mode-logo {
  display: block !important;
}

.id-badge-card:not(.theme-dark) .light-mode-logo {
  display: block !important;
}

.id-badge-card:not(.theme-dark) .dark-mode-logo {
  display: none !important;
}

.id-nfc-badge {
  color: var(--text-muted);
  display: grid;
  place-items: center;
}

.id-badge-card.theme-dark .id-nfc-badge {
  color: #94a3b8;
}

/* Hardware Row: Microchip & Hologram */
.id-hardware-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}

.id-smart-chip {
  width: 46px;
  height: 36px;
  border-radius: 6px;
  background: linear-gradient(135deg, #fef08a 0%, #f59e0b 35%, #d97706 70%, #fef08a 100%);
  border: 1px solid #b45309;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.6);
  position: relative;
}

.chip-circuit {
  position: absolute;
  inset: 4px;
  border: 1px solid #92400e;
  border-radius: 3px;
}

.chip-circuit::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #92400e;
}

.chip-circuit::after {
  content: "";
  position: absolute;
  left: 45%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #92400e;
}

.id-hologram-seal {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, #ec4899, #8b5cf6, #3b82f6, #10b981, #f59e0b, #ec4899);
  border: 1.5px solid rgba(255,255,255,0.85);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  display: grid;
  place-items: center;
}

.hologram-inner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 8.5px;
  color: #ffffff;
  font-weight: 800;
  line-height: 1;
}

.hologram-inner small {
  font-size: 6px;
  letter-spacing: 0.5px;
}

/* Photo & Identity Section */
.id-identity-section {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.id-photo-frame-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.id-photo-frame {
  width: 92px;
  height: 110px;
  border-radius: 12px;
  border: 2.5px solid #ffffff;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.12);
  overflow: hidden;
  position: relative;
  background: #e0e7ff;
}

.id-badge-card.theme-dark .id-photo-frame {
  border-color: #38bdf8;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.25);
}

.id-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.id-photo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: pointer;
  gap: 2px;
}

.id-photo-frame:hover .id-photo-overlay {
  opacity: 1;
}

.id-photo-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 8px;
  font-weight: 700;
  color: #027a48;
  background: #ecfdf3;
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid #a6f4c5;
}

.id-photo-status-badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #12b76a;
}

.id-primary-identity {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.id-badge-name {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 2px;
  color: inherit;
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.id-badge-desig {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.id-badge-card.theme-dark .id-badge-desig {
  color: #38bdf8;
}

.id-badge-dept-pill {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--brand-primary);
}

.id-badge-card.theme-dark .id-badge-dept-pill {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

/* Metadata Grid */
.id-badge-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
  text-align: left;
}

.id-badge-card.theme-dark .id-badge-meta-grid {
  background: #1a2230;
  border-color: #2e3b4e;
}

.id-badge-meta-grid .meta-item.full-width {
  grid-column: span 2;
}

.id-badge-meta-grid .meta-item .lbl {
  font-size: 7.5px;
  font-weight: 700;
  color: var(--text-subtle);
  display: block;
  letter-spacing: 0.3px;
  margin-bottom: 1px;
}

.id-badge-card.theme-dark .id-badge-meta-grid .meta-item .lbl {
  color: #94a3b8;
}

.id-badge-meta-grid .meta-item .val {
  font-size: 10.5px;
  font-weight: 700;
  color: inherit;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bottom Barcode & QR Row */
.id-card-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 6px 8px;
  margin-bottom: 6px;
}

.id-badge-card.theme-dark .id-card-bottom-row {
  background: #1a2230;
  border-color: #2e3b4e;
}

.id-barcode-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.id-barcode-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  height: 26px;
  width: 100%;
}

.id-barcode-preview span {
  display: inline-block;
  height: 100%;
  background: #181d27;
  border-radius: 1px;
}

.id-badge-card.theme-dark .id-barcode-preview span {
  background: #f8fafc;
}

.barcode-label {
  font-size: 8px;
  font-family: monospace;
  font-weight: 700;
  color: var(--text-subtle);
  letter-spacing: 0.5px;
}

.id-badge-card.theme-dark .barcode-label {
  color: #94a3b8;
}

.id-qr-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.id-security-microtext {
  font-size: 6.5px;
  text-align: center;
  color: var(--text-subtle);
  letter-spacing: 0.4px;
}

.id-badge-card.theme-dark .id-security-microtext {
  color: #64748b;
}

/* ==================== BACK SIDE CARD SPECIFICS ==================== */
.id-magnetic-stripe {
  height: 38px;
  width: calc(100% + 36px);
  margin: 0 -18px 10px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}

.stripe-luster {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  height: 12px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.18), rgba(255,255,255,0.03));
}

.id-back-company {
  text-align: center;
  margin-bottom: 8px;
}

.id-back-company h4 {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 800;
  margin: 0 0 2px;
  letter-spacing: 0.2px;
  color: inherit;
}

.id-back-company p {
  font-size: 8px;
  color: var(--text-muted);
  margin: 0 0 1px;
}

.id-badge-card.theme-dark .id-back-company p {
  color: #94a3b8;
}

.id-back-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 6px 8px;
  margin-bottom: 8px;
  text-align: left;
}

.id-badge-card.theme-dark .id-back-meta-grid {
  background: #1a2230;
  border-color: #2e3b4e;
}

.id-back-meta-grid .meta-item .lbl {
  font-size: 7px;
  font-weight: 700;
  color: var(--text-subtle);
  display: block;
  letter-spacing: 0.3px;
  margin-bottom: 1px;
}

.id-badge-card.theme-dark .id-back-meta-grid .meta-item .lbl {
  color: #94a3b8;
}

.id-back-meta-grid .meta-item .val {
  font-size: 9.5px;
  font-weight: 700;
  color: inherit;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.id-back-terms {
  font-size: 7.5px;
  color: var(--text-muted);
  text-align: left;
  margin-bottom: 8px;
  background: rgba(0,0,0,0.02);
  padding: 5px 6px;
  border-radius: 6px;
}

.id-badge-card.theme-dark .id-back-terms {
  background: rgba(255,255,255,0.03);
  color: #94a3b8;
}

.id-back-terms strong {
  display: block;
  font-size: 7.5px;
  margin-bottom: 2px;
  color: inherit;
}

.id-back-terms ol {
  margin: 0;
  padding-left: 12px;
  line-height: 1.3;
}

.helpline-bar {
  margin-top: 4px;
  padding-top: 3px;
  border-top: 1px dashed var(--border-light);
  font-size: 7.5px;
  color: var(--brand-primary);
}

.id-badge-card.theme-dark .helpline-bar {
  color: #38bdf8;
  border-color: #334155;
}

.id-back-signatures {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 6px;
}

.sig-col {
  text-align: left;
}

.digital-sig-art {
  color: #1e293b;
  margin-bottom: -2px;
}

.id-badge-card.theme-dark .digital-sig-art {
  color: #93c5fd;
}

.sig-label {
  display: block;
  font-size: 7.5px;
  font-weight: 700;
  color: var(--text-subtle);
  border-top: 1px solid var(--border-light);
  padding-top: 2px;
}

.id-badge-card.theme-dark .sig-label {
  color: #94a3b8;
  border-color: #334155;
}

.sig-name {
  display: block;
  font-size: 7px;
  color: var(--text-muted);
}

.id-badge-card.theme-dark .sig-name {
  color: #cbd5e1;
}

.seal-col {
  display: flex;
  align-items: center;
  justify-content: center;
}

.corporate-seal-stamp {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px dashed #2563eb;
  display: grid;
  place-items: center;
  padding: 2px;
  transform: rotate(-8deg);
}

.id-badge-card.theme-dark .corporate-seal-stamp {
  border-color: #38bdf8;
}

.seal-inner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #2563eb;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 6px;
  color: #2563eb;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.id-badge-card.theme-dark .seal-inner {
  border-color: #38bdf8;
  color: #38bdf8;
}

/* ==================== ROSTER TABLE PHOTO THUMBNAILS ==================== */
.avatar-photo-sm-wrap {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  position: relative;
  flex-shrink: 0;
  overflow: visible;
}

.avatar-photo-sm {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  border: 1.5px solid #ffffff;
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.12);
  background: #f2f4f7;
}

.avatar-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: absolute;
  bottom: -1px;
  right: -1px;
  border: 1.5px solid #ffffff;
}

.avatar-status-dot.active {
  background: #12b76a;
}

.avatar-status-dot.inactive {
  background: #f79009;
}

.emp-code-pill {
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
  background: #f2f4f7;
  padding: 2px 6px;
  border-radius: 4px;
  color: #344054;
}

.blood-group-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #b42318;
  background: #fef3f2;
  border: 1px solid #fee4e2;
  padding: 2px 6px;
  border-radius: 6px;
}

/* Print Badge Stylesheet */
@media print {
  body * {
    visibility: hidden !important;
  }
  #idCardStage, #idCardStage * {
    visibility: visible !important;
  }
  #idCardStage {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: transparent !important;
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
  }
  .id-badge-card {
    box-shadow: none !important;
    border: 1px solid #94a3b8 !important;
    page-break-inside: avoid;
  }
}

/* ==========================================================================
   PAYSLIP STATEMENT STYLES
   ========================================================================== */
.payslip-statement {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.payslip-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 18px;
  margin-bottom: 20px;
}

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

.payslip-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.payslip-calc-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--border-light);
}

.payslip-calc-row.total {
  border-top: 1px solid var(--border-strong);
  border-bottom: 0;
  font-weight: 700;
  color: var(--text-main);
  padding-top: 8px;
  font-size: 12px;
}

.payslip-net-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.payslip-net-box strong {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--color-green-text);
}

/* ==========================================================================
   RESPONSIVE DESIGN SYSTEM
   ========================================================================== */
@media (max-width: 1200px) {
  .two-col-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 16px 0 40px rgba(16, 24, 40, 0.15);
  }

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

  .scrim.show {
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, 0.4);
    z-index: 90;
    display: block;
  }

  .main {
    margin-left: 0 !important;
  }

  .menu-btn {
    display: inline-flex;
  }

  .topbar {
    padding: 0 16px;
  }

  .content {
    padding: 20px 16px 40px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .search-trigger {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .search-placeholder, .search-kbd, .crumb-parent, .crumb-sep:first-of-type, .header-badge-demo {
    display: none;
  }

  .page-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .heading-actions {
    justify-content: flex-start;
  }

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

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

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

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-left, .toolbar-right {
    width: 100%;
  }

  .search-input-wrap {
    min-width: 0;
    flex: 1;
  }

  .filter-select {
    flex: 1;
  }

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