.nav-brand-name {
  color: #1e293b !important;
  font-weight: 850 !important;
  letter-spacing: -0.6px !important;
  font-family: 'Outfit', sans-serif;
}

.nav-brand-name span {
  color: #3b82f6 !important;
}

/* ─── Reset & Tokens ─────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #fdfdff;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-2: #f4f7fe;
  --border: rgba(0, 0, 0, 0.05);
  --border-focus: #6366f1;

  --blue-50: #eef2ff;
  --blue-100: #e0e7ff;
  --blue-500: #6366f1;
  --blue-600: #4f46e5;
  --blue-700: #4338ca;

  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-500: #10b981;
  --green-700: #15803d;

  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;

  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;

  --violet-50: #faf5ff;
  --violet-100: #f3e8ff;
  --violet-500: #8b5cf6;
  --violet-600: #7c3aed;
  --violet-700: #6d28d9;

  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 12px 20px -8px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 35px 60px -15px rgba(0, 0, 0, 0.15);

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  --font: 'Inter', 'Outfit', sans-serif;
  --transition: 200ms cubic-bezier(.4, 0, .2, 1);

  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --p3-accent: #6366f1;

  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-200: #a7f3d0;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;

  /* Navbar height for desktop (mobile overrides to 64px in media query) */
  --nav-h: 68px;
}

/* ─── 3D Model Loader ─────────────────────────────── */
.p3-loader-ring {
  width: 40px;
  height: 40px;
  border: 3px solid var(--blue-100);
  border-radius: 50%;
  border-top-color: var(--p3-accent);
  animation: p3-spin 1s ease-in-out infinite;
}

@keyframes p3-spin {
  to {
    transform: rotate(360deg);
  }
}

.p3-model-wrapper model-viewer[loading="lazy"]+[slot="progress-bar"],
.p3-model-wrapper model-viewer:not(.hydrated) [slot="progress-bar"] {
  display: flex !important;
}

.p3-model-wrapper model-viewer.hydrated [slot="progress-bar"] {
  display: none !important;
}


html {
  font-family: var(--font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

body {
  background: #f8fafc !important;
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
}

h1 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -.5px;
}

h2 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -.3px;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
}

p {
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

/* ═══════════ LOGIN — SPLIT SCREEN ═══════════ */
#login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: stretch;
  background: #050b1a;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ── Left branding panel ── */
.login-left {
  flex: 0 0 45%;
  background: linear-gradient(145deg, #0f1729 0%, #1a1060 40%, #2d1b7e 70%, #1e0a5c 100%);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 4rem 3.5rem;
  overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 500px at 30% 20%, rgba(99, 102, 241, 0.35) 0%, transparent 60%),
    radial-gradient(ellipse 500px 400px at 80% 80%, rgba(168, 85, 247, 0.3) 0%, transparent 60%),
    radial-gradient(ellipse 300px 300px at 60% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 60%);
  animation: loginGlowPulse 8s ease-in-out infinite alternate;
}

@keyframes loginGlowPulse {
  0% {
    opacity: 0.7;
    transform: scale(1);
  }

  100% {
    opacity: 1;
    transform: scale(1.06);
  }
}

/* Floating orbs */
.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.25;
  animation: floatOrb 12s ease-in-out infinite alternate;
}

.login-orb-1 {
  width: 280px;
  height: 280px;
  background: #6366f1;
  top: -80px;
  right: -60px;
  animation-delay: 0s;
}

.login-orb-2 {
  width: 200px;
  height: 200px;
  background: #a855f7;
  bottom: 60px;
  left: -40px;
  animation-delay: -4s;
}

.login-orb-3 {
  width: 150px;
  height: 150px;
  background: #3b82f6;
  top: 55%;
  right: 10%;
  animation-delay: -2s;
}

@keyframes floatOrb {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.1;
  }

  50% {
    transform: translateY(-30px) rotate(10deg);
    opacity: 0.2;
  }
}

@keyframes alFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Grid dots decoration */
.login-left::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.login-brand {
  position: relative;
  z-index: 2;
  margin-bottom: 3rem;
}

.login-brand-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(168, 85, 247, 0.9));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.login-brand-icon svg {
  width: 28px;
  height: 28px;
  stroke: white;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-brand-name {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 0.4rem;
}

.login-brand-name span {
  background: linear-gradient(90deg, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-tagline {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 400;
  letter-spacing: 0.2px;
}

.login-features {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: featureSlideIn 0.6s ease both;
}

.login-feature:nth-child(1) {
  animation-delay: 0.1s;
}

.login-feature:nth-child(2) {
  animation-delay: 0.2s;
}

.login-feature:nth-child(3) {
  animation-delay: 0.3s;
}

.login-feature:nth-child(4) {
  animation-delay: 0.4s;
}

@keyframes featureSlideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.login-feature-icon {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}

.login-feature-icon svg {
  width: 17px;
  height: 17px;
  stroke: #a5b4fc;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-feature-text strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.1rem;
}

.login-feature-text span {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
}

.login-left-footer {
  position: absolute;
  bottom: 2rem;
  left: 3.5rem;
  z-index: 2;
  font-size: 0.73rem;
  color: rgba(255, 255, 255, 0.28);
}

/* ── Right form panel ── */
.login-right {
  flex: 1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  position: relative;
}

/* Removed vertical line */

.login-form-wrap {
  width: 100%;
  max-width: 380px;
  animation: formFadeIn 0.5s ease 0.15s both;
}

@keyframes formFadeIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-form-header {
  margin-bottom: 2.25rem;
}

.login-form-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--blue-500);
  margin-bottom: 1rem;
  border: none !important;
  background: none !important;
  box-shadow: none !important;
}

.login-form-eyebrow span {
  width: 6px;
  height: 6px;
  background: var(--blue-500);
  border-radius: 50%;
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

.login-form-header h2 {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 0.4rem;
}

.login-form-header p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* New input styling for login */
.login-input-group {
  margin-bottom: 1.25rem;
}

.login-input-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

.login-input-wrap {
  position: relative;
}

.login-input-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color 200ms ease;
}

.login-input-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-input {
  width: 100%;
  height: 48px;
  padding: 0 1rem 0 2.6rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text-primary);
  background: #fafafa;
  transition: all 200ms ease;
  outline: none;
}

.login-input:focus {
  border-color: var(--blue-500);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.login-input:focus+.login-input-icon,
.login-input-wrap:focus-within .login-input-icon {
  color: var(--blue-500);
}

.login-input::placeholder {
  color: #c0c7d4;
}

.login-pw-toggle {
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: #9ca3af;
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: color 200ms ease;
}

.login-pw-toggle:hover {
  color: var(--blue-500);
}

.login-pw-toggle svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.login-pw-input {
  padding-right: 2.8rem;
}

.login-form-footer-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 0.35rem;
}

.login-forgot {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--blue-600);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font);
  transition: color 200ms ease;
}

.login-forgot:hover {
  color: var(--blue-700);
  text-decoration: underline;
}

.login-submit-btn {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  margin-top: 1.75rem;
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 4px 18px rgba(79, 70, 229, 0.35);
}

.login-submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  opacity: 0;
  transition: opacity 200ms ease;
}

.login-submit-btn:hover:not(:disabled)::before {
  opacity: 1;
}

.login-submit-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.15), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}

.login-submit-btn:hover:not(:disabled)::after {
  left: 150%;
}

.login-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45);
}

.login-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.login-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-submit-btn svg {
  position: relative;
  z-index: 1;
  stroke: white;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-submit-btn span {
  position: relative;
  z-index: 1;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #f0f0f5;
}

.login-divider span {
  font-size: 0.75rem;
  color: #c0c7d4;
  white-space: nowrap;
}

/* Responsive: stack on small screens */
@media (max-width: 820px) {
  #login-screen {
    flex-direction: column;
  }

  .login-left {
    flex: 0 0 auto;
    padding: 2.5rem 2rem;
    min-height: auto;
  }

  .login-features {
    display: none;
  }

  .login-left-footer {
    display: none;
  }

  .login-right {
    padding: 2.5rem 1.5rem;
  }
}

/* ─── Forms ─── */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .7px;
  margin-bottom: .45rem;
}

.form-control {
  width: 100%;
  padding: .65rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  /* 16px font prevents auto-zoom on iOS */
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--surface);
  transition: all var(--transition);
  outline: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.form-control:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
  background: #fff;
}

.form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

textarea.form-control {
  resize: vertical;
  min-height: 50px;
  /* Reduced min-height */
  line-height: 1.4;
}

/* ── Select elements: reset native appearance to prevent black-circle bug ── */
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 14px;
  padding-right: 2rem;
  cursor: pointer;
}

/* ─── Password Eye Toggle ─── */
.pw-wrap {
  position: relative;
}

.pw-wrap .form-control {
  padding-right: 2.6rem;
}

.pw-eye {
  position: absolute;
  right: .65rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color var(--transition);
  line-height: 0;
}

.pw-eye:hover {
  color: var(--blue-500);
}

.pw-eye svg {
  width: 17px;
  height: 17px;
  pointer-events: none;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  padding: .6rem 1.15rem;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.btn svg {
  flex-shrink: 0;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue-600) 0%, var(--blue-700) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-25deg);
  transition: all 0.7s ease;
}

.btn-primary:hover:not(:disabled)::after {
  left: 150%;
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.45);
  transform: translateY(-2px) scale(1.02);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.btn-full {
  width: 100%;
  padding: .75rem 1.25rem;
  font-size: 1rem;
  border-radius: var(--radius);
}

.btn-danger {
  background: var(--red-50);
  color: var(--red-600);
  border: 1px solid var(--red-100);
}

.btn-danger:hover:not(:disabled) {
  background: var(--red-100);
  color: var(--red-700);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text-primary);
}

.btn-sm {
  padding: .4rem .75rem;
  font-size: .82rem;
}

.btn-icon {
  padding: .42rem;
  width: 30px;
  height: 30px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}

.btn-icon:hover:not(:disabled) {
  background: var(--red-50);
  color: var(--red-600);
  border-color: var(--red-100);
}

.btn-icon svg {
  width: 14px;
  height: 14px;
}

/* ─── Alerts ─── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  border: 1px solid transparent;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-error {
  background: var(--red-50);
  color: var(--red-700);
  border-color: var(--red-100);
}

.alert-success {
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all var(--transition);
}

.nav-inner {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 2.5rem;
  gap: 1.25rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-left: 0;
}

.nav-brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1e293b !important;
  letter-spacing: -0.4px;
}

.nav-brand-name span {
  color: #3b82f6 !important;
}

.nav-brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--blue-700), var(--blue-500));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.nav-brand-icon svg {
  width: 20px;
  height: 20px;
  fill: white;
}

.nav-brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-brand-name span {
  color: var(--blue-600);
}

.nav-sep {
  width: 1px;
  height: 28px;
  background: var(--border);
  margin: 0 .25rem;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-left: auto;
}

.nav-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-500), var(--violet-500));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
  border: 2px solid white;
  transition: all var(--transition);
  position: relative;
}

.nav-avatar:hover {
  transform: scale(1.05) rotate(5deg);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.nav-user-stack {
  line-height: 1.25;
}

.nav-user-name {
  font-size: .875rem;
  font-weight: 600;
  display: block;
}

.nav-user-email {
  font-size: .73rem;
  color: var(--text-muted);
  display: block;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.badge-admin {
  background: var(--violet-100);
  color: var(--violet-700);
}

.badge-employee {
  background: var(--blue-100);
  color: var(--blue-700);
}

/* ─── Main ─── */
#main-content {
  flex: 1;
  padding: 1.5rem 1rem 3rem 1.25rem;
  /* Reduced horizontal padding to increase workspace width */
  max-width: 100%;
  margin: 0;
  width: 100%;
}

