/* ═══════════════════════════════════════════════════════
   HRMSGene Design System
   Premium dark-mode UI with glassmorphism aesthetics
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@600;700&display=swap');

/* ─── CSS Variables / Design Tokens ──────────────────── */
:root {
  /* Backgrounds */
  --bg-primary: #06140f;
  --bg-secondary: #0b1f18;
  --bg-card: rgba(255,255,255,0.03);
  --bg-card-hover: rgba(255,255,255,0.06);
  --bg-input: rgba(255,255,255,0.05);
  --bg-sidebar: #041a14;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #a5bf1e 0%, #5c7f1c 100%);
  --gradient-accent: linear-gradient(135deg, #00d4aa 0%, #00b4d8 100%);
  --gradient-bg: linear-gradient(135deg, #06140f 0%, #0f2c20 50%, #06140f 100%);

  /* Text */
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-white: #ffffff;

  /* Accent Colors */
  --color-primary: #a5bf1e;
  --color-primary-light: #c3d94a;
  --color-purple: #5c7f1c;
  --color-success: #00d4aa;
  --color-error: #ff6b6b;
  --color-warning: #ffd93d;
  --color-info: #00b4d8;

  /* Borders */
  --border-subtle: rgba(255,255,255,0.06);
  --border-light: rgba(255,255,255,0.1);
  --border-focus: rgba(165, 191, 30,0.5);

  /* Glass */
  --glass-bg: rgba(255,255,255,0.04);
  --glass-border: 1px solid rgba(255,255,255,0.08);
  --glass-blur: blur(20px);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 20px rgba(165, 191, 30,0.3);

  /* Spacing */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --header-height: 64px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-white);
}

h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 16px; }

a {
  color: var(--color-primary-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover { color: var(--color-primary); }

/* ─── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
}

/* ─── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--gradient-primary);
  color: var(--text-white);
  box-shadow: 0 4px 15px rgba(165, 191, 30,0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(165, 191, 30,0.45);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.15);
}

.btn-danger {
  background: rgba(255,107,107,0.15);
  color: var(--color-error);
  border: 1px solid rgba(255,107,107,0.2);
}

.btn-danger:hover {
  background: rgba(255,107,107,0.25);
  transform: translateY(-1px);
}

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

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

.btn .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: none;
}

.btn.loading .spinner { display: block; }
.btn.loading .btn-text { opacity: 0.5; }

/* ─── Inputs ─────────────────────────────────────────── */
/* ─── Form Layouts ────────────────────────────────── */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: all var(--transition-base);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(165, 191, 30,0.15);
}

/* ─── Cards Grid ──────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ─── Leave Type Badge ────────────────────────────── */
.leave-type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: all var(--transition-base);
  outline: none;
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(165, 191, 30,0.15);
  background: rgba(255,255,255,0.07);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.input-wrapper {
  position: relative;
}

.input-wrapper .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.input-wrapper .form-input {
  padding-left: 42px;
}

.input-wrapper .input-action {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
}

.input-wrapper .input-action:hover {
  color: var(--text-secondary);
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ─── Cards ──────────────────────────────────────────── */
.card {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: all var(--transition-base);
}

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

.card-static:hover {
  transform: none;
  box-shadow: none;
}

/* Stat Cards */
.stat-card {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: var(--glass-blur);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0.8;
}

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background: rgba(165, 191, 30,0.12);
  color: var(--color-primary-light);
}

.stat-card .stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ─── Tables ─────────────────────────────────────────── */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: var(--glass-border);
  background: var(--glass-bg);
}

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

thead th {
  padding: 14px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.02);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.015);
}

/* ─── Badges / Pills ────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-success {
  background: rgba(0,212,170,0.12);
  color: var(--color-success);
}

.badge-error {
  background: rgba(255,107,107,0.12);
  color: var(--color-error);
}

.badge-warning {
  background: rgba(255,217,61,0.12);
  color: var(--color-warning);
}

.badge-info {
  background: rgba(0,180,216,0.12);
  color: var(--color-info);
}

.badge-neutral {
  background: rgba(148,163,184,0.12);
  color: var(--text-secondary);
}

/* ─── Avatar ─────────────────────────────────────────── */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-white);
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }

/* ─── Layout: Login Page ─────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #06140f 0%, #0f2c20 25%, #0f2027 50%, #203a43 75%, #06140f 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

.login-bg::before,
.login-bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: float 8s ease-in-out infinite;
}

.login-bg::before {
  width: 500px;
  height: 500px;
  background: var(--color-primary);
  top: -100px;
  right: -100px;
}

.login-bg::after {
  width: 400px;
  height: 400px;
  background: var(--color-purple);
  bottom: -100px;
  left: -100px;
  animation-delay: -4s;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 40px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  animation: slideUp 0.6s ease;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-logo p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

.login-error {
  background: rgba(255,107,107,0.1);
  border: 1px solid rgba(255,107,107,0.2);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--color-error);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
  animation: slideUp 0.3s ease;
}

.login-error.visible { display: block; }

.login-footer {
  text-align: center;
  margin-top: 32px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── Layout: Dashboard ──────────────────────────────── */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: width var(--transition-base);
}

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

