:root {
  --bg: #0b0f19;
  --surface: rgba(17, 25, 40, 0.65);
  --surface-solid: #111827;
  --surface-hover: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.08);
  --border-neon: rgba(0, 242, 254, 0.25);
  --border-neon-purple: rgba(197, 85, 236, 0.3);
  
  --brand: #00f2fe;
  --brand-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --purple-gradient: linear-gradient(135deg, #c555ec 0%, #7000ff 100%);
  --accent: #7c5cff;
  
  --ok: #10b981;
  --ok-glow: 0 0 12px rgba(16, 185, 129, 0.4);
  --warn: #f59e0b;
  --warn-glow: 0 0 12px rgba(245, 158, 11, 0.4);
  --danger: #ef4444;
  --danger-glow: 0 0 12px rgba(239, 68, 68, 0.4);
  --info: #3b82f6;
  
  --ink: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, 0.06);
  
  --shadow-neon: 0 0 20px rgba(0, 242, 254, 0.15);
  --shadow-neon-purple: 0 0 20px rgba(197, 85, 236, 0.15);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  --radius: 12px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--brand) var(--bg);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 254, 0.3);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand);
  box-shadow: var(--shadow-neon);
}

body {
  margin: 0;
  background: var(--bg);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(0, 242, 254, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(197, 85, 236, 0.05) 0%, transparent 40%);
  color: var(--ink);
  font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

button, input, select, textarea {
  font: inherit;
  outline: none;
}

button {
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* App Shell with Glassmorphism */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

/* Sidebar Styling */
.sidebar {
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--border);
  color: #f7fbff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 50px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(0, 242, 254, 0.6));
  animation: logo-glow 3s ease-in-out infinite alternate;
}

@keyframes logo-glow {
  0% { filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.4)); }
  100% { filter: drop-shadow(0 0 18px rgba(0, 242, 254, 0.8)); }
}

.brand strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand span, .sidebar-note {
  color: var(--muted);
  font-size: 11px;
}

.sidebar-note {
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  line-height: 1.6;
}

/* Cyber Switcher */
.role-switch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
}

.role-switch button {
  min-height: 36px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
}

.role-switch button.active {
  background: var(--brand-gradient);
  color: #0b0f19;
  box-shadow: var(--shadow-neon);
}

.session-role-badge {
  min-height: 44px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 14px;
  border: 0;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.12), rgba(79, 172, 254, 0.08));
  color: #e0faff;
  font-weight: 800;
  box-shadow: inset 0 0 18px rgba(0, 242, 254, 0.08);
}

.session-role-badge.admin {
  border-color: rgba(197, 85, 236, 0.32);
  background: linear-gradient(135deg, rgba(197, 85, 236, 0.16), rgba(124, 92, 255, 0.1));
  color: #f7e8ff;
}

.session-role-badge.manager {
  border-color: rgba(79, 172, 254, 0.32);
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.16), rgba(0, 242, 254, 0.1));
  color: #e0f7ff;
}

.session-role-badge svg {
  width: 18px;
  height: 18px;
}

/* Admin Sidebar Active Switch */
.sidebar .role-switch button[data-switch-role="admin"].active {
  background: var(--purple-gradient);
  color: #fff;
  box-shadow: var(--shadow-neon-purple);
}

/* Nav Menu */
.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav button {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  color: var(--muted);
  background: transparent;
  text-align: right;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 500;
}

.nav button:hover {
  color: #fff;
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.03);
}

.nav button.active {
  color: #fff;
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.15);
  box-shadow: inset 0 0 10px rgba(0, 242, 254, 0.05);
}

.sidebar[data-theme="admin"] .nav button.active {
  background: rgba(197, 85, 236, 0.08);
  border-color: rgba(197, 85, 236, 0.15);
}

.nav svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.nav button:hover svg {
  transform: scale(1.1);
}

/* Main Area */
.main {
  min-width: 0;
  padding: 24px 32px 40px;
}

/* Cyber Hero Band */
.hero-band {
  min-height: 184px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
  background:
    linear-gradient(120deg, rgba(0, 242, 254, 0.12), rgba(124, 92, 255, 0.08) 48%, rgba(15, 23, 42, 0.24)),
    linear-gradient(135deg, rgba(11, 15, 25, 0.96), rgba(17, 24, 39, 0.88));
  background-size: cover;
  border: 1px solid var(--border-neon);
  border-radius: var(--radius);
  padding: 22px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-neon);
}

.hero-band[data-theme="admin"] {
  border-color: var(--border-neon-purple);
  box-shadow: var(--shadow-neon-purple);
}

.hero-band::after {
  content: "";
  position: absolute;
  inset: auto -60px -60px auto;
  width: 220px;
  aspect-ratio: 1;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.14), rgba(124, 92, 255, 0.04));
  transform: rotate(12deg);
  pointer-events: none;
}

.hero-band[data-theme="admin"]::after {
  background: linear-gradient(135deg, rgba(197, 85, 236, 0.16), rgba(0, 242, 254, 0.04));
}

.hero-band > * {
  position: relative;
  z-index: 2;
}

.hero-band h1 {
  font-size: 32px;
  font-weight: 800;
  margin-top: 8px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-band .eyebrow {
  color: var(--brand);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-band[data-theme="admin"] .eyebrow {
  color: #c555ec;
}

.hero-band .muted {
  color: var(--muted);
  line-height: 1.6;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  padding: 14px 16px;
  border: 1px solid rgba(0, 242, 254, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(0, 242, 254, 0.055), rgba(124, 92, 255, 0.055)),
    rgba(8, 13, 27, 0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.2);
}

h1 {
  font-size: 30px;
  font-weight: 800;
  background: linear-gradient(to left, #fff, #c3dafe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

/* Glassmorphic Panel Card */
.panel {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.panel:hover {
  border-color: rgba(0, 242, 254, 0.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 242, 254, 0.05);
}

.panel.admin-panel-gantt:hover {
  border-color: rgba(197, 85, 236, 0.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 15px rgba(197, 85, 236, 0.05);
}

/* Floating Actions */
.top-actions, .row-actions, .filters, .form-row, .tabs {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.role-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -12px 0 22px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 242, 254, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(0, 242, 254, 0.08), rgba(124, 92, 255, 0.055)),
    rgba(15, 23, 42, 0.58);
  box-shadow: 0 16px 36px rgba(2, 6, 23, 0.16);
}

.role-guide.admin {
  border-color: rgba(197, 85, 236, 0.22);
  background:
    linear-gradient(135deg, rgba(197, 85, 236, 0.1), rgba(0, 242, 254, 0.055)),
    rgba(15, 23, 42, 0.58);
}

.role-guide strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.role-guide span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  margin-top: 2px;
}

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

.role-guide-actions button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(0, 242, 254, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.role-guide-actions button:hover,
.role-guide-actions button.active {
  background: var(--brand-gradient);
  border-color: transparent;
  color: #06111f;
  box-shadow: 0 10px 22px rgba(0, 242, 254, 0.2);
}

.quick-actions-wrap {
  position: relative;
}

.quick-actions-btn {
  border-color: rgba(0, 242, 254, 0.2);
}

.quick-actions-menu {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  z-index: 150;
  width: min(245px, calc(100vw - 32px));
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(0, 242, 254, 0.18);
  border-radius: 14px;
  background: #0f172a;
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.42);
}

.quick-actions-menu button {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #e2e8f0;
  font-weight: 700;
}

.quick-actions-menu button:hover {
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.16);
}

.quick-actions-menu .danger-action {
  color: #fca5a5;
}

.quick-actions-menu svg {
  width: 16px;
  height: 16px;
}

.tabs {
  position: relative;
  z-index: 2;
  padding: 4px;
  border: 1px solid rgba(0, 242, 254, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.tabs button {
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tabs button.active {
  background: var(--brand-gradient);
  color: #08111f;
  box-shadow: 0 8px 22px rgba(0, 242, 254, 0.24);
}

[data-theme-mode="light"] .tabs {
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(0, 180, 216, 0.22);
}

[data-theme-mode="light"] .tabs button {
  color: #52647f;
}

/* Premium Buttons */
.primary, .secondary, .danger, .ghost, .icon-btn {
  min-height: 42px;
  padding: 0 20px;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius);
  border: 1px solid transparent;
}

.primary {
  background: var(--brand-gradient);
  color: #0b0f19;
  box-shadow: 0 4px 14px rgba(0, 242, 254, 0.3);
}

.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.5);
}

.primary:active {
  transform: translateY(0);
}

.secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--ink);
}

.secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.danger {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.2);
}