.page-hd {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.page-hd h1 {
  margin-bottom: .3rem;
}

.page-hd p {
  color: var(--text-secondary);
  font-size: .9rem;
}

/* ─── Dashboard Stats ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #ffffff !important;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border) !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden !important;
  z-index: 1;
}

.stat-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: translateY(-5px);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.03;
  z-index: -1;
  transition: all 0.5s ease;
}

.stat-card:hover::after {
  transform: scale(1.5);
  opacity: 0.05;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.stat-card:hover .stat-icon {
  transform: scale(1.1) rotate(-5deg);
}

.si-blue {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #2563eb;
}

.si-amber {
  background: var(--amber-50);
  color: var(--amber-500);
}

.si-green {
  background: var(--green-50);
  color: var(--green-500);
}

.stat-lbl {
  font-size: .67rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .55px;
  margin-bottom: .2rem;
}

.stat-val {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.stat-sub {
  margin-top: .2rem;
}

/* ─── Workspace Switcher ─── */
.workspace-switcher {
  display: flex;
  gap: 3rem;
  margin-bottom: 2rem;
  margin-top: 0.5rem;
  padding: 0;
  background: transparent;
  border: none;
  width: 100%;
  justify-content: center;
}

.ws-btn {
  padding: 0.5rem 0;
  border-radius: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 1.1rem;
  /* Slightly larger as in photo */
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all var(--transition);
  position: relative;
  opacity: 0.7;
}

.ws-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.ws-btn.active {
  color: var(--blue-600);
  opacity: 1;
}

.ws-btn.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--blue-600);
  border-radius: 2px;
}

.ws-btn svg {
  width: 16px;
  height: 16px;
}

/* ─── 3D Project Specific ─── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  /* Tighter gap */
  margin-bottom: 0.6rem;
  /* Tighter spacing */
}

.form-section-title {
  font-size: .78rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin: 1.5rem 0 .75rem;
  padding-bottom: .4rem;
  padding-left: .75rem;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid var(--blue-500);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-bottom: .95rem;
}

.check-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .88rem;
  cursor: pointer;
}


html body[data-role="admin"] .top-row-grid,
html body[data-role="superadmin"] .top-row-grid {
  grid-template-columns: 38% 24% 38%;
  gap: 1.25rem;
  align-items: stretch;
  flex-wrap: nowrap;
  width: 100%;
  margin-bottom: 2rem;
}

@media (max-width: 1100px) {

  html body[data-role="admin"] .top-row-grid,
  html body[data-role="superadmin"] .top-row-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  #create-sec {
    min-height: auto !important;
  }
}

.top-row-grid>div {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-width: 0 !important;
}

/* ── Dashboard Grid Architecture ── */
#create-sec {
  grid-column: 1 !important;
  grid-row: 1 / span 2 !important;
  min-height: 600px !important;
  height: 100% !important;
  background: #ffffff !important;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
}

/* ── Attendance Status Badges ── */
.attendance-status {
  display: inline-flex;
  align-items: center;
  padding: .25rem .75rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.status-present {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.status-half_day {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.status-absent {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.status-leave {
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

/* ── Scrolling Fix & Container Overrides ── */
.dashboard-container-fixed {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  /* Allow content to push height */
  overflow: visible !important;
}

#main-content {
  overflow-y: visible !important;
  height: auto !important;
  min-height: calc(100vh - 70px);
}


#emp-create-col {
  grid-column: 3 !important;
  grid-row: 1 !important;
  min-height: 280px !important;
}

#emp-sec {
  grid-column: 2 / span 2 !important;
  grid-row: 2 !important;
  min-height: 300px !important;
  margin-top: 0 !important;
}

.card {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-body {
  flex: 1;
  padding: 1.25rem;
}

#create-sec .card-body {
  padding: 1.25rem !important;
}

.task-form {
  max-height: none;
  overflow: visible;
}

#chart-sec {
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-card {
  height: 100%;
  justify-content: center;
}

#emp-create-col .card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.form-group {
  margin-bottom: 0.75rem;
}

model-viewer {
  width: 100%;
  height: 100%;
  min-height: 400px;
  background: radial-gradient(circle, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 12px;
}

/* Only suppress pseudo-elements on the section container itself, NOT on children
       (the broad *::before/*::after rule was causing the native select black-circle bug) */
#create-sec::before,
#create-sec::after {
  display: none !important;
  content: none !important;
}

/* ─── Standardized Form Layouts ─── */
.form-section {
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 0.5rem;
}

.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.5rem;
  padding-left: 2px;
}

/* ─── Enhanced Project Cards ─── */
.proj-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.proj-card:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  transform: translateY(-3px);
  border-color: var(--blue-200);
}

.proj-card-hd {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  cursor: pointer;
  background: linear-gradient(to right, #ffffff, #fafbff);
}

.proj-info {
  flex: 1;
  min-width: 0;
}

.proj-name-text {
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.proj-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.proj-meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.proj-task-list {
  background: #f8fafc;
  padding: 0 1.5rem 1.5rem;
  display: none;
  border-top: 1px solid rgba(0, 0, 0, 0.03);
}

.proj-card.open .proj-task-list,
.proj-task-list.open {
  display: block;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.proj-task-item {
  padding: 1rem;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.2s;
}

.proj-task-item:hover {
  border-color: var(--blue-400);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}

.dashboard-right-stack {
  display: contents;
  /* Unwraps the stack to participate in the outer grid */
}

/* Row 1: Split Chart & Emp Form - FORCE SIDE-BY-SIDE */
.dashboard-right-top {
  display: contents;
  /* Unwraps the stack to participate in the outer grid */
}

.dashboard-right-top>div {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Shared Stretch logic */
.top-row-grid>div,
.dashboard-right-stack>div {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
}

.team-members-sec {
  height: 100% !important;
  min-height: 320px !important;
  width: 100%;
}

.chart-card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chart-card-body {
  padding: 0.75rem;
}

@media (max-width: 768px) {
  .top-row-grid {
    grid-template-columns: 1fr !important;
  }

  #create-sec,
  #chart-sec,
  #emp-create-col {
    grid-column: auto !important;
  }
}

.top-row-grid.admin-hidden {
  display: none !important;
}

/* Forced Admin Visibility Removed - Handled by app.js showPanel() */


/* 🛡️ Aggressive Employee/Non-Admin Hiding (Failsafe) */
body:not([data-panel="dashboard"]) #top-row-grid,
body:not([data-panel="dashboard"]) #stats-sec,
body:not([data-panel="dashboard"]) #all-tasks-sec,
body:not([data-panel="dashboard"]) #ws-switcher,
body:not([data-role="admin"]):not([data-role="superadmin"]) #create-sec,
body:not([data-role="admin"]):not([data-role="superadmin"]) #chart-sec,
body:not([data-role="admin"]):not([data-role="superadmin"]) #emp-create-col,
body:not([data-role="admin"]):not([data-role="superadmin"]) #emp-sec,
body:not([data-role="admin"]):not([data-role="superadmin"]) #stats-sec,
body:not([data-role="admin"]):not([data-role="superadmin"]) #top-row-grid {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

#nav-badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* When admin sections hidden (employee view), collapse mgm-row */
.top-row-grid.admin-hidden {
  display: none;
}

/* ─── Notifications ─── */
.nav-notif-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  margin-right: 0.75rem;
}

.nav-notif-btn:hover {
  background: var(--surface-3);
  color: var(--violet-600);
  border-color: var(--violet-200);
}

/* ─── Voice Recorder Premium Styles ─── */
.voice-recorder-container {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: var(--gray-50);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.vr-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.vr-label {
  font-size: 0.75rem;
  font-weight: 750;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vr-controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.vr-mic-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--border);
  color: var(--red-500);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.vr-mic-btn:hover {
  transform: scale(1.08);
  border-color: var(--red-200);
  background: var(--red-50);
}

.vr-mic-btn.is-recording {
  background: var(--red-500);
  color: #fff;
  border-color: var(--red-600);
  animation: vr-pulse 1.5s infinite;
}

@keyframes vr-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }

  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.vr-timer {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-primary);
  min-width: 60px;
}

.vr-preview-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.vr-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  animation: fi 0.3s ease-out;
}

.vr-item audio {
  height: 32px;
  flex: 1;
}

.vr-del {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--red-50);
  color: var(--red-500);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.vr-del:hover {
  background: var(--red-500);
  color: white;
}

.vr-finished-msg {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--emerald-600);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--red-500);
  color: white;
  font-size: 0.62rem;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2.5px solid #fff;
}

.notif-panel {
  position: absolute;
  top: 55px;
  right: 0;
  width: 340px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  z-index: 10000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.2s ease-out;
}

.notif-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--gray-50);
}

.notif-header span {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.notif-clear {
  font-size: 0.72rem;
  color: var(--violet-600);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 700;
}

.notif-list {
  max-height: 420px;
  overflow-y: auto;
}

.notif-item {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.notif-item:hover {
  background: var(--gray-50);
}

.notif-item.unread {
  background: #fdf2ff;
  /* Very soft violet tint */
  border-left: 3px solid var(--violet-500);
}

.comment-audio {
  margin-top: 0.5rem;
}

.comment-audio audio {
  height: 32px;
  max-width: 100%;
}

.comment-mic-btn {
  background: #fff;
  border: 1.5px solid var(--border);
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--gray-500);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.comment-mic-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.comment-mic-btn:hover {
  background: var(--red-50);
  color: var(--red-500);
  border-color: var(--red-200);
  transform: scale(1.05);
}

.comment-mic-btn.active {
  background: var(--red-500);
  color: white;
  border-color: var(--red-600);
  animation: vr-pulse 1.5s infinite;
}

.comment-send-btn {
  padding: 8px;
  border-radius: 8px;
  background: var(--emerald-600);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  transition: all 0.2s;
}

.comment-send-btn:hover {
  background: var(--emerald-700);
  transform: translateY(-1px);
}

.comment-send-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}


.notif-item-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.notif-item-msg {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.notif-item-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.notif-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}


.mgm-row:has(.top-row-grid.hidden) {
  display: block;
}

.mgm-row:has(.top-row-grid.hidden) .stats-grid {
  flex: unset;
  flex-direction: row !important;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 1.25rem;
}

/* ─── Content Grid ─── */
.c-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 3.5fr;
  gap: 1.25rem;
  align-items: stretch;
}

/* Collapse to 1 column when left col is not visible */
.c-grid:has(.c-left-col:not(:has(> :not(.hidden)))) {
  grid-template-columns: 1fr;
}

/* Left column stacks create-sec and chart-sec vertically */
.c-left-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* When left col has no visible children, collapse the grid to single column */
.c-left-col:empty,
.c-left-col:not(:has(> :not(.hidden))) {
  display: none;
}

/* Employee view: task table spans full width */
.c-left-col+.card {
  min-width: 0;
}

/* ─── Center Targeted Sections (1800px) ─── */
.all-tasks-sec,
.admin-attendance-sec,
.schedule-admin-sec,
.schedule-sec,
#leave-admin-sec,
#leave-employee-sec {
  max-width: 1800px;
  margin: 0 auto 1.5rem auto;
  width: 100%;
  padding: 0 0.5rem;
}

/* ─── Team Members full-width section ─── */
.team-members-sec {
  margin-bottom: 1.25rem;
}

/* ─── Card ─── */
.card {
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  overflow: visible;
  transition: all var(--transition);
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  box-shadow: 0 16px 48px -12px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

.card-hd {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: .7rem;
  background: rgba(255, 255, 255, 0.4);
}

.card-hd-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-600);
  flex-shrink: 0;
}

.card-hd-icon svg {
  width: 15px;
  height: 15px;
}

.card-hd-text {
  flex: 1;
  min-width: 0;
}

.card-title {
  font-size: .9rem;
  font-weight: 600;
}

.card-sub {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .05rem;
}

.card-body {
  padding: 1.4rem 1.5rem;
  flex: 1;
}

.task-form {
  max-height: 90vh;
  overflow-y: auto;
  padding-right: .5rem;
  margin-right: -.5rem;
}

/* Targeted fix for 3D form button visibility */
#form-3d .card-body {
  display: flex;
  flex-direction: column;
  height: auto;
  max-height: none;
}

#form-3d .task-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-right: .75rem;
}

#form-3d #create-3d-btn {
  margin-top: 1.25rem;
  padding: 1.15rem !important;
  font-size: 1.15rem;
  font-weight: 700;
}

.task-form .form-group {
  margin-bottom: .8rem;
}

#create-sec .card-body,
#emp-create-col .card-body {
  padding: 0.75rem 1rem;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

#create-sec .form-section-title {
  margin: 0.75rem 0 0.4rem;
  padding-bottom: 0.2rem;
}

/* ─── Table Premium ─── */
.tbl-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.3);
  max-width: 100%;
}

table {
  width: 100%;
  max-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .9rem;
}