.sidebar-logo {
  position: relative;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  border-bottom: 1px solid var(--border-subtle);
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--color-primary, #a5bf1e) 22%, transparent) 0%, transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.03), transparent);
  overflow: hidden;
}
/* subtle accent line under the brand */
.sidebar-logo::after {
  content: '';
  position: absolute;
  left: 16px; right: 16px; bottom: -1px;
  height: 1px;
  background: var(--gradient-primary);
  opacity: .55;
}

/* Logo sits on a light tile so dark/coloured logos stay clearly visible */
.brand-tile {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.08), 0 0 0 3px color-mix(in srgb, var(--color-primary, #a5bf1e) 28%, transparent);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.sidebar-logo:hover .brand-tile {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 8px 22px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.1), 0 0 0 3px color-mix(in srgb, var(--color-primary, #a5bf1e) 45%, transparent);
}
.brand-tile .logo-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.brand-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  transition: opacity var(--transition-base);
}

.sidebar-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Company name: solid, high-contrast, wraps to 2 lines instead of being cut off */
.sidebar-logo .logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .2px;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  background: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  text-shadow: 0 1px 10px color-mix(in srgb, var(--color-primary, #a5bf1e) 35%, transparent);
  transition: opacity var(--transition-base);
}

.brand-sub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted, #8b8fa3);
  white-space: nowrap;
}
.brand-sub strong {
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #00d4aa;
  box-shadow: 0 0 0 3px rgba(0,212,170,0.18);
  animation: brandPulse 2.4s ease-in-out infinite;
}
@keyframes brandPulse { 0%,100% { box-shadow: 0 0 0 3px rgba(0,212,170,0.18); } 50% { box-shadow: 0 0 0 5px rgba(0,212,170,0.06); } }

.sidebar.collapsed .logo-text { opacity: 0; width: 0; }
.sidebar.collapsed .brand-meta { opacity: 0; width: 0; overflow: hidden; }
.sidebar.collapsed .sidebar-logo { padding: 14px 0; justify-content: center; }
.sidebar.collapsed .brand-tile { width: 42px; height: 42px; }

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-section-title {
  padding: 16px 20px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.35);
  margin-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  margin: 2px 8px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}

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

.nav-item.active {
  background: rgba(165, 191, 30,0.1);
  color: var(--color-primary-light);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gradient-primary);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-item .nav-label {
  transition: opacity var(--transition-base);
}

.sidebar.collapsed .nav-label { opacity: 0; width: 0; }

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border-subtle);
}

.sidebar-toggle {
  position: absolute;
  top: 24px;
  right: -14px;
  width: 28px;
  height: 28px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  z-index: 101;
  transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* Main Content */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-base);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* Header */