.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  transform: translateY(-1px);
  box-shadow: var(--danger-glow);
}

.ghost {
  background: transparent;
  color: var(--brand);
}

.ghost:hover {
  background: rgba(0, 242, 254, 0.05);
}

.icon-btn {
  width: 42px;
  padding: 0;
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--ink);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--brand);
  color: var(--brand);
}

/* Grids */
.grid {
  display: grid;
  gap: 16px;
}

.metrics {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  margin-bottom: 24px;
}

.metric {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 110px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.metric:hover {
  border-color: var(--brand-neon);
  transform: translateY(-2px);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.metric strong {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  margin-top: 6px;
}

.metric svg {
  color: var(--brand);
  filter: drop-shadow(0 0 6px var(--brand));
}

.control-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.wide-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
}

.split {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
}

.unified-action-center {
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 90% 0%, rgba(0, 242, 254, 0.12), transparent 28%),
    linear-gradient(135deg, rgba(0, 242, 254, 0.055), rgba(124, 92, 255, 0.075)),
    var(--surface);
  box-shadow: var(--shadow);
}

.action-center-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.action-center-head h2 {
  margin: 2px 0 4px;
}

.action-center-score {
  flex: 0 0 auto;
  min-width: 116px;
  min-height: 76px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 14px;
  border: 1px solid rgba(0, 242, 254, 0.22);
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.12), rgba(124, 92, 255, 0.12));
}

.action-center-score span {
  color: var(--brand);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.action-center-score small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}

.action-center-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.action-center-card {
  min-height: 178px;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
  position: relative;
}

.action-center-card::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.action-center-card.urgent,
.action-center-card.danger {
  border-color: rgba(245, 158, 11, 0.34);
}

.action-center-card.ok {
  border-color: rgba(16, 185, 129, 0.28);
}

.action-card-top,
.action-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.action-card-top strong {
  color: var(--ink);
  font-size: 30px;
  font-weight: 900;
}

.action-center-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
}

.action-center-card p {
  margin: 0;
  min-height: 46px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.action-card-footer {
  margin-top: auto;
}

.action-card-footer span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.client-command-center {
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) minmax(220px, 0.7fr) minmax(220px, 0.7fr);
  gap: 16px;
  margin-bottom: 24px;
}

.client-decision-center {
  margin-bottom: 24px;
}

.compact-head {
  margin-bottom: 12px;
}

.decision-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.decision-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.045), rgba(124, 92, 255, 0.045)), var(--surface);
  min-height: 168px;
}

.decision-card.urgent {
  border-color: rgba(245, 158, 11, 0.35);
}

.decision-card > strong {
  font-size: 30px;
  line-height: 1;
  color: var(--ink);
}

.decision-card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
}

.decision-card p {
  min-height: 42px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.client-action-card,
.client-brief-card,
.client-status-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.client-action-card {
  padding: 22px;
}

.client-action-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.client-action-head h2 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.35;
}

.client-action-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.client-brief-card {
  padding: 18px;
}

.client-brief-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.client-brief-list div,
.client-brief-list button {
  width: 100%;
  text-align: start;
  border: 1px solid var(--line);
  background: var(--surface-hover);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
}

.client-brief-list button {
  cursor: pointer;
}

.client-brief-list button:hover {
  border-color: var(--brand);
}

.client-brief-list strong {
  display: block;
  font-size: 13px;
  line-height: 1.45;
}

.client-brief-list span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.client-status-strip {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
}

.client-status-strip.safe {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.22);
}

.client-status-strip.warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.24);
}

.client-status-strip strong {
  color: var(--ink);
}

.client-status-strip span {
  color: var(--muted);
  font-size: 12px;
}

.approval-decision-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.35fr);
  gap: 20px;
  align-items: stretch;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(124, 92, 255, 0.08)), var(--surface);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.approval-decision-card h2 {
  margin: 2px 0 8px;
  font-size: 24px;
}

.approval-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.approval-meta-grid div,
.approval-action-panel,
.approval-ledger-card,
.approval-queue {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.approval-meta-grid div {
  padding: 11px 12px;
}

.approval-meta-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.approval-meta-grid strong {
  font-size: 13px;
}

.approval-action-panel {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 16px;
}

.approval-clear-state {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
}

.approval-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.38fr);
  gap: 16px;
}

.approval-queue,
.approval-ledger-card {
  padding: 18px;
}

.approval-row {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-hover);
  margin-top: 10px;
}

.approval-row .row-actions {
  justify-content: space-between;
  margin-top: 12px;
}

.progress-quick-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.progress-quick-controls button {
  min-height: 26px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.progress-quick-controls button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.progress-quick-controls.wide button {
  flex: 1;
}

.drawer-progress-editor {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-hover);
}

.drawer-progress-editor input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
  padding: 0;
  border: 0;
  background: transparent;
}

.deliverable-impact-box {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 242, 254, 0.18);
  background: rgba(0, 242, 254, 0.06);
}

.deliverable-impact-box strong {
  color: var(--ink);
}

.deliverable-impact-box span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

/* SLA Dynamic HUD & Delay Coefficient Gauge */
.sla-gauge-hud {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius);
  color: #fca5a5;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.05);
  animation: border-pulse-red 3s infinite alternate;
}

.sla-gauge-hud.safe-sla {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
  animation: border-pulse-green 3s infinite alternate;
}

@keyframes border-pulse-red {
  0% { border-color: rgba(239, 68, 68, 0.15); box-shadow: 0 0 8px rgba(239, 68, 68, 0.03); }
  100% { border-color: rgba(239, 68, 68, 0.4); box-shadow: 0 0 18px rgba(239, 68, 68, 0.12); }
}
@keyframes border-pulse-green {
  0% { border-color: rgba(16, 185, 129, 0.15); box-shadow: 0 0 8px rgba(16, 185, 129, 0.03); }
  100% { border-color: rgba(16, 185, 129, 0.4); box-shadow: 0 0 18px rgba(16, 185, 129, 0.12); }
}

.sla-coefficient-pill {
  padding: 6px 14px;
  background: #ef4444;
  color: #fff;
  border-radius: 99px;
  font-weight: 800;
  font-size: 13px;
  box-shadow: var(--danger-glow);
  white-space: nowrap;
}

.sla-coefficient-pill.safe {
  background: #10b981;
  box-shadow: var(--ok-glow);
}

/* Security Console Screen - Login */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background-color: #070913;
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(0, 242, 254, 0.08) 0%, transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
}

.login-panel {
  width: min(450px, 100%);
  padding: 32px;
  background: rgba(13, 18, 33, 0.8);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-neon);
  box-shadow: var(--shadow-neon), var(--shadow);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

.login-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--brand-gradient);
}

.security-badge-hud {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 242, 254, 0.05);
  border: 1px solid rgba(0, 242, 254, 0.12);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  color: var(--brand);
  font-family: monospace;
  margin-top: 14px;
}

/* Progress Ring */
.progress-ring {
  --value: 0;
  width: 140px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 10px auto;
  background: conic-gradient(var(--brand) calc(var(--value) * 1%), rgba(255, 255, 255, 0.06) 0);
  position: relative;
}

.progress-ring::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: var(--surface-solid);
}

.progress-ring strong {
  position: relative;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
}

/* Interactive Timeline Chronos Gantt */
.timeline {
  position: relative;
  z-index: 20;
  overflow: auto;
  max-height: min(72dvh, 760px);
  background:
    linear-gradient(135deg, rgba(0, 242, 254, 0.1), rgba(124, 92, 255, 0.08)),
    rgba(8, 13, 27, 0.88);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 46px rgba(0, 0, 0, 0.22);
  padding: 10px 0;
}

.timeline:hover,
.timeline:focus-within {
  z-index: 240;
}

.gantt-meta {
  position: sticky;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 10px;
  width: max-content;
  color: #f8fafc;
}

.gantt {
  min-width: 900px;
  display: grid;
  grid-template-columns: 240px repeat(12, 1fr);
  align-items: stretch;
  overflow: visible;
}