thead th {
  padding: 1.15rem 1.25rem;
  text-align: left;
  font-size: .72rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  background: #f4f7fe;
  /* Fixed: Solid background to prevent overlap transparency */
  border-bottom: 1.5px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  /* Fixed: High z-index to stay above scrolling content */
}

tbody tr {
  background: transparent;
  transition: all var(--transition);
}

tbody tr:hover {
  background: rgba(var(--blue-50-rgb), 0.3);
  box-shadow: inset 3px 0 0 var(--blue-500);
  transform: translateX(4px);
}

tbody td {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

/* ─── Premium Assignee Card Redesign ─── */
.assignee-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 16px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 280px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
}

.assignee-card.is-orphaned {
  background: rgba(244, 63, 94, 0.03);
  border: 1px solid rgba(244, 63, 94, 0.15);
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.05);
}

.assignee-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 2px;
}

.assignee-name {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

.assignee-email {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.orphaned-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  color: white;
  font-size: 0.64rem;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 99px;
  margin-top: 6px;
  width: fit-content;
  box-shadow: 0 4px 10px rgba(244, 63, 94, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
  0% {
    box-shadow: 0 4px 10px rgba(244, 63, 94, 0.35);
  }

  50% {
    box-shadow: 0 4px 18px rgba(244, 63, 94, 0.55);
  }

  100% {
    box-shadow: 0 4px 10px rgba(244, 63, 94, 0.35);
  }
}

.quick-reassign {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  transform: translateY(8px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.assignee-cell-td:hover .quick-reassign,
.assignee-card.is-orphaned .quick-reassign {
  max-height: 50px;
  opacity: 1;
  margin-top: 10px;
  transform: translateY(0);
}

.reassign-select {
  width: 100%;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid rgba(99, 102, 241, 0.2);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  color: var(--blue-700);
  cursor: pointer;
  outline: none;
  transition: all 0.3s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236366f1' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 32px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.reassign-select:hover {
  border-color: var(--blue-400);
  background: var(--blue-50);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}

.reassign-select:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Task Actions Dropdown */
.task-actions-dropdown {
  position: relative;
  display: inline-block;
}

.task-actions-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: all var(--transition);
}

.task-actions-btn:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.task-actions-menu {
  position: absolute;
  right: 0;
  top: 100%;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 140px;
  z-index: 1000;
  display: none;
  padding: 4px 0;
}

.task-actions-menu.show {
  display: block;
}

.task-actions-menu-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-primary);
  transition: background var(--transition);
}

.task-actions-menu-item:hover {
  background: var(--surface-2);
}

.task-actions-menu-item.danger {
  color: var(--red-500);
}

.task-actions-menu-item.danger:hover {
  background: var(--red-50);
}

.cell-title {
  font-weight: 600;
  max-width: 260px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-primary);
  font-size: .9rem;
  line-height: 1.5;
}

.cell-desc {
  font-size: .82rem;
  color: var(--text-muted);
  max-width: 260px;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: .2rem;
  line-height: 1.5;
}

.cell-email {
  color: var(--text-secondary);
  font-size: .82rem;
}

.cell-date {
  color: var(--text-secondary);
  font-size: .82rem;
  white-space: nowrap;
}

.cell-overdue {
  color: var(--red-500) !important;
  font-weight: 600;
}

/* ═══════════ EMPLOYEE TASK CARDS (big readable view) ═══════════ */
.emp-task-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
}

.emp-task-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.emp-task-card:hover {
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}

.emp-task-card.card-overdue {
  border-left: 4px solid var(--red-500);
}

.emp-task-card.card-completed {
  border-left: 4px solid var(--green-500);
  opacity: 0.85;
}

.emp-task-card.card-pending {
  border-left: 4px solid var(--amber-500);
}

.emp-card-top {
  padding: 1.25rem 1.5rem 1rem;
}

.emp-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.emp-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  flex: 1;
  letter-spacing: -0.2px;
}

.emp-card-status-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.85rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.emp-status-pending {
  background: #fff7ed;
  color: #c2410c;
  border: 1.5px solid #fed7aa;
}

.emp-status-completed {
  background: #ecfdf5;
  color: #047857;
  border: 1.5px solid #a7f3d0;
}

.emp-card-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.emp-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.emp-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.emp-meta-chip svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.emp-meta-chip.chip-due {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.emp-meta-chip.chip-overdue {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--red-600);
  font-weight: 700;
}

.emp-meta-chip.chip-assigned {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #5b21b6;
}

.emp-card-bottom {
  padding: 0.9rem 1.5rem;
  background: #f9fafb;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.emp-card-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.emp-status-select {
  padding: 0.45rem 1.75rem 0.45rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all var(--transition);
  appearance: none;
  -webkit-appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 14px;
  color: var(--text-primary);
}

.emp-status-select:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.emp-comment-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.emp-comment-toggle:hover {
  background: var(--blue-50);
  border-color: var(--blue-200, #bfdbfe);
  color: var(--blue-600);
}

.emp-comment-toggle.active {
  background: var(--blue-50);
  border-color: var(--blue-500);
  color: var(--blue-600);
}

.emp-wf-section {
  margin-top: 0.5rem;
}

.emp-card-attachment {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.emp-task-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

/* Number indicator on the task card */
.emp-task-num {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--blue-500), var(--violet-500));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 8px;
  flex-shrink: 0;
  margin-right: 0.5rem;
}

.assignee-cell {
  display: flex;
  align-items: center;
  gap: .45rem;
}

.mini-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-400, #60a5fa), var(--violet-500));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .62rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.status-sel {
  padding: .35rem .85rem;
  background: #f8fafc;
  color: var(--text-primary);
  border: 1.5px solid #e2e8f0;
  border-radius: 99px;
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .6rem center;
  background-size: 11px;
  padding-right: 1.85rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-sel:hover {
  border-color: #cbd5e1;
  background: #fff;
}

.status-sel:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  border-color: var(--blue-500);
}

.s-pending,
.s-open,
.open,
.not-started {
  background: #fffbeb !important;
  color: #92400e !important;
  border-color: #fef3c7 !important;
}

.s-completed,
.completed {
  background: #f0fdf4 !important;
  color: #166534 !important;
  border-color: #dcfce7 !important;
}

.s-in_progress,
.s-inprogress,
.inprogress,
.in-progress {
  background: #eff6ff !important;
  color: #1e40af !important;
  border-color: #dbeafe !important;
}

.s-hold,
.s-onhold,
.onhold,
.hold {
  background: #fff1f2 !important;
  color: #9f1239 !important;
  border-color: #ffe4e6 !important;
}

.s-cancel,
.cancel {
  background: #f3f4f6 !important;
  color: #374151 !important;
  border-color: #e5e7eb !important;
}

.s-closed,
.closed {
  background: #1f2937 !important;
  color: #f9fafb !important;
  border-color: #374151 !important;
}

.s-review,
.review {
  background: #f5f3ff !important;
  color: #5b21b6 !important;
  border-color: #ddd6fe !important;
}

.s-assigned {
  background: #fffbeb !important;
  color: #b45309 !important;
  border-color: #fca5a1 !important;
}

.s-acknowledged {
  background: #f0fdf4 !important;
  /* Green */
  color: #15803d !important;
  border-color: #86efac !important;
}

/* Acknowledge Button */
.btn-ack {
  background-color: #f59e0b;
  /* Solid fallback */
  background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
  color: #ffffff !important;
  border: none;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.45);
  animation: pulse-ack 2s infinite;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 130px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

@keyframes pulse-ack {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    transform: scale(1.03);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    transform: scale(1);
  }
}

.btn-ack:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 10px 20px rgba(245, 158, 11, 0.5);
  background: linear-gradient(135deg, var(--amber-600), var(--amber-700));
  animation: none;
}

.btn-ack:active {
  transform: scale(0.95);
}

.btn-ack:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  filter: grayscale(1);
  animation: none;
}

.ack-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--emerald-50);
  color: var(--emerald-700);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1.5px solid var(--emerald-200);
  animation: fi-scale 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fi-scale {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}


.client-review {
  background: #faf5ff !important;
  color: #6b21a8 !important;
  border-color: #f3e8ff !important;
}

.revision {
  background: #fff1f2 !important;
  color: #9f1239 !important;
  border-color: #ffe4e6 !important;
}

.completed {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

/* ─── Empty & Spinner ─── */
.spinner-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--border);
  border-top-color: var(--blue-500);
  border-radius: 50%;
  animation: spin .65s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty-state {
  padding: 3.5rem 1.5rem;
  text-align: center;
}

.empty-ico {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.1rem;
  color: var(--text-muted);
}

.empty-ico svg {
  width: 28px;
  height: 28px;
}

.empty-state h3 {
  font-size: .9rem;
  color: var(--text-secondary);
  margin-bottom: .35rem;
}

.empty-state p {
  font-size: .8rem;
  color: var(--text-muted);
}

.card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  overflow: visible;
  transition: all var(--transition);
  position: relative;
}



/* ─── Toast ─── */
#toast-ctr {
  position: fixed;
  top: calc(var(--nav-h) + 1rem);
  right: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .7rem 1rem;
  box-shadow: var(--shadow-lg);
  font-size: .875rem;
  font-weight: 500;
  min-width: 270px;
  max-width: 360px;
  pointer-events: all;
  animation: slideIn .25s ease forwards;
}

.toast.out {
  animation: slideOut .22s ease forwards;
}

.toast-success {
  border-left: 3px solid var(--green-500);
}

.toast-error {
  border-left: 3px solid var(--red-500);
}

.toast-info {
  border-left: 3px solid var(--blue-500);
}

.t-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast-success .t-dot {
  background: var(--green-500);
}

.toast-error .t-dot {
  background: var(--red-500);
}

.toast-info .t-dot {
  background: var(--blue-500);
}

@keyframes slideIn {
  from {
    transform: translateX(110%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(110%);
    opacity: 0;
  }
}

/* --- Dynamic Link Fields --- */
.links-dynamic-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.link-field-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  animation: fi 0.3s ease both;
}

.remove-link-btn {
  background: var(--red-50);
  color: var(--red-500);
  border: 1px solid var(--red-100);
  border-radius: 8px;
  padding: 0.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.remove-link-btn:hover {
  background: var(--red-100);
  color: var(--red-600);
}

/* --- Multi-File Display --- */
.file-list-display {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.file-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-primary);
  animation: fi 0.3s ease both;
}

.file-chip-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
}

.file-chip-remove:hover {
  color: var(--red-500);
}