.header {
  height: var(--header-height);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(10,14,39,0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.breadcrumb .current {
  color: var(--text-primary);
  font-weight: 500;
}

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

/* --- Desktop App download menu (header) ------------ */
.agent-dl { position: relative; }
.dla { position: relative; }
.dla-btn {
  --c1: #a5bf1e; --c2: #6f8f2a;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 5px 8px 5px 5px; border-radius: 12px; cursor: pointer;
  color: var(--text-primary); font: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 2px 10px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.06);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.dla-windows-theme { --c1: #0078d4; --c2: #00a2ed; }
.dla-mac-theme     { --c1: #4b5563; --c2: #111827; }
.dla-linux-theme   { --c1: #f59e0b; --c2: #d97706; }
.dla-btn:hover, .dla-btn.is-open {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--c1) 70%, transparent);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--c1) 30%, transparent), 0 0 0 1px color-mix(in srgb, var(--c1) 35%, transparent);
}
.dla-btn-ico {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}
.dla-btn-ico svg { width: 18px; height: 18px; }
.dla-btn-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.dla-btn-top { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted, #9ca3af); }
.dla-btn-main { font-size: 13px; font-weight: 700; white-space: nowrap; }
.dla-btn-ver {
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap;
  color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 2px 6px color-mix(in srgb, var(--c1) 35%, transparent);
}
.dla-btn-chev { display: inline-flex; color: var(--text-muted, #9ca3af); transition: transform .2s ease; }
.dla-btn-chev svg { width: 16px; height: 16px; }
.dla-btn.is-open .dla-btn-chev { transform: rotate(180deg); }

.dla-panel {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 1200; width: 390px;
  background: var(--bg-secondary, #0d1f18); border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); overflow: hidden;
  animation: dlaIn .16s ease-out;
}
.dla-panel[hidden] { display: none; }
@keyframes dlaIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.dla-head {
  display: flex; gap: 12px; align-items: center; padding: 14px 16px;
  background: linear-gradient(135deg, rgba(165, 191, 30,0.18), rgba(111, 143, 42,0.06));
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.dla-head-ico {
  width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; background: linear-gradient(135deg, #a5bf1e, #6f8f2a); flex-shrink: 0;
}
.dla-head-ico svg { width: 20px; height: 20px; }
.dla-head-title { font-weight: 700; font-size: 14px; }
.dla-head-sub { font-size: 11.5px; color: var(--text-muted, #9ca3af); margin-top: 2px; }
.dla-list { padding: 8px; display: grid; gap: 4px; }
.dla-row {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px;
  text-decoration: none; color: var(--text-primary); transition: background .15s ease;
}
a.dla-row:hover { background: rgba(255,255,255,0.05); }
.dla-row.is-disabled { opacity: .5; cursor: not-allowed; }
.dla-ico {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.dla-ico svg { width: 22px; height: 22px; }
.dla-ico.dla-windows { background: linear-gradient(135deg, #0078d4, #00a2ed); }
.dla-ico.dla-mac     { background: linear-gradient(135deg, #4b5563, #111827); }
.dla-ico.dla-linux   { background: linear-gradient(135deg, #f59e0b, #d97706); }
.dla-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dla-name { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.dla-tag { font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: rgba(0,212,170,0.15); color: #00d4aa; }
.dla-meta { font-size: 11.5px; color: var(--text-secondary, #a1a1aa); margin-top: 2px; }
.dla-req { font-size: 10.5px; color: var(--text-muted, #71717a); }
.dla-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.dla-ver {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: rgba(165, 191, 30,0.18); color: #d4e57a; border: 1px solid rgba(165, 191, 30,0.35);
}
.dla-get {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700;
  padding: 5px 10px; border-radius: 8px; color: #fff; background: linear-gradient(135deg, #a5bf1e, #6f8f2a);
  transition: transform .15s ease, box-shadow .15s ease;
}
.dla-get svg { width: 13px; height: 13px; }
a.dla-row:hover .dla-get { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(165, 191, 30,0.4); }
.dla-soon { font-size: 11px; font-weight: 600; color: var(--text-muted, #71717a); }
.dla-foot { padding: 10px 16px; font-size: 11px; color: var(--text-muted, #71717a); border-top: 1px solid rgba(255,255,255,0.08); }

@media (max-width: 1100px) {
  .dla-btn-text, .dla-btn-ver { display: none; }
  .dla-panel { width: 340px; }
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.header-user .user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Content Area */
.content {
  flex: 1;
  padding: 28px;
  animation: fadeIn 0.3s ease;
}

/* ─── Stat Grid ──────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

/* ─── Filter Bar ─────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-bar .form-input {
  width: auto;
  min-width: 180px;
}

/* ─── Screenshot Grid ────────────────────────────────── */
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.screenshot-tile {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-base);
}

.screenshot-tile:hover {
  border-color: rgba(165, 191, 30,0.3);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(165, 191, 30,0.15);
}

.screenshot-tile .tile-image {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-secondary);
}

.screenshot-tile .tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.screenshot-tile:hover .tile-image img {
  transform: scale(1.05);
}

.screenshot-tile .tile-timestamp {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  color: #fff;
}

.screenshot-tile .tile-info {
  padding: 12px 14px;
}

.screenshot-tile .tile-title {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Lightbox ───────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
  z-index: 10;
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.2);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  z-index: 10;
}

.lightbox-nav:hover {
  background: rgba(255,255,255,0.15);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-image {
  max-width: 85vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.lightbox-meta {
  margin-top: 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

.lightbox-counter {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0,0,0,0.5);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  color: rgba(255,255,255,0.8);
}

/* ─── Modal ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-base);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

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

.modal-header h3 { font-size: 18px; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ─── Toast ──────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-secondary);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  min-width: 280px;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  backdrop-filter: blur(16px);
}

.toast.toast-success { border-left: 3px solid var(--color-success); }
.toast.toast-error { border-left: 3px solid var(--color-error); }
.toast.toast-warning { border-left: 3px solid var(--color-warning); }
.toast.toast-info { border-left: 3px solid var(--color-info); }

.toast.removing { animation: slideOutRight 0.3s ease forwards; }

/* ─── Skeleton Loading ───────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 20px; width: 60%; margin-bottom: 12px; }
.skeleton-image { aspect-ratio: 16/9; }
.skeleton-card { height: 120px; }

/* ─── Tabs ───────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

.tab-item {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: 'Inter', sans-serif;
}

.tab-item:hover { color: var(--text-secondary); }

.tab-item.active {
  color: var(--color-primary-light);
  border-bottom-color: var(--color-primary);
}

/* ─── Toggle Switch ──────────────────────────────────── */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle input { display: none; }

.toggle .toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  transition: background var(--transition-base);
}

.toggle .toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition-base);
}

.toggle input:checked + .toggle-slider {
  background: var(--color-primary);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ─── Range Slider ───────────────────────────────────── */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--gradient-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(165, 191, 30,0.4);
}

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

.empty-state svg {
  width: 80px;
  height: 80px;
  color: var(--text-muted);
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 400px;
}

/* ─── Pagination ─────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.pagination button {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pagination button:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--border-light);
}

.pagination button.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

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

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

/* ─── Search Bar ─────────────────────────────────────── */
.search-bar {
  position: relative;
  max-width: 320px;
}

.search-bar .form-input {
  padding-left: 38px;
}

.search-bar svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

/* ─── Keyframes ──────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(60px); }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

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

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    width: var(--sidebar-collapsed);
  }
  .sidebar .nav-label,
  .sidebar .logo-text { opacity: 0; width: 0; }
  .sidebar .brand-meta { opacity: 0; width: 0; overflow: hidden; }
  .main-wrapper {
    margin-left: var(--sidebar-collapsed);
  }
  .content {
    padding: 16px;
  }
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
  }
  .screenshot-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
  }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-bar .form-input {
    width: 100%;
    min-width: unset;
  }
  .header { padding: 0 16px; }
  .lightbox-image { max-width: 95vw; }
}

@media (max-width: 480px) {
  .screenshot-grid {
    grid-template-columns: 1fr;
  }
  .login-card {
    margin: 16px;
    padding: 28px;
  }
}

/* ─── Utility Classes ────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.gap-3 { gap: 12px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hidden { display: none !important; }

/* ─── Action Buttons (Timesheets) ────────────────────── */
.btn-action {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-approve {
  color: var(--color-success);
}

.btn-approve:hover {
  background: rgba(0,212,170,0.15);
  border-color: var(--color-success);
  transform: scale(1.1);
}

.btn-reject {
  color: var(--color-error);
}

.btn-reject:hover {
  background: rgba(255,107,107,0.15);
  border-color: var(--color-error);
  transform: scale(1.1);
}

/* Input field (shared portal style) */
.input-field {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: all var(--transition-base);
  outline: none;
}

.input-field:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(165, 191, 30,0.15);
  background: rgba(255,255,255,0.07);
}

/* Table footer */
.table-footer {
  border-top: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.02);
}

/* Section header */
.section-header {
  margin-bottom: 24px;
}

.section-header h2 {
  margin-bottom: 4px;
}

/* ─── Chat Panel 3-Column Layout ─────────────────────────────────────── */
.chat-panel {
  position: fixed;
  inset: 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  z-index: 200;
  display: flex;
  box-shadow: var(--shadow-lg);
  transform: translateY(120%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.chat-panel.open {
  transform: translateY(0);
}

/* Left Column */
.chat-col-left {
  width: 320px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

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

.chat-left-header h2 {
  font-size: 18px;
  margin: 0;
}

.chat-search-bar {
  padding: 12px 16px;
}

.chat-search-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
}
.chat-search-input:focus {
  border-color: var(--border-focus);
}

.chat-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 16px;
  overflow-x: auto;
}
.chat-tabs::-webkit-scrollbar { display: none; }

.chat-tab {
  padding: 10px 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.chat-tab.active {
  color: var(--color-primary-light);
  border-bottom-color: var(--color-primary);
}

.chat-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

/* Middle Column */
.chat-col-middle {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

.chat-middle-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  min-height: 61px;
}

.chat-middle-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--color-primary-light);
  margin-bottom: 8px;
  font-style: italic;
  padding: 0 4px;
}
.typing-dots { display: flex; gap: 3px; }
.typing-dots span {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--color-primary-light);
  animation: typing 1.4s infinite ease-in-out both;
}
.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes typing {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.chat-composer {
  border-top: 1px solid var(--border-subtle);
  padding: 12px 20px;
  background: var(--bg-secondary);
}

.chat-composer-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.chat-input-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  transition: border-color var(--transition-fast);
}

.chat-input-wrapper.dragover {
  border-color: var(--color-primary);
  background: rgba(165, 191, 30,0.1);
}

.chat-input-area {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  resize: none;
  outline: none;
  min-height: 40px;
  max-height: 120px;
  font-family: inherit;
  font-size: 13px;
}

/* Right Column */
.chat-col-right {
  width: 280px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

.chat-right-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  min-height: 61px;
  display: flex;
  align-items: center;
}

.chat-right-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.chat-info-section {
  margin-bottom: 24px;
}

.chat-info-section h4 {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.chat-member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-primary);
}

.chat-avatar-sm {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

/* Shared */
.chat-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.chat-icon-btn svg { display: block; pointer-events: none; }
.chat-icon-btn:hover {
  background: rgba(165,191,30,0.10);
  border-color: rgba(165,191,30,0.25);
  color: var(--color-primary-light, #c3d94a);
}
.chat-icon-btn:active { transform: scale(0.94); }
.chat-icon-btn:focus-visible { outline: 2px solid var(--color-primary, #a5bf1e); outline-offset: 1px; }
.chat-toolbar-sep { width: 1px; height: 20px; background: var(--border-subtle, rgba(255,255,255,.1)); align-self: center; margin: 0 4px; }

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--gradient-primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(165, 191, 30,0.3);
}

/* Lists & Items */
.chat-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.chat-list-item:hover {
  background: rgba(255,255,255,0.04);
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #fff;
  position: relative;
}

.chat-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 2px solid var(--bg-secondary);
}
.chat-status-dot.online { background: #00d4aa; }

.chat-list-info { flex: 1; min-width: 0; }
.chat-list-name { font-size: 13px; font-weight: 600; color: var(--text-primary); display: flex; gap: 6px; align-items: center; }
.chat-list-preview { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list-time { font-size: 11px; color: var(--text-muted); }

.chat-unread-count {
  background: var(--color-primary);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
}

/* Messages */
.chat-msg {
  display: flex;
  gap: 10px;
  max-width: 80%;
  animation: fadeIn 0.2s ease;
}
.chat-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg.theirs { align-self: flex-start; }

.chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  margin-top: 4px;
}

.chat-msg-content { display: flex; flex-direction: column; }
.chat-msg-name { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
.chat-msg.mine .chat-msg-name { text-align: right; }

.chat-msg-bubble {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
  position: relative;
}
.chat-msg.mine .chat-msg-bubble {
  background: var(--gradient-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.theirs .chat-msg-bubble {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-msg-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.chat-msg.mine .chat-msg-meta { justify-content: flex-end; }

.chat-msg-time { font-size: 10px; color: var(--text-muted); }
.chat-msg-actions button {
  background: none; border: none; color: var(--text-muted);
  font-size: 10px; cursor: pointer; padding: 2px 4px;
}
.chat-msg-actions button:hover { color: var(--text-primary); }

/* Emoji-only messages: large emojis */
.chat-msg-text.emoji-only {
  font-size: 40px;
  line-height: 1.2;
  background: transparent !important;
}
.chat-msg-text.emoji-only + .chat-msg-reactions { margin-top: 4px; }

/* File attachment links in messages */
.chat-attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(165, 191, 30, 0.15);
  border: 1px solid rgba(165, 191, 30, 0.3);
  border-radius: var(--radius-sm);
  color: var(--color-primary-light);
  text-decoration: none;
  font-size: 13px;
  transition: all var(--transition-fast);
  margin-top: 4px;
}
.chat-attachment-link:hover {
  background: rgba(165, 191, 30, 0.25);
  border-color: var(--color-primary);
  text-decoration: none;
}

.chat-msg-reactions {
  display: flex; gap: 4px; margin-top: 4px;
}
.chat-msg-reactions span {
  background: rgba(0,0,0,0.2); padding: 2px 6px; border-radius: 10px; font-size: 10px;
}

.chat-date-separator {
  text-align: center;
  margin: 16px 0;
  position: relative;
}
.chat-date-separator::before {
  content: '';
  position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: var(--border-subtle); z-index: 1;
}
.chat-date-separator span {
  background: var(--bg-primary); padding: 0 12px; color: var(--text-muted);
  font-size: 11px; position: relative; z-index: 2;
}

.chat-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 13px; }
.chat-loading { text-align: center; padding: 40px; color: var(--text-muted); font-size: 13px; }



/* --- Tabs Bar -------------------------------------- */
.tabs-bar {
  display: flex;
  gap: 4px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 8px 18px;
  border: none;
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
}

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

.page-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.page-actions {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.btn-sm:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.btn-outline {
  border-color: var(--primary);
  color: var(--primary);
}

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

/* --- Action Buttons (table row actions) ------------ */
.action-cell {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: nowrap;
}

.btn-action {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
  line-height: 1;
}

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

.btn-action.btn-edit:hover { color: #a5bf1e; border-color: #a5bf1e; }
.btn-action.btn-approve:hover { color: #00d4aa; border-color: #00d4aa; }
.btn-action.btn-reject:hover { color: #ef5350; border-color: #ef5350; }
.btn-action.btn-delete:hover { color: #ef5350; border-color: #ef5350; }
.btn-action.btn-cancel-lv:hover { color: #ffa726; border-color: #ffa726; }

/* Chat Module Enhancements */
.emoji-picker {
  position: absolute;
  bottom: 100%;
  left: 10px;
  width: 320px;
  max-height: 250px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

.emoji-picker-category {
  font-size: 12px;
  color: var(--text-muted);
  margin: 8px 0 4px 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.emoji-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.emoji-btn:hover {
  background: rgba(255,255,255,0.1);
}

.chat-file-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  padding: 8px 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--color-info);
}

#chatFilePreviewRemove {
  background: none;
  border: none;
  color: var(--color-error);
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
}

.chat-input-editable {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  overflow-y: auto;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  padding: 10px;
  outline: none;
  line-height: 1.4;
}

.chat-input-editable:empty:before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
  display: block;
}

.chat-format-btn.active {
  background: rgba(165,191,30,0.18);
  border-color: rgba(165,191,30,0.45);
  color: var(--color-primary-light, #c3d94a);
}

.chat-composer {
  position: relative;
}

/* ─── Native dropdown options: readable on dark theme ─── */
select { color-scheme: dark; }
select option, select optgroup {
  background-color: #1a1f3a;
  color: #e8eaf6;
}
select option:checked, select option:hover {
  background-color: #a5bf1e;
  color: #ffffff;
}
select option:disabled { color: #7a7f9a; }


/* =====================================================================
   Sidebar brand v2 — full-width logo card (logo trimmed by branding.js)
   ===================================================================== */
.sidebar-logo {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 14px 14px 12px;
  min-height: 0;
}
.sidebar-logo .brand-tile {
  width: 100%;
  height: 84px;
  padding: 8px 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f6fb 100%);
  box-shadow: 0 8px 22px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.10),
              0 0 0 3px color-mix(in srgb, var(--color-primary, #a5bf1e) 25%, transparent);
}
.sidebar-logo .brand-tile .logo-full {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
}
.sidebar-logo .brand-tile .logo-icon-img { display: none; }
.sidebar-logo .brand-meta { align-items: center; text-align: center; padding: 0 4px; }
.sidebar-logo .logo-text { font-size: 15px; }

/* Collapsed / narrow: square tile with the emblem only */
.sidebar.collapsed .sidebar-logo { padding: 14px 0 12px; align-items: center; }
.sidebar.collapsed .sidebar-logo .brand-tile { width: 46px; height: 46px; padding: 5px; border-radius: 12px; }
.sidebar.collapsed .sidebar-logo .brand-tile .logo-full { display: none; }
.sidebar.collapsed .sidebar-logo .brand-tile .logo-icon-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sidebar.collapsed .sidebar-logo .brand-meta { display: none; }
@media (max-width: 768px) {
  .sidebar .sidebar-logo { padding: 14px 0 12px; align-items: center; }
  .sidebar .sidebar-logo .brand-tile { width: 46px; height: 46px; padding: 5px; }
  .sidebar .sidebar-logo .brand-tile .logo-full { display: none; }
  .sidebar .sidebar-logo .brand-tile .logo-icon-img { display: block; width: 100%; height: 100%; object-fit: contain; }
  .sidebar .sidebar-logo .brand-meta { display: none; }
}
.sidebar-toggle { top: 46px; }

/* =====================================================================
   HRMSGene "Infinity" theme — matches the logo (lime #A5BF1E · olive #5C7F1C
   · deep forest #04231D). AI-style aurora background, glass surfaces, glow.
   ===================================================================== */
:root {
  --bg-primary: #06140f;
  --bg-secondary: #0b1f18;
  --bg-sidebar: #041a14;
  --bg-card: rgba(165, 191, 30, 0.035);
  --bg-card-hover: rgba(165, 191, 30, 0.07);
  --bg-input: rgba(255, 255, 255, 0.045);
  --color-primary: #a5bf1e;
  --color-primary-light: #c3d94a;
  --color-purple: #5c7f1c;
  --color-success: #2fd27a;
  --color-info: #3cc7b5;
  --gradient-primary: linear-gradient(135deg, #b8d22a 0%, #8aa317 45%, #5c7f1c 100%);
  --gradient-accent: linear-gradient(135deg, #2fd27a 0%, #1fa59a 100%);
  --gradient-bg: radial-gradient(1200px 600px at 10% -10%, rgba(165,191,30,0.10), transparent 60%),
                 radial-gradient(900px 500px at 100% 0%, rgba(47,143,91,0.10), transparent 60%),
                 linear-gradient(180deg, #06140f 0%, #071a13 100%);
  --text-primary: #e7efe2;
  --text-secondary: #a3b5a6;
  --text-muted: #6f8576;
  --border-subtle: rgba(195, 217, 74, 0.08);
  --border-light: rgba(195, 217, 74, 0.14);
  --border-focus: rgba(165, 191, 30, 0.55);
  --glass-bg: rgba(12, 34, 26, 0.55);
  --glass-border: 1px solid rgba(195, 217, 74, 0.10);
  --shadow-glow: 0 0 24px rgba(165, 191, 30, 0.28);
  --on-primary: #0a1a12;
}

/* Aurora background with a faint neural grid */
body {
  background: var(--gradient-bg) fixed, var(--bg-primary);
  color: var(--text-primary);
}
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(195,217,74,0.07) 1px, transparent 0);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}
.main-wrapper, .login-container { position: relative; z-index: 1; }
::selection { background: rgba(165,191,30,0.35); color: #fff; }

/* Sidebar: deep forest with a lime edge light */
.sidebar {
  background: linear-gradient(180deg, #05211a 0%, #041a14 60%, #03140f 100%);
  border-right: 1px solid rgba(195,217,74,0.10);
  box-shadow: inset -1px 0 0 rgba(165,191,30,0.06), 8px 0 30px rgba(0,0,0,0.25);
}
.nav-item:hover { background: rgba(165,191,30,0.07); color: #eef5e6; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(165,191,30,0.18), rgba(165,191,30,0.04));
  color: #d9ea7a;
  box-shadow: inset 0 0 0 1px rgba(165,191,30,0.18);
}
.nav-item.active svg { filter: drop-shadow(0 0 6px rgba(165,191,30,0.55)); }
.nav-section-title { color: rgba(195,217,74,0.45); }

/* Header: frosted glass */
.header {
  background: rgba(6, 20, 15, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(195,217,74,0.10);
}

/* Cards: glass + lime rim light on hover */
.card, .stat-card, .kpi-card, .modal, .modal-content, .login-card {
  background: linear-gradient(180deg, rgba(14,40,30,0.72), rgba(8,26,20,0.72));
  border: 1px solid rgba(195,217,74,0.10);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.card:not(.card-static):hover, .stat-card:hover, .kpi-card:hover {
  border-color: rgba(165,191,30,0.30);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35), 0 0 0 1px rgba(165,191,30,0.12), 0 0 30px rgba(165,191,30,0.10);
}

/* Primary buttons: lime gradient with dark text (readable), glow on hover */
.btn-primary, button.btn-primary, .btn.btn-primary {
  background: var(--gradient-primary);
  color: var(--on-primary) !important;
  font-weight: 700;
  border: none;
  box-shadow: 0 6px 18px rgba(165,191,30,0.25), inset 0 1px 0 rgba(255,255,255,0.25);
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 8px 26px rgba(165,191,30,0.40), inset 0 1px 0 rgba(255,255,255,0.3); }
.btn-secondary { border: 1px solid rgba(195,217,74,0.18); }
.btn-secondary:hover { border-color: rgba(165,191,30,0.45); }

/* Inputs: lime focus ring */
input:focus, select:focus, textarea:focus,
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: rgba(165,191,30,0.6) !important;
  box-shadow: 0 0 0 3px rgba(165,191,30,0.18) !important;
}
select option { background: #0b1f18; color: var(--text-primary); }

/* Tables */
.data-table thead th { color: #9fb39f; border-bottom-color: rgba(195,217,74,0.12); }
.data-table tbody tr:hover td { background: rgba(165,191,30,0.045); }

/* Tabs */
.tab-btn.active { background: var(--gradient-primary); color: var(--on-primary); border-color: transparent; font-weight: 700; }

/* Avatar + KPI icons pick up the brand gradient */
.avatar { background: var(--gradient-primary); color: var(--on-primary); font-weight: 700; box-shadow: 0 0 0 2px rgba(165,191,30,0.25); }

/* Toggles / checkboxes / progress */
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: #a5bf1e; }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(165,191,30,0.22); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(165,191,30,0.4); background-clip: padding-box; }

/* Desktop App download button: themed to the brand when no OS theme applies */
.dla-head { background: linear-gradient(135deg, rgba(165,191,30,0.18), rgba(47,143,91,0.06)); }
.dla-head-ico, .dla-get { background: var(--gradient-primary); color: var(--on-primary); }
.dla-ver { background: rgba(165,191,30,0.15); color: #d4e57a; border-color: rgba(165,191,30,0.35); }

/* Login page */
.login-container { background: var(--gradient-bg), var(--bg-primary); }
.login-card { box-shadow: 0 30px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(165,191,30,0.10), 0 0 60px rgba(165,191,30,0.08); }

/* =====================================================================
   Sidebar brand v3 — clean horizontal lockup: emblem tile + name
   ===================================================================== */
.sidebar-logo {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  min-height: 72px;
  background: linear-gradient(180deg, rgba(165,191,30,0.06) 0%, rgba(165,191,30,0) 100%);
  border-bottom: 1px solid rgba(195,217,74,0.10);
}
.sidebar-logo::after { left: 18px; right: 18px; opacity: .35; }
.sidebar-logo .brand-tile {
  width: 44px;
  height: 44px;
  padding: 3px;
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35), 0 0 0 1px rgba(195,217,74,0.22);
}
.sidebar-logo:hover .brand-tile {
  transform: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35), 0 0 0 1px rgba(195,217,74,0.40), 0 0 16px rgba(165,191,30,0.25);
}
.sidebar-logo .brand-tile .logo-full { display: none; }
.sidebar-logo .brand-tile .logo-icon-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 9px;
}
.sidebar-logo .brand-meta {
  align-items: flex-start;
  text-align: left;
  padding: 0;
  gap: 2px;
  min-width: 0;
}
.sidebar-logo .logo-text {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: .1px;
  line-height: 1.2;
  color: #f2f7ec;
  -webkit-text-fill-color: #f2f7ec;
  text-shadow: none;
}
.sidebar-logo .brand-sub {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .2px;
  color: #8fa392;
  gap: 5px;
}
.sidebar-logo .brand-sub strong {
  background: none;
  -webkit-text-fill-color: #c3d94a;
  color: #c3d94a;
  font-weight: 600;
}
.sidebar-logo .brand-dot { width: 5px; height: 5px; }
.sidebar-toggle { top: 22px; }

.sidebar.collapsed .sidebar-logo { padding: 16px 0; justify-content: center; }
.sidebar.collapsed .sidebar-logo .brand-tile { width: 42px; height: 42px; }
/* =====================================================================
   Sidebar brand v4 — transparent emblem on a glass tile (high contrast)
   ===================================================================== */
.sidebar-logo .brand-tile {
  width: 50px;
  height: 50px;
  padding: 4px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(165,191,30,0.16), rgba(165,191,30,0.04)) !important;
  border: 1px solid rgba(195,217,74,0.28);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.06);
}
.sidebar-logo:hover .brand-tile {
  border-color: rgba(195,217,74,0.5);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35), 0 0 18px rgba(165,191,30,0.28), inset 0 1px 0 rgba(255,255,255,0.08);
}
.sidebar-logo .brand-tile .logo-icon-img {
  border-radius: 0;
  filter: drop-shadow(0 2px 6px rgba(165,191,30,0.35));
}
.sidebar.collapsed .sidebar-logo .brand-tile { width: 46px; height: 46px; }.sidebar-logo .brand-tile { width: 60px; height: 48px; padding: 3px 4px; }
.sidebar.collapsed .sidebar-logo .brand-tile { width: 50px; height: 42px; padding: 3px; }
/* Layout safety: sidebar must stay fixed (theme layer must never change this) */
.sidebar { position: fixed !important; z-index: 100; }

/* Missing design tokens used by several components */
:root {
  --surface: rgba(165, 191, 30, 0.06);
  --surface-hover: rgba(165, 191, 30, 0.12);
  --border: rgba(195, 217, 74, 0.16);
}

/* Default (unstyled) .btn — dark glass instead of the browser's white button */
.btn:not(.btn-primary):not(.btn-danger):not(.btn-success):not(.btn-warning) {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn:not(.btn-primary):not(.btn-danger):not(.btn-success):not(.btn-warning):hover {
  background: var(--surface-hover);
  border-color: rgba(165,191,30,0.45);
  color: #fff;
}
/* =====================================================================
   Responsive & polish fixes
   ===================================================================== */
/* Header icon buttons (chat) — dark glass instead of white */
.header .btn-icon, .btn-icon#chatToggleBtn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.header .btn-icon:hover { background: var(--surface-hover) !important; border-color: rgba(165,191,30,0.45) !important; box-shadow: 0 0 14px rgba(165,191,30,0.2); }

/* Never let the content area push the page wider than the screen */
.main-wrapper { min-width: 0; }
.content { min-width: 0; overflow-x: hidden; }
.header { gap: 12px; }
.header-right { min-width: 0; }
.header-user .user-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1024px) {
  .header-user .user-name { display: none; }
}

@media (max-width: 768px) {
  /* Collapsed rail: hide group titles + toggle (rail is fixed width on mobile) */
  .sidebar .nav-section-title { font-size: 0; padding: 10px 0 0; margin: 6px 16px 0; border-top: 1px solid rgba(195,217,74,0.10); }
  .sidebar-toggle { display: none; }
  .sidebar .nav-item { justify-content: center; padding: 11px 0; }
  .header { padding: 0 12px; }
  .breadcrumb > span:first-child, .breadcrumb > svg { display: none; }
  .header-right { gap: 8px; }
  .page-header { flex-wrap: wrap; gap: 6px; }
  .page-header h2 { font-size: 20px; }
}

@media (max-width: 600px) {
  .content { padding: 12px !important; }
  /* Inline 2/3/4-column layouts collapse to one column on phones */
  .content [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  /* KPI cards: two compact columns */
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  .stat-card { padding: 14px !important; min-width: 0; }
  .stat-card .stat-value, .stat-value { font-size: 22px !important; }
  .stat-card .stat-label, .stat-label { font-size: 11.5px !important; }
  .page-header > *:last-child:not(h2) { font-size: 12px; }
  .data-table { font-size: 12.5px; }
  .table-responsive, .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .modal, .modal-content { width: calc(100vw - 24px) !important; max-width: calc(100vw - 24px) !important; }
  .tabs-bar { overflow-x: auto; flex-wrap: nowrap; }
  .tab-btn { white-space: nowrap; }
}@media (max-width: 768px) {
  .main-wrapper { width: calc(100vw - var(--sidebar-collapsed)); max-width: calc(100vw - var(--sidebar-collapsed)); overflow-x: hidden; }
  .header { overflow: visible; }
  .header .breadcrumb { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .dla-btn { padding: 4px; gap: 4px; }
  .dla-btn-chev { display: none; }
  .dla-panel { position: fixed; top: 60px; right: 8px; left: 8px; width: auto; }
}
@media (max-width: 600px) {
  .page-header > p, .page-header > span, .page-header .welcome-text, .page-header > div:last-child:not(.page-actions) { display: none; }
  .stats-grid > * { min-width: 0; }
}@media (min-width: 601px) and (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (min-width: 1101px) {
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* ─── Phones: page headers stack (title, description, then actions) ─── */
@media (max-width: 600px) {
  .section-header { flex-direction: column; align-items: stretch; gap: 10px; }
  .section-header > * { min-width: 0; }
  .section-header > div[style*="display:flex"], .section-header > div[style*="display: flex"] { flex-wrap: wrap; }
  .section-header > .btn { align-self: flex-start; }
  .page-actions { flex-wrap: wrap; max-width: 100%; }
  .page-actions > select, .page-actions > .form-select { flex: 1 1 130px; width: auto !important; margin-right: 0 !important; }
}