.gantt-cell, .gantt-label {
  min-height: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  border-inline-start: 1px solid rgba(255, 255, 255, 0.055);
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 13px;
  color: var(--ink);
}

.gantt-head {
  background: #111827;
  color: #dbeafe;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 8;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.26);
}

.gantt-label {
  position: sticky;
  right: 0;
  z-index: 5;
  background: rgba(10, 18, 36, 0.98);
  border-inline-start: 0;
}

.gantt-label.gantt-head {
  top: 0;
  right: 0;
  z-index: 12;
  background: #111827;
}

.gantt-label span[style*="var(--danger)"] {
  color: #c555ec !important;
  font-weight: 800;
}

.bar-track {
  grid-column: 2 / -1;
  position: relative;
  z-index: 1;
  min-height: 48px;
  min-width: var(--gantt-track-width, auto);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background-image: linear-gradient(to left, rgba(125, 211, 252, 0.1) 1px, transparent 1px);
  background-size: 8.333% 100%;
  overflow: visible;
}

.bar-track:hover,
.bar-track:focus-within {
  z-index: 90;
}

.bar {
  position: absolute;
  top: 10px;
  height: 28px;
  border: 0;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  min-width: 40px;
  overflow: hidden;
  white-space: nowrap;
  background: rgba(15, 23, 42, 0.42);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.28);
  cursor: pointer;
  transition: all 0.3s ease;
}

.bar::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--progress, 0%);
  max-width: 100%;
  min-width: 0;
  border-radius: inherit;
  background: var(--bar-fill, linear-gradient(135deg, #00d9ff 0%, #3b82f6 48%, #7c5cff 100%));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: width 0.28s ease;
}

.bar::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 1px solid rgba(0, 242, 254, 0.24);
  border-radius: inherit;
  pointer-events: none;
}

.bar:hover {
  transform: scaleY(1.1);
  box-shadow: 0 8px 24px rgba(0, 242, 254, 0.38);
}

.bar-percent,
.bar-date-chip {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.bar-date-chip {
  position: absolute;
  inset-inline: 8px;
  opacity: 0;
  transform: translateY(6px);
  font-size: 10px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-scheduled:hover .bar-percent,
.status-scheduled:focus-visible .bar-percent {
  opacity: 0;
  transform: translateY(-6px);
}

.status-scheduled:hover .bar-date-chip,
.status-scheduled:focus-visible .bar-date-chip {
  opacity: 1;
  transform: translateY(0);
}

.gantt-tooltip-anchor,
.bar-track > .gantt-bar-tooltip {
  position: absolute;
  top: 0;
  height: 48px;
  pointer-events: none;
  z-index: 260;
  display: none;
}

.bar-track > .gantt-bar-tooltip {
  right: 8px;
  width: 260px;
}

.gantt-bar-tooltip {
  position: absolute;
  z-index: 280;
  right: 50%;
  bottom: calc(100% + 10px);
  width: min(320px, 78vw);
  padding: 12px;
  border: 1px solid rgba(0, 242, 254, 0.28);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(0, 242, 254, 0.08), rgba(124, 92, 255, 0.08)),
    #0f172a;
  color: #f8fafc;
  box-shadow: 0 18px 46px rgba(2, 6, 23, 0.42);
  opacity: 0;
  visibility: hidden;
  transform: translate(50%, 8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  white-space: normal;
  text-align: start;
}

.bar:hover + .gantt-tooltip-anchor .gantt-bar-tooltip,
.bar:focus-visible + .gantt-tooltip-anchor .gantt-bar-tooltip,
.bar:hover + .gantt-bar-tooltip,
.bar:focus-visible + .gantt-bar-tooltip {
  opacity: 0;
  visibility: hidden;
}

.gantt-floating-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2147482500;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.gantt-floating-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.gantt-floating-tooltip .gantt-bar-tooltip {
  position: static !important;
  right: auto !important;
  bottom: auto !important;
  width: min(330px, calc(100vw - 24px));
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  display: block;
}

.tooltip-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.tooltip-head strong {
  color: #f8fafc;
  font-size: 12px;
  line-height: 1.5;
}

.tooltip-head span {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(0, 242, 254, 0.12);
  color: #67e8f9;
  font-size: 10px;
  font-weight: 800;
}

.tooltip-dates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 9px;
}

.tooltip-dates div {
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
}

.tooltip-dates small,
.gantt-bar-tooltip p {
  color: #94a3b8;
  font-size: 10px;
  line-height: 1.7;
}

.tooltip-dates b {
  display: block;
  margin-top: 2px;
  color: #f8fafc;
  font-size: 11px;
}

.gantt-bar-tooltip p {
  margin: 0;
}

/* Glowing Gantt status colors */
.status-completed {
  --bar-fill: linear-gradient(135deg, #02c7c7 0%, #10b981 100%);
  background: rgba(16, 185, 129, 0.14);
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.28);
}
.status-progress {
  --bar-fill: linear-gradient(135deg, #00d9ff 0%, #3b82f6 48%, #7c5cff 100%);
  background: rgba(59, 130, 246, 0.14);
  box-shadow: 0 10px 28px rgba(59, 130, 246, 0.3);
}
.status-internal-review {
  --bar-fill: linear-gradient(135deg, #22d3ee 0%, #8b5cf6 100%);
  background: rgba(34, 211, 238, 0.14);
  box-shadow: 0 10px 28px rgba(34, 211, 238, 0.24);
}
.status-sent {
  --bar-fill: linear-gradient(135deg, #38bdf8 0%, #c555ec 100%);
  background: rgba(56, 189, 248, 0.14);
  box-shadow: 0 10px 28px rgba(79, 172, 254, 0.25);
}
.status-approval {
  --bar-fill: linear-gradient(135deg, #c555ec 0%, #8b5cf6 52%, #4facfe 100%);
  background: rgba(139, 92, 246, 0.16);
  box-shadow: 0 10px 28px rgba(139, 92, 246, 0.32);
}
.status-delayed {
  --bar-fill: linear-gradient(135deg, #ff5c8a 0%, #c555ec 100%);
  background: rgba(255, 92, 138, 0.16);
  box-shadow: 0 10px 28px rgba(197, 85, 236, 0.32);
  animation: pulse-danger 2s infinite alternate;
}
.status-scheduled {
  --bar-fill: linear-gradient(135deg, #38d5ff 0%, #4facfe 100%);
  background: rgba(148, 163, 184, 0.22);
  color: #f8fafc;
}
.status-revision {
  --bar-fill: var(--accent);
  background: rgba(124, 92, 255, 0.16);
  box-shadow: 0 0 10px rgba(124, 92, 255, 0.3);
}
.status-approved {
  --bar-fill: linear-gradient(135deg, #00d9ff 0%, #10b981 100%);
  background: rgba(16, 185, 129, 0.12);
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.26);
}
.status-closed {
  --bar-fill: linear-gradient(135deg, #10b981 0%, #0f766e 100%);
  background: rgba(15, 118, 110, 0.16);
  box-shadow: 0 10px 28px rgba(15, 118, 110, 0.2);
}

@keyframes pulse-danger {
  0% { box-shadow: 0 0 6px rgba(239, 68, 68, 0.3); }
  100% { box-shadow: 0 0 16px rgba(239, 68, 68, 0.7); }
}

/* Badges */
.badge {
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge.ok {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.2);
}
.badge.warn {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.2);
}
.badge.danger {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.2);
}
.badge.info {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.2);
}
.badge.accent {
  background: rgba(197, 85, 236, 0.12);
  color: #e879f9;
  border-color: rgba(197, 85, 236, 0.2);
}

/* Delivery Hub & Document Hub Elements */
.kanban {
  display: grid;
  gap: 16px;
}
.delivery-board {
  grid-template-columns: repeat(4, minmax(200px, 1fr));
}
.kanban-column {
  min-height: 300px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.kanban-column h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  color: #fff;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.delivery-card, .risk-card, .scope-card, .client-card {
  background: rgba(31, 41, 55, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.delivery-card:hover, .risk-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-neon);
}

.client-card.active {
  border-color: var(--brand);
  box-shadow: var(--shadow-neon);
  background: rgba(0, 242, 254, 0.02);
}

.clients-workspace {
  display: grid;
  gap: 18px;
}

.clients-head {
  margin-bottom: 0;
}

.client-overview-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.25fr) repeat(auto-fit, minmax(150px, 0.5fr));
  gap: 14px;
  align-items: stretch;
}

.client-profile-card,
.client-stat-card,
.client-detail-panel {
  border: 1px solid rgba(0, 242, 254, 0.14);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(0, 242, 254, 0.06), rgba(124, 92, 255, 0.045)),
    var(--surface);
  box-shadow: var(--shadow);
}

.client-profile-card {
  min-height: 104px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.client-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--brand-gradient);
  color: #06111f;
  font-weight: 900;
  font-size: 24px;
  box-shadow: 0 12px 28px rgba(0, 242, 254, 0.22);
}

.client-profile-card h3 {
  margin: 2px 0;
  font-size: 20px;
  line-height: 1.35;
}

.client-stat-card {
  min-height: 104px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.client-stat-card small,
.client-card-meta small,
.client-detail-list span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.client-stat-card strong {
  display: block;
  font-size: 26px;
  line-height: 1;
  color: var(--ink);
}

.client-management-layout {
  display: block;
}

.client-main-area {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.client-grid.professional {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  gap: 14px;
  align-items: stretch;
}

.client-card.professional {
  min-width: 0;
  height: 100%;
  margin-bottom: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), rgba(0, 242, 254, 0.035)),
    rgba(15, 23, 42, 0.58);
}

.client-card.professional .item-head {
  align-items: flex-start;
}

.client-card.professional h3,
.client-card.professional p,
.client-contact-row span {
  overflow-wrap: anywhere;
}

.client-card.professional:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 242, 254, 0.24);
}