/* --- Keyframe Entrance --- */
@keyframes fi {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fi {
  animation: fi 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.fi1 {
  animation-delay: 100ms;
}

.fi2 {
  animation-delay: 200ms;
}

.fi3 {
  animation-delay: 300ms;
}

.fi4 {
  animation-delay: 400ms;
}

/* ─── Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  backdrop-filter: blur(4px);
  z-index: 15000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0;
  /* Changed from 1rem to allow full height */
  overflow-y: auto;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 2rem;
  max-width: 390px;
  width: 100%;
  margin: auto;
  animation: mIn .2s ease forwards;
}

@keyframes mIn {
  from {
    transform: scale(.93);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-ico {
  width: 46px;
  height: 46px;
  background: var(--red-50);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red-500);
  margin-bottom: 1.2rem;
}

.modal-ico svg {
  width: 22px;
  height: 22px;
}

.modal h2 {
  margin-bottom: .45rem;
}

.modal p {
  color: var(--text-secondary);
  font-size: .88rem;
  margin-bottom: 1.5rem;
}

.modal-btns {
  display: flex;
  gap: .65rem;
  justify-content: flex-end;
}



@media (max-width: 768px) {
  :root {
    --nav-h: 64px;
  }

  #main-content {
    padding: 1.25rem 0.75rem 5rem;
    /* Extra bottom padding for thumb reach */
  }

  #navbar {
    padding: 0 0.75rem;
    gap: .5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
  }

  .nav-user-stack,
  .nav-sep,
  .nav-badge {
    display: none !important;
  }

  .nav-right {
    gap: 0.4rem;
  }

  .btn-profile,
  .btn-cp,
  .btn-ghost {
    padding: 0.5rem !important;
    width: 36px;
    height: 36px;
  }

  .btn-profile span,
  .btn-cp span,
  .btn-ghost span,
  .btn-profile svg+text,
  .btn-cp svg+text,
  .btn-ghost svg+text {
    display: none;
  }

  /* Only show icons in navbar buttons on mobile */
  .nav-right .btn span {
    display: none;
  }

  .nav-right .btn {
    border-radius: 50%;
    min-width: 36px;
    justify-content: center;
    padding: 0 !important;
  }

  h1 {
    font-size: 1.5rem;
    letter-spacing: -0.5px;
  }

  .c-left-col {
    flex-direction: column;
  }

  /* Stack stats items more aggressively */
  .stat-card {
    flex: 1 1 calc(50% - 0.5rem);
    padding: 1rem;
  }

  .stat-val {
    font-size: 1.5rem;
  }

  .stat-lbl {
    font-size: 0.7rem;
  }

  .workspace-switcher {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
  }

  .ws-btn {
    flex-shrink: 0 !important;
  }

  /* ─── MOBILE APP TRANSFORMATION (Now for 768px tablets too) ─── */

  .c-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .tbl-wrap table {
    border: none;
  }

  .tbl-wrap thead {
    display: none;
  }

  .tbl-wrap tbody tr {
    display: block;
    background: #fff !important;
    border: 1.5px solid var(--border) !important;
    border-radius: 18px !important;
    margin-bottom: 1.25rem !important;
    padding: 1rem !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
    transform: none !important;
  }

  .tbl-wrap tbody td {
    display: block;
    padding: 0.5rem 0 !important;
    border: none !important;
    width: 100% !important;
    text-align: left !important;
    min-width: auto !important;
  }

  .tbl-wrap td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
  }

  .tbl-wrap td:last-child {
    border-top: 1.5px dashed var(--border) !important;
    margin-top: 0.75rem !important;
    padding-top: 1rem !important;
  }

  .tbl-wrap td:last-child div {
    justify-content: flex-start !important;
    gap: 0.75rem !important;
  }

  .modal-overlay {
    padding: 0;
    align-items: center;
  }

  .modal {
    max-width: 95% !important;
    border-radius: 24px !important;
    padding: 1.5rem !important;
  }

  .btn {
    min-height: 44px;
  }

  .nav-inner {
    padding: 0 1rem !important;
  }

  .rating-stars {
    font-size: 1.4rem !important;
    gap: 8px !important;
  }

  .form-control {
    font-size: 16px !important;
  }

  .p3-side {
    border-right: none !important;
    border-top: 1px solid var(--border);
    background: var(--surface) !important;
  }

  .attendance-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .login-left {
    padding: 2.5rem 1.5rem;
    min-height: 240px;
  }

  .login-brand-name {
    font-size: 1.8rem;
  }

  .stat-card {
    flex: 1 1 100%;
  }
}

/* ═══════════ CHART CARD ═══════════ */
.chart-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  position: relative;
}

.chart-card-hd {
  padding: 1.1rem 1.4rem .9rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}

.chart-card-title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.2px;
}

.chart-card-sub {
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: .1rem;
}

.chart-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .18rem .55rem;
  border-radius: 99px;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .4px;
  background: var(--green-50);
  color: var(--green-700);
  border: 1px solid var(--green-100);
  text-transform: uppercase;
}

.chart-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-500);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: .5;
    transform: scale(.7);
  }
}

.chart-canvas-wrap {
  padding: 1.25rem 1.2rem 1rem;
  position: relative;
}

/* Loading skeleton for chart */
.chart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: .65rem;
  height: 200px;
  color: var(--text-muted);
  font-size: .8rem;
}

.chart-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--border);
  border-top-color: var(--blue-500);
  border-radius: 50%;
  animation: spin .65s linear infinite;
}

/* Chart error state */
.chart-error {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: .5rem;
  height: 200px;
  color: var(--red-500);
  font-size: .8rem;
}

.chart-error svg {
  width: 26px;
  height: 26px;
  color: var(--red-400);
  opacity: .7;
}

/* Legend dots below chart */
.chart-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  padding: 0 1.2rem 1.1rem;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .72rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Chart fade-in */
@keyframes chartReveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.chart-canvas-wrap canvas {
  animation: chartReveal .5s ease both;
}

/* ═══════════ EMPLOYEE MANAGEMENT ═══════════ */
.emp-section-hd {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
}

/* ═══════════ ATTENDANCE ═══════════ */
.attendance-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.personal-attendance-card {
  max-width: 450px;
  margin-left: 0;
  margin-right: auto;
}

.attendance-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.attendance-title {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.attendance-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  text-transform: capitalize;
}

.status-present {
  background: var(--green-50);
  color: var(--green-700);
  border: 1px solid var(--green-100);
}

.status-half_day {
  background: var(--amber-50);
  color: var(--amber-700);
  border: 1px solid var(--amber-100);
}

.status-leave {
  background: var(--red-50);
  color: var(--red-700);
  border: 1px solid var(--red-100);
}

.attendance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.atten-item {
  text-align: center;
  padding: 0.75rem;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.atten-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.atten-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.attendance-actions {
  display: flex;
  gap: 1rem;
}

.attendance-actions button {
  flex: 1;
  padding: 0.8rem;
  border-radius: var(--radius);
  border: none;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.btn-checkin {
  background: var(--blue-600);
  color: white;
}

.btn-checkin:hover {
  background: var(--blue-700);
  transform: translateY(-1px);
}

.btn-checkin:active {
  transform: translateY(0);
}

.btn-checkin:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.btn-checkout {
  background: var(--amber-500);
  color: white;
}

.btn-checkout:hover {
  background: var(--amber-700);
  transform: translateY(-1px);
}

.btn-checkout:active {
  transform: translateY(0);
}

.btn-checkout:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.admin-attendance-sec {
  margin-top: 2rem;
}

.admin-attendance-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.emp-section-hd-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--violet-500), #a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 2px 8px rgba(139, 92, 246, .35);
  flex-shrink: 0;
}

.emp-section-hd-icon svg {
  width: 18px;
  height: 18px;
}

/* ─── Management Row: Stats + Management Columns ─── */
.mgm-row {
  display: flex;
  flex-direction: column;
  /* Stacked vertically */
  gap: 1.25rem;
  align-items: stretch;
  margin-bottom: 1.25rem;
}

/* Dashboard Stats (Vertical Left Column) */
.stats-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  /* 4 horizontal columns for stats */
  gap: 1rem;
  margin-bottom: 1.25rem;
  width: 100%;
}

/* Right panel fills remaining space */


.emp-section-hd-text h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: .1rem;
}

.emp-section-hd-text p {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.emp-divider {
  height: 1px;
  background: linear-gradient(to right, var(--violet-100), var(--border), transparent);
  margin-bottom: 1.5rem;
}

.emp-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 3fr;
  gap: 1.5rem;
  align-items: stretch;
}

@media (max-width: 960px) {
  .emp-grid {
    grid-template-columns: 1fr;
  }
}

/* Create employee card */
.emp-create-card .card-hd-icon {
  background: var(--violet-50);
  border-color: var(--violet-100);
  color: var(--violet-700);
}

.btn-violet {
  background: var(--violet-500);
  color: white;
  box-shadow: 0 1px 3px rgba(139, 92, 246, .35);
}

.btn-violet:hover:not(:disabled) {
  background: var(--violet-700);
  box-shadow: 0 4px 14px rgba(139, 92, 246, .4);
  transform: translateY(-1px);
}

.btn-violet:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

/* Employee table card */
.emp-count {
  margin-left: auto;
  background: var(--violet-50);
  color: var(--violet-700);
  border: 1px solid var(--violet-100);
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 99px;
}

.emp-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet-500), #a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  letter-spacing: .5px;
}

.emp-name-cell {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.emp-name-text {
  font-weight: 600;
  font-size: .875rem;
}

.emp-email-text {
  color: var(--text-secondary);
  font-size: .82rem;
}

.btn-icon-danger {
  padding: .42rem;
  background: var(--red-50);
  border: 1px solid var(--red-100);
  color: var(--red-500);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}

.btn-icon-danger:hover:not(:disabled) {
  background: var(--red-100);
  color: var(--red-700);
  border-color: var(--red-200, #fecaca);
  transform: translateY(-1px);
}

.btn-icon-danger svg {
  width: 14px;
  height: 14px;
}

/* ═══════════ 3D Project Detail modal ═══════════ */
.p3-detail-modal {
  max-width: 1050px;
  padding: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: 2rem auto !important;
  height: 90vh;
  max-height: 90vh;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
}

.modal-header-3d {
  padding: 1.5rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
  /* Fixed: High z-index to stay above modal content */
  background: #ffffff;
  /* Fixed: Solid background to prevent content overlap transparency */
  backdrop-filter: blur(10px);
}

.modal-header-3d-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--violet-50);
  color: var(--violet-600);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px var(--violet-100);
}

.modal-header-3d-icon svg {
  width: 26px;
  height: 26px;
}

.modal-header-3d-text h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.modal-header-3d-text p {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.modal-header-3d .modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.modal-header-3d .modal-close:hover {
  color: var(--red-500);
}

.modal-body-3d {
  padding: 2.5rem;
  background: #fbfbfb;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--violet-200) transparent;
}

.p3-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

.detail-section {
  margin-bottom: 1.75rem;
}

.detail-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.detail-value {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
}

.text-long {
  white-space: pre-wrap;
  color: var(--text-secondary);
  background: var(--surface);
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.88rem;
}

.p3-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.p3-tags>span {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.p3-subgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.side-info-card,
.side-links-card {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.info-row:last-child {
  border: none;
}

.info-lbl {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.info-row>span:not(.info-lbl) {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.p3-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.p3-link-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #edf2f7;
  text-decoration: none;
  color: var(--violet-600);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.p3-link-item:hover {
  background: #eff6ff;
  border-color: #dbeafe;
  transform: translateX(3px);
}

@media (max-width: 800px) {
  .p3-grid {
    grid-template-columns: 1fr;
  }

  .p3-detail-modal {
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
  }
}

/* ═══════════ Project Mode UI ═══════════ */
.proj-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  transition: all var(--transition);
  overflow: hidden;
}

.proj-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--violet-300);
}

.proj-card-hd {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  background: #fafafa;
}

.proj-card-hd:hover {
  background: #f4f7fe;
}

.proj-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.proj-name-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.proj-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.proj-actions {
  display: flex;
  gap: 0.5rem;
}

.proj-task-list {
  padding: 0.5rem 1.5rem 1.25rem;
  border-top: 1px dashed var(--border);
  display: none;
  animation: fi 0.3s ease both;
}

.proj-task-list.open {
  display: block;
}

.proj-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.proj-task-item:last-child {
  border-bottom: none;
}

.proj-task-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.proj-task-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.proj-task-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.proj-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.85rem;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.badge-reputed {
  background: var(--amber-50);
  color: var(--amber-700);
  border: 1px solid var(--amber-100);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 800;
}


#emp-list-body {
  min-height: 120px;
}

/* ═══════════ CHANGE PASSWORD MODAL ═══════════ */
#cp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 15000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms cubic-bezier(.4, 0, .2, 1);
  overflow-y: auto;
}

#cp-modal-overlay.cp-open {
  opacity: 1;
  pointer-events: all;
}

.cp-modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25), 0 0 0 1px rgba(0, 0, 0, .05);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  transform: scale(.92) translateY(12px);
  opacity: 0;
  transition: transform 260ms cubic-bezier(.34, 1.56, .64, 1), opacity 220ms cubic-bezier(.4, 0, .2, 1);
  margin: auto;
}

#cp-modal-overlay.cp-open .cp-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.cp-modal-header {
  background: linear-gradient(140deg, #1e40af, #3b82f6 80%, #60a5fa);
  padding: 1.5rem 1.75rem 1.35rem;
  display: flex;
  align-items: center;
  gap: .85rem;
}

.cp-modal-header-icon {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cp-modal-header-icon svg {
  width: 20px;
  height: 20px;
  stroke: white;
}

.cp-modal-header-text h2 {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  margin-bottom: .15rem;
}

.cp-modal-header-text p {
  font-size: .78rem;
  color: rgba(255, 255, 255, .7);
}

.cp-modal-body {
  padding: 1.6rem 1.75rem 1.75rem;
}

.cp-field-error {
  font-size: .75rem;
  color: var(--red-600);
  margin-top: .3rem;
  display: none;
}

.cp-field-error.visible {
  display: block;
}

.form-control.input-error {
  border-color: var(--red-500);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .12);
}

#cp-server-msg {
  border-radius: var(--radius);
  padding: .7rem 1rem;
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: 1.1rem;
  display: none;
  align-items: center;
  gap: .55rem;
  line-height: 1.4;
}

#cp-server-msg.msg-error {
  display: flex;
  background: var(--red-50);
  color: var(--red-700);
  border: 1px solid var(--red-100);
}

#cp-server-msg.msg-success {
  display: flex;
  background: var(--green-50);
  color: var(--green-700);
  border: 1px solid var(--green-100);
}

#cp-server-msg svg {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
}

.cp-modal-footer {
  display: flex;
  gap: .65rem;
  justify-content: flex-end;
  padding-top: .25rem;
}

/* Change Password nav button */
.btn-cp {
  background: rgba(59, 130, 246, .1);
  color: var(--blue-600);
  border: 1px solid rgba(59, 130, 246, .2);
}

.btn-cp:hover:not(:disabled) {
  background: rgba(59, 130, 246, .18);
  color: var(--blue-700);
  border-color: rgba(59, 130, 246, .3);
}

/* ═══════════ FORGOT PASSWORD ═══════════ */
.login-panel {
  transition: opacity 300ms ease, transform 300ms ease;
}

.login-panel.panel-hidden {
  opacity: 0;
  transform: translateX(-18px);
  pointer-events: none;
  position: absolute;
  width: calc(100% - 5rem);
}

.login-panel.panel-enter {
  opacity: 0;
  transform: translateX(18px);
}

.login-panel.panel-enter-active {
  opacity: 1;
  transform: translateX(0);
}

#reset-panel {
  display: none;
}

#reset-panel.visible {
  display: block;
}

.forgot-link {
  display: inline-block;
  font-size: .8rem;
  color: var(--blue-600);
  text-decoration: none;
  margin-top: .5rem;
  font-weight: 500;
  transition: color var(--transition);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font);
}

.forgot-link:hover {
  color: var(--blue-700);
  text-decoration: underline;
}

.btn-back {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}

.btn-back:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text-primary);
  border-color: #d1d5db;
}

.reset-desc {
  font-size: .85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1.4rem;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius);
  padding: .75rem 1rem;
}

.reset-success-box {
  text-align: center;
  padding: 1rem 0 .5rem;
}

.reset-success-icon {
  width: 56px;
  height: 56px;
  background: var(--green-50);
  border: 1.5px solid var(--green-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: var(--green-500);
}

.reset-success-icon svg {
  width: 26px;
  height: 26px;
}

.reset-success-box h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .35rem;
  color: var(--text-primary);
}

.reset-success-box p {
  font-size: .83rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Toast for login screen (positioned differently since no navbar) */
#login-toast-ctr {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  align-items: center;
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}

@keyframes loginToastIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loginToastOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(12px);
  }
}

.login-toast {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .7rem 1.1rem;
  box-shadow: var(--shadow-xl);
  font-size: .875rem;
  font-weight: 500;
  width: 100%;
  pointer-events: all;
  animation: loginToastIn .28s ease forwards;
}

.login-toast.out {
  animation: loginToastOut .22s ease forwards;
}

.login-toast-success {
  border-left: 3px solid var(--green-500);
}

.login-toast-error {
  border-left: 3px solid var(--red-500);
}

.login-toast .t-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.login-toast-success .t-dot {
  background: var(--green-500);
}

.login-toast-error .t-dot {
  background: var(--red-500);
}

.spinner-inline {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ═══════════ FILE UPLOAD ═══════════ */
.file-input-wrapper {
  position: relative;
}

.file-input-label {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .6rem .9rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: .875rem;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.file-input-label:hover {
  border-color: var(--blue-500);
  background: var(--blue-50);
  color: var(--blue-600);
}

.file-input-label svg {
  flex-shrink: 0;
}

.file-name-display {
  font-size: .78rem;
  color: var(--blue-600);
  margin-top: .3rem;
  display: none;
  align-items: center;
  gap: .35rem;
  font-weight: 500;
}

.file-name-display.visible {
  display: flex;
}

input[type="file"]#taskFile {
  display: none;
}

/* ── File upload zone ── */
.file-upload-zone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--blue-500);
  border-radius: var(--radius);
  background: var(--blue-50);
  padding: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 0.5rem;
}

.file-upload-zone:hover {
  background: var(--blue-100);
  border-color: var(--blue-600);
}

.file-label-inner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--blue-600);
  font-size: 0.875rem;
  font-weight: 500;
  pointer-events: none;
}

.file-label-inner svg {
  width: 18px;
  height: 18px;
  stroke: var(--blue-500);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ═══════════ ATTACHMENT LINK ═══════════ */
.attachment-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .7rem;
  background: var(--blue-50);
  color: var(--blue-600);
  border: 1px solid var(--blue-100);
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.attachment-link:hover {
  background: var(--blue-100);
  color: var(--blue-700);
  border-color: var(--blue-200, #bfdbfe);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, .18);
}

/* ─── Task cards enhanced ─── */
tbody tr {
  transition: all 0.2s ease;
}

tbody tr:hover {
  background: #f8fafc !important;
  transform: scale(1.002);
  box-shadow: inset 4px 0 0 var(--blue-500), 0 4px 12px rgba(0, 0, 0, 0.03);
}

/* ═══════════ COMMENTS ═══════════ */
.comment-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .65rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
  white-space: nowrap;
}

.comment-toggle-btn:hover {
  background: var(--blue-50);
  color: var(--blue-600);
  border-color: var(--blue-200, #bfdbfe);
}

.comment-toggle-btn.active {
  background: var(--blue-50);
  color: var(--blue-600);
  border-color: var(--blue-200, #bfdbfe);
}

.comment-section {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  opacity: 0;
}

.comment-section.open {
  max-height: 600px;
  opacity: 1;
}

.comment-section-inner {
  background: #f9fafb;
  border-top: 1px solid var(--border);
  padding: .85rem 1.1rem;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin-bottom: .75rem;
}

.comment-list:empty::before {
  content: 'No comments yet. Be the first!';
  display: block;
  font-size: .78rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: .5rem 0;
}

.comment-item {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  padding: .6rem .75rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.comment-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-500), var(--violet-500));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  letter-spacing: .5px;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-author {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: .1rem;
}

.comment-text {
  font-size: .9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
}

.comment-date {
  font-size: .68rem;
  color: var(--text-muted);
  margin-top: .2rem;
}

.comment-input-row {
  display: flex;
  gap: .5rem;
  align-items: flex-end;
}

.comment-input {
  flex: 1;
  padding: .5rem .75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--surface);
  resize: none;
  outline: none;
  line-height: 1.4;
  transition: border-color var(--transition), box-shadow var(--transition);
  min-height: 38px;
  max-height: 100px;
}

.comment-input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}

.comment-input::placeholder {
  color: var(--text-muted);
}

.comment-send-btn {
  padding: .45rem .85rem;
  background: var(--blue-600);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.comment-send-btn:hover:not(:disabled) {
  background: var(--blue-700);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(37, 99, 235, .35);
}

.comment-send-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.comment-spinner {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
}

/* ═══════════ FILE ATTACHMENT BOX ═══════════ */
.attach-box {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .32rem .8rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-secondary);
  max-width: 160px;
}

.attach-box-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.attach-download {
  flex-shrink: 0;
  padding: .18rem .5rem;
  background: var(--blue-600);
  color: white;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--transition);
}

.attach-download:hover {
  background: var(--blue-700);
}

/* ═══════════ SCRIPT SOURCE & ASSIGNMENT FIELD LOGIC ═══════════ */
#script-pending-notice {
  display: none;
}

#script-pending-notice.visible {
  display: flex !important;
}

/* Attachment URL link hover */
a[href].attach-url-link:hover {
  background: var(--blue-100) !important;
  color: var(--blue-700) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, .18);
}

/* ═══════════ GLASSMORPHISM ENHANCEMENTS ═══════════ */
.glass-card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.08);
}

/* Stat cards simplified */
.stat-card {
  background: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
  transform: none !important;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.2);
}

/* Count-up animation flash */
@keyframes countUp {
  0% {
    transform: scale(1.3);
    opacity: 0;
    color: var(--blue-500);
  }

  60% {
    transform: scale(0.97);
  }

  100% {
    transform: scale(1);
    opacity: 1;
    color: var(--text-primary);
  }
}

.stat-val.counting {
  animation: countUp 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Navbar glassmorphism */
#navbar {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  height: 70px;
  box-shadow: none;
}

/* Nav avatar as image */
.nav-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* Profile button in nav */
.btn-profile {
  background: rgba(59, 130, 246, 0.08);
  color: var(--blue-600);
  border: 1px solid rgba(59, 130, 246, 0.18);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.btn-profile:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue-700);
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-1px);
}

/* ═══════════ PROFILE MODAL ═══════════ */
#profile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 15000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms cubic-bezier(.4, 0, .2, 1);
  overflow-y: auto;
}

#profile-overlay.prof-open {
  opacity: 1;
  pointer-events: all;
}

.profile-modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.05);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  transform: scale(.9) translateY(16px);
  opacity: 0;
  transition: transform 280ms cubic-bezier(.34, 1.56, .64, 1), opacity 220ms cubic-bezier(.4, 0, .2, 1);
  margin: auto;
}

#profile-overlay.prof-open .profile-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.profile-modal-header {
  background: linear-gradient(140deg, #1e3a8a 0%, #2563eb 60%, #60a5fa 100%);
  padding: 1.75rem 2rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.profile-modal-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 300px 200px at 90% -10%, rgba(99, 102, 241, .4) 0%, transparent 65%);
}

.profile-modal-header-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.profile-modal-header-text h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  margin-bottom: .15rem;
}

.profile-modal-header-text p {
  font-size: .78rem;
  color: rgba(255, 255, 255, .7);
}

.profile-modal-close {
  margin-left: auto;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .2);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}

.profile-modal-close:hover {
  background: rgba(255, 255, 255, .25);
}

.profile-modal-close svg {
  width: 14px;
  height: 14px;
}

/* Avatar section in header */
.profile-avatar-wrap {
  position: relative;
  display: inline-block;
}

.profile-big-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  border: 2.5px solid rgba(255, 255, 255, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  overflow: hidden;
  flex-shrink: 0;
}

.profile-big-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-avatar-upload-btn {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
  transition: transform var(--transition);
  color: var(--blue-600);
}

.profile-avatar-upload-btn:hover {
  transform: scale(1.1);
}

.profile-avatar-upload-btn svg {
  width: 12px;
  height: 12px;
}

input[type="file"]#profileAvatarInput {
  display: none;
}

.profile-modal-body {
  padding: 1.75rem 2rem 2rem;
}

.profile-form .form-group {
  margin-bottom: 1rem;
}

.profile-modal-footer {
  display: flex;
  gap: .65rem;
  justify-content: flex-end;
  padding-top: .5rem;
}

#profile-server-msg {
  border-radius: var(--radius);
  padding: .65rem .9rem;
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: 1rem;
  display: none;
  align-items: center;
  gap: .5rem;
  line-height: 1.4;
}

#profile-server-msg.msg-error {
  display: flex;
  background: var(--red-50);
  color: var(--red-700);
  border: 1px solid var(--red-100);
}

#profile-server-msg.msg-success {
  display: flex;
  background: var(--green-50);
  color: var(--green-700);
  border: 1px solid var(--green-100);
}

#profile-server-msg svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

/* Avatar preview below upload input */
.avatar-preview-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: .5rem;
}

.avatar-preview-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  display: none;
}

.avatar-preview-thumb.visible {
  display: block;
}

.avatar-file-name {
  font-size: .78rem;
  color: var(--blue-600);
  font-weight: 500;
}

/* ═══════════ WORKFLOW LEVELS ═══════════ */
.wf-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .22rem .62rem;
  border-radius: 99px;
  font-size: .68rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .3px;
}

.rating-stars {
  display: flex;
  gap: 3px;
  margin-top: 8px;
}

.rating-stars .star {
  cursor: pointer;
  font-size: 1.3rem;
  color: #d1d5db;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1;
}