.client-card-progress,
.table-progress {
  height: 8px;
  background: rgba(148, 163, 184, 0.16);
  border-radius: 99px;
  overflow: hidden;
}

.client-card-progress {
  margin: 14px 0;
}

.client-card-progress span,
.table-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #00f2fe, #4facfe 52%, #c555ec);
  border-radius: inherit;
  box-shadow: 0 0 18px rgba(0, 242, 254, 0.24);
}

.client-card-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.client-card-meta div,
.client-detail-list div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-hover);
}

.client-card-meta strong,
.client-detail-list strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.client-contact-row {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.projects-table-panel {
  padding: 0;
  overflow: hidden;
}

.projects-table-panel .panel-title {
  padding: 18px 20px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.professional-table {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.professional-table table {
  min-width: 980px;
}

.professional-table th {
  background: rgba(0, 242, 254, 0.055);
}

.professional-table td {
  vertical-align: middle;
}

.table-progress {
  width: 120px;
  margin-bottom: 6px;
}

.client-detail-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.client-actions-grid-modal {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.client-actions-modal {
  width: min(820px, 100%);
}

.client-action-tile {
  min-height: 176px;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(0, 242, 254, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(0, 242, 254, 0.06), rgba(124, 92, 255, 0.04)),
    var(--surface);
  color: var(--ink);
  text-align: start;
}

.client-action-tile:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: 0 18px 40px rgba(0, 242, 254, 0.12);
}

.client-action-tile strong {
  color: var(--ink);
  font-size: 16px;
}

.client-action-tile small {
  color: var(--muted);
  line-height: 1.8;
}

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

.detail-modal > .panel {
  box-shadow: none;
  background: transparent;
  border-color: rgba(0, 242, 254, 0.12);
}

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

.activities-workspace {
  display: grid;
  gap: 16px;
}

.activities-head {
  margin-bottom: 0;
}

.activity-command-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 0.7fr)) minmax(260px, 1.1fr);
  gap: 12px;
}

.activity-insight-card {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(0, 242, 254, 0.14);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(0, 242, 254, 0.055), rgba(124, 92, 255, 0.04)),
    var(--surface);
  box-shadow: 0 14px 32px rgba(2, 6, 23, 0.16);
}

.activity-insight-card.next {
  align-items: flex-start;
}

.activity-insight-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.activity-insight-card strong {
  display: block;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.15;
}

.activity-insight-card p {
  margin-top: 4px;
  line-height: 1.55;
}

.activities-table-panel {
  max-width: 1180px;
  width: 100%;
  justify-self: center;
  padding: 0;
  overflow: hidden;
}

.activities-table-panel .panel-title {
  padding: 18px 20px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.activity-view-toggle {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-hover);
}

.activity-view-toggle button,
.activity-pagination button {
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.activity-view-toggle button.active,
.activity-pagination button.active {
  color: #061625;
  background: linear-gradient(135deg, #00f2fe, #4facfe);
  box-shadow: 0 10px 24px rgba(0, 180, 216, 0.22);
}

.activity-control-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(160px, 0.45fr) minmax(220px, 0.65fr) auto;
  gap: 12px;
  align-items: end;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.activity-control-bar .field {
  margin: 0;
}

.activity-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}

.activity-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 20px 8px;
}

.activity-operating-card {
  display: grid;
  gap: 11px;
  min-height: 250px;
  padding: 16px;
  border: 1px solid rgba(0, 242, 254, 0.14);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(0, 242, 254, 0.045), rgba(124, 92, 255, 0.045)),
    var(--surface);
  box-shadow: 0 14px 32px rgba(2, 6, 23, 0.12);
}

.activity-card-topline,
.activity-card-title,
.activity-card-progress,
.activity-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.activity-card-title {
  align-items: flex-start;
}

.activity-card-title h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

.activity-card-progress .progress-line {
  flex: 1;
}

.activity-card-progress strong {
  min-width: 42px;
  text-align: end;
}

.activity-card-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.activity-card-meta div {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-hover);
}

.activity-card-meta span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 3px;
}

.activity-card-meta strong {
  font-size: 12px;
  line-height: 1.4;
}

.activity-more-menu {
  position: relative;
}

.activity-more-menu summary {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  font-weight: 800;
}

.activity-more-menu summary::-webkit-details-marker {
  display: none;
}

.activity-more-menu div {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 150px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.activity-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 20px 20px;
}

.activity-pagination div {
  display: inline-flex;
  gap: 5px;
}

.activity-pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.compact-filter select {
  min-width: 170px;
}

.activities-table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.activities-table-wrap table {
  min-width: 960px;
}

.activities-table-wrap th {
  background: rgba(0, 242, 254, 0.055);
}

.activities-table-wrap td {
  vertical-align: top;
}

/* Tables */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
  background: var(--surface);
}
th, td {
  padding: 14px 16px;
  text-align: right;
  border-bottom: 1px solid var(--line);
}
th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.progress-line {
  height: 6px;
  width: 80px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  overflow: hidden;
}
.progress-line span {
  display: block;
  height: 100%;
  background: var(--brand-gradient);
  box-shadow: var(--shadow-neon);
}

/* Activity Comments Chat Panel */
.comments-chat-hub {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.chat-bubble {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.5;
}
.chat-bubble.admin-comment {
  border-right: 3px solid var(--accent);
  background: rgba(124, 92, 255, 0.04);
}
.chat-bubble.client-comment {
  border-right: 3px solid var(--brand);
  background: rgba(0, 242, 254, 0.04);
}

.activity-files-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-hover);
}

.activity-file-list {
  display: grid;
  gap: 10px;
}

.activity-file-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.activity-file-card strong,
.file-item h3 {
  display: block;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.activity-file-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.activity-file-card a {
  display: inline-block;
  max-width: 100%;
  color: var(--brand);
  font-size: 11px;
  margin-top: 4px;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-decoration: none;
}

.activity-file-card a:hover {
  text-decoration: underline;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.activity-file-form {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.modal-file-manager {
  margin-top: 18px;
  background: rgba(0, 242, 254, 0.045);
}

.modal-file-manager .panel-title {
  align-items: center;
}

.modal-file-manager .empty {
  margin: 0;
}

.access-checklist {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.access-checklist strong {
  font-size: 13px;
}

.access-checklist label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.access-checklist input {
  width: 16px;
  height: 16px;
}

.user-access-modal {
  width: min(880px, 100%);
}

.generated-credentials {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(0, 242, 254, 0.18);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.07), rgba(124, 92, 255, 0.06));
}

.role-help-panel {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.08), rgba(124, 92, 255, 0.07));
  color: var(--ink);
  line-height: 1.8;
}

.role-help-panel strong {
  color: var(--ink);
  font-size: 14px;
}

.role-help-panel span {
  color: var(--muted);
  font-size: 13px;
}

.role-help-panel b {
  color: var(--ink);
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 12px;
}

.file-open-link {
  text-decoration: none;
  white-space: nowrap;
}

/* Drawer with Glassmorphism Slider */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2200;
  animation: fade-in 0.3s ease;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(480px, calc(100vw - 28px));
  height: 100dvh;
  background: rgba(13, 18, 33, 0.95);
  border-left: 1px solid var(--border);
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: -18px 0 55px rgba(0, 0, 0, 0.5);
  animation: slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-head {
  position: sticky;
  top: -24px;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: -24px -24px 18px;
  padding: 22px 24px 16px;
  background: inherit;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
  margin: 4px 0 0;
  color: #f8fafc;
  -webkit-text-fill-color: currentColor;
  background: none;
  font-size: 22px;
  line-height: 1.45;
}

.drawer-head .eyebrow {
  margin: 0;
}

.drawer-tabs {
  position: sticky;
  top: 76px;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: -4px 0 14px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(10, 18, 36, 0.98);
}

.drawer-tabs button {
  min-height: 38px;
  border-radius: 8px;
  padding: 7px 8px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  font-size: 12px;
}

.drawer-tabs button.active {
  color: #00111f;
  background: var(--brand-gradient);
  border-color: rgba(0, 242, 254, 0.4);
}

.drawer-tabs svg {
  width: 14px;
  height: 14px;
}

.drawer-tab-summary .drawer-files-section,
.drawer-tab-summary .drawer-comments-section {
  display: none;
}

.drawer-tab-files .drawer-body > :not(.drawer-files-section),
.drawer-tab-comments .drawer-body > :not(.drawer-comments-section),
.drawer-tab-approval .drawer-body > :not(.drawer-approval-section) {
  display: none !important;
}

.drawer-tab-approval .drawer-approval-section {
  display: flex;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slide-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* Inputs & Form Elements */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

input, select, textarea {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: #fff;
  padding: 10px 14px;
  transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 8px rgba(0, 242, 254, 0.2);
}

/* Stepper Map */
.stepper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.step-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.step-dot {
  width: 28px;
  height: 28px;
  background: var(--brand-gradient);
  color: #0b0f19;
  font-weight: 800;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
}

/* Notification Toasts */
.toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: rgba(13, 18, 33, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--brand);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius);
  z-index: 99;
  box-shadow: var(--shadow-neon);
  animation: slide-up-fade 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
}

@keyframes slide-up-fade {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Audit Log Panel in Admin View */
.security-audit-ledger {
  background: var(--surface);
  padding: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  max-height: 340px;
  overflow: auto;
  color: var(--ink);
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.audit-table th,
.audit-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.55;
}

.audit-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-solid);
  color: var(--muted);
  font-weight: 800;
}

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

.audit-table tr:hover td {
  background: var(--surface-hover);
}

.ledger-tag {
  color: var(--brand);
  font-weight: 700;
}

.ledger-hash {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
}

/* ====== LIGHT THEME ====== */
[data-theme-mode="light"] {
  --bg: #f0f2f5;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-solid: #ffffff;
  --surface-hover: rgba(0, 0, 0, 0.04);
  --border: rgba(0, 0, 0, 0.1);
  --border-neon: rgba(0, 180, 200, 0.3);
  --border-neon-purple: rgba(150, 50, 200, 0.25);
  --ink: #1e293b;
  --muted: #64748b;
  --line: rgba(0, 0, 0, 0.06);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-neon: 0 0 16px rgba(0, 180, 200, 0.12);
  --shadow-neon-purple: 0 0 16px rgba(150, 50, 200, 0.12);
  color-scheme: light;
}
[data-theme-mode="light"] body,
[data-theme-mode="light"] {
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(0, 180, 200, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(150, 50, 200, 0.04) 0%, transparent 40%);
}
[data-theme-mode="light"] .sidebar {
  background: rgba(255, 255, 255, 0.92);
  border-left-color: rgba(0,0,0,0.08);
  color: #1e293b;
}
[data-theme-mode="light"] .sidebar-note { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.1); }
[data-theme-mode="light"] .timeline {
  background:
    linear-gradient(135deg, rgba(0, 242, 254, 0.15), rgba(124, 92, 255, 0.12)),
    #f8fbff;
  border-color: rgba(0, 180, 216, 0.28);
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}
[data-theme-mode="light"] .gantt-label {
  background: #ffffff;
  color: #172033;
}
[data-theme-mode="light"] .gantt-head {
  background: #eef8ff;
  color: #1d3557;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.14);
}
[data-theme-mode="light"] .gantt-label.gantt-head {
  background: #eef8ff;
}
[data-theme-mode="light"] .gantt-cell,
[data-theme-mode="light"] .gantt-label,
[data-theme-mode="light"] .bar-track {
  border-color: rgba(14, 116, 144, 0.12);
}
[data-theme-mode="light"] .bar-track {
  background-color: rgba(255, 255, 255, 0.42);
  background-image: linear-gradient(to left, rgba(0, 180, 216, 0.16) 1px, transparent 1px);
}
[data-theme-mode="light"] .gantt-meta .muted {
  color: #5b6f91 !important;
}

[data-theme-mode="light"] .gantt-bar-tooltip {
  background:
    linear-gradient(135deg, rgba(0, 180, 216, 0.1), rgba(124, 92, 255, 0.075)),
    #ffffff;
  border-color: rgba(0, 180, 216, 0.24);
  color: #172033;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.2);
}

[data-theme-mode="light"] .tooltip-head strong,
[data-theme-mode="light"] .tooltip-dates b {
  color: #172033;
}

[data-theme-mode="light"] .tooltip-head span {
  background: rgba(0, 180, 216, 0.12);
  color: #087996;
}

[data-theme-mode="light"] .tooltip-dates div {
  background: rgba(15, 23, 42, 0.035);
  border-color: rgba(15, 23, 42, 0.08);
}