.rating-stars .star.filled {
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

.rating-stars .star:hover {
  transform: scale(1.2);
  color: #f59e0b;
}

.rating-stars .star-static {
  cursor: default;
  font-size: 1.1rem;
  color: #fbbf24;
}

.wf-script-pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.wf-script-approved {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.wf-assigned {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #c4b5fd;
}

.wf-editing {
  background: #fef9c3;
  color: #92400e;
  border: 1px solid #fde047;
}

.wf-output-submitted {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.wf-changes-required {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.wf-approved {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.wf-completed {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.wf-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .4rem;
}

.btn-approve {
  background: var(--green-50);
  color: var(--green-700);
  border: 1px solid var(--green-100);
  padding: .3rem .7rem;
  font-size: .78rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

.btn-approve:hover {
  background: var(--green-100);
  color: var(--green-700);
  transform: translateY(-1px);
}

.btn-reject {
  background: var(--red-50);
  color: var(--red-600);
  border: 1px solid var(--red-100);
  padding: .3rem .7rem;
  font-size: .78rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

.btn-reject:hover {
  background: var(--red-100);
  transform: translateY(-1px);
}

.btn-wf {
  background: var(--blue-600);
  color: #fff;
  border: none;
  padding: .4rem .9rem;
  font-size: .8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
  font-weight: 700;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-wf:hover {
  background: var(--blue-700);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.btn-review-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: .3rem .75rem;
  border-radius: 8px;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--violet-200);
  background: var(--violet-50);
  color: var(--violet-700);
  transition: all var(--transition);
}

.btn-review-toggle:hover {
  background: var(--violet-600);
  color: #fff;
  border-color: var(--violet-600);
}

.btn-complete {
  background: var(--violet-50);
  color: var(--violet-700);
  border: 1px solid var(--violet-100);
  padding: .3rem .7rem;
  font-size: .78rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

.btn-complete:hover {
  background: var(--violet-100);
  transform: translateY(-1px);
}

.assign-editor-wrap {
  display: flex;
  gap: .35rem;
  align-items: center;
  margin-top: .35rem;
  flex-wrap: wrap;
}

.assign-editor-sel {
  padding: .28rem .65rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .8rem;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--surface);
  cursor: pointer;
  outline: none;
}

.assign-editor-sel:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}

.change-history-box {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
  font-size: .78rem;
  color: #92400e;
  margin-top: .35rem;
  max-width: 320px;
  line-height: 1.5;
}

.change-history-box strong {
  display: block;
  margin-bottom: .2rem;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .4px;
}

/* Script source radio row */
.script-source-row {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: .3rem;
}

.script-source-opt {
  display: flex;
  align-items: center;
  gap: .38rem;
  font-size: .875rem;
  color: var(--text-primary);
  cursor: pointer;
  padding: .38rem .75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  font-weight: 500;
}

.script-source-opt:has(input:checked) {
  border-color: var(--blue-500);
  background: var(--blue-50);
  color: var(--blue-700);
}

.script-source-opt input {
  accent-color: var(--blue-600);
  margin: 0;
}

#script-internal-note {
  font-size: .78rem;
  color: var(--amber-700);
  background: var(--amber-50);
  border: 1px solid var(--amber-100);
  padding: .45rem .7rem;
  border-radius: var(--radius-sm);
  margin-top: .5rem;
  display: none;
}

#script-internal-note.visible {
  display: block;
}

.editor-submit-box {
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
  margin-top: .35rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.editor-submit-box p {
  font-size: .8rem;
  color: var(--blue-700);
  margin: 0;
}

.change-msg-box {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
  font-size: .8rem;
  color: #92400e;
  line-height: 1.5;
  margin-top: .35rem;
}

/* ═══════════ MANAGE CLIENTS PANEL ═══════════ */
.manage-clients-wrap {
  margin-bottom: 1rem;
}

.manage-clients-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.85rem;
  background: #f5f3ff;
  border: 1.5px solid #ddd6fe;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  color: #5b21b6;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  justify-content: center;
}

.manage-clients-toggle:hover {
  background: #ede9fe;
  border-color: #c4b5fd;
}

.mc-chevron {
  margin-left: auto;
  transition: transform 250ms ease;
}

.manage-clients-panel {
  display: none;
  margin-top: 0.6rem;
  border: 1.5px solid #ddd6fe;
  border-radius: 10px;
  overflow: hidden;
  background: #faf5ff;
}

.manage-clients-panel.open {
  display: block;
}

.manage-clients-toggle.open .mc-chevron {
  transform: rotate(180deg);
}

.mc-add-row {
  display: flex;
  gap: 0.45rem;
  align-items: stretch;
  padding: 0.75rem 0.85rem 0.5rem;
}

.mc-inp {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem !important;
  padding: 0.4rem 0.7rem !important;
}

.mc-cat-sel {
  width: 110px;
  flex-shrink: 0;
  font-size: 0.8rem !important;
  padding: 0.4rem 0.5rem !important;
}

.mc-add-btn {
  flex-shrink: 0;
  padding: 0.4rem 0.75rem !important;
  font-size: 0.8rem !important;
  white-space: nowrap;
}

.mc-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 0.4rem 0.85rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mc-empty {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.75rem 0;
}

.mc-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.7rem;
  background: #fff;
  border: 1.5px solid #ede9fe;
  border-radius: 8px;
  transition: all var(--transition);
}

.mc-item:hover {
  border-color: #c4b5fd;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.1);
}

.mc-item-name {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mc-item-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
}

.mc-item-badge.regular {
  background: #f3f4f6;
  color: #6b7280;
}

.mc-item-badge.reputed {
  background: #fef3c7;
  color: #d97706;
}

.mc-del-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  transition: all var(--transition);
  padding: 0;
}

.mc-del-btn:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--red-500);
}

.mc-del-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
}

/* ═══════════ MEDIA REVIEW PANEL ═══════════ */
.mr-panel {
  border-top: 1.5px solid var(--border);
  background: #fafbff;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  /* removed jarring transform animation that caused shaking */
}

.mr-panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .75rem 1.1rem;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  border-bottom: 1.5px solid #e0e7ff;
  flex-wrap: wrap;
}

.mr-panel-hd-left {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .82rem;
  font-weight: 700;
  color: #4338ca;
}

.mr-panel-hd-left svg {
  width: 15px;
  height: 15px;
  stroke: #4338ca;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mr-toggle-btn {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  gap: .35rem;
  padding: .6rem 1rem;
  border-radius: 10px;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid var(--blue-100);
  background: #fff;
  color: var(--blue-600);
  transition: all var(--transition);
  font-family: var(--font);
  box-shadow: var(--shadow-sm);
}

.mr-toggle-btn:hover {
  background: var(--blue-50);
  color: var(--blue-700);
  border-color: var(--blue-500);
  transform: translateY(-1px);
}

.mr-toggle-btn svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
}

.mr-body {
  display: block;
  padding: .9rem 1.1rem;
  background: #fff;
}

/* ── Upload Zone ── */
.mr-upload-zone {
  border: 2px dashed #c7d2fe;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: #fafafe;
  margin-bottom: .9rem;
  position: relative;
}

.mr-upload-zone:hover,
.mr-upload-zone.drag-over {
  border-color: #6366f1;
  background: #eef2ff;
}

.mr-upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.mr-upload-icon {
  width: 32px;
  height: 32px;
  stroke: #818cf8;
  fill: none;
  stroke-width: 1.5;
  margin: 0 auto .5rem;
  display: block;
}

.mr-upload-label {
  font-size: .8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.mr-upload-label strong {
  color: #4338ca;
}

.mr-upload-hint {
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: .2rem;
}

.mr-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem 1rem;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 700;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
  margin-top: .55rem;
}

.mr-upload-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, .35);
}

.mr-upload-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.mr-upload-btn svg {
  width: 13px;
  height: 13px;
  stroke: white;
  fill: none;
  stroke-width: 2.5;
}

.mr-upload-prog {
  display: none;
  width: 100%;
  height: 4px;
  background: #e0e7ff;
  border-radius: 99px;
  margin-top: .5rem;
  overflow: hidden;
}

.mr-upload-prog-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 99px;
  transition: width .3s;
}

/* ── Media Files List ── */
.mr-files-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.mr-files-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin-bottom: .9rem;
}

.mr-file-item {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .65rem .9rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  transition: all var(--transition);
  cursor: pointer;
}

.mr-file-item:hover {
  border-color: #a5b4fc;
  box-shadow: 0 2px 8px rgba(99, 102, 241, .1);
}

.mr-file-item.selected {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
  background: #f5f3ff;
}

.mr-file-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mr-file-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mr-file-icon.icon-video {
  background: #fef3c7;
}

.mr-file-icon.icon-video svg {
  stroke: #d97706;
}

.mr-file-icon.icon-image {
  background: #ecfdf5;
}

.mr-file-icon.icon-image svg {
  stroke: #059669;
}

.mr-file-icon.icon-pdf {
  background: #fef2f2;
}

.mr-file-icon.icon-pdf svg {
  stroke: #dc2626;
}

.mr-file-icon.icon-psd {
  background: #faf5ff;
}

.mr-file-icon.icon-psd svg {
  stroke: #7c3aed;
}

.mr-file-icon.icon-other {
  background: var(--surface-2);
}

.mr-file-icon.icon-other svg {
  stroke: var(--text-muted);
}

.mr-file-info {
  flex: 1;
  min-width: 0;
}

.mr-file-name {
  font-size: .83rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mr-file-meta {
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: .1rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.mr-version-badge {
  display: inline-flex;
  align-items: center;
  padding: .15rem .45rem;
  border-radius: 5px;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

/* ── Review Status Badges ── */
.mr-status-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .18rem .6rem;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  flex-shrink: 0;
}


.mr-status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mrs-pending {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.mrs-pending::before {
  background: #94a3b8;
}

.mrs-in_review {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.mrs-in_review::before {
  background: #3b82f6;
}

.mrs-needs_changes {
  background: #fefce8;
  color: #854d0e;
  border: 1px solid #fde68a;
}

.mrs-needs_changes::before {
  background: #f59e0b;
}

.mrs-approved {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.mrs-approved::before {
  background: #22c55e;
}

/* ── Review Status Selector (admin) ── */
.mr-status-sel {
  font-size: .75rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: .25rem .5rem;
  font-family: var(--font);
  background: #fff;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
}

.mr-status-sel:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

/* ── Media Preview Area ── */
.mr-preview-wrap {
  background: #0f172a;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: .9rem;
  display: none;
  position: relative;
}

.mr-preview-wrap.show {
  display: block;
}

.mr-preview-wrap video {
  width: 100%;
  max-height: 380px;
  display: block;
}

.mr-preview-wrap img {
  width: 100%;
  max-height: 380px;
  object-fit: contain;
  display: block;
}

.mr-preview-iframe {
  width: 100%;
  height: 480px;
  border: none;
  display: block;
}

.mr-download-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .75rem;
  border-radius: 7px;
  font-size: .75rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  background: #4338ca;
  margin-top: .55rem;
  transition: all var(--transition);
}

.mr-download-btn:hover {
  background: #3730a3;
}

.mr-download-btn svg {
  width: 12px;
  height: 12px;
  stroke: white;
  fill: none;
  stroke-width: 2.5;
}

/* ── Comments Thread ── */
.mr-comments-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.mr-comments-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: .75rem;
  max-height: 260px;
  overflow-y: auto;
}

.mr-comment-empty {
  font-size: .82rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1rem 0;
}

.mr-comment-item {
  display: flex;
  gap: .6rem;
  animation: alFadeIn .25s ease both;
}

.mr-comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 800;
  color: #fff;
}

.mr-comment-avatar.role-admin {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

.mr-comment-avatar.role-employee {
  background: linear-gradient(135deg, #059669, #0d9488);
}

.mr-comment-body {
  flex: 1;
  min-width: 0;
}

.mr-comment-header {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .1rem;
}

.mr-comment-name {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-primary);
}

.mr-comment-role-badge {
  font-size: .63rem;
  font-weight: 700;
  padding: .08rem .35rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.mr-comment-role-badge.badge-admin {
  background: #eef2ff;
  color: #4338ca;
}

.mr-comment-role-badge.badge-employee {
  background: #ecfdf5;
  color: #059669;
}

.mr-comment-ts {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 5px;
  font-size: .7rem;
  font-weight: 700;
  padding: .05rem .35rem;
  margin-bottom: .2rem;
  display: inline-block;
}

.mr-comment-text {
  font-size: .8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  word-break: break-word;
}

.mr-comment-time {
  font-size: .68rem;
  color: var(--text-muted);
  margin-top: .1rem;
}

/* ── Comment Input ── */
.mr-comment-input-wrap {
  display: flex;
  gap: .5rem;
  align-items: flex-end;
  border-top: 1px solid var(--border);
  padding-top: .65rem;
}

.mr-comment-input-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-width: 0;
}

.mr-ts-row {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.mr-ts-label {
  font-size: .71rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.mr-ts-input {
  width: 80px;
  padding: .25rem .5rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: .78rem;
  font-family: var(--font);
  outline: none;
}

.mr-ts-input:focus {
  border-color: #6366f1;
}

.btn-io-frame {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #f5f3ff;
  color: #7c3aed;
  border: 1px solid #ddd6fe;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  margin-left: 2px;
}

.btn-io-frame:hover {
  background: #ede9fe;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(124, 58, 237, 0.1);
}

.btn-io-frame:active {
  transform: translateY(0);
}

.mr-comment-textarea {
  width: 100%;
  padding: .5rem .7rem;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: .83rem;
  font-family: var(--font);
  resize: none;
  outline: none;
  line-height: 1.4;
  transition: border-color var(--transition);
}

.mr-comment-textarea:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .1);
}

.mr-send-btn {
  padding: .5rem .8rem;
  border-radius: 9px;
  font-size: .78rem;
  font-weight: 700;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  align-self: flex-end;
  display: flex;
  align-items: center;
  gap: .35rem;
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.mr-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(79, 70, 229, .35);
}

.mr-send-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.mr-send-btn svg {
  width: 11px;
  height: 11px;
  stroke: white;
  fill: none;
  stroke-width: 2.5;
}

/* No-media empty state */
.mr-no-media {
  text-align: center;
  padding: 1.25rem 1rem;
  color: var(--text-muted);
}

.mr-no-media svg {
  width: 38px;
  height: 38px;
  stroke: #d1d5db;
  fill: none;
  stroke-width: 1.5;
  margin: 0 auto .6rem;
  display: block;
}

.mr-no-media p {
  font-size: .82rem;
}

/* ═══════════ ACTIVITY LOG SECTION ═══════════ */
/* Activity log removed */

/* ═══════════ REPUTED CLIENTS SECTION ═══════════ */
.reputed-sec {
  margin-bottom: 1.5rem;
}

.reputed-sec-hd {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.reputed-sec-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.reputed-sec-icon svg {
  width: 22px;
  height: 22px;
  stroke: white;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reputed-sec-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.reputed-sec-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

.reputed-search-wrap {
  margin-left: auto;
  position: relative;
}

.reputed-search-wrap svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  stroke: #9ca3af;
  fill: none;
  stroke-width: 2;
  pointer-events: none;
}

#reputed-search {
  padding: 0.5rem 1rem 0.5rem 2.3rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--text-primary);
  background: #fff;
  outline: none;
  transition: border-color 200ms ease, box-shadow 200ms ease;
  width: 240px;
}

#reputed-search:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.reputed-empty {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.reputed-empty svg {
  width: 42px;
  height: 42px;
  stroke: #d1d5db;
  fill: none;
  stroke-width: 1.5;
  margin: 0 auto 1rem;
  display: block;
}

.client-group {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  transition: box-shadow var(--transition);
}

.client-group:hover {
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.1);
}