[data-theme-mode="light"] .tooltip-dates small,
[data-theme-mode="light"] .gantt-bar-tooltip p {
  color: #64748b;
}
[data-theme-mode="light"] .login-screen { background-color: #e8ecf1; }
[data-theme-mode="light"] .login-panel { background: rgba(255,255,255,0.92); border-color: rgba(0,180,200,0.3); }
[data-theme-mode="light"] .security-audit-ledger { background: #ffffff; color: #172033; border-color: rgba(0,0,0,0.1); }
[data-theme-mode="light"] .toast { background: rgba(255,255,255,0.95); color: #1e293b; border-color: var(--brand); }
[data-theme-mode="light"] .drawer { background: rgba(255,255,255,0.97); border-right-color: rgba(0,0,0,0.08); }
[data-theme-mode="light"] .drawer {
  background: #ffffff;
  border-left-color: rgba(15, 23, 42, 0.1);
}
[data-theme-mode="light"] .drawer-head h2 {
  color: #172033;
}
[data-theme-mode="light"] .drawer-tabs {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
}
[data-theme-mode="light"] .progress-ring::before { background: #fff; }
[data-theme-mode="light"] h1 { background: linear-gradient(to left, #1e293b, #334155); -webkit-background-clip: text; }
[data-theme-mode="light"] input, [data-theme-mode="light"] select, [data-theme-mode="light"] textarea {
  background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.12); color: #1e293b;
}
[data-theme-mode="light"] th { background: rgba(0,0,0,0.03); color: #475569; }
[data-theme-mode="light"] tr:hover td { background: rgba(0,0,0,0.02); }
[data-theme-mode="light"] .chat-bubble { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.08); }
[data-theme-mode="light"] .chat-bubble.admin-comment { background: rgba(124,92,255,0.06); }
[data-theme-mode="light"] .chat-bubble.client-comment { background: rgba(0,180,200,0.06); }
[data-theme-mode="light"] .hero-band { background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(240,245,255,0.9)); }
[data-theme-mode="light"] .metric { background: var(--surface); }
[data-theme-mode="light"] ::-webkit-scrollbar-track { background: #f0f2f5; }
[data-theme-mode="light"] ::-webkit-scrollbar-thumb { background: rgba(0,180,200,0.3); }

/* ====== MODAL OVERLAY ====== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 2147483000;
  isolation: isolate;
  pointer-events: auto;
  transform: translateZ(0);
  animation: fade-in 0.25s ease;
}
.modal-panel {
  width: min(760px, 100%);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  background: #0f172a;
  color: #f8fafc;
  opacity: 1;
  background-clip: padding-box;
  border: 1px solid var(--border-neon-purple);
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: var(--shadow-neon-purple), var(--shadow);
  animation: modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 2147483001;
  isolation: isolate;
  pointer-events: auto;
  transform: translateZ(0);
}

#app:has(.modal-backdrop) .app-shell,
#app:has(.modal-backdrop) .drawer-backdrop,
#app:has(.modal-backdrop) .drawer,
#app:has(.modal-backdrop) .notifications-panel {
  pointer-events: none;
}
.modal-panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 3px;
  background: var(--purple-gradient);
  border-radius: 16px 16px 0 0;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  margin: 0;
  color: inherit;
  -webkit-text-fill-color: currentColor;
  background: none;
  line-height: 1.35;
}
.modal-head .icon-btn {
  flex: 0 0 42px;
  position: relative;
  z-index: 2;
}
@keyframes modal-pop {
  from { transform: scale(0.92) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* ====== TOOLBAR TOGGLES ====== */
.toolbar-toggles {
  display: flex;
  align-items: center;
  gap: 6px;
}
.toggle-pill {
  min-height: 36px;
  padding: 0 14px;
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}
.toggle-pill:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(0,242,254,0.06);
}
.toggle-pill svg { width: 16px; height: 16px; }
[data-theme-mode="light"] .toggle-pill { background: rgba(0,0,0,0.04); }

/* ====== PREMIUM ADMIN ADD ACTIVITY BUTTON ====== */
#openActivityModalBtn,
.activity-add-btn {
  background: var(--purple-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(197, 85, 236, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(197, 85, 236, 0.3);
}
#openActivityModalBtn:hover,
.activity-add-btn:hover {
  box-shadow: 0 6px 20px rgba(197, 85, 236, 0.5);
  transform: translateY(-2px);
  border-color: rgba(197, 85, 236, 0.6);
}
#openActivityModalBtn:active,
.activity-add-btn:active {
  transform: translateY(0);
}

.csv-upload-btn {
  cursor: pointer;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.csv-choice-modal {
  max-width: 760px;
}

.csv-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 12px;
}

.csv-choice-card {
  min-height: 190px;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(0, 242, 254, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(0, 242, 254, 0.07), rgba(124, 92, 255, 0.045)),
    var(--surface);
  color: var(--ink);
  text-align: start;
}

.csv-choice-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: 0 18px 42px rgba(0, 242, 254, 0.12);
}

.csv-choice-card.replace {
  border-color: rgba(245, 158, 11, 0.24);
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(197, 85, 236, 0.045)),
    var(--surface);
}

.csv-choice-card strong {
  color: var(--ink);
  font-size: 17px;
}

.csv-choice-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.project-bundle-modal {
  width: min(1040px, 100%);
}

.modal-section-block {
  padding: 18px;
  border: 1px solid rgba(0, 242, 254, 0.14);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(0, 242, 254, 0.055), rgba(124, 92, 255, 0.04)),
    rgba(15, 23, 42, 0.56);
}

.modal-section-block .panel-title {
  align-items: flex-start;
  margin-bottom: 14px;
}

.modal-section-block h3 {
  margin: 0;
  color: var(--ink);
}

.inline-template-field {
  min-width: min(260px, 100%);
}

.inline-template-field label {
  font-size: 11px;
  color: var(--muted);
}

.modal-action-row {
  justify-content: flex-end;
  padding-top: 4px;
}

/* ====== UX POLISH: COMPACT ADMIN ICONS & MOBILE FRIENDLY CONTROLS ====== */
.primary svg,
.secondary svg,
.danger svg,
.ghost svg,
.toggle-pill svg,
.nav svg,
.icon-btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  filter: none;
}

.compact-metrics {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.ui-card-metric {
  min-height: 88px;
  padding: 14px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.ui-card-metric:hover {
  transform: translateY(-1px);
}

.metric-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--border);
}

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

.metric-icon.info { color: var(--info); }
.metric-icon.warn { color: var(--warn); }
.metric-icon.accent { color: var(--accent); }
.metric-icon.ok { color: var(--ok); }
.metric-icon.urgent,
.metric-icon.danger { color: var(--warn); }

.ui-card-metric p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.ui-card-metric strong {
  display: block;
  margin-top: 2px;
  font-size: 21px;
  line-height: 1.2;
}

.notification-wrap {
  position: relative;
}

.notification-btn {
  position: relative;
}

.notification-dot {
  position: absolute;
  top: -5px;
  left: -5px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border: 2px solid var(--surface-solid);
}

.notifications-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(360px, calc(100vw - 28px));
  z-index: 80;
  padding: 14px;
  background: rgba(15, 23, 42, 0.97);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.notifications-list {
  display: grid;
  gap: 8px;
  max-height: 330px;
  overflow: auto;
}

.notification-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.notification-status {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--info);
}

.notification-item.warn .notification-status {
  background: var(--warn);
}

.notification-item h4,
.notification-item p {
  margin: 0;
}

.notification-item h4 {
  font-size: 13px;
}

.notification-item p,
.notification-item small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.journey-tracker {
  display: grid;
  grid-template-columns: repeat(8, minmax(54px, 1fr));
  gap: 6px;
  margin-top: 10px;
  position: relative;
}

.journey-step {
  display: grid;
  justify-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  min-width: 0;
}

.journey-step span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight: 800;
}

.journey-step.done span {
  background: rgba(16, 185, 129, 0.18);
  color: var(--ok);
  border-color: rgba(16, 185, 129, 0.38);
}

.journey-step.active span {
  color: #0b0f19;
  background: var(--brand);
  border-color: var(--brand);
  animation: pipeline-pulse 1.8s ease-in-out infinite;
}

.journey-step small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes pipeline-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(0, 242, 254, 0); }
  50% { box-shadow: 0 0 18px rgba(0, 242, 254, 0.42); }
}

.sla-inline {
  margin-top: 8px;
}

.sla-countdown {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
}

.sla-countdown strong {
  font-size: 12px;
}

.sla-countdown small {
  color: var(--muted);
}

.sla-countdown.safe {
  color: var(--ok);
  border-color: rgba(16, 185, 129, 0.28);
}

.sla-countdown.warning {
  color: var(--warn);
  border-color: rgba(245, 158, 11, 0.34);
}

.sla-countdown.danger {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.38);
  animation: sla-shake 0.65s ease-in-out infinite alternate;
}

@keyframes sla-shake {
  from { transform: translateX(0); }
  to { transform: translateX(2px); }
}

.approval-meta {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.upload-simulation {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed var(--border-neon);
  background: rgba(0, 242, 254, 0.04);
}

.upload-simulation svg {
  width: 22px;
  height: 22px;
  color: var(--brand);
}

.signature-modal {
  text-align: center;
}

.signature-seal {
  width: 78px;
  height: 78px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.38);
  color: var(--ok);
  animation: seal-pop 0.7s ease both;
}

.signature-seal svg {
  width: 36px;
  height: 36px;
}

@keyframes seal-pop {
  from { transform: scale(0.72); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.certificate-box {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 14px;
  text-align: start;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.certificate-box div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.certificate-box span {
  color: var(--muted);
  font-size: 12px;
}

.certificate-box strong {
  font-size: 12px;
}

.certificate-hash {
  display: grid !important;
  gap: 4px;
}

.certificate-hash strong {
  direction: ltr;
  word-break: break-all;
  color: var(--brand);
}

@media (max-width: 720px) {
  .primary, .secondary, .danger, .ghost {
    min-height: 38px;
    padding: 0 12px;
    font-size: 12px;
  }

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

  .ui-card-metric {
    min-height: 78px;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 9px;
  }

  .metric-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .ui-card-metric strong {
    font-size: 18px;
  }

  .top-actions {
    align-items: stretch;
  }

  .role-guide {
    align-items: stretch;
    flex-direction: column;
    margin-top: -8px;
  }

  .role-guide-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .client-command-center {
    grid-template-columns: 1fr;
  }

  .action-center-head {
    align-items: stretch;
    flex-direction: column;
  }

  .action-center-score {
    width: 100%;
  }

  .action-center-grid {
    grid-template-columns: 1fr;
  }

  .client-overview-grid,
  .client-grid.professional,
  .activity-command-grid,
  .activity-control-bar,
  .activity-card-grid,
  .csv-choice-grid,
  .client-actions-grid-modal {
    grid-template-columns: 1fr;
  }

  .activity-view-toggle,
  .activity-card-actions,
  .activity-results-head,
  .activity-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .activity-card-meta {
    grid-template-columns: 1fr;
  }

  .modal-section-block .panel-title,
  .modal-action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-modal-list {
    grid-template-columns: 1fr;
  }

  .activities-table-panel {
    max-width: 100%;
  }

  .client-profile-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .client-profile-card > .badge {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .client-card-meta {
    grid-template-columns: 1fr;
  }

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

  .drawer-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    top: 66px;
  }

  .client-status-strip,
  .client-action-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .approval-decision-card,
  .approval-workspace,
  .approval-meta-grid {
    grid-template-columns: 1fr;
  }

  .notification-wrap,
  .notification-wrap .icon-btn {
    width: 100%;
  }

  .notifications-panel {
    position: fixed;
    top: 76px;
    left: 14px;
    right: 14px;
    width: auto;
  }

  .journey-tracker {
    grid-template-columns: repeat(4, minmax(44px, 1fr));
    gap: 4px;
  }

  .journey-step small {
    font-size: 9px;
  }
}

/* ====== FINAL HARDENING: ICON SCALE + LIGHT THEME CONTRAST ====== */
#app svg {
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
  flex: 0 0 18px;
  display: inline-block;
  vertical-align: middle;
  stroke-width: 2;
  filter: none;
}

#app .nav svg,
#app .primary svg,
#app .secondary svg,
#app .danger svg,
#app .ghost svg,
#app .toggle-pill svg,
#app .icon-btn svg {
  width: 16px;
  height: 16px;
  max-width: 16px;
  max-height: 16px;
  flex-basis: 16px;
}

#app .sidebar-note svg,
#app .security-badge-hud svg,
#app .alert svg,
#app .metric-icon svg {
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
}

#app .upload-simulation svg {
  width: 22px;
  height: 22px;
  max-width: 22px;
  max-height: 22px;
}

#app .signature-seal svg {
  width: 36px;
  height: 36px;
  max-width: 36px;
  max-height: 36px;
}

#app .login-panel > div[style*="font-size:42px"] svg {
  width: 34px;
  height: 34px;
  max-width: 34px;
  max-height: 34px;
}

#app .sidebar-note {
  display: block;
  font-size: 11px;
}

#app .sidebar-note > svg {
  float: inline-start;
  margin-inline-end: 8px;
  margin-top: 2px;
}

[data-theme-mode="light"] {
  --ink: #172033;
  --muted: #5f6f86;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --surface-hover: rgba(15, 23, 42, 0.045);
  --border: rgba(15, 23, 42, 0.12);
  --line: rgba(15, 23, 42, 0.08);
}

[data-theme-mode="light"] body,
[data-theme-mode="light"] #app,
[data-theme-mode="light"] .main,
[data-theme-mode="light"] .panel,
[data-theme-mode="light"] .metric,
[data-theme-mode="light"] .drawer,
[data-theme-mode="light"] .modal-panel,
[data-theme-mode="light"] .kanban-column,
[data-theme-mode="light"] .delivery-card,
[data-theme-mode="light"] .risk-card,
[data-theme-mode="light"] .scope-card,
[data-theme-mode="light"] .client-card,
[data-theme-mode="light"] .file-item,
[data-theme-mode="light"] .update-item {
  color: var(--ink);
}

[data-theme-mode="light"] .modal-backdrop {
  background: rgba(15, 23, 42, 0.72);
}

[data-theme-mode="light"] .modal-panel {
  background: #ffffff !important;
  color: #172033 !important;
  border-color: rgba(124, 92, 255, 0.32);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.32), 0 0 0 1px rgba(124, 92, 255, 0.08);
}

[data-theme-mode="light"] .modal-head h2,
[data-theme-mode="light"] .modal-panel h2,
[data-theme-mode="light"] .modal-panel h3,
[data-theme-mode="light"] .modal-panel strong,
[data-theme-mode="light"] .modal-panel label {
  color: #172033 !important;
  -webkit-text-fill-color: currentColor !important;
}

[data-theme-mode="light"] h1,
[data-theme-mode="light"] h2,
[data-theme-mode="light"] h3,
[data-theme-mode="light"] h4,
[data-theme-mode="light"] strong,
[data-theme-mode="light"] td,
[data-theme-mode="light"] label,
[data-theme-mode="light"] .panel-title h2,
[data-theme-mode="light"] .panel-title h3,
[data-theme-mode="light"] .ui-card-metric strong,
[data-theme-mode="light"] .metric strong,
[data-theme-mode="light"] .item-head h3,
[data-theme-mode="light"] .delivery-card h3,
[data-theme-mode="light"] .risk-card h3,
[data-theme-mode="light"] .scope-card h3 {
  color: var(--ink) !important;
  -webkit-text-fill-color: currentColor;
}

[data-theme-mode="light"] .muted,
[data-theme-mode="light"] .small,
[data-theme-mode="light"] .eyebrow,
[data-theme-mode="light"] .notification-item p,
[data-theme-mode="light"] .notification-item small,
[data-theme-mode="light"] .journey-step,
[data-theme-mode="light"] .sla-countdown small {
  color: var(--muted) !important;
}

[data-theme-mode="light"] .hero-band {
  color: var(--ink);
  border-color: rgba(15, 23, 42, 0.1);
  background:
    linear-gradient(120deg, rgba(0, 180, 216, 0.16), rgba(124, 92, 255, 0.1) 46%, rgba(255, 255, 255, 0.92)),
    #ffffff;
}

[data-theme-mode="light"] .hero-band .muted,
[data-theme-mode="light"] .hero-band .eyebrow {
  color: var(--muted) !important;
}