.client-group-hd {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-bottom: 1.5px solid #fde68a;
  cursor: pointer;
  user-select: none;
}

.client-group-hd:hover {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.client-logo-circle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -0.5px;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.3);
}

.client-group-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: #92400e;
  flex: 1;
}

.client-proj-count {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  background: #f59e0b;
  color: #fff;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 800;
}

.client-group-arrow {
  width: 18px;
  height: 18px;
  stroke: #92400e;
  fill: none;
  stroke-width: 2.5;
  transition: transform 300ms ease;
  flex-shrink: 0;
}

.client-group.collapsed .client-group-arrow {
  transform: rotate(-90deg);
}

.client-projects-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  transition: all 300ms ease;
}

.client-group.collapsed .client-projects-list {
  display: none;
}

.project-card {
  background: #fafafa;
  border: 1.5px solid #f3f4f6;
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all var(--transition);
}

.project-card:hover {
  background: #fff;
  border-color: #fbbf24;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.12);
  transform: translateY(-2px);
}

.project-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.project-card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.project-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.project-meta-chip svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.project-output-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition);
  margin-top: 0.2rem;
  align-self: flex-start;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.25);
}

.project-output-btn:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
}

.project-output-btn svg {
  width: 12px;
  height: 12px;
  stroke: white;
  fill: none;
  stroke-width: 2.5;
}

/* ═══════════ RESET PASSWORD SCREEN ═══════════ */
#reset-pw-screen {
  position: fixed;
  inset: 0;
  background: #050b1a;
  display: none;
  align-items: stretch;
  z-index: 9999;
  overflow-y: auto;
  overflow-x: hidden;
}

#reset-pw-screen.active {
  display: flex;
}

.rpw-left {
  flex: 0 0 45%;
  background: linear-gradient(145deg, #0f1729 0%, #1a1060 40%, #2d1b7e 70%, #1e0a5c 100%);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 4rem 3.5rem;
  overflow: hidden;
}

.rpw-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 500px at 30% 20%, rgba(99, 102, 241, 0.35) 0%, transparent 60%),
    radial-gradient(ellipse 500px 400px at 80% 80%, rgba(168, 85, 247, 0.3) 0%, transparent 60%);
  animation: loginGlowPulse 8s ease-in-out infinite alternate;
}

.rpw-left::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.rpw-brand {
  position: relative;
  z-index: 2;
  margin-bottom: 2rem;
}

.rpw-brand-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(168, 85, 247, 0.9));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.rpw-brand-icon svg {
  width: 28px;
  height: 28px;
  stroke: white;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rpw-brand-name {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 0.4rem;
}

.rpw-brand-name span {
  background: linear-gradient(90deg, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rpw-tagline {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.55);
}

.rpw-info-box {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  backdrop-filter: blur(10px);
}

.rpw-info-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.75rem;
}

.rpw-info-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

.rpw-info-item:last-child {
  margin-bottom: 0;
}

.rpw-info-dot {
  width: 6px;
  height: 6px;
  background: #818cf8;
  border-radius: 50%;
  flex-shrink: 0;
}

.rpw-right {
  flex: 1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  position: relative;
}

.rpw-right::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(99, 102, 241, 0.15), transparent);
}

.rpw-form-wrap {
  width: 100%;
  max-width: 400px;
  animation: formFadeIn 0.5s ease 0.1s both;
}

.rpw-success-box,
.rpw-expired-box {
  text-align: center;
  padding: 1rem 0;
}

.rpw-success-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25);
}

.rpw-success-icon svg {
  width: 34px;
  height: 34px;
  stroke: #059669;
  fill: none;
  stroke-width: 2.5;
}

.rpw-expired-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.2);
}

.rpw-expired-icon svg {
  width: 34px;
  height: 34px;
  stroke: #dc2626;
  fill: none;
  stroke-width: 2.5;
}

.rpw-success-title,
.rpw-expired-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}

.rpw-success-sub,
.rpw-expired-sub {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 1.75rem;
}

.rpw-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 50px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 4px 18px rgba(79, 70, 229, 0.35);
  text-decoration: none;
  margin-top: 0.5rem;
}

.rpw-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45);
}

@media (max-width: 820px) {
  #reset-pw-screen {
    flex-direction: column;
  }

  .rpw-left {
    flex: 0 0 auto;
    padding: 2.5rem 2rem;
  }

  .rpw-info-box {
    display: none;
  }

  .rpw-right {
    padding: 2.5rem 1.5rem;
  }
}

/* ═══════════ NEXT DAY SCHEDULE ═══════════ */
.schedule-sec {
  margin-top: 1.5rem;
  animation: alFadeIn .4s ease both;
}

.schedule-admin-sec {
  margin-top: 1.5rem;
  animation: alFadeIn .4s ease both;
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.schedule-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.schedule-card:hover {
  border-color: var(--blue-500);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

.sch-date-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--blue-50);
  color: var(--blue-700);
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  margin-bottom: .75rem;
}

.sch-time {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: .4rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.sch-reason {
  font-size: .875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.sch-emp-name {
  font-size: .75rem;
  font-weight: 700;
  color: var(--violet-600);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: .8rem;
  display: block;
}

.sch-del-btn {
  position: absolute;
  top: .75rem;
  right: .75rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem;
  border-radius: 50%;
  transition: all var(--transition);
}

.sch-del-btn:hover {
  background: var(--red-50);
  color: var(--red-500);
}

.sch-form-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 2px dashed var(--blue-200);
}

.sch-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--surface-2);
  border-radius: var(--radius-xl);
  color: var(--text-muted);
}

.sch-empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  opacity: .4;
}

/* Grouping by day in admin view */
.sch-day-group {
  margin-bottom: 2.5rem;
}

.sch-day-hd {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--border);
}

.sch-day-hd svg {
  color: var(--blue-500);
}

/* ════════════ MOBILE & TABLET OPTIMIZATIONS (iOS & Android) ════════════ */
@media (max-width: 768px) {

  /* 📱 Fix Navbar for small screens */
  #navbar {
    height: auto;
    padding: 0.8rem 1.5rem;
    flex-direction: column;
    gap: 0.8rem;
    align-items: flex-start;
  }

  .nav-right {
    width: 100%;
    justify-content: center;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .nav-sep {
    display: none;
  }

  .nav-brand-name span {
    display: none;
  }

  /* Only show icons in nav buttons on narrow mobile */
  .nav-right .btn-sm span,
  .nav-right .btn-sm {
    font-size: 0;
    padding: 0.5rem;
    border-radius: 50%;
  }

  .nav-right .btn-sm svg {
    width: 18px;
    height: 18px;
    margin: 0;
  }

  .nav-user-stack {
    display: none;
  }

  /* 📊 Dashboard Table Fixes */
  .tbl-wrap {
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px var(--border);
  }

  /* Hide less vital columns on mobile via CSS - DISABLED to allow Action column visibility */
  /* table thead th:nth-child(4),
  table tbody td:nth-child(4),
  table thead th:nth-child(5),
  table tbody td:nth-child(5) {
    display: none;
  } */

  /* 🏗️ Modals - Make them fill the screen better on mobile */
  .modal {
    max-width: 95% !important;
    padding: 1.5rem !important;
    border-radius: var(--radius-lg);
  }

  .p3-detail-modal {
    width: 100% !important;
    height: 100% !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
  }

  .modal-header-3d {
    padding: 1rem;
  }

  .p3-modal-body {
    padding: 1rem;
  }

  /* 🎬 Media Review Panel improvements */
  .mr-panel-hd {
    padding: 0.6rem 1rem;
  }

  .btn-review-toggle {
    padding: 0.5rem 0.8rem;
    /* larger hit area */
  }

  .mr-upload-btn {
    width: 100%;
    justify-content: center;
    padding: 0.8rem;
  }

  /* 📅 Stats Grid */
  .stats-grid {
    gap: 0.8rem;
  }

  .stat-card {
    padding: 1rem;
  }
}