[data-theme-mode="light"] .unified-action-center {
  background:
    radial-gradient(circle at 90% 0%, rgba(0, 180, 216, 0.14), transparent 28%),
    linear-gradient(135deg, #ffffff, #eef8ff);
  border-color: rgba(0, 180, 216, 0.2);
}

[data-theme-mode="light"] .action-center-card {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme-mode="light"] .hero-band [style*="color:#fff"],
[data-theme-mode="light"] [style*="color:#fff"],
[data-theme-mode="light"] [style*="color: #fff"],
[data-theme-mode="light"] [style*="color:#ffffff"],
[data-theme-mode="light"] [style*="color: #ffffff"] {
  color: var(--ink) !important;
}

[data-theme-mode="light"] .primary {
  color: #06202c !important;
}

[data-theme-mode="light"] .primary *,
[data-theme-mode="light"] .primary svg {
  color: #06202c !important;
  stroke: currentColor;
}

[data-theme-mode="light"] .secondary,
[data-theme-mode="light"] .ghost,
[data-theme-mode="light"] .icon-btn,
[data-theme-mode="light"] .toggle-pill {
  color: var(--ink);
}

[data-theme-mode="light"] .topbar {
  background:
    linear-gradient(135deg, rgba(0, 180, 216, 0.08), rgba(124, 92, 255, 0.06)),
    rgba(255, 255, 255, 0.84);
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

[data-theme-mode="light"] .role-guide {
  background:
    linear-gradient(135deg, rgba(0, 180, 216, 0.09), rgba(124, 92, 255, 0.055)),
    rgba(255, 255, 255, 0.88);
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

[data-theme-mode="light"] .role-guide strong,
[data-theme-mode="light"] .role-guide-actions button {
  color: var(--ink);
}

[data-theme-mode="light"] .role-guide-actions button {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme-mode="light"] .role-guide-actions button:hover,
[data-theme-mode="light"] .role-guide-actions button.active {
  color: #06202c;
  border-color: transparent;
}

[data-theme-mode="light"] .client-profile-card,
[data-theme-mode="light"] .client-stat-card,
[data-theme-mode="light"] .client-detail-panel,
[data-theme-mode="light"] .client-card.professional {
  background:
    linear-gradient(135deg, rgba(0, 180, 216, 0.08), rgba(124, 92, 255, 0.045)),
    rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme-mode="light"] .client-card-meta div,
[data-theme-mode="light"] .client-detail-list div,
[data-theme-mode="light"] .professional-table th,
[data-theme-mode="light"] .activities-table-wrap th {
  background: rgba(15, 23, 42, 0.035);
}

[data-theme-mode="light"] .activity-insight-card {
  background:
    linear-gradient(135deg, rgba(0, 180, 216, 0.08), rgba(124, 92, 255, 0.045)),
    rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme-mode="light"] .client-action-tile {
  background:
    linear-gradient(135deg, rgba(0, 180, 216, 0.08), rgba(124, 92, 255, 0.045)),
    rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme-mode="light"] .modal-section-block {
  background:
    linear-gradient(135deg, rgba(0, 180, 216, 0.08), rgba(124, 92, 255, 0.045)),
    rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme-mode="light"] .quick-actions-menu {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
}

[data-theme-mode="light"] .quick-actions-menu button {
  color: var(--ink);
}

[data-theme-mode="light"] .quick-actions-menu button:hover {
  background: rgba(0, 180, 216, 0.08);
  border-color: rgba(0, 180, 216, 0.16);
}

[data-theme-mode="light"] .sidebar .brand strong {
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  background: none;
}

[data-theme-mode="light"] .sidebar-note,
[data-theme-mode="light"] .security-badge-hud,
[data-theme-mode="light"] .notifications-panel,
[data-theme-mode="light"] .notification-item,
[data-theme-mode="light"] .certificate-box,
[data-theme-mode="light"] .upload-simulation {
  background: rgba(15, 23, 42, 0.035);
  border-color: rgba(15, 23, 42, 0.12);
  color: var(--ink);
}

[data-theme-mode="light"] .progress-ring strong {
  color: var(--ink) !important;
}

[data-theme-mode="light"] .bar,
[data-theme-mode="light"] .badge.ok,
[data-theme-mode="light"] .badge.warn,
[data-theme-mode="light"] .badge.danger,
[data-theme-mode="light"] .badge.info,
[data-theme-mode="light"] .badge.accent {
  -webkit-text-fill-color: currentColor;
}

[data-theme-mode="light"] .chat-bubble [style*="color:#fff"],
[data-theme-mode="light"] .risk-card [style*="color:#fff"] {
  color: var(--ink) !important;
}

/* FINAL NAV CONTRAST LOCK: keeps sidebar readable in light mode. */
[data-theme-mode="light"] .sidebar .nav button,
[data-theme-mode="light"] .sidebar .nav button *,
[data-theme-mode="light"] .sidebar .nav button svg {
  color: #64748b !important;
  stroke: currentColor !important;
  -webkit-text-fill-color: currentColor !important;
}

[data-theme-mode="light"] .sidebar .nav button:hover,
[data-theme-mode="light"] .sidebar .nav button:hover *,
[data-theme-mode="light"] .sidebar .nav button.active,
[data-theme-mode="light"] .sidebar .nav button.active * {
  color: #172033 !important;
  stroke: currentColor !important;
  -webkit-text-fill-color: currentColor !important;
}

[data-theme-mode="light"] .sidebar .nav button:hover {
  background: rgba(22, 119, 242, 0.07) !important;
  border-color: rgba(22, 119, 242, 0.16) !important;
  box-shadow: none !important;
}

[data-theme-mode="light"] .sidebar .nav button.active {
  background: rgba(22, 119, 242, 0.1) !important;
  border-color: rgba(22, 119, 242, 0.24) !important;
  box-shadow: inset 3px 0 0 rgba(22, 119, 242, 0.75) !important;
}

[data-theme-mode="light"] .sidebar[data-theme="admin"] .nav button.active {
  background: rgba(124, 92, 255, 0.12) !important;
  border-color: rgba(124, 92, 255, 0.28) !important;
  box-shadow: inset 3px 0 0 rgba(124, 92, 255, 0.85) !important;
}

[data-theme-mode="light"] .role-switch button,
[data-theme-mode="light"] .role-switch button * {
  color: #475569 !important;
  -webkit-text-fill-color: currentColor !important;
}

[data-theme-mode="light"] .role-switch button.active,
[data-theme-mode="light"] .role-switch button.active * {
  color: #ffffff !important;
  -webkit-text-fill-color: currentColor !important;
}

[data-theme-mode="light"] .session-role-badge {
  color: #0f4c5c !important;
  border-color: rgba(0, 180, 216, 0.28);
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.16), rgba(79, 172, 254, 0.1));
  -webkit-text-fill-color: currentColor !important;
}

[data-theme-mode="light"] .session-role-badge.admin {
  color: #4c1d95 !important;
  border-color: rgba(124, 92, 255, 0.28);
  background: linear-gradient(135deg, rgba(197, 85, 236, 0.14), rgba(124, 92, 255, 0.1));
}

[data-theme-mode="light"] .session-role-badge.manager {
  color: #075985 !important;
  border-color: rgba(79, 172, 254, 0.28);
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.14), rgba(0, 242, 254, 0.1));
}

/* FINAL ICON SIZE LOCK: prevents oversized SVGs from inline icon markup. */
#app .sidebar svg,
#app .sidebar .nav svg,
#app .sidebar-note svg,
#app .security-badge-hud svg {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  flex: 0 0 18px !important;
  transform: none !important;
}

#app .sidebar-note svg,
#app .security-badge-hud svg {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  flex-basis: 20px !important;
}

/* FINAL NOTIFICATIONS LOCK: dropdown must read as one isolated UI layer. */
#app .topbar {
  position: relative;
  z-index: 120;
}

#app .notification-wrap {
  position: relative;
  z-index: 130;
}

#app .notifications-panel {
  position: absolute !important;
  top: calc(100% + 12px) !important;
  inset-inline-end: 0 !important;
  inset-inline-start: auto !important;
  width: min(360px, calc(100vw - 32px)) !important;
  max-height: min(520px, calc(100vh - 116px));
  z-index: 999 !important;
  overflow: hidden;
  background: #0f172a !important;
  color: #f8fafc !important;
  border: 1px solid rgba(148, 163, 184, 0.26) !important;
  border-radius: 16px !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  isolation: isolate;
}

#app .notifications-panel .panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

#app .notifications-panel .panel-title h3 {
  margin: 0;
  color: inherit !important;
  -webkit-text-fill-color: currentColor !important;
  font-size: 16px;
  line-height: 1.35;
}

#app .notifications-list {
  max-height: min(410px, calc(100vh - 220px)) !important;
  overflow: auto;
  padding-inline-end: 4px;
}

#app .notification-item {
  background: #111827 !important;
  color: #f8fafc !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
  box-shadow: none !important;
}

#app .notification-item h4 {
  color: #f8fafc !important;
  -webkit-text-fill-color: currentColor !important;
  line-height: 1.45;
}

#app .notification-item p,
#app .notification-item small {
  color: #94a3b8 !important;
}

[data-theme-mode="light"] #app .notifications-panel {
  background: #ffffff !important;
  color: #172033 !important;
  border-color: rgba(15, 23, 42, 0.14) !important;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2) !important;
}

[data-theme-mode="light"] #app .notifications-panel .panel-title {
  border-bottom-color: rgba(15, 23, 42, 0.1);
}

[data-theme-mode="light"] #app .notification-item {
  background: #f8fafc !important;
  color: #172033 !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
}

[data-theme-mode="light"] #app .notification-item h4 {
  color: #172033 !important;
}

[data-theme-mode="light"] #app .notification-item p,
[data-theme-mode="light"] #app .notification-item small {
  color: #64748b !important;
}

@media (max-width: 720px) {
  #app .notifications-panel {
    position: fixed !important;
    top: 92px !important;
    inset-inline: 14px !important;
    width: auto !important;
    max-height: calc(100vh - 112px);
  }

  #app .drawer {
    right: 0;
    left: auto;
    width: min(420px, 100vw);
    padding: 18px;
  }

  #app .drawer-head {
    top: -18px;
    margin: -18px -18px 16px;
    padding: 18px 18px 14px;
  }

  #app .drawer-head h2 {
    font-size: 18px;
  }

  #app .activity-file-card {
    grid-template-columns: 1fr;
  }

  #app .file-actions {
    justify-content: stretch;
  }

  #app .file-actions button,
  #app .activity-file-card .file-open-link {
    width: 100%;
  }
}