@media (max-width: 480px) {

  /* 🔒 Login Page Mobile Fix */
  .login-card {
    padding: 1.5rem;
    border-radius: 0;
    min-height: 100vh;
    width: 100%;
    box-shadow: none;
    border: none;
  }

  .login-header-logo {
    width: 48px;
    height: 48px;
  }

  .login-header h1 {
    font-size: 1.5rem;
  }

  /* Page Title spacing */
  .page-hd {
    margin-bottom: 1.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .pg-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .pg-actions .btn {
    flex: 1;
    justify-content: center;
  }

  /* Workflow buttons stacking */
  .wf-action-group {
    flex-direction: column !important;
    width: 100%;
    gap: 0.6rem !important;
  }

  .wf-action-group button {
    width: 100%;
    justify-content: center;
    padding: 0.6rem;
  }
}

/* 🍎 iOS specific touch fixes */
@supports (-webkit-touch-callout: none) {

  .btn,
  .btn-wf,
  .btn-review-toggle {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  select,
  input,
  textarea {
    font-size: 16px !important;
    /* Prevents auto-zoom on iOS */
  }
}

/* 📱 MOBILE FIXES (Android & iOS) continued */
@media (max-width: 768px) {
  body {
    /* Support for iPhone Notch and Home Indicator */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .nav-avatar {
    width: 38px;
    height: 38px;
    font-size: 0.85rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Attendance Section Mobile */
  .attendance-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .atten-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding: 0.8rem 1.2rem;
  }

  .attendance-actions {
    flex-direction: column;
  }

  .attendance-actions button {
    width: 100%;
    min-height: 48px;
  }

  /* Table Responsiveness */
  .p3-table-wrap {
    margin-left: -1rem;
    margin-right: -1rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .p3-table {
    min-width: 600px;
  }

  .p3-table th,
  .p3-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
  }

  .card-hd,
  .attendance-hd {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .attendance-status {
    align-self: flex-start;
  }

  #main-content {
    padding: 1.25rem 1rem 3rem;
  }

  .workspace-switcher {
    width: 100%;
    flex-direction: column;
  }

  .ws-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  h1 {
    font-size: 1.4rem;
  }

  .stat-val {
    font-size: 1.5rem;
  }

  .btn {
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    min-height: 44px;
  }

  /* Better Modal Close on Mobile */
  .modal {
    border-radius: 1.25rem 1.25rem 0 0;
  }

  /* Stack Task Form sections */
  .top-row-grid {
    grid-template-columns: 1fr;
  }

  /* Ensure notifications panel is full width on mobile */
  .notif-panel {
    width: calc(100vw - 2rem);
    right: 1rem;
    left: 1rem;
    position: fixed;
    top: 70px;
  }

  /* Mobile Table Enhancements */
  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
  }
}

/* ─── Stability Overrides ─── */
body {
  background: #f8fafc !important;
  background-image: none !important;
}

/* Create Section Safety — scoped only, does NOT affect global pseudo-elements */
#create-sec {
  background: transparent !important;
  overflow: visible !important;
}

#create-sec .card {
  overflow: visible !important;
  height: 100% !important;
}

/* Form layout helpers */
.form-content {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  flex-grow: 1;
  justify-content: center;
}

.form-actions {
  margin-top: auto;
  padding-top: 1rem;
}

.form-actions button {
  width: 100%;
}

#task-form-content .form-group {
  margin-bottom: 0.8rem;
}

.form-control {
  height: 38px;
}

textarea.form-control {
  min-height: 80px;
  height: auto;
}

.form-section:not(:last-child) {
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  padding-bottom: 0.8rem;
}

.add-client-text {
  color: var(--blue-600);
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  margin-left: 0.5rem;
  display: flex;
  align-items: center;
}

.add-client-text:hover {
  text-decoration: underline;
}

.chart-pill {
  background: #22c55e !important;
  color: white !important;
  padding: 2px 8px !important;
  border-radius: 4px !important;
  font-size: 0.65rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.chart-pill-dot {
  background: white !important;
  width: 5px !important;
  height: 5px !important;
}

/* 📱 Premium Mobile System (Overhaul) */
@media (max-width: 820px) {
  .tbl-wrap {
    margin: 0;
    background: transparent;
    box-shadow: none;
  }

  table {
    border-collapse: separate;
    border-spacing: 0 12px;
  }

  thead {
    display: none;
  }

  /* Hide headers entirely */
  tr {
    display: flex !important;
    flex-direction: column;
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 1.25rem;
    margin-bottom: 4px;
    transition: transform 0.2s;
    position: relative;
  }

  td {
    display: block !important;
    padding: 0.5rem 0 !important;
    width: 100% !important;
    border: none !important;
    text-align: left !important;
    min-height: auto !important;
  }

  /* Folder Styles */
  tr.folder-header-row {
    padding: 1rem;
    background: var(--blue-50);
    border: 1.5px solid var(--blue-100);
    border-radius: 12px;
    margin: 2rem 0 0.5rem;
    cursor: pointer;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
  }

  tr.folder-header-row td {
    padding: 0 !important;
    font-size: 0.9rem !important;
  }

  tr.folder-header-row::after {
    content: '↕ Toggle';
    font-size: 0.65rem;
    color: var(--blue-600);
    font-weight: 800;
    text-transform: uppercase;
    background: var(--blue-100);
    padding: 4px 10px;
    border-radius: 20px;
  }

  /* Task Card Layout */
  td[data-label="TASK TITLE"] {
    border-bottom: 2px solid var(--slate-50) !important;
    padding-bottom: 0.75rem !important;
    margin-bottom: 0.5rem;
    font-weight: 700;
  }

  td[data-label="TASK TITLE"] div:first-child {
    font-size: 1.15rem !important;
    font-weight: 900;
    color: var(--slate-900);
  }

  /* Row-based info for meta */
  td[data-label="Status"],
  td[data-label="Deadline"],
  td[data-label="Time Tracked"],
  td[data-label="Assigned to"] {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0 !important;
    font-size: 0.85rem;
    color: var(--slate-600);
  }

  td[data-label]::before {
    content: attr(data-label);
    font-weight: 800;
    font-size: 0.68rem;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 0.8px;
  }

  /* Actions - Full width at bottom */
  td:last-child {
    margin-top: 1rem;
    padding-top: 1rem !important;
    border-top: 2px solid var(--slate-50) !important;
    display: flex !important;
    width: 100% !important;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
  }

  td:last-child div {
    justify-content: stretch !important;
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  td:last-child button {
    width: 100%;
    margin: 0 !important;
    font-weight: 800 !important;
    height: 44px;
  }

  /* Rating Stars */
  .rating-stars {
    justify-content: flex-end;
  }

  .dashboard-container-fixed {
    padding: 0 0.75rem;
  }

  .card {
    padding: 1.25rem !important;
  }
}

.dashboard-container-fixed {
  width: 100%;
  max-width: none !important;
  margin: 0 auto !important;
  padding: 0 2rem 0 3.5rem;
  /* Spacious padding to align with layout */
}

/* ─── Fixed-width form grid for mobile ─── */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {

  .form-grid-2,
  .form-group-row {
    grid-template-columns: 1fr;
  }
}

/* 📱 MOBILE OVERLAP FIX & STACKING */
@media (max-width: 1100px) {

  html,
  body {
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100vw;
    position: relative;
  }

  #app,
  .main-content,
  .c-grid {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    position: relative;
    box-sizing: border-box !important;
  }

  /* Enforce "one by one" stacking securely using FLEX to override grid placements */
  html body[data-role="admin"] #top-row-grid,
  html body[data-role="superadmin"] #top-row-grid {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    max-width: 100vw;
    width: 100%;
    margin: 0 auto;
    overflow-x: hidden;
    box-sizing: border-box;
    padding: 0 1rem;
  }

  /* Fix Task Create Disappearing & Grid Column Overlap */
  #create-sec,
  #chart-sec,
  #emp-create-col {
    height: auto !important;
    min-height: auto !important;
    position: relative !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 auto !important;
    grid-column: auto !important;
    grid-row: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }

  #create-sec .card,
  #chart-sec .card,
  #emp-create-col .card {
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    width: 100% !important;
    max-width: 360px !important;
    margin: 0 auto !important;
    border-radius: 16px !important;
  }

  /* Mobile Sizing Adjustments: Make fonts/padding smaller */
  #create-sec .card-body,
  #chart-sec .card-body,
  #emp-create-col .card-body {
    padding: 1.25rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }

  tr.folder-header-row {
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
  }

  tr.folder-header-row td {
    padding: 0 !important;
    font-size: 0.9rem !important;
  }

  tr.folder-header-row::after {
    content: '↕ Toggle';
    font-size: 0.65rem;
    color: var(--blue-600);
    font-weight: 800;
    text-transform: uppercase;
    background: var(--blue-100);
    padding: 4px 10px;
    border-radius: 20px;
  }

  /* Task Card Layout */
  td[data-label="TASK TITLE"] {
    border-bottom: 2px solid var(--slate-50) !important;
    padding-bottom: 0.75rem !important;
    margin-bottom: 0.5rem;
    font-weight: 700;
  }

  td[data-label="TASK TITLE"] div:first-child {
    font-size: 1.15rem !important;
    font-weight: 900;
    color: var(--slate-900);
  }

  /* Row-based info for meta */
  td[data-label="Status"],
  td[data-label="Deadline"],
  td[data-label="Time Tracked"],
  td[data-label="Assigned to"] {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0 !important;
    font-size: 0.85rem;
    color: var(--slate-600);
  }

  td[data-label]::before {
    content: attr(data-label);
    font-weight: 800;
    font-size: 0.68rem;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 0.8px;
  }

  /* Actions - Full width at bottom */
  td:last-child {
    margin-top: 1rem;
    padding-top: 1rem !important;
    border-top: 2px solid var(--slate-50) !important;
    display: flex !important;
    width: 100% !important;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
  }

  td:last-child div {
    justify-content: stretch !important;
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  td:last-child button {
    width: 100%;
    margin: 0 !important;
    font-weight: 800 !important;
    height: 44px;
  }

  /* Rating Stars */
  .rating-stars {
    justify-content: flex-end;
  }

  .dashboard-container-fixed {
    padding: 0 0.75rem;
  }

  .card {
    padding: 1.25rem !important;
  }
}

/* Comment Delete Button Styles */
.cmt-del-btn {
  background: none;
  border: none;
  color: var(--slate-400);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0 4px;
  opacity: 0.4;
  transition: all 0.2s;
  margin-left: 8px;
}

.comment-item:hover .cmt-del-btn {
  opacity: 1;
}

.cmt-del-btn:hover {
  color: var(--red-500);
  transform: scale(1.2);
}

/* Dashboard Stat Card Active State */
.stat-card.active {
  border-color: var(--blue-500) !important;
  background: var(--blue-50) !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
  transform: translateY(-4px) !important;
}

/* Activity Timeline Styles */
.activity-timeline {
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid var(--slate-200);
  margin-left: 0.5rem;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.25rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 0.25rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid white;
  background: var(--blue-500);
  transform: translateX(-50%);
}

.timeline-time {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.timeline-content {
  font-size: 0.82rem;
  color: var(--text-primary);
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.timeline-user {
  font-weight: 700;
  color: var(--slate-700);
}

.timeline-action {
  color: var(--text-secondary);
}

.timeline-item.mine .timeline-user {
  color: var(--blue-600);
}

.timeline-item.status-completed .timeline-action {
  color: var(--green-600);
  font-weight: 600;
}

.timeline-item.status-inprogress .timeline-action {
  color: var(--blue-600);
  font-weight: 600;
}

/* -----------------------------------------------
   ADMIN EDIT PANEL & EDITED BADGE
   ----------------------------------------------- */


.admin-edit-panel {
  background: linear-gradient(135deg, var(--amber-50), #fff8e1);
  border: 2px solid var(--amber-200);
  border-top: none;
  padding: 1.25rem 1.5rem;
  animation: slideDown 0.2s ease;
}

.admin-edit-panel label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--amber-700);
  margin-bottom: 4px;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn-admin-edit {
  background: white;
  border: 1px solid var(--border);
  color: var(--blue-600);
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-admin-edit:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.7);
}

/* Edited badge shown on task rows */
.badge-edited {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--amber-100);
  color: var(--amber-700);
  border: 1px solid var(--amber-200);
  vertical-align: middle;
  margin-left: 4px;
}

/* 🛡️ Superadmin UI Style */
body[data-role="superadmin"] #nav-chart,
body[data-role="superadmin"] #nav-employees,
body[data-role="superadmin"] .attendance-actions,
body[data-role="superadmin"] #attendance-personal-sec {
  display: none !important;
}

.desc-ref-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-height: 120px;
  overflow-y: auto;
  margin-bottom: 12px;
  white-space: pre-wrap;
  border-left: 4px solid var(--blue-500);
}

.desc-label-mini {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}


/* --- Mobile Login Fixes --- */
@media (max-width: 820px) {
  .login-brand {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
    margin-bottom: 2rem !important;
  }

  .login-brand-text {
    align-items: center !important;
  }

  .login-brand img {
    margin-bottom: 12px;
  }

  .login-features {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
    margin: 1.5rem 0 !important;
  }

  .login-feature {
    display: flex !important;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .login-left-footer {
    display: block !important;
    text-align: center;
    opacity: 0.5;
    margin-top: 1rem;
  }
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 3rem;
}

.login-brand img {
  height: 48px;
  width: 48px;
  object-fit: contain;
}

.login-brand-text {
  display: flex;
  flex-direction: column;
}

.login-brand-name {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.login-brand-name span {
  color: #60a5fa;
}

.login-tagline {
  margin-top: 4px;
  font-size: 0.875rem;
  color: #cbd5e1;
}