/* ============================================================
   axcelerata — single-file stylesheet
   Palette: #00C281 (primary), #00A56C (hover), #0D2F4F (navy),
            #5A6C7E (body), #F5F7FA / #E4E8EE (surfaces / lines)
   ============================================================ */

:root {
  /* brand */
  --green: #00C281;
  --green-hover: #00A56C;
  --green-700: #008E5C;
  --green-50: #E6FAF2;
  --green-100: #CCF5E3;

  /* text & surfaces */
  --navy: #0D2F4F;
  --navy-soft: #14406B;
  --gray: #5A6C7E;
  --gray-400: #8A98A8;
  --line: #E4E8EE;
  --line-strong: #D5DCE5;
  --surface: #F5F7FA;
  --white: #FFFFFF;

  /* feedback */
  --danger: #B0231A;
  --danger-bg: #FDECEC;
  --danger-border: #F6C5C0;

  /* navy-tinted shadows feel airier than black alphas */
  --shadow-sm: 0 1px 2px rgba(13, 47, 79, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(13, 47, 79, 0.14),
               0 2px 6px -2px rgba(13, 47, 79, 0.08);
  --shadow-lg: 0 24px 60px -20px rgba(13, 47, 79, 0.22),
               0 8px 18px -8px rgba(13, 47, 79, 0.12);
  --shadow-float: 0 18px 40px -16px rgba(13, 47, 79, 0.24);

  /* shape */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* layout */
  --max-w: 1180px;
  --header-h: 80px;
  --footer-h: 73px;

  --transition: 160ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--navy);
  background: var(--white);
  padding-bottom: var(--footer-h);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; color: var(--navy); line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-hover); }

:focus-visible {
  outline: 3px solid rgba(0, 194, 129, 0.45);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus { left: 0; color: #fff; }

/* ========================================================
   HEADER
   ======================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 32px;
}

/* Wordmark — lowercase 'x' styled (italic + skew + green) sits naturally
   between the surrounding lowercase letters. */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--navy);
  text-decoration: none;
  line-height: 1;
}
.wordmark:hover { color: var(--navy); }
.wm-part { color: var(--navy); }
.wm-x {
  color: var(--green);
  font-weight: 800;
  font-style: italic;
  display: inline-block;
  transform: skewX(-10deg) scale(1.12);
  padding: 0 0.04em;
  letter-spacing: -0.04em;
  text-shadow: 0 1px 0 rgba(0, 194, 129, 0.12);
}

/* Nav */
.primary-nav { flex: 1; min-width: 0; }
.primary-nav ul {
  display: flex;
  gap: 28px;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--navy);
  font-size: 15px;
  font-weight: 500;
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.nav-link:hover {
  color: var(--green-hover);
  border-bottom-color: var(--green);
}
.caret { font-size: 11px; color: var(--gray-400); margin-left: 2px; position: relative; top: -1px; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.login-link {
  color: var(--green);
  font-weight: 600;
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.login-link:hover { color: var(--green-hover); }

.greeting { color: var(--navy); font-size: 15px; }
.greeting strong { font-weight: 600; }

.link-muted {
  color: var(--gray);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--transition);
}
.link-muted:hover { color: var(--navy); }

.link-green {
  color: var(--green);
  font-weight: 600;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-green:hover { color: var(--green-hover); }

/* ========================================================
   BUTTONS
   ======================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  padding: 12px 24px;
  border-radius: 8px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--transition), background var(--transition),
              color var(--transition), border-color var(--transition),
              box-shadow var(--transition);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  box-shadow: 0 6px 16px -6px rgba(0, 194, 129, 0.55);
}
.btn-primary:hover {
  background: var(--green-hover);
  border-color: var(--green-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -10px rgba(0, 165, 108, 0.65);
}

.btn-ghost {
  background: #fff;
  color: var(--green-hover);
  border-color: var(--green);
}
.btn-ghost:hover {
  background: var(--green-50);
  color: var(--green-700);
  border-color: var(--green-hover);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:disabled, .btn-danger[disabled] { opacity: .55; cursor: not-allowed; }

.btn-lg { padding: 15px 28px; font-size: 16px; min-height: 50px; }
.btn-sm { padding: 10px 18px; font-size: 14px; }
.btn-block { width: 100%; }

/* ========================================================
   HERO
   ======================================================== */
.hero {
  padding: 110px 24px 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(
      1200px 500px at 50% -10%,
      rgba(0, 194, 129, 0.10),
      transparent 60%
    ),
    var(--white);
}
.hero-inner {
  max-width: 880px;
  margin: 0 auto;
}
.hero-title {
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--navy);
  margin: 0 auto 22px;
  max-width: 12ch;
}
.hero-subtitle {
  max-width: 640px;
  margin: 0 auto 36px;
  color: var(--gray);
  font-size: 20px;
  line-height: 1.55;
}
.hero-ctas {
  display: inline-flex;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ========================================================
   SHOWCASE
   ======================================================== */
.showcase-band {
  position: relative;
  padding: 70px 24px 140px;
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(0, 194, 129, 0.06), transparent 70%),
    linear-gradient(180deg, var(--green-50) 0%, #F4FCF8 55%, var(--white) 100%);
  border-top: 1px solid var(--green-100);
}
.showcase-stage {
  position: relative;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  min-height: 520px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Central module card */
.module-card {
  position: relative;
  z-index: 2;
  width: min(660px, 100%);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px 28px 24px;
}
.module-head { margin-bottom: 14px; }
.module-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}
.check-pill {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px -3px rgba(0, 194, 129, 0.45);
}
.module-eyebrow {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--gray-400);
}
.module-title {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.module-status {
  display: inline-block;
  font-size: 13px;
  color: var(--gray);
  background: var(--surface);
  padding: 4px 10px;
  border-radius: 999px;
  margin-top: 8px;
}
.module-desc {
  margin: 14px 0 18px;
  color: var(--gray);
  font-size: 15px;
  line-height: 1.55;
}

.lesson-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lesson {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: background var(--transition), border-color var(--transition),
              transform var(--transition);
}
.lesson:hover {
  transform: translateY(-1px);
  background: #fff;
  border-color: var(--line-strong);
}
.thumb {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}
.thumb--a { background: linear-gradient(135deg, #00C281, #00A56C); }
.thumb--b { background: linear-gradient(135deg, #2DA4FF, #1A6FE0); }
.thumb--c { background: linear-gradient(135deg, #FFB155, #F08A2A); }
.thumb--d { background: linear-gradient(135deg, #C8D2DD, #8B97A6); }
.lesson-body { flex: 1; min-width: 0; }
.lesson-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}
.lesson-status {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--gray);
}
.status-ok { color: var(--green-700); }
.status-pending { color: var(--gray-400); }
.lesson--muted .lesson-title { color: var(--gray); }

.lesson-tick {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
}
.lesson-score {
  flex: none;
  font-weight: 700;
  color: var(--green-700);
  font-size: 12px;
  background: var(--green-50);
  padding: 4px 10px;
  border-radius: 999px;
}
.lesson-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}

/* Floating side cards */
.float-card {
  position: absolute;
  z-index: 3;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  padding: 14px 16px;
  min-width: 210px;
  transition: transform var(--transition);
}
.float-label {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--gray-400);
}
.float-card--dates {
  top: 12px;
  left: 2%;
  transform: rotate(-2deg);
}
.float-card--progress {
  bottom: -30px;
  left: 5%;
  transform: rotate(1.5deg);
  min-width: 230px;
}
.float-card:hover { transform: translateY(-2px) rotate(0deg); }

.dates-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dates-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--green-700);
  line-height: 1.35;
}

.cal-icon {
  flex: none;
  display: inline-flex;
  flex-direction: column;
  width: 36px;
  height: 40px;
  border-radius: 6px;
  background: var(--green-50);
  border: 1px solid rgba(0, 194, 129, 0.35);
  overflow: hidden;
}
.cal-top { height: 9px; background: var(--green); }
.cal-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 4px;
}
.cal-dot {
  background: rgba(0, 194, 129, 0.55);
  border-radius: 1px;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ring {
  --p: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: conic-gradient(
    var(--green) calc(var(--p) * 1%),
    var(--green-100) 0
  );
  display: grid;
  place-items: center;
  position: relative;
  flex: none;
}
.ring::after {
  content: '';
  position: absolute;
  inset: 6px;
  background: var(--white);
  border-radius: 50%;
}
.ring-value {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 800;
  color: var(--green-700);
}
.progress-meta { display: flex; flex-direction: column; gap: 2px; }
.progress-pct {
  font-weight: 800;
  color: var(--green-700);
  font-size: 18px;
  letter-spacing: -0.02em;
}
.progress-sub {
  font-size: 12px;
  color: var(--gray);
  font-weight: 500;
}

/* Right-side chat cluster */
.chat-cluster {
  position: absolute;
  z-index: 3;
  top: 60px;
  right: 2%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 280px;
  transform: rotate(1deg);
}
.avatar {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-hover));
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px -6px rgba(0, 165, 108, 0.5);
}
.bubble {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px 14px 14px 4px;
  padding: 12px 14px;
  box-shadow: var(--shadow-md);
  position: relative;
}
.bubble p {
  margin: 0;
  font-size: 13px;
  color: var(--navy);
  line-height: 1.45;
  font-weight: 500;
}
.bubble-meta {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--gray-400);
  font-weight: 500;
}

/* ========================================================
   FOOTER
   ======================================================== */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  border-top: 1px solid var(--line);
  background: var(--white);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 28px;
  text-align: center;
}
.footer-inner p {
  margin: 0;
  color: var(--gray-400);
  font-size: 14px;
}

/* ========================================================
   AUTH — full-viewport split: form pane on the left, promo on the right
   ======================================================== */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.auth-body { background: var(--surface); }
.auth-body .site-header,
.auth-body .site-footer { display: none; }

.auth-split {
  display: grid;
  grid-template-columns: minmax(420px, 5fr) 7fr;
  min-height: 100vh;
}
.auth-pane {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}
.auth-pane--form { background: var(--surface); }
.auth-pane--promo { background: var(--white); }

.auth-card {
  width: 100%;
  max-width: 430px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 40px 36px 32px;
  box-shadow: var(--shadow-md);
}

.auth-logo {
  display: flex;
  justify-content: center;
  align-items: baseline;
  text-decoration: none;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.02em;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 36px;
}
.auth-logo:hover { color: var(--navy); }

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 6px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}
.field input,
.field textarea,
.field select {
  font-family: inherit;
  font-size: 15px;
  color: var(--navy);
  background: var(--white);
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  padding: 12px 14px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field textarea { resize: vertical; min-height: 74px; line-height: 1.4; }
.field input::placeholder,
.field textarea::placeholder { color: var(--gray-400); }
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(0, 194, 129, 0.18);
}
.field input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(176, 35, 26, 0.12);
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.show-toggle {
  background: transparent;
  border: 0;
  padding: 4px 2px;
  color: var(--green);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: color var(--transition);
  font-family: inherit;
}
.show-toggle:hover { color: var(--green-hover); }

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: -4px;
  flex-wrap: wrap;
}
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--navy);
  cursor: pointer;
  font-weight: 500;
  user-select: none;
}
.checkbox input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  background: var(--white);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: background var(--transition), border-color var(--transition);
  margin: 0;
  flex: none;
}
.checkbox input:hover { border-color: var(--green); }
.checkbox input:checked {
  background: var(--green);
  border-color: var(--green);
}
.checkbox input:checked::after {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(0, -1px);
}
.checkbox input:focus-visible {
  outline: 3px solid rgba(0, 194, 129, 0.4);
  outline-offset: 2px;
}

.flash {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
}
.flash p { margin: 2px 0 0; }
.flash-title { display: block; font-weight: 700; font-size: 13px; }
.flash-icon {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
}
.flash--error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}
.flash--error .flash-icon { background: var(--danger); color: #fff; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px 0 18px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.auth-divider span {
  color: var(--gray);
  font-size: 13px;
  font-weight: 500;
}

.auth-social {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: var(--white);
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  color: var(--navy);
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition),
              transform var(--transition);
}
a.btn-social { text-decoration: none; }
.btn-social:hover {
  border-color: var(--green);
  background: var(--green-50);
}
.btn-social:active { transform: translateY(1px); }
.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: none;
}

.auth-privacy {
  display: block;
  text-align: center;
  margin-top: 24px;
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.auth-privacy:hover { color: var(--green-hover); }

/* Promo column */
.promo-inner {
  width: 100%;
  max-width: 540px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.promo-title {
  margin: 0;
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.promo-text {
  margin: 0;
  color: var(--gray);
  font-size: 16px;
  line-height: 1.7;
}
.promo-text strong { color: var(--navy); font-weight: 700; }
.promo-link {
  color: var(--green);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 15px;
}
.promo-link:hover { color: var(--green-hover); }
.promo-image {
  margin-top: 12px;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--surface);
}
.promo-image svg { width: 100%; height: 100%; display: block; }

/* Toast for "coming soon" social buttons */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  z-index: 100;
  max-width: 90vw;
}
.toast--visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ========================================================
   PUBLIC VALIDATION — form + result page (no site chrome)
   ======================================================== */
.validate-body { background: var(--surface); }
.validate-body .site-header,
.validate-body .site-footer { display: none; }

.validate-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

/* Validate form (enter cert number + surname) */
.validate-card {
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 36px 36px 32px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.validate-check-icon {
  text-align: center;
  margin-bottom: 20px;
}
.validate-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.validate-no-surname {
  margin-top: -8px;
  font-size: 13px;
}
.required-star {
  color: var(--danger);
  font-weight: 400;
}
.btn-validate {
  background: #6B7C93;
  color: #fff;
  border-color: #6B7C93;
  box-shadow: none;
  margin-top: 4px;
}
.btn-validate:hover {
  background: #5A6A80;
  border-color: #5A6A80;
  color: #fff;
  transform: translateY(-1px);
}
.btn-validate svg {
  flex: none;
}

/* ----- aXcelerate-shaped validation result page ----- */
.validate-wrap--result { display: none; } /* legacy wrapper unused */

.validationPageContainer {
  font-style: normal;
  padding: 40px 24px;
  margin: 0 auto;
  width: 100%;
  max-width: 900px;
  box-sizing: border-box;
}
.validationPageContent {
  background-color: #fff;
  padding: 32px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  text-align: center;
}

.column1 {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  min-width: 0;
}
.column2 {
  background: transparent;
  padding: 0;
  border-radius: 0;
  min-width: 0;
  border: none;
}

.btnValidate {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #e0e3ea;
  border-radius: 4px;
  color: #5e46ef;
  background: #fff;
  padding: 9px 14px 9px 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 32px;
  transition: background 160ms ease, border-color 160ms ease;
  text-decoration: none;
}
.btnValidate:hover { background: #f6f5ff; border-color: #d9d4ff; color: #5e46ef; }
.btnValidate .icon-arrow-left { font-weight: 700; font-size: 16px; line-height: 1; }

.messageSuccess {
  background-color: #f1f8e8;
  border: solid 1px #71bd1e;
  border-radius: 8px;
  padding: 9px 16px 9px 38px;
  margin: 4px 0 14px;
  text-align: center;
  background-repeat: no-repeat;
  background-position: 12px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='%2371bd1e'/%3E%3Cpath d='M4.6 8.5l2.2 2.2L11.4 6' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 16px 16px;
}
.messageSuccess .v-value {
  color: #71bd1e;
  font-weight: 500;
  font-size: 14px;
}
.messageError {
  background-color: #fdecec;
  border: solid 1px #b0231a;
  border-radius: 8px;
  padding: 9px 16px;
  margin: 4px 0 14px;
  text-align: center;
}
.messageError .v-value { color: #b0231a; font-weight: 500; font-size: 14px; }

.v-label {
  font-size: 13px;
  color: #5c6975;
  text-align: left;
  margin: 22px 0 4px;
  font-weight: 400;
  line-height: 1.3;
}
.v-value {
  font-weight: 500;
  font-size: 14px;
  color: #334352;
  text-align: left;
  margin: 0;
  line-height: 1.45;
}

.messageInfo.certificateTr {
  display: none; /* shown on narrow viewports only */
  margin: 18px 0 6px;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.cert-frame-stage {
  position: relative;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  min-height: 480px;
}
.column2 .cert-frame-stage { min-height: 650px; }
.cert-frame-stage object,
.cert-frame-stage embed,
.cert-frame-stage iframe,
.cert-frame-stage img {
  display: block;
  width: 100%;
  border: 0;
  background: #fff;
}
.cert-frame-stage object,
.cert-frame-stage embed,
.cert-frame-stage iframe { height: 650px; }
.column1 .cert-frame-stage object,
.column1 .cert-frame-stage embed,
.column1 .cert-frame-stage iframe { height: 480px; }
.cert-frame-stage img { height: auto; max-width: 100%; }

.cert-watermark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  overflow: hidden;
}
.watermark-text {
  transform: rotate(-22deg);
  text-align: center;
  font-family: 'Inter', sans-serif;
  line-height: 1.05;
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
}
.watermark-brand {
  display: block;
  font-size: clamp(22px, 3.2vw, 38px);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: rgba(13, 47, 79, 0.14);
}
.watermark-brand .watermark-x {
  color: rgba(0, 194, 129, 0.32);
  font-style: italic;
  display: inline-block;
  transform: skewX(-10deg) scale(1.12);
  padding: 0 0.04em;
}
.watermark-label {
  display: block;
  margin-top: 6px;
  font-size: clamp(14px, 1.8vw, 20px);
  font-weight: 900;
  letter-spacing: 0.12em;
  color: rgba(13, 47, 79, 0.22);
}
.watermark-small {
  display: block;
  margin-top: 3px;
  font-size: clamp(9px, 1.1vw, 13px);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: rgba(13, 47, 79, 0.18);
}

.column-single { grid-column: 1 / -1; text-align: left; }
.result-not-found {
  color: #5c6975;
  font-size: 14px;
  line-height: 1.6;
  margin: 8px 0 0;
}

@media (max-width: 880px) {
  .validationPageContent {
    grid-template-columns: 1fr;
    padding: 24px;
  }
  .column2 { display: none; }
  .messageInfo.certificateTr { display: block; }
}
@media (max-width: 480px) {
  .validationPageContainer { padding: 24px 14px; }
  .validationPageContent { padding: 18px; }
}

/* ========================================================
   DASHBOARD additions — fixed-meta hint, link-actions, copy button
   ======================================================== */
.fixed-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
}
.fixed-meta > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fixed-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--gray);
}
.fixed-value {
  font-size: 13px;
  color: var(--navy);
  font-weight: 600;
}

.link-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.copy-btn:hover { color: var(--green-hover); border-color: var(--green); background: var(--green-50); }
.copy-btn.is-copied {
  color: var(--green-700);
  border-color: var(--green);
  background: var(--green-50);
}
.link-muted.small { font-size: 12px; }
.link-danger {
  background: none;
  border: none;
  padding: 0;
  color: var(--danger);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition);
}
.link-danger:hover { color: #8b1a13; text-decoration: underline; }
.link-action {
  background: none;
  border: none;
  padding: 0;
  color: var(--green);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition);
  margin-right: 10px;
}
.link-action:hover { color: #009960; text-decoration: underline; }

@media (max-width: 640px) {
  .fixed-meta { grid-template-columns: 1fr; }
  .link-actions { gap: 6px; }
}

/* ========================================================
   DASHBOARD TABS
   ======================================================== */
.dash-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--line);
  margin-bottom: 4px;
}
.dash-tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
}
.dash-tab:hover { color: var(--navy); }
.dash-tab--active {
  color: var(--green-700);
  border-bottom-color: var(--green);
}

/* Left sidebar dashboard layout on wide screens. The nav is FIXED to the
   viewport (so it can't affect content spacing and stays put while scrolling),
   and page content is given left padding to clear it. Content flows normally
   (the page's own flex column) so there are no grid gaps. Below 980px the nav
   falls back to the top tab bar. */
@media (min-width: 980px) {
  .dash-body .dash-wrap { padding-left: 252px; }
  /* .dash-body prefix raises specificity so this wins over the base .dash-stack. */
  .dash-body .dash-stack { max-width: none; width: 100%; margin: 0; }
  .dash-body .dash-stack > .dash-tabs {
    position: fixed;
    top: 96px;
    left: 28px;
    width: 200px;
    max-height: calc(100vh - 124px);
    overflow-y: auto;
    flex-direction: column;
    gap: 2px;
    border-bottom: none;
    margin: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 1px 3px rgba(16,24,40,.04);
  }
  .dash-body .dash-stack > .dash-tabs .dash-tab {
    border-bottom: none;
    border-left: 3px solid transparent;
    border-radius: 0 8px 8px 0;
    margin-bottom: 0;
    padding: 9px 14px;
    white-space: nowrap;
  }
  .dash-body .dash-stack > .dash-tabs .dash-tab:hover { background: var(--surface); }
  .dash-body .dash-stack > .dash-tabs .dash-tab--active {
    border-bottom-color: transparent;
    border-left-color: var(--green);
    background: #ECFDF5;
  }
}

/* Inline add forms (users / tasks) */
.inline-add-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.inline-input {
  font-family: inherit;
  font-size: 14px;
  color: var(--navy);
  background: var(--white);
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  flex: 1;
  min-width: 140px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.inline-input::placeholder { color: var(--gray-400); }
.inline-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 194, 129, 0.18);
}
.inline-input--sm { flex: 0 1 160px; min-width: 120px; }
.inline-select {
  font-family: inherit;
  font-size: 14px;
  color: var(--navy);
  background: var(--white);
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 150px;
  cursor: pointer;
  transition: border-color var(--transition);
}
.inline-select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 194, 129, 0.18);
}

/* Status dropdown in task table */
.status-select {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  background: var(--white);
  transition: border-color var(--transition);
}
.status-select:focus { outline: none; border-color: var(--green); }
.status-select--pending { color: #b45309; background: #fffbeb; border-color: #fcd34d; }
.status-select--in-progress { color: #1d4ed8; background: #eff6ff; border-color: #93c5fd; }
.status-select--completed { color: var(--green-700); background: var(--green-50); border-color: var(--green-100); }

/* ========================================================
   TASK FORM
   ======================================================== */
.task-form { margin-bottom: 0; }
.task-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
.task-form-field { display: flex; flex-direction: column; gap: 6px; }
.task-form-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.task-form-field--wide { grid-column: 1 / -1; }
.inline-textarea {
  resize: vertical;
  min-height: 60px;
  line-height: 1.5;
}
.file-input {
  font-family: inherit;
  font-size: 13px;
  color: var(--navy);
}
.multi-select-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  max-height: 140px;
  overflow-y: auto;
}
.multi-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--navy);
  cursor: pointer;
  white-space: nowrap;
}
.multi-check input[type="checkbox"] {
  accent-color: var(--green);
  width: 16px;
  height: 16px;
}
.task-form-actions { display: flex; justify-content: flex-end; }

/* ========================================================
   PROJECT GROUPS
   ======================================================== */
.project-group { margin-bottom: 24px; }
.project-group-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
}

/* ========================================================
   ROLE BADGES
   ======================================================== */
.role-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: capitalize;
}
.role-badge--user { color: #475569; background: #f1f5f9; }
.role-badge--manager { color: #7c3aed; background: #ede9fe; }
.role-select { cursor: pointer; }
.role-select--admin { color: #991B1B; font-weight: 600; }
.role-select--user { color: #475569; }
.inline-select--sm { min-width: 100px; padding: 8px 10px; font-size: 13px; }

/* ========================================================
   TASK CARDS (collapsible)
   ======================================================== */
.task-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gray-400);
  border-radius: 10px;
  margin-bottom: 10px;
  transition: box-shadow var(--transition);
}
.task-card[open] { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.task-card--pending { border-left-color: #f59e0b; }
.task-card--in-progress { border-left-color: #3b82f6; }

/* Completed task: the left border is reserved for the per-user color (set
   inline in the admin view), so completion is signalled with a green glow +
   tint instead, which reads clearly without overriding the user color. */
.task-card--completed {
  border-left-color: #22c55e; /* applies in views without an inline user color */
  background:
    linear-gradient(0deg, rgba(34,197,94,0.06), rgba(34,197,94,0.06)),
    var(--white);
  box-shadow: 0 0 0 1.5px rgba(34,197,94,0.35), 0 2px 10px rgba(34,197,94,0.12);
}
.task-card--completed[open] {
  box-shadow: 0 0 0 1.5px rgba(34,197,94,0.45), 0 4px 16px rgba(34,197,94,0.18);
}
/* Mute the title a touch so done tasks recede next to active ones. */
.task-card--completed .task-card-summary-title { color: var(--green-700); }

.task-card-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.task-card-summary::-webkit-details-marker { display: none; }
.task-card-summary::before {
  content: '▸';
  font-size: 12px;
  color: var(--gray-400);
  flex-shrink: 0;
  transition: transform 0.15s;
}
.task-card[open] > .task-card-summary::before { transform: rotate(90deg); }
.task-card-summary-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* When the card is opened, show the full title: the meta badges drop to their
   own full-width line so the title has the whole row to wrap across normally
   (a hover tooltip on the title element covers the collapsed state). */
.task-card[open] > .task-card-summary {
  flex-wrap: wrap;
  align-items: flex-start;
}
.task-card[open] > .task-card-summary > .task-card-summary-title {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}
.task-card[open] > .task-card-summary > .task-card-summary-meta {
  flex-basis: 100%;
  justify-content: flex-start;
  margin-top: 8px;
}
.task-card-summary-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}
.status-pill--pending { color: #b45309; background: #fffbeb; }
.status-pill--in-progress { color: #1d4ed8; background: #eff6ff; }
.status-pill--completed { color: var(--green-700); background: var(--green-50); }
.status-pill--completed::before { content: '\2713\00a0'; font-weight: 700; }

.task-card-body { padding: 0 18px 16px; }

.task-card-header { margin-bottom: 10px; }
.task-card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.task-card-title {
  font-size: 15px;
  color: var(--navy);
  flex: 1;
}
.task-card-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--gray);
  margin-top: 4px;
  flex-wrap: wrap;
}
.task-card-notes {
  font-size: 13px;
  color: var(--navy);
  line-height: 1.6;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 6px;
  margin-bottom: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}
.task-card-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--navy);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  text-decoration: none;
  transition: background var(--transition);
}
.attachment-chip:hover { background: var(--line); }

/* Priority badges */
.priority-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.priority-badge--low { color: #475569; background: #f1f5f9; }
.priority-badge--medium { color: #1d4ed8; background: #eff6ff; }
.priority-badge--high { color: #b45309; background: #fffbeb; }
.priority-badge--urgent { color: #dc2626; background: #fef2f2; }

/* Cost & Payment badges */
.cost-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  color: #065f46;
  background: #ecfdf5;
  white-space: nowrap;
}
/* When a KPI deduction applies: original cost struck through, net cost emphasised. */
.cost-badge--struck {
  color: var(--gray-500, #6b7280);
  background: var(--surface, #f1f5f9);
  text-decoration: line-through;
  text-decoration-color: #DC2626;
  opacity: .8;
}
.cost-badge--net {
  color: #065f46;
  background: #d1fae5;
  font-weight: 700;
}
.ded-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  color: #991B1B;
  background: #FEE2E2;
  white-space: nowrap;
}
.payment-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.payment-badge--approved {
  color: #065f46;
  background: #d1fae5;
}
.task-card-payment {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 8px 0;
  margin-bottom: 4px;
  border-top: 1px solid var(--gray-100, #f3f4f6);
}
.payment-field {
  display: flex;
  align-items: center;
  gap: 6px;
}
.payment-label {
  font-size: 0.75rem;
  color: var(--gray-500, #6b7280);
  font-weight: 500;
  white-space: nowrap;
}
.cost-input {
  width: 90px;
  padding: 4px 8px !important;
  font-size: 0.8rem !important;
}
.btn-payment-approved {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-size: 0.75rem;
  cursor: pointer;
}
.btn-payment-approved:hover {
  background: #a7f3d0;
}
.btn-payment-pending {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
  font-size: 0.75rem;
  cursor: pointer;
}
.btn-payment-pending:hover {
  background: #e5e7eb;
}

/* Progress bar */
.task-card-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.progress-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--green);
  border-radius: 4px;
  transition: width 0.2s ease;
}
.progress-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray);
  min-width: 36px;
  text-align: right;
}
.progress-slider {
  width: 100px;
  accent-color: var(--green);
  cursor: pointer;
}

/* Task card footer */
.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ========================================================
   DROP ZONE & EDIT ATTACHMENTS
   ======================================================== */
.drop-zone {
  position: relative;
  border: 2px dashed var(--line-strong);
  border-radius: 10px;
  padding: 28px 20px;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
}
.drop-zone--over,
.drop-zone:hover {
  border-color: var(--green);
  background: rgba(0, 194, 129, 0.04);
}
.drop-zone-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
}
.drop-zone-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.drop-zone-prompt p {
  margin: 0;
  font-size: 14px;
  color: var(--gray);
}
.drop-zone-browse {
  color: var(--green);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.drop-zone-files {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  text-align: start;
}
.drop-zone.has-files .drop-zone-prompt { display: none; }
.drop-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: var(--surface);
  border-radius: 6px;
  font-size: 13px;
}
.drop-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.edit-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.edit-att-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.edit-att-item .link-danger { font-size: 14px; line-height: 1; }

.back-link {
  font-size: 13px;
  color: var(--green);
  text-decoration: none;
  font-weight: 500;
}
.back-link:hover { text-decoration: underline; }
.dash-header-row { margin-bottom: 6px; }

.task-card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ========================================================
   RESPONSIVE — TASK MANAGEMENT
   ======================================================== */
@media (max-width: 768px) {
  .task-form-grid { grid-template-columns: 1fr; }
  .task-form-field--wide { grid-column: 1; }
  .inline-add-form { flex-direction: column; align-items: stretch; }
  .inline-add-form .inline-input,
  .inline-add-form .inline-select { min-width: 100%; flex: none; }
  .inline-add-form .btn { width: 100%; }
  .inline-input--sm { flex: 1; min-width: 100%; }
  .cert-table th:nth-child(3),
  .cert-table td:nth-child(3),
  .cert-table th:nth-child(4),
  .cert-table td:nth-child(4) { display: none; }
  .task-card { padding: 14px 16px; }
  .progress-slider { width: 70px; }
  .dash-stack { max-width: 100%; }
}

@media (max-width: 480px) {
  .dash-wrap { padding: 20px 12px 60px; }
  .dash-title { font-size: 22px; }
  .cert-table th:nth-child(2),
  .cert-table td:nth-child(2) { display: none; }
  .task-card-title-row { flex-direction: column; align-items: flex-start; }
  .task-card-meta { flex-direction: column; gap: 4px; }
  .task-card-footer { flex-direction: column; align-items: flex-start; gap: 8px; }
  .progress-slider { width: 60px; }
}

/* ========================================================
   DASHBOARD
   ======================================================== */
.dash-body { background: var(--surface); }
.dash-wrap {
  min-height: calc(100vh - var(--header-h) - var(--footer-h));
  padding: 48px 24px 100px;
}
.dash-stack {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.dash-header { margin: 0 0 4px; padding: 0 4px; }
.dash-title {
  margin: 0 0 6px;
  font-size: clamp(26px, 3.4vw, 32px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.dash-lede {
  margin: 0;
  color: var(--gray);
  font-size: 15px;
  max-width: 620px;
}

/* Assigned Tasks page — header bar with at-a-glance stat strip */
.assigned-hd {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.assigned-hd-text { min-width: 0; }
.assigned-hd-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.ahd-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 68px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.ahd-num {
  font-size: 23px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.ahd-lbl {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray);
}
.ahd-stat--blue { border-color: #bfdbfe; background: #eff6ff; }
.ahd-stat--blue .ahd-num { color: #2563eb; }
.ahd-stat--amber { border-color: #fde68a; background: #fffbeb; }
.ahd-stat--amber .ahd-num { color: #d97706; }
.ahd-stat--red { border-color: #fecaca; background: #fef2f2; }
.ahd-stat--red .ahd-num { color: #dc2626; }
@media (max-width: 640px) {
  .assigned-hd-stats { width: 100%; gap: 8px; }
  .ahd-stat { flex: 1 1 0; min-width: 0; padding: 9px 8px; }
}

/* Task card date chips (Assigned / Due) */
.task-date {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 12px;
  color: var(--gray);
  white-space: nowrap;
}
.task-date-lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--navy);
  opacity: 0.5;
}

/* Generic panel — shared by issue-form, list, and health */
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px 28px 24px;
}
.panel--compact { padding: 18px 22px; }
.panel-head { margin-bottom: 20px; }
.panel-head--with-badge { display: flex; align-items: baseline; justify-content: space-between; }
.panel-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.panel-sub {
  margin: 0;
  color: var(--gray);
  font-size: 14px;
}

.count-badge {
  display: inline-block;
  background: var(--green-50);
  color: var(--green-700);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}

/* Flash messages on dashboard (categories: success/error/info) */
.flash-stack { display: flex; flex-direction: column; gap: 10px; }
.flash--success {
  background: var(--green-50);
  color: var(--green-700);
  border: 1px solid var(--green-100);
}
.flash--success .flash-icon { background: var(--green); color: #fff; }
.flash--info {
  background: var(--surface);
  color: var(--navy);
  border: 1px solid var(--line);
}
.flash--info .flash-icon { background: var(--gray-400); color: #fff; }

/* Issue-certificate form */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field-opt {
  font-weight: 400;
  color: var(--gray);
  font-size: 12px;
}
.field-hint {
  display: block;
  font-size: 12px;
  color: var(--gray);
  margin-top: 4px;
}
.cert-form .field { margin-bottom: 18px; }
.cert-form .field:last-of-type { margin-bottom: 0; }
.cert-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
}

/* File-drop zone */
.file-drop {
  position: relative;
  border: 2px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  padding: 26px 20px;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
}
.file-drop:hover, .file-drop.is-dragging {
  border-color: var(--green);
  background: var(--green-50);
}
.file-drop.has-file {
  border-style: solid;
  border-color: var(--green);
  background: var(--white);
  text-align: left;
  padding: 16px 18px;
  cursor: default;
}
.file-drop input[type=file] {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}
.file-drop.has-file input[type=file] { display: none; }

.file-drop-icon {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--green-50);
  color: var(--green);
  margin: 0 auto 8px;
}
.file-drop-primary {
  margin: 4px 0 6px;
  font-size: 14px;
  color: var(--navy);
  font-weight: 500;
}
.file-drop-browse {
  color: var(--green);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.file-drop-hint {
  margin: 0;
  font-size: 13px;
  color: var(--gray);
}

.file-drop-selected {
  display: flex;
  align-items: center;
  gap: 14px;
}
.file-drop-thumb {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--green-50);
  display: grid;
  place-items: center;
  font-size: 22px;
}
.file-drop-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.file-drop-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  word-break: break-all;
}
.file-drop-size {
  font-size: 12px;
  color: var(--gray);
}
.file-drop-clear {
  flex: none;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--gray);
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  position: relative;
  z-index: 2;
  transition: color var(--transition), border-color var(--transition);
}
.file-drop-clear:hover { color: var(--danger); border-color: var(--danger); background: #fff; }

/* Certificates table */
.cert-table-wrap {
  margin: 0 -8px;
  overflow-x: auto;
}
.cert-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.cert-table th, .cert-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.cert-table thead th {
  font-weight: 600;
  color: var(--gray);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.cert-table tbody tr:hover { background: var(--surface); }
.cert-table tbody tr:last-child td { border-bottom: 0; }
.cell-action { text-align: right; white-space: nowrap; }

/* Collapsible "My SSH Access" dropdown panel (starts closed) */
.srv-dropdown > summary.panel-head {
  cursor: pointer;
  list-style: none;
  align-items: center;
}
.srv-dropdown > summary.panel-head::-webkit-details-marker { display: none; }
.srv-dropdown > summary.panel-head::after {
  content: "\203A";
  margin-left: 12px;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--gray);
  transform: rotate(90deg);
  transition: transform .15s ease;
}
.srv-dropdown[open] > summary.panel-head::after { transform: rotate(-90deg); }
.srv-dropdown:not([open]) > summary.panel-head { margin-bottom: 0; }

/* Scrollable Access Records table — sticky header, body scrolls in place */
.cert-table-wrap--scroll { max-height: 460px; overflow-y: auto; }
.cert-table-wrap--scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: inset 0 -1px 0 var(--line);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--navy);
  font-weight: 700;
  background: var(--green-50);
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.ext-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 5px;
  color: #fff;
  margin-right: 8px;
  vertical-align: middle;
}
.ext-pill--pdf  { background: #DC2626; }
.ext-pill--jpg, .ext-pill--jpeg, .ext-pill--png { background: #2563EB; }

.size-muted { color: var(--gray); font-size: 13px; }
.muted { color: var(--gray); }

.empty-state {
  text-align: center;
  padding: 36px 16px 28px;
  color: var(--gray);
}
.empty-icon {
  display: inline-block;
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.7;
}
.empty-state p { margin: 0; font-size: 14px; line-height: 1.6; }

.health-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 18px 20px;
}
.health-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.health-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex: 1;
}
.health-state {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.health-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gray-400);
  box-shadow: 0 0 0 4px rgba(139, 151, 166, 0.18);
  transition: background var(--transition), box-shadow var(--transition);
}
.health-dot.is-ok {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(0, 194, 129, 0.22);
}
.health-dot.is-err {
  background: #E53E3E;
  box-shadow: 0 0 0 4px rgba(229, 62, 62, 0.22);
}
.health-json {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ========================================================
   RESPONSIVE
   ======================================================== */
@media (max-width: 1024px) {
  .float-card--dates { left: 0; top: 0; }
  .float-card--progress { left: 0; bottom: -10px; }
  .chat-cluster { right: 0; top: 40px; }
}

@media (max-width: 960px) {
  .primary-nav ul { gap: 18px; }
  .nav-link { font-size: 14px; }
}

@media (max-width: 768px) {
  .header-inner {
    height: 68px;
    padding: 0 18px;
    gap: 12px;
  }
  .primary-nav { display: none; }
  .login-link { display: none; }
  /* Keep the greeting visible on mobile so users still know who they are. */
  .greeting { font-size: 14px; }
  .header-actions .btn { padding: 10px 16px; font-size: 14px; }

  .hero { padding: 64px 20px 32px; }
  .hero-title { font-size: clamp(34px, 9vw, 42px); max-width: 18ch; }
  .hero-subtitle { font-size: 17px; }
  .hero-ctas {
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: 28px;
  }
  .hero-ctas .btn { width: 100%; }

  .showcase-band { padding: 48px 16px 72px; }
  .showcase-stage {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    min-height: 0;
  }
  .module-card,
  .float-card,
  .chat-cluster {
    position: static;
    transform: none;
    width: 100%;
    max-width: 100%;
  }
  .module-card { order: 2; padding: 22px 20px; }
  .float-card--dates { order: 1; }
  .float-card--progress { order: 3; }
  .chat-cluster { order: 4; }

  .auth-card { padding: 28px 22px; }
  .dash-wrap { padding: 28px 14px 64px; }
  .panel { padding: 22px 18px; }
  .grid-2 { grid-template-columns: 1fr; }
  .cert-table th, .cert-table td { padding: 10px 8px; font-size: 13px; }
  .cell-action { text-align: left; padding-top: 0 !important; }
}

/* Auth split: stack vertically on tablet/mobile */
@media (max-width: 980px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-pane { padding: 36px 24px; }
  .auth-pane--promo { order: 2; }
  .promo-image { aspect-ratio: 16 / 7; max-height: 220px; }
}
@media (max-width: 540px) {
  .auth-pane--promo { display: none; }
  .auth-card { padding: 28px 22px; }
}

@media (max-width: 420px) {
  .wordmark { font-size: 22px; }
  /* On the smallest phones the greeting + sign-out button can crowd the
     wordmark — drop the greeting text but keep Sign out as the action. */
  .greeting { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  .float-card,
  .chat-cluster { transform: none !important; }
}

/* ========================================================
   REPORT CARDS
   ======================================================== */
.report-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 12px;
}
.report-card--inline {
  padding: 14px 16px;
  margin-bottom: 8px;
}
.report-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.report-card-title { font-size: 15px; color: var(--navy); }
.report-card-meta { font-size: 12px; }
.report-card-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--navy);
  white-space: pre-wrap;
  word-break: break-word;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: 6px;
  margin-bottom: 10px;
}
.report-card-footer { display: flex; justify-content: flex-end; }
.reports-label {
  display: block;
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 8px;
}
.reports-list { margin-top: 16px; }
.task-card-reports { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

.report-add-toggle { margin-top: 10px; }
.report-add-toggle summary {
  cursor: pointer;
  list-style: none;
  font-size: 13px;
}
.report-add-toggle summary::-webkit-details-marker { display: none; }
.report-inline-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

/* ========================================================
   TASK SEARCH BAR
   ======================================================== */
.search-bar-wrap {
  padding: 0 0 0.75rem;
}
.search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: 8px;
  font-size: 0.9rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}

/* ========================================================
   PROJECT BADGE (task card summary)
   ======================================================== */
.project-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: #0e7490;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  border-radius: 6px;
  padding: 2px 8px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: capitalize;
}

/* ========================================================
   ASSIGNED BADGE (task card summary)
   ======================================================== */
.assigned-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: #4338ca;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  padding: 2px 8px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========================================================
   AUTO-DIRECTION FOR USER CONTENT (Farsi, Arabic, etc.)
   ======================================================== */
.rtl-auto {
  unicode-bidi: plaintext;
  direction: auto;
  text-align: start;
  font-family: 'Vazirmatn', 'Inter', 'Tahoma', sans-serif;
}
.rtl-auto-input {
  unicode-bidi: plaintext;
  direction: auto;
  text-align: start;
  font-family: 'Vazirmatn', 'Inter', 'Tahoma', sans-serif;
}

/* ========================================================
   TASK OVERVIEW STATS DASHBOARD
   ======================================================== */
.stats-dashboard {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  flex-wrap: wrap;
}
.stats-chart-wrap {
  flex: 0 0 110px;
}
.donut-chart {
  width: 110px;
  height: 110px;
  transform: rotate(-90deg);
}
.donut-seg {
  fill: none;
  stroke-width: 20;
  stroke-linecap: butt;
}
.donut-seg--completed { stroke: #22c55e; }
.donut-seg--in-progress { stroke: #3b82f6; }
.donut-seg--overdue { stroke: #ef4444; }
.donut-seg--pending { stroke: #f59e0b; }
.donut-center-num,
.donut-center-label {
  transform: rotate(90deg);
  transform-origin: 100px 100px;
  text-anchor: middle;
  fill: var(--gray-700, #374151);
}
.donut-center-num {
  font-size: 20px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
}
.donut-center-label {
  font-size: 9px;
  font-weight: 500;
  fill: var(--gray-500, #6b7280);
  font-family: 'Inter', sans-serif;
}
.stats-cards {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  min-width: 240px;
}
.stat-card {
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  text-align: center;
  transition: box-shadow 0.15s;
}
.stat-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.stat-num {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--gray-800, #1f2937);
}
.stat-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--gray-500, #6b7280);
  margin-top: 0.1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-card--green .stat-num { color: #16a34a; }
.stat-card--green { border-color: #bbf7d0; background: #f0fdf4; }
.stat-card--blue .stat-num { color: #2563eb; }
.stat-card--blue { border-color: #bfdbfe; background: #eff6ff; }
.stat-card--amber .stat-num { color: #d97706; }
.stat-card--amber { border-color: #fde68a; background: #fffbeb; }
.stat-card--red .stat-num { color: #dc2626; }
.stat-card--red { border-color: #fecaca; background: #fef2f2; }
.stat-card--gray .stat-num { color: #6b7280; }
.stat-card--gray { border-color: #e5e7eb; background: #f9fafb; }

.stats-legend {
  width: 100%;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  padding-top: 0.25rem;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  color: var(--gray-600, #4b5563);
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.legend-dot--completed { background: #22c55e; }
.legend-dot--in-progress { background: #3b82f6; }
.legend-dot--overdue { background: #ef4444; }
.legend-dot--pending { background: #f59e0b; }

/* Assign dropdown on task summary */
.assign-dd-wrap {
  position: relative;
  display: inline-block;
  vertical-align: middle;
}
.assign-dd-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--gray-300, #d1d5db);
  background: var(--white, #fff);
  cursor: pointer;
  font-size: .75rem;
  font-weight: 600;
  color: var(--gray-700, #374151);
  transition: border-color .15s, box-shadow .15s;
  max-width: 180px;
}
.assign-dd-btn:hover { border-color: #3b82f6; }
.assign-dd-names {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assign-dd-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  min-width: 170px;
  background: var(--white, #fff);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  padding: 4px 0;
}
.assign-dd-menu--open { display: block; }
.assign-dd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: .8rem;
  cursor: pointer;
  transition: background .1s;
}
.assign-dd-item:hover { background: var(--gray-50, #f9fafb); }
.assign-dd-item input[type="checkbox"] {
  accent-color: #3b82f6;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

@media (max-width: 640px) {
  .stats-dashboard {
    flex-direction: column;
    align-items: stretch;
  }
  .stats-chart-wrap {
    flex: none;
    display: flex;
    justify-content: center;
  }
  .stats-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Inline action notice (user task card) */
.action-notice {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 600;
  color: #dc2626;
  padding: 3px 0;
}
.action-notice-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  animation: pulse-dot 1.5s infinite;
}
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:.3} }
.comment-form-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
}
.btn-action {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  font-weight: 700;
}
.btn-action:hover {
  background: #fee2e2;
}

/* Admin notification bar */
.notif-bar {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 0.5rem;
}
.notif-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: #eff6ff;
  border-radius: 6px;
  font-size: .75rem;
}
.notif-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3b82f6;
  flex-shrink: 0;
}
.notif-text {
  flex: 1;
  min-width: 0;
}
.notif-text strong { font-weight: 600; }
.notif-dismiss {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--gray-400, #9ca3af);
  padding: 0 2px;
  line-height: 1;
}
.notif-dismiss:hover { color: var(--gray-700, #374151); }
.notif-link {
  font-size: .7rem;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  white-space: nowrap;
}
.notif-link:hover { text-decoration: underline; }

/* User action-required notifications (red/urgent) */
#user-actions .notif-item {
  background: #fef2f2;
  border: 1px solid #fecaca;
  animation: action-flash 1.5s ease-in-out infinite;
}
#user-actions .notif-dot {
  background: #ef4444;
  animation: action-pulse 1s ease-in-out infinite;
}
#user-actions .notif-text { color: #991b1b; }
#user-actions .notif-link { color: #dc2626; }
@keyframes action-flash {
  0%, 100% { background: #fef2f2; }
  50% { background: #fee2e2; }
}
@keyframes action-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.6); opacity: 0.6; }
}

/* View task detail page */
.view-task-details {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.view-task-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.view-task-row--block {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}
.view-task-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-500, #6b7280);
  min-width: 100px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.view-task-notes {
  background: var(--gray-50, #f9fafb);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: .88rem;
  line-height: 1.6;
  width: 100%;
  white-space: pre-wrap;
}

/* ========================================================
   AI FIX BUTTON
   ======================================================== */
.ai-fix-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  margin-left: 6px;
  cursor: pointer;
  vertical-align: middle;
  letter-spacing: 0.04em;
  transition: opacity 0.15s, transform 0.15s;
  line-height: 1.4;
}
.ai-fix-btn:hover {
  opacity: 0.85;
  transform: scale(1.05);
}
.ai-fix-btn:disabled {
  cursor: wait;
  opacity: 0.6;
}
/* Farsi-translation variant of the AI button (teal, to distinguish from the
   purple grammar-only button). */
.ai-fix-btn--fa {
  background: linear-gradient(135deg, #0ea5e9, #14b8a6);
}
.ai-fix-btn--loading {
  animation: ai-pulse 0.8s ease-in-out infinite alternate;
}
@keyframes ai-pulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}
.ai-field-wrap {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}
.ai-field-wrap .inline-input,
.ai-field-wrap .inline-textarea {
  flex: 1;
}
.ai-field-wrap .ai-fix-btn {
  margin-top: 6px;
  padding: 4px 10px;
  font-size: 0.7rem;
}

/* ========================================================
   COMMENTS
   ======================================================== */
.task-card-comments {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-200, #e5e7eb);
}
.comments-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-600, #4b5563);
  margin-bottom: 0.5rem;
}
.comment-bubble {
  position: relative;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.45;
}
.comment-bubble--admin {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px 12px 12px 2px;
}
.comment-bubble--user {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px 12px 2px 12px;
}
.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 4px;
  font-size: 0.75rem;
}
.comment-header strong {
  color: var(--gray-700, #374151);
}
.comment-body {
  color: var(--gray-700, #374151);
  white-space: pre-wrap;
  word-break: break-word;
}
.comment-form {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.comment-form .ai-field-wrap {
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
}
.comment-form .btn {
  align-self: flex-end;
}
.comment-input {
  resize: vertical;
  min-height: 44px;
}

/* ── Weekly Calendar ────────────────────────────────────────── */
.week-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--gray-200, #e2e8f0);
  border-radius: 8px;
  overflow: hidden;
  margin: 4px 0 0;
}
.week-day {
  background: var(--white, #fff);
  min-height: 110px;
  display: flex;
  flex-direction: column;
}
.week-day--today {
  background: #f0fdf4;
}
.week-day-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 10px 4px;
  border-bottom: 1px solid var(--gray-100, #f1f5f9);
}
.week-day--today .week-day-header {
  border-bottom-color: #bbf7d0;
}
.week-day-label {
  font-weight: 700;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gray-500, #64748b);
}
.week-day--today .week-day-label {
  color: #16a34a;
}
.week-day-num {
  font-size: .78rem;
  color: var(--gray-400, #94a3b8);
}
.week-day--today .week-day-num {
  color: #16a34a;
  font-weight: 600;
}
.week-day-tasks {
  padding: 6px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.week-day-empty {
  color: var(--gray-300, #cbd5e1);
  font-size: .82rem;
  text-align: center;
  margin-top: 8px;
}
.week-task {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: .78rem;
  line-height: 1.3;
  text-decoration: none;
  color: var(--gray-700, #334155);
  background: var(--gray-50, #f8fafc);
  transition: background .15s;
  cursor: pointer;
}
.week-task:hover {
  background: var(--gray-100, #f1f5f9);
}
.week-task--completed {
  opacity: .55;
  text-decoration: line-through;
}
.week-task-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.week-task-dot--low { background: #94a3b8; }
.week-task-dot--medium { background: #f59e0b; }
.week-task-dot--high { background: #f97316; }
.week-task-dot--urgent { background: #ef4444; }
.week-task-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.week-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .95rem;
}
.week-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--gray-100, #f1f5f9);
  color: var(--gray-700, #334155);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  transition: background .15s, color .15s;
}
.week-nav-btn:hover {
  background: var(--gray-200, #e2e8f0);
  color: var(--gray-900, #0f172a);
}
.week-current-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #16a34a;
  font-size: .75rem;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 4px;
}
.week-today-link {
  font-size: .8rem;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  background: #eff6ff;
  transition: background .15s;
}
.week-today-link:hover {
  background: #dbeafe;
}
@media (max-width: 768px) {
  .week-nav {
    flex-wrap: wrap;
    font-size: .82rem;
    gap: 8px;
  }
  .week-nav-btn {
    width: 28px;
    height: 28px;
    font-size: .95rem;
  }
}
@media (max-width: 768px) {
  .week-calendar {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .week-day {
    min-height: auto;
    flex-direction: row;
    align-items: center;
    padding: 6px 12px;
    gap: 12px;
    border-bottom: 1px solid var(--gray-100, #f1f5f9);
  }
  .week-day-header {
    min-width: 80px;
    border-bottom: none;
    padding: 0;
  }
  .week-day-tasks {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0;
  }
}

/* File viewer modal */
.fv-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.85);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.fv-overlay.fv-open { display: flex; }
.fv-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  z-index: 10;
  line-height: 1;
}
.fv-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 2.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.fv-nav:hover { background: rgba(255,255,255,.3); }
.fv-prev { left: 12px; }
.fv-next { right: 12px; }
.fv-content {
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fv-img {
  max-width: 90vw;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 6px;
}
.fv-iframe {
  width: 80vw;
  height: 78vh;
  border: none;
  border-radius: 6px;
  background: #fff;
}
.fv-unsupported {
  text-align: center;
  color: #fff;
  padding: 2rem;
}
.fv-unsupported p { margin-bottom: 1rem; font-size: 1.1rem; }
.fv-footer {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,.8);
  font-size: .8rem;
}
.fv-dl-btn {
  color: #93c5fd;
  text-decoration: none;
  font-weight: 600;
  font-size: .8rem;
}
.fv-dl-btn:hover { text-decoration: underline; }

/* Attachment tiles */
.att-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.att-tile {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  border: 1px solid var(--gray-200, #e5e7eb);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow .15s;
}
.att-tile:hover { box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.att-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.att-tile-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px;
  text-align: center;
}
.att-tile-ext {
  font-size: .65rem;
  font-weight: 700;
  color: var(--gray-500, #6b7280);
  text-transform: uppercase;
}
.att-tile-name {
  font-size: .55rem;
  color: var(--gray-400, #9ca3af);
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Comment attachment upload */
.cmt-attach-btn {
  background: none;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: .75rem;
  color: var(--gray-500, #6b7280);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cmt-attach-btn:hover {
  background: var(--gray-50, #f9fafb);
  border-color: var(--gray-300, #d1d5db);
}
.cmt-file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.cmt-file-chip {
  font-size: .7rem;
  background: #eff6ff;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.cmt-file-chip .link-danger { font-size: .65rem; }

/* Group toggle */
.search-bar-wrap { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.search-bar-wrap .search-input { flex: 1; min-width: 200px; }
.group-toggle { display: flex; gap: 0; border: 1px solid var(--gray-200); border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.group-toggle-btn {
  padding: .35rem .75rem;
  font-size: .75rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--gray-600);
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  transition: background .15s, color .15s;
}
.group-toggle-btn:last-child { border-right: none; }
.group-toggle-btn:hover { background: var(--gray-50); }
.group-toggle-btn--active {
  background: var(--brand);
  color: var(--white);
}
.group-toggle-btn--active:hover { background: var(--brand-dark, #00a86e); }

/* Approved for Payment section */
.approved-panel { border-left: 3px solid var(--brand); }
.approved-list { padding: .5rem 1rem 1rem; }
.approved-total {
  font-size: .85rem;
  color: var(--gray-600);
  padding: .5rem 0;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: .5rem;
}
.approved-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--gray-50);
  flex-wrap: wrap;
}
.approved-item:last-child { border-bottom: none; }
.approved-item-title { font-weight: 600; font-size: .85rem; }
.approved-item-title a { color: var(--gray-900); text-decoration: none; }
.approved-item-title a:hover { color: var(--brand); }
.approved-item-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* User color coding */
.user-color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  vertical-align: middle;
}
.user-color-swatch {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid var(--gray-200);
  vertical-align: middle;
  transition: border-color .15s;
}
.user-color-swatch:hover { border-color: var(--gray-400); }
.user-color-picker {
  width: 0;
  height: 0;
  padding: 0;
  border: none;
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Task ID badge */
.task-id-badge {
  font-size: .6rem;
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: var(--gray-500);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: .5px;
}

/* Compact approved for payment */
.approved-compact {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-left: 3px solid var(--brand);
  border-radius: 8px;
  padding: .6rem .8rem;
  margin-bottom: 1rem;
  font-size: .8rem;
}
.approved-compact-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .4rem;
}
.approved-compact-title {
  font-weight: 700;
  font-size: .85rem;
  color: var(--gray-900);
}
.count-badge--sm {
  font-size: .6rem;
  padding: 1px 5px;
}
.approved-compact-total {
  font-weight: 700;
  color: var(--brand);
  margin-left: auto;
}
.rcti-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  font-size: .7rem;
  font-weight: 600;
  color: var(--white);
  background: var(--brand);
  border-radius: 4px;
  text-decoration: none;
  transition: background .15s;
}
.rcti-btn:hover { background: #00a86e; }
.rcti-btn--sm { font-size: .6rem; padding: 1px 5px; background: var(--gray-500); }
.rcti-btn--sm:hover { background: var(--gray-700); }

.approved-week {
  border-top: 1px solid var(--gray-100);
  padding-top: .3rem;
  margin-top: .3rem;
}
.approved-week-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .2rem;
}
.approved-week-label {
  font-weight: 600;
  font-size: .7rem;
  color: var(--gray-600);
}
.approved-week-total {
  font-weight: 600;
  font-size: .7rem;
  color: var(--brand);
  margin-left: auto;
}
.approved-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 2px 0;
  font-size: .75rem;
}
.approved-row-id {
  font-family: 'Courier New', monospace;
  font-size: .6rem;
  font-weight: 600;
  color: var(--gray-500);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  padding: 0 4px;
  border-radius: 3px;
  flex-shrink: 0;
}
.approved-row-title {
  color: var(--gray-800);
  text-decoration: none;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.approved-row-title:hover { color: var(--brand); }
.approved-row-cost {
  font-weight: 600;
  color: var(--gray-700);
  flex-shrink: 0;
}

/* Payments page */
.pay-summary {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.pay-summary-item {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.pay-summary-item--total { margin-right: auto; }
.pay-summary-num {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.1;
}
.pay-summary-item--total .pay-summary-num { color: var(--brand); }
.pay-summary-label {
  font-size: .7rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.pay-rcti-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: .45rem .9rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--white);
  background: var(--brand);
  border-radius: 6px;
  text-decoration: none;
  transition: background .15s;
}
.pay-rcti-all:hover { background: #00a86e; }
.pay-rcti-all svg { flex-shrink: 0; }

.pay-week-panel { margin-bottom: .75rem; }
.pay-week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  flex-wrap: wrap;
  gap: .5rem;
}
.pay-week-head-left {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.pay-week-head-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.pay-week-title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--gray-800);
  margin: 0;
}
.pay-week-total {
  font-size: .9rem;
  font-weight: 700;
  color: var(--brand);
}

.pay-table-wrap { overflow-x: auto; }
.pay-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}
.pay-table th {
  text-align: left;
  padding: .4rem .75rem;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-100);
}
.pay-table td {
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--gray-50);
  vertical-align: middle;
}
.pay-table tbody tr:hover { background: var(--gray-50); }
.pay-table tfoot td {
  padding: .5rem .75rem;
  background: var(--gray-50);
  border-top: 2px solid var(--gray-200);
  font-size: .8rem;
}
.pay-table .cell-right { text-align: right; }
.pay-task-link {
  color: var(--gray-800);
  text-decoration: none;
  font-weight: 500;
}
.pay-task-link:hover { color: var(--brand); }

/* ============================================================
   Server Management
   ============================================================ */
.srv-status-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.srv-status-dot--running { background: #10B981; box-shadow: 0 0 4px rgba(16,185,129,.4); }
.srv-status-dot--stopped { background: #EF4444; }
.srv-status-dot--pending { background: #F59E0B; }

.srv-chevron {
  transition: transform .2s ease;
  color: var(--gray);
  flex-shrink: 0;
}

.srv-body { padding: 0 1.5rem 1.5rem; }

.srv-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
  padding: .75rem 0;
}
.srv-info-item {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.srv-info-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--gray);
}
.srv-info-value {
  font-size: .9rem;
  color: var(--navy);
  font-weight: 500;
}

.srv-badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 4px;
}
.srv-badge--done {
  background: #D1FAE5;
  color: #065F46;
}
.srv-badge--pending {
  background: #FEF3C7;
  color: #92400E;
}

.srv-ssh-cmd {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: .2rem .5rem;
  border-radius: 4px;
  font-size: .8rem;
  cursor: pointer;
  transition: background .15s;
}
.srv-ssh-cmd:hover { background: var(--line); }

.role-badge--admin {
  background: #FEE2E2;
  color: #991B1B;
}
.role-badge--readonly {
  background: #E0E7FF;
  color: #3730A3;
}

/* Server approval panel */
.srv-approval-panel {
  border: 2px solid #F59E0B;
  animation: srv-glow .8s ease-in-out infinite alternate;
}
@keyframes srv-glow {
  from { box-shadow: 0 0 0 0 rgba(245,158,11,.15); }
  to   { box-shadow: 0 0 12px 2px rgba(245,158,11,.25); }
}
.srv-approval-pulse {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #F59E0B;
  animation: srv-pulse 1.2s ease-in-out infinite;
}
@keyframes srv-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: .5; transform: scale(.8); }
}

.srv-code-form { margin-bottom: 1rem; }
.srv-code-info {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}
.srv-code-inputs {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
}
.srv-code-input {
  font-family: monospace;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 2px;
  padding: .6rem 1rem;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  width: 280px;
  text-align: center;
  transition: border-color .15s;
}
.srv-code-input:focus {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,194,129,.15);
}

/* Active server access cards */
.srv-active-card {
  padding: .75rem 0;
  border-bottom: 1px solid var(--line);
}
.srv-active-card:last-child { border-bottom: none; }
.srv-active-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .5rem;
  flex-wrap: wrap;
}
.srv-active-servers {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding-left: .5rem;
}
.srv-active-server-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.srv-creds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem;
}
.srv-cred-item {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.srv-cred-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gray);
}
.srv-cred-val {
  font-size: .95rem;
  font-weight: 600;
  color: var(--navy);
}

.srv-instance-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.5rem;
  border-bottom: 1px solid var(--line);
  transition: background .1s;
}
.srv-instance-row:hover { background: var(--surface); }
.srv-instance-row:last-of-type { border-bottom: none; }

.srv-deploy-details { margin-top: .25rem; }
.srv-deploy-list {
  list-style: none;
  padding: .5rem 0 0;
  margin: 0;
  font-size: .85rem;
}
.srv-deploy-list li {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .25rem 0;
}

.srv-connect-help {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .75rem 1rem;
  margin-top: 1rem;
}

/* SSH Guide */
.ssh-limits-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.ssh-limits-table td {
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--gray-700, #334155);
}
.ssh-limits-table tr:last-child td { border-bottom: none; }
.ssh-lim-action { font-weight: 700; color: var(--navy); white-space: nowrap; width: 1%; }
.ssh-lim-badge { white-space: nowrap; width: 1%; }
.ssh-pill {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.ssh-pill--green  { background: #D1FAE5; color: #065F46; }
.ssh-pill--amber  { background: #FEF3C7; color: #92400E; }
.ssh-pill--purple { background: #EDE9FE; color: #6D28D9; }
.ssh-pill--red    { background: #FEE2E2; color: #991B1B; }

.ssh-steps {
  margin: 0;
  padding-left: 1.25rem;
  font-size: .9rem;
  line-height: 2;
  color: var(--gray-700, #334155);
}
.ssh-steps code, .ssh-trouble code {
  background: #eef2f7;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .82rem;
}
.ssh-trouble { margin-bottom: 1rem; }
.ssh-trouble:last-child { margin-bottom: 0; }
.ssh-trouble > strong { display: block; color: var(--navy); margin-bottom: .25rem; }
.ssh-trouble ul { margin: 0; padding-left: 1.2rem; font-size: .85rem; line-height: 1.7; color: var(--gray-700, #334155); }

.srv-guide-banner {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 8px;
  padding: .75rem 1rem;
  margin-bottom: 1rem;
  font-size: .88rem;
  color: #1E3A5F;
}
.srv-guide-banner a { color: var(--green); font-weight: 700; }
.srv-limits-details { margin-top: .5rem; }

.srv-suspended {
  border: 2px solid #DC2626 !important;
  background: linear-gradient(180deg, #DC2626 0%, #B91C1C 100%) !important;
  animation: srv-susp-glow 1s ease-in-out infinite alternate;
}
.srv-suspended .panel-head { border-bottom-color: rgba(255,255,255,.25); }
@keyframes srv-susp-glow {
  from { box-shadow: 0 0 0 0 rgba(220,38,38,.3); }
  to   { box-shadow: 0 0 18px 3px rgba(220,38,38,.55); }
}
.srv-susp-pulse {
  display: inline-block; width: 11px; height: 11px; border-radius: 50%;
  background: #fff; animation: srv-pulse 1s ease-in-out infinite;
}
.srv-susp-card {
  background: rgba(255,255,255,.95);
  border-radius: 8px;
  padding: .75rem 1rem;
  margin-bottom: .6rem;
}
.srv-susp-card:last-child { margin-bottom: 0; }

.srv-countdown {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 700;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
  margin-left: .4rem;
}

.srv-fullaccess {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: 8px;
  padding: .75rem 1rem;
}
.srv-fullaccess strong { color: #065F46; font-size: .9rem; }

.srv-conns { margin-top: .5rem; }
.srv-conns .ssh-limits-table td { padding: .4rem .5rem; }
.srv-keys-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: .5rem .75rem; }
.srv-keys-list { display: flex; flex-direction: column; gap: .4rem; }
.srv-key-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.srv-key-info code { font-size: .72rem; word-break: break-all; }
.srv-key-actions { display: flex; gap: .6rem; white-space: nowrap; }

/* ---- Responsive (mobile) ---- */
@media (max-width: 640px) {
  .srv-creds-grid { grid-template-columns: 1fr; }
  .srv-active-server-item { flex-wrap: wrap; }
  .srv-active-server-item .srv-ssh-cmd { width: 100%; word-break: break-all; }
  .srv-code-input { width: 100%; }
  .srv-code-inputs { flex-direction: column; align-items: stretch; }
  .srv-code-inputs .btn { width: 100%; }
  .srv-instance-row { padding: .6rem 1rem; }
  .srv-body { padding: 0 1rem 1rem; }
  .ssh-limits-table td { display: block; width: auto; }
  .ssh-limits-table tr { display: block; padding: .4rem 0; border-bottom: 1px solid var(--line); }
  .ssh-lim-action, .ssh-lim-badge { white-space: normal; }
  .cert-table-wrap, .srv-conns { overflow-x: auto; }
  .dash-tabs { overflow-x: auto; white-space: nowrap; }
}
.srv-connect-help code {
  background: #eef2f7;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .8rem;
}

.srv-select-grid {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.srv-checkbox-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: background .1s, border-color .1s;
  font-size: .85rem;
}
.srv-checkbox-label:hover { background: var(--surface); }
.srv-checkbox-label input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--green);
}

/* ============================================================
   KPI Score — credit-score style gauge
   ============================================================ */

/* Hero row: title left, KPI widget right */
.kpi-hero-row {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

/* KPI widget card (top-right) */
.kpi-widget {
  flex-shrink: 0;
  width: 340px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
}

.kpi-widget-title {
  font-size: .72rem;
  font-weight: 700;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: .1rem;
}

.kpi-widget-gauge {
  width: 210px;
  height: auto;
  margin: -.15rem 0 -.25rem;
}
.kpi-widget-gauge svg { display: block; width: 100%; height: auto; }

.kpi-widget-score {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  margin-top: -.15rem;
}

.kpi-widget-quality {
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: .25rem;
}

.kpi-widget-stats {
  display: flex;
  gap: .5rem;
  width: 100%;
  justify-content: center;
  padding-top: .35rem;
  border-top: 1px solid var(--line);
}

.kpi-widget-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .05rem;
  min-width: 55px;
}

.kpi-widget-stat-num {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.2;
}

.kpi-widget-stat-lbl {
  font-size: .62rem;
  color: var(--gray);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .3px;
}

/* Inline warnings */
.kpi-widget-warnings {
  width: 100%;
  margin-top: .35rem;
}

.kpi-widget-warn {
  background: #FEF3C7;
  border: 1px solid #F59E0B;
  border-radius: 6px;
  padding: .35rem .6rem;
  font-size: .72rem;
  color: #92400E;
  margin-bottom: .25rem;
  text-align: center;
  line-height: 1.4;
}

.kpi-widget-warn--term {
  background: #FEE2E2;
  border-color: #DC2626;
  color: #991B1B;
}

.kpi-widget-warn strong { font-weight: 700; }
.kpi-widget-warn em { font-style: italic; font-size: .68rem; }

/* Project mini bars */
.kpi-widget-projects {
  width: 100%;
  padding-top: .35rem;
  border-top: 1px solid var(--line);
  margin-top: .25rem;
}

.kpi-widget-proj-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .15rem 0;
}

.kpi-widget-proj-name {
  font-size: .7rem;
  font-weight: 600;
  color: var(--navy);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-widget-proj-bar {
  flex: 1.5;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}

.kpi-widget-proj-bar > div {
  height: 100%;
  border-radius: 3px;
  transition: width .5s;
}

/* Expandable task scores */
.kpi-widget-detail {
  width: 100%;
  padding-top: .25rem;
  border-top: 1px solid var(--line);
  margin-top: .2rem;
}

.kpi-widget-detail summary {
  font-size: .72rem;
  cursor: pointer;
}

.kpi-widget-tasklist {
  margin-top: .25rem;
  max-height: 150px;
  overflow-y: auto;
}

.kpi-widget-task-row {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .72rem;
}

.kpi-widget-task-row:last-child { border-bottom: none; }

.kpi-widget-task-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--navy);
}

@media (max-width: 768px) {
  .kpi-hero-row {
    flex-direction: column;
  }
  .kpi-widget {
    width: 100%;
    max-width: 360px;
    align-self: center;
  }
}

/* KPI info button ("?") */
.kpi-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--gray);
  background: transparent;
  color: var(--gray);
  font-size: .7rem;
  font-weight: 700;
  cursor: pointer;
  vertical-align: middle;
  margin-left: .35rem;
  padding: 0;
  line-height: 1;
  transition: all .15s;
}
.kpi-info-btn:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* KPI info modal */
.kpi-info-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.55);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.kpi-info-content {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 48px rgba(0,0,0,.25);
  padding: 2rem 2.2rem;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}
.kpi-info-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray);
  line-height: 1;
  padding: .25rem;
}
.kpi-info-close:hover { color: var(--navy); }
.kpi-info-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 .75rem;
}
.kpi-info-section { margin-bottom: .75rem; }
.kpi-info-section h4 {
  font-size: .85rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 .35rem;
}
.kpi-info-section ul {
  margin: 0;
  padding-left: 1.2rem;
  list-style: disc;
}
.kpi-info-section[dir="rtl"] ul {
  padding-left: 0;
  padding-right: 1.2rem;
}
.kpi-info-section li {
  font-size: .82rem;
  line-height: 1.6;
  color: var(--body);
}

.kpi-panel { padding: 1.5rem; }

.kpi-gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1rem 1rem;
}

.kpi-gauge {
  position: relative;
  width: 280px;
  height: 150px;
}

.kpi-gauge svg { width: 100%; height: 100%; overflow: visible; }

.kpi-gauge-bg {
  fill: none;
  stroke: var(--line);
  stroke-width: 20;
  stroke-linecap: round;
}

.kpi-gauge-fill {
  fill: none;
  stroke-width: 20;
  stroke-linecap: round;
  transition: stroke-dashoffset .8s cubic-bezier(.4,0,.2,1),
              stroke .4s;
}

.kpi-gauge-needle {
  transform-origin: 140px 130px;
  transition: transform .8s cubic-bezier(.4,0,.2,1);
}

.kpi-gauge-needle line {
  stroke: var(--navy);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.kpi-gauge-needle circle {
  fill: var(--navy);
}

.kpi-score-display {
  text-align: center;
  margin-top: -0.25rem;
}

.kpi-score-num {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
}

.kpi-score-label {
  font-size: .85rem;
  color: var(--gray);
  margin-top: .25rem;
}

.kpi-score-quality {
  font-size: .95rem;
  font-weight: 600;
  margin-top: .15rem;
}

/* Score color classes */
.kpi-color-excellent { color: #16A34A; }
.kpi-color-good { color: #65A30D; }
.kpi-color-fair { color: #CA8A04; }
.kpi-color-poor { color: #EA580C; }
.kpi-color-critical { color: #DC2626; }
.kpi-color-none { color: var(--gray-400); }

/* Gauge gradient ticks */
.kpi-gauge-ticks text {
  font-size: 11px;
  fill: var(--gray);
  font-weight: 500;
}

/* KPI summary stats */
.kpi-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .75rem;
  padding: 0 1.5rem 1.25rem;
}

.kpi-stat-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  text-align: center;
}

.kpi-stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
}

.kpi-stat-label {
  font-size: .75rem;
  color: var(--gray);
  margin-top: .15rem;
}

.kpi-stat-card--green .kpi-stat-num { color: #16A34A; }
.kpi-stat-card--amber .kpi-stat-num { color: #CA8A04; }
.kpi-stat-card--red .kpi-stat-num { color: #DC2626; }
.kpi-stat-card--blue .kpi-stat-num { color: #2563EB; }

/* Warnings */
.kpi-warnings {
  padding: 0 1.5rem 1.25rem;
}

.kpi-warning-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: .5rem;
}

.kpi-warning-item--warn {
  background: #FEF3C7;
  border: 1px solid #F59E0B;
}

.kpi-warning-item--termination {
  background: #FEE2E2;
  border: 1px solid #DC2626;
}

.kpi-warning-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.kpi-warning-text {
  font-size: .85rem;
  color: var(--navy);
  flex: 1;
}

.kpi-warning-text strong { font-weight: 700; }

.kpi-warning-date {
  font-size: .75rem;
  color: var(--gray);
}

/* Project breakdown */
.kpi-projects {
  padding: 0 1.5rem 1.25rem;
}

.kpi-project-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--line);
}

.kpi-project-row:last-child { border-bottom: none; }

.kpi-project-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--navy);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-project-bar-wrap {
  flex: 2;
  height: 10px;
  background: var(--line);
  border-radius: 5px;
  overflow: hidden;
}

.kpi-project-bar {
  height: 100%;
  border-radius: 5px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

.kpi-project-score {
  font-size: .8rem;
  font-weight: 700;
  width: 3rem;
  text-align: right;
}

/* Task score list */
.kpi-task-scores {
  padding: 0 1.5rem 1.25rem;
}

.kpi-task-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .45rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .82rem;
}

.kpi-task-row:last-child { border-bottom: none; }

.kpi-task-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--navy);
}

.kpi-task-score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 1.5rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: .75rem;
  color: #fff;
}

/* Top-of-page link to the dedicated archive page (admin Task Management). */
.archive-bar { margin: 0 0 1rem; }

/* Archived (paid) tasks — collapsible section, user + admin. */
.archive-block > summary.archive-summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  color: var(--navy);
  list-style: none;
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem 0;
}
.archive-block > summary.archive-summary::-webkit-details-marker { display: none; }
.archive-block > summary.archive-summary::before {
  content: "▸";
  font-size: .8rem;
  color: var(--gray-400, #9ca3af);
  transition: transform .15s ease;
}
.archive-block[open] > summary.archive-summary::before { transform: rotate(90deg); }
.archive-list { display: flex; flex-direction: column; gap: .4rem; }
.archive-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .75rem;
  background: var(--surface, #f8fafc);
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 8px;
}
.archive-row-title { font-weight: 600; font-size: .9rem; color: var(--navy); flex: 0 1 auto; }
.archive-row-meta { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-left: auto; }

/* Completion checklist (modal form on the user side, review block on admin side). */
.complete-q { margin-bottom: 1.1rem; }
.complete-q-label { display: block; font-weight: 600; font-size: .9rem; color: var(--navy); margin-bottom: .45rem; }
.complete-radio-row { display: flex; gap: 1.25rem; margin-bottom: .5rem; }
.complete-radio-row label { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; cursor: pointer; }
.complete-sub { margin-top: .35rem; padding-left: .25rem; }
.complete-sub-label { display: block; font-size: .8rem; color: var(--gray-600, #4b5563); margin-bottom: .3rem; }
.complete-sub .inline-input { width: 100%; }

.compreview {
  border-top: 1px solid var(--line);
  margin-top: .75rem;
  padding: .85rem 0 .25rem;
}
.compreview-title { font-size: .82rem; font-weight: 700; color: var(--gray); letter-spacing: .02em; margin-bottom: .5rem; }
.compreview-row { display: flex; gap: .5rem; font-size: .84rem; margin-bottom: .4rem; align-items: baseline; }
.compreview-q { color: var(--gray-600, #4b5563); min-width: 9.5rem; }
.compreview-a { font-weight: 600; color: var(--navy); }
.compreview-badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: .12rem .45rem; border-radius: 999px; }
.compreview-badge--yes { background: #DCFCE7; color: #166534; }
.compreview-badge--no { background: #FEE2E2; color: #991B1B; }
.compreview-reason { background: #FEF2F2; border: 1px solid #FCA5A5; border-radius: 8px; padding: .5rem .65rem; font-size: .84rem; color: #7F1D1D; }
.compreview-missing { font-size: .84rem; color: var(--gray-500, #6b7280); font-style: italic; }

/* Trigger button that opens the Task-scores modal (button reset → looks like a link). */
.kpi-scores-trigger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-top: .35rem;
  font: inherit;
}

.kpi-task-deduction {
  font-size: .75rem;
  color: #DC2626;
  font-weight: 600;
}

.kpi-task-deduction-reason {
  font-size: .72rem;
  color: var(--gray);
  font-style: italic;
}

/* KPI rating form (admin edit task page) */
.kpi-rate-section {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--line);
}

.kpi-rate-section h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 1rem;
}

.kpi-rate-user {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .75rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--line);
}

.kpi-rate-user:last-child { border-bottom: none; }

.kpi-rate-name {
  font-weight: 600;
  font-size: .9rem;
  color: var(--navy);
  min-width: 120px;
}

.kpi-rate-field {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.kpi-rate-field label {
  font-size: .72rem;
  color: var(--gray);
  font-weight: 500;
}

.kpi-score-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 160px;
  height: 8px;
  border-radius: 4px;
  outline: none;
  background: linear-gradient(to right, #DC2626, #EA580C, #F59E0B, #65A30D, #16A34A);
}

.kpi-score-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--navy);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.kpi-score-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--navy);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.kpi-score-val {
  font-size: 1.1rem;
  font-weight: 800;
  min-width: 2rem;
  text-align: center;
}

.kpi-deduction-input {
  width: 60px;
  padding: .3rem .5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: .85rem;
  text-align: center;
}

.kpi-deduction-reason-input {
  width: 180px;
  padding: .3rem .5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: .82rem;
}

.kpi-rate-save {
  padding: .35rem .9rem;
  font-size: .8rem;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.kpi-rate-save:hover { background: var(--green-hover); }

.kpi-rate-existing {
  font-size: .75rem;
  color: var(--gray);
  margin-top: .15rem;
}

@media (max-width: 640px) {
  .kpi-gauge { width: 220px; height: 120px; }
  .kpi-score-num { font-size: 2rem; }
  .kpi-stats { grid-template-columns: repeat(2, 1fr); }
  .kpi-rate-user { flex-direction: column; align-items: flex-start; }
  .kpi-score-slider { width: 100%; }
  .kpi-deduction-reason-input { width: 100%; }
}

/* Voice comment recording button (admin) */
.vc-btn.vc-rec {
  background: #FEE2E2;
  border-color: #FCA5A5;
  color: #B91C1C;
  font-weight: 700;
  animation: vc-pulse 1.2s ease-in-out infinite;
}
@keyframes vc-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .35); }
  50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

/* Inline XHR upload progress (comments & file uploads) */
.up-progress { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.up-progress-track {
  flex: 1 1 auto; height: 8px; border-radius: 6px;
  background: var(--surface, #f1f5f9); overflow: hidden;
  border: 1px solid var(--line, #e5e7eb);
}
.up-progress-track > i {
  display: block; height: 100%; width: 0;
  background: var(--green, #00C281);
  transition: width .15s ease;
}
.up-progress > span { font-size: .76rem; color: var(--gray, #6b7280); white-space: nowrap; }

/* ---- "Attach from Library" picker on task forms ---- */
.lib-picker { margin-top: 10px; }
.lib-picker-open { font-size: .82rem; }
.lib-picker-panel {
  margin-top: 8px; border: 1px solid var(--gray-200, #e2e8f0);
  border-radius: 10px; background: #fff; padding: 10px;
}
.lib-picker-search { width: 100%; box-sizing: border-box; margin-bottom: 8px; }
.lib-picker-list { max-height: 260px; overflow-y: auto; }
.lib-picker-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px;
  border-radius: 8px; cursor: pointer; user-select: none;
}
.lib-picker-row:hover, .lib-picker-row:focus-visible { background: var(--gray-50, #f8fafc); outline: none; }
.lib-picker-row.on { background: #ECFDF5; }
.lib-picker-check {
  flex: 0 0 20px; height: 20px; line-height: 18px; text-align: center;
  border: 1.5px solid var(--gray-300, #cbd5e1); border-radius: 6px;
  font-size: .72rem; color: #059669; background: #fff;
}
.lib-picker-row.on .lib-picker-check { border-color: #059669; }
.lib-picker-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lib-picker-main strong { font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-picker-main small { font-size: .72rem; color: var(--gray, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-picker-size { flex: 0 0 auto; font-size: .74rem; color: var(--gray, #6b7280); }
.lib-picker-chips { margin-top: 8px; }

/* ---- Task stages (subtasks) ---- */
.stages-badge{display:inline-flex;align-items:center;gap:4px;font-size:.7rem;font-weight:700;padding:2px 8px;border-radius:999px;background:#EDE9FE;color:#5B21B6}
.subtasks{margin:.5rem 0 .25rem;border:1px solid var(--line,#e2e8f0);border-radius:10px;padding:.5rem .6rem;background:var(--surface,#f8fafc)}
.subtasks-head{font-size:.72rem;font-weight:700;color:var(--gray,#64748b);text-transform:uppercase;letter-spacing:.03em;margin-bottom:.4rem}
.subtask-row{display:flex;align-items:center;gap:.6rem;padding:.4rem .5rem;border-radius:8px;background:#fff;border:1px solid var(--line,#e2e8f0);margin-bottom:.35rem;flex-wrap:wrap}
.subtask-row--active{border-color:#2563EB;box-shadow:inset 0 0 0 1px #2563EB}
.subtask-row--paid{opacity:.75}
.subtask-row--waiting{background:#fafafa}
.subtask-order{flex:0 0 auto;width:20px;height:20px;border-radius:50%;background:var(--navy,#0D2F4F);color:#fff;font-size:.72rem;font-weight:700;display:flex;align-items:center;justify-content:center}
.subtask-main{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:2px}
.subtask-label{font-weight:600;font-size:.85rem;color:var(--navy,#0D2F4F)}
.subtask-who{font-size:.72rem;color:var(--gray,#64748b);display:flex;align-items:center;gap:4px}
.subtask-cost{flex:0 0 auto;font-size:.8rem;font-weight:700;color:#16A34A}
.subtask-state{flex:0 0 auto;font-size:.72rem;font-weight:700;padding:2px 8px;border-radius:999px}
.subtask-state--paid{background:#DCFCE7;color:#166534}
.subtask-state--active{background:#DBEAFE;color:#1D4ED8}
.subtask-state--waiting{background:#F1F5F9;color:#64748b}
.subtask-actions{flex:0 0 auto;display:flex;align-items:center;gap:.4rem}
.add-subtask{margin-top:.3rem}
.add-subtask summary{cursor:pointer;font-size:.78rem;color:#1D4ED8;font-weight:600;list-style:none;padding:.25rem 0}
.add-subtask-form{display:flex;gap:.4rem;flex-wrap:wrap;align-items:center;margin-top:.4rem}
.stage-banner{margin:.2rem 0 .7rem;padding:.6rem .8rem;border-radius:10px;background:#EFF6FF;border:1px solid #BFDBFE;color:#1E3A8A;font-size:.84rem}
.stage-banner--wait{background:#FEF9C3;border-color:#FDE68A;color:#854D0E}
.subtask-due{flex:0 0 auto;font-size:.72rem;color:var(--gray,#64748b);white-space:nowrap}
.subtask-kpi{margin:.15rem 0 .5rem 30px;padding:.3rem .5rem;background:#fff;border:1px dashed var(--line,#e2e8f0);border-radius:8px;display:flex;flex-direction:column;gap:.25rem}
.subtask-kpi .kpi-rate-user{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap;padding:0;border:none;font-size:.78rem}
.subtask-kpi .kpi-rate-name{min-width:90px;font-weight:600;color:var(--gray,#64748b)}

/* ---- Foldable task detail sections (Option B: stepper + collapsible) ---- */
.task-section{border:0.5px solid var(--line,#e2e8f0);border-radius:10px;margin-top:.6rem;background:var(--white,#fff)}
.task-section > .task-section-sum{list-style:none;cursor:pointer;padding:.6rem .8rem;font-size:.85rem;font-weight:600;color:var(--navy,#0D2F4F);display:flex;align-items:center;gap:.5rem}
.task-section > .task-section-sum::-webkit-details-marker{display:none}
.task-section-sum .task-sec-caret{font-style:normal;color:var(--gray,#94a3b8);transition:transform .15s;font-size:.8rem}
.task-section[open] > .task-section-sum .task-sec-caret{transform:rotate(90deg)}
.task-section-sum .task-sec-count{background:var(--surface,#eef2f7);color:var(--gray,#64748b);border-radius:999px;font-size:.72rem;font-weight:700;padding:1px 8px}
.task-section > *:not(.task-section-sum){padding-left:.8rem;padding-right:.8rem}
.task-section > *:last-child{padding-bottom:.7rem}
.task-section.kpi-rate-section[open] > .task-section-sum{border-bottom:0.5px solid var(--line,#e2e8f0);margin-bottom:.4rem}
.task-section.task-card-comments .comment-form{margin-top:.5rem}

/* ---- Tabbed task card (Overview / Stages / Activity / Payment) ---- */
.tc-tabbar{display:flex;gap:2px;border-bottom:1px solid var(--line,#e2e8f0);margin:.2rem 0 .9rem}
.tc-tab{background:none;border:none;border-bottom:2px solid transparent;padding:9px 14px;font-size:.86rem;font-weight:600;color:var(--gray,#64748b);cursor:pointer;margin-bottom:-1px;display:inline-flex;align-items:center;gap:6px}
.tc-tab:hover{color:var(--navy,#0D2F4F)}
.tc-tab.on{color:var(--navy,#0D2F4F);border-bottom-color:var(--green,#00C281)}
.tc-tab-n{background:var(--surface,#eef2f7);color:var(--gray,#64748b);border-radius:999px;font-size:.7rem;font-weight:700;padding:0 7px;line-height:1.5}
.tc-tab.on .tc-tab-n{background:var(--green,#00C281);color:#fff}
.tc-panel{display:none}
.tc-panel.on{display:block;animation:tcfade .12s ease}
@keyframes tcfade{from{opacity:.4}to{opacity:1}}
.tc-block{margin:0 0 .9rem}
.tc-label{font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--gray,#94a3b8);margin-bottom:.3rem}
/* Stepper */
.stepper{display:flex;align-items:flex-start;margin:.2rem 0 1rem;overflow-x:auto;padding-bottom:.3rem}
.stepper-node{display:flex;flex-direction:column;align-items:center;text-align:center;flex:0 0 auto;min-width:96px;gap:4px}
.stepper-dot{width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;border:2px solid var(--line,#e2e8f0);background:var(--white,#fff);color:var(--gray,#94a3b8)}
.stepper-node--paid .stepper-dot{background:#DCFCE7;border-color:#16A34A;color:#166534}
.stepper-node--active .stepper-dot{background:#DBEAFE;border-color:#2563EB;color:#1D4ED8}
.stepper-label{font-size:.8rem;font-weight:600;color:var(--navy,#0D2F4F);white-space:nowrap}
.stepper-sub{font-size:.72rem;color:var(--gray,#94a3b8);white-space:nowrap}
.stepper-node--paid .stepper-sub{color:#166534}
.stepper-node--active .stepper-sub{color:#1D4ED8}
.stepper-bar{flex:1 1 30px;min-width:24px;height:2px;margin-top:14px;background:var(--line,#e2e8f0)}
.stepper-bar--paid{background:#16A34A}

/* --- KPI performance graph (Team KPI cards + user's Employment KPI widget) --- */
.kpi-graph-wrap { width: 100%; margin-top: .65rem; }
.kpi-graph-title {
  font-size: .7rem; font-weight: 700; color: var(--gray-500, #6b7280);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: .3rem; text-align: start;
}
.kpi-graph-legend { display: flex; flex-wrap: wrap; gap: .35rem .7rem; margin-top: .35rem; justify-content: center; }
.kpi-graph-leg-item { display: inline-flex; align-items: center; gap: .28rem; font-size: .64rem; font-weight: 600; color: var(--gray-500, #6b7280); }
.kpi-graph-dot { width: .55rem; height: .55rem; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.kpi-cx-chip { font-size: .62rem; font-weight: 700; border-radius: 999px; padding: .1rem .4rem; color: #fff; flex: 0 0 auto; }


/* ---------------------------------------------------------------------------
   Claude Agent page — Claude Code-style sessions UI
--------------------------------------------------------------------------- */
.cc-shell {
  display: flex; padding: 0; overflow: hidden; min-height: 640px;
  height: calc(100vh - 320px);
}

/* sessions sidebar */
.cc-side {
  width: 250px; flex-shrink: 0; display: flex; flex-direction: column;
  background: #F0EEE8; border-right: 1px solid #E2DFD6; padding: .75rem;
  gap: .6rem;
}
.cc-new {
  border: 1px solid #D9CFC2; background: #FFF; border-radius: var(--radius-sm);
  padding: .5rem .7rem; font-size: .85rem; font-weight: 600; color: #3D3929;
  cursor: pointer; text-align: left; transition: background var(--transition);
}
.cc-new:hover { background: #FAF9F5; border-color: #D97757; }
.cc-newform {
  background: #FFF; border: 1px solid #E2DFD6; border-radius: var(--radius-sm);
  padding: .6rem; display: flex; flex-direction: column; gap: .45rem; font-size: .8rem;
}
.cc-newform label { color: #6B6555; font-weight: 600; }
.cc-newform select {
  padding: .35rem .45rem; border: 1px solid #D9CFC2; border-radius: 6px;
  font-size: .82rem; background: #FFF; max-width: 100%;
}
.cc-newform-btns { display: flex; gap: .4rem; }
.cc-newform-btns button {
  flex: 1; padding: .38rem 0; border-radius: 6px; border: 0; cursor: pointer;
  font-size: .8rem; font-weight: 600; background: #D97757; color: #fff;
}
.cc-ghost {
  background: transparent !important; color: #6B6555 !important;
  border: 1px solid #D9CFC2 !important; cursor: pointer; border-radius: 6px;
  padding: .3rem .6rem; font-size: .8rem;
}
.cc-filter {
  padding: .35rem .45rem; border: 1px solid #D9CFC2; border-radius: 6px;
  font-size: .78rem; background: #FFF; color: #6B6555;
}
.cc-sessions { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .35rem; }
.cc-sess {
  background: #FFF; border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: .5rem .6rem; cursor: pointer; transition: border-color var(--transition);
  position: relative;
}
.cc-sess:hover { border-color: #D9CFC2; }
.cc-sess--on { border-color: #D97757; box-shadow: 0 0 0 1px #D97757 inset; }
.cc-sess-title {
  font-size: .82rem; font-weight: 600; color: #3D3929; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.cc-sess-meta {
  display: flex; align-items: center; gap: .45rem; margin-top: .25rem;
  font-size: .68rem; color: #9A937F;
}
.cc-sess-server {
  background: #F0EEE8; border: 1px solid #E2DFD6; border-radius: 999px;
  padding: .05rem .45rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #6B6555; max-width: 120px; overflow: hidden; text-overflow: ellipsis;
}
.cc-sess-noserver { font-style: italic; }
.cc-sess-del {
  margin-left: auto; border: 0; background: none; color: #C9C2B2; cursor: pointer;
  font-size: .95rem; line-height: 1; padding: 0 .1rem; visibility: hidden;
}
.cc-sess:hover .cc-sess-del { visibility: visible; }
.cc-sess-del:hover { color: var(--danger); }
.cc-sess-none { font-size: .78rem; color: #9A937F; padding: .5rem .2rem; }
.cc-live {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #D97757; margin-right: .35rem; animation: ccpulse 1.4s infinite;
}
@keyframes ccpulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

/* main column */
.cc-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #FAF9F5; }
.cc-head {
  display: flex; align-items: center; gap: .7rem; padding: .65rem 1.1rem;
  border-bottom: 1px solid #E2DFD6; background: #FFF;
}
.cc-head-title {
  display: flex; align-items: center; gap: .55rem; min-width: 0;
  font-size: .92rem; font-weight: 600; color: #3D3929;
}
#cc-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-server-chip {
  background: #F0EEE8; border: 1px solid #E2DFD6; border-radius: 999px;
  padding: .12rem .55rem; font-size: .72rem; color: #6B6555;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; flex-shrink: 0;
}
.cc-budget {
  margin-left: auto; font-size: .78rem; color: #9A937F; white-space: nowrap;
}

/* conversation */
.cc-chat { flex: 1; overflow-y: auto; padding: 1.2rem 1.4rem; scroll-behavior: smooth; }
.cc-chat.cc-drag { outline: 2px dashed #D97757; outline-offset: -8px; }
.cc-empty { text-align: center; color: #9A937F; margin-top: 12vh; line-height: 1.65; font-size: .92rem; }
.cc-empty-mark { font-size: 2rem; color: #D97757; margin-bottom: .5rem; }

.cc-turn { display: flex; gap: .6rem; margin: .9rem 0; max-width: 860px; }
.cc-turn-user { justify-content: flex-start; }
.cc-user-card {
  background: #EFECE4; border-radius: var(--radius-md);
  padding: .6rem .9rem; font-size: .9rem; line-height: 1.55; color: #3D3929;
  max-width: 100%; overflow-wrap: break-word;
}
.cc-msg-files { margin-top: .35rem; font-size: .78rem; color: #6B6555; }
.cc-spark { color: #D97757; font-size: .9rem; flex-shrink: 0; margin-top: .15rem; }
.cc-spark-live { animation: ccpulse 1.4s infinite; }
.cc-md {
  font-size: .9rem; line-height: 1.6; color: #29261B; min-width: 0;
  overflow-wrap: break-word;
}
.cc-md .cc-h { display: block; margin: .5rem 0 .15rem; }
.cc-md pre {
  background: #1E1C17; color: #E8E4D8; border-radius: var(--radius-sm);
  padding: .65rem .8rem; overflow-x: auto; margin: .5rem 0;
  font-size: .8rem; line-height: 1.5;
}
.cc-md pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.cc-md code, .cc-user-card code {
  background: #E7E2D6; border-radius: 4px; padding: .05rem .3rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82em;
  color: #4a4432;
}
.cc-working { color: #9A937F; }
.cc-dots span { animation: ccpulse 1.2s infinite; }
.cc-dots span:nth-child(2) { animation-delay: .2s; }
.cc-dots span:nth-child(3) { animation-delay: .4s; }
.cc-cursor { animation: ccpulse 1s infinite; color: #D97757; }
.cc-sysmsg {
  max-width: 860px; margin: .6rem 0; font-size: .8rem; color: var(--danger);
  background: var(--danger-bg); border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm); padding: .45rem .7rem;
}

/* tool cards — collapsed monospace rows, Claude Code style */
.cc-tool {
  max-width: 860px; margin: .35rem 0 .35rem 1.5rem;
  border: 1px solid #E2DFD6; border-radius: var(--radius-sm); background: #FFF;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.cc-tool summary {
  display: flex; align-items: center; gap: .5rem; padding: .4rem .65rem;
  cursor: pointer; font-size: .78rem; color: #3D3929; list-style: none;
  overflow: hidden;
}
.cc-tool summary::-webkit-details-marker { display: none; }
.cc-tool summary code {
  background: none; padding: 0; color: inherit; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0;
}
.cc-tool-dot { color: #D97757; flex-shrink: 0; }
.cc-tool-server {
  flex-shrink: 0; font-size: .68rem; color: #9A937F;
  border: 1px solid #E2DFD6; border-radius: 999px; padding: .05rem .45rem;
}
.cc-tool[open] summary { border-bottom: 1px solid #E2DFD6; }
.cc-tool pre {
  margin: 0; padding: .55rem .7rem; max-height: 260px; overflow: auto;
  font-size: .74rem; line-height: 1.5; color: #55503F; white-space: pre-wrap;
  word-break: break-word; background: #FAF9F5;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

/* attachments + composer */
.cc-attach-row {
  display: flex; gap: .4rem; flex-wrap: wrap; padding: .5rem 1.4rem 0;
  background: #FAF9F5;
}
.cc-chip {
  display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem;
  background: #FFF; border: 1px solid #D9CFC2; border-radius: 999px;
  padding: .25rem .6rem; color: #3D3929;
}
.cc-chip-x { border: 0; background: none; cursor: pointer; font-size: .95rem; color: #9A937F; }

.cc-composer-wrap { padding: .8rem 1.4rem 1rem; background: #FAF9F5; }
.cc-composer {
  max-width: 860px; background: #FFF; border: 1px solid #D9CFC2;
  border-radius: 14px; box-shadow: var(--shadow-sm);
  transition: border-color var(--transition);
}
.cc-composer:focus-within { border-color: #D97757; }
.cc-composer textarea {
  width: 100%; border: 0; resize: none; padding: .75rem .9rem .3rem;
  font-size: .92rem; font-family: inherit; line-height: 1.5; background: none;
  max-height: 200px; outline: none; color: #29261B;
}
.cc-composer-bar {
  display: flex; align-items: center; gap: .5rem; padding: .35rem .55rem .55rem;
}
.cc-iconbtn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid #E2DFD6;
  background: #FFF; cursor: pointer; font-size: 1rem; color: #6B6555;
  display: inline-flex; align-items: center; justify-content: center;
}
.cc-iconbtn:hover { background: #FAF9F5; }
.cc-model {
  border: 0; background: none; font-size: .78rem; color: #6B6555;
  cursor: pointer; max-width: 220px;
}
.cc-spacer { flex: 1; }
.cc-send {
  width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  background: #D97757; color: #fff; font-size: 1rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.cc-send:hover:not(:disabled) { background: #C4633F; }
.cc-send:disabled { opacity: .45; cursor: default; }

/* admin limits table */
.agent-limits-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.agent-limits-table th, .agent-limits-table td {
  padding: .45rem .6rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap;
}
.agent-limits-table th { color: var(--gray); font-weight: 600; font-size: .78rem; }

@media (max-width: 860px) {
  .cc-shell { flex-direction: column; height: auto; }
  .cc-side {
    width: 100%; border-right: 0; border-bottom: 1px solid #E2DFD6;
    max-height: 240px;
  }
  .cc-chat { min-height: 46vh; }
  .cc-turn, .cc-tool, .cc-composer { max-width: 100%; }
}

/* --- Claude Agent v3: bigger centered layout, fullscreen, voice, spark ---- */
.cc-shell { height: calc(100vh - 250px); min-height: 700px; }
.cc-chat { padding: 1.4rem 1.6rem; }
.cc-turn, .cc-sysmsg { max-width: 920px; margin-left: auto; margin-right: auto; }
.cc-tool { max-width: 920px; margin: .4rem auto; width: 100%; }
.cc-md { font-size: .95rem; line-height: 1.65; }
.cc-user-card { font-size: .95rem; }
.cc-composer { max-width: 920px; margin: 0 auto; }
.cc-attach-row { justify-content: center; }
.cc-composer textarea { font-size: .95rem; }

/* big animated Claude spark while the agent is working */
.cc-turn-working { align-items: center; gap: .8rem; }
.cc-bigspark {
  color: #D97757; font-size: 1.7rem; line-height: 1; flex-shrink: 0;
  display: inline-block; animation: ccspin 3s linear infinite;
}
@keyframes ccspin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.25); }
  100% { transform: rotate(360deg) scale(1); }
}
.cc-empty-mark { font-size: 2.6rem; animation: ccspin 6s linear infinite; }

/* header buttons (full screen / back to dashboard) */
.cc-headbtn {
  flex-shrink: 0; font-size: .78rem; font-weight: 600; color: #6B6555;
  border: 1px solid #D9CFC2; border-radius: 8px; padding: .32rem .7rem;
  text-decoration: none; background: #FFF; transition: all var(--transition);
  white-space: nowrap;
}
.cc-headbtn:hover { border-color: #D97757; color: #D97757; }

/* voice dictation */
#cc-mic { font-size: .9rem; }
.cc-mic--on {
  background: #D97757 !important; border-color: #D97757 !important; color: #fff !important;
  animation: ccpulse 1.2s infinite;
}
.cc-langbtn {
  border: 1px solid #E2DFD6; background: #FFF; border-radius: 8px;
  height: 30px; padding: 0 .5rem; font-size: .7rem; font-weight: 700;
  color: #6B6555; cursor: pointer;
}
.cc-langbtn:hover { border-color: #D97757; color: #D97757; }

/* fullscreen mode (own browser tab, same login session) */
body.cc-fullbody { margin: 0; padding: 0; background: #FAF9F5; }
.cc-shell--full {
  display: flex; height: 100vh; min-height: 100vh; overflow: hidden;
  border: 0; border-radius: 0; box-shadow: none; margin: 0; padding: 0;
  background: #FAF9F5;
}
.cc-shell--full .cc-side { padding-top: .9rem; }
.cc-brand {
  display: flex; align-items: baseline; gap: .4rem; padding: 0 .2rem .5rem;
  font-weight: 800; font-size: .95rem; color: #3D3929;
}
.cc-brand-spark { color: #D97757; }
.cc-brand-sub { margin-left: auto; font-weight: 500; font-size: .68rem; color: #9A937F; }

@media (max-width: 860px) {
  .cc-shell { height: auto; min-height: 0; }
  .cc-shell--full { height: 100vh; flex-direction: column; }
  .cc-shell--full .cc-side { max-height: 200px; }
}

/* --- Claude Agent v4: smooth streaming, timer, context meter, effort ------ */
.cc-live-status {
  display: flex; align-items: center; gap: .35rem; font-size: .8rem;
  color: #9A937F; margin-bottom: .35rem;
}
.cc-live-label { font-weight: 600; color: #D97757; }
.cc-timer {
  margin-left: .35rem; font-size: .72rem; color: #9A937F;
  background: #F0EEE8; border-radius: 999px; padding: .08rem .5rem;
  font-variant-numeric: tabular-nums;
}
.cc-meta { margin-top: .45rem; font-size: .72rem; color: #9A937F; }
.cc-live-turn .cc-md { width: 100%; flex: 1; min-width: 0; }

/* context-window meter (header) */
.cc-ctx {
  display: flex; align-items: center; gap: .45rem; margin-left: auto;
  font-size: .72rem; color: #9A937F; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cc-ctx + .cc-budget { margin-left: 0; }
.cc-ctx-bar {
  width: 74px; height: 6px; border-radius: 999px; background: #EDEAE1;
  overflow: hidden; border: 1px solid #E2DFD6;
}
.cc-ctx-bar i {
  display: block; height: 100%; width: 2%; background: #D97757;
  border-radius: 999px; transition: width .6s ease, background .6s ease;
}

/* effort chip in composer */
.cc-effort { font-size: .72rem; color: #9A937F; white-space: nowrap; }

/* smoother spark + streaming text appearance */
.cc-spark-live { animation: ccspin 2.4s cubic-bezier(.6,.05,.4,.95) infinite; display: inline-block; }
.cc-live-body { animation: ccfade .25s ease; }
@keyframes ccfade { from { opacity: .55; } to { opacity: 1; } }
.cc-turn { animation: ccfade .3s ease; }
.cc-tool { animation: ccfade .3s ease; }

/* --- Claude Agent v5: modes, approvals, multi-server ---------------------- */
.cc-newform-servers {
  display: flex; flex-direction: column; gap: .25rem; max-height: 150px;
  overflow-y: auto; background: #FAF9F5; border: 1px solid #E2DFD6;
  border-radius: 6px; padding: .45rem .55rem;
}
.cc-cb {
  display: flex; align-items: center; gap: .45rem; font-size: .8rem;
  color: #3D3929; cursor: pointer; font-weight: 500;
}
.cc-hintxt { color: #9A937F; font-weight: 400; font-size: .72rem; }

.cc-server-chips { display: inline-flex; gap: .3rem; flex-wrap: wrap; min-width: 0; }
.cc-mode {
  border: 1px solid #D9CFC2; background: #FFF; border-radius: 8px;
  font-size: .74rem; font-weight: 600; color: #6B6555; padding: .22rem .4rem;
  cursor: pointer; flex-shrink: 0;
}
.cc-mode:hover { border-color: #D97757; color: #D97757; }

.cc-live--wait { background: #d9822b !important; }

/* approval card (manual mode) */
.cc-approve {
  max-width: 920px; margin: .7rem auto; border: 1px solid #E8C9A8;
  border-left: 3px solid #d9822b; border-radius: var(--radius-sm);
  background: #FDF6EC; padding: .6rem .75rem; animation: ccfade .3s ease;
}
.cc-approve-head { font-size: .84rem; font-weight: 600; color: #7A5220; margin-bottom: .5rem; }
.cc-approve-item {
  display: flex; align-items: center; gap: .5rem; padding: .35rem .45rem;
  background: #FFF; border: 1px solid #EFE3D0; border-radius: 6px;
  margin-bottom: .35rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .78rem;
}
.cc-approve-item code {
  background: none; padding: 0; flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; color: #3D3929;
}
.cc-approve-all { display: flex; gap: .45rem; justify-content: flex-end; margin-top: .45rem; }
.cc-ok, .cc-no {
  border: 0; border-radius: 6px; padding: .3rem .8rem; font-size: .76rem;
  font-weight: 700; cursor: pointer; flex-shrink: 0; font-family: Inter, sans-serif;
}
.cc-ok { background: #00C281; color: #fff; }
.cc-ok:hover { background: #00A56C; }
.cc-no { background: #FDECEC; color: #B0231A; border: 1px solid #F6C5C0; }
.cc-no:hover { background: #F6C5C0; }
.cc-ok:disabled, .cc-no:disabled { opacity: .5; cursor: default; }
.cc-decided { opacity: .45; }

/* --- Claude Agent v6: sizing, professional neutral styling, share/rename -- */
.cc-side { width: 292px; padding: .9rem; gap: .65rem; }
.cc-new { font-size: .92rem; padding: .6rem .8rem; }
.cc-newform { font-size: .85rem; padding: .7rem; gap: .5rem; }
.cc-newform select, .cc-filter { font-size: .84rem; padding: .42rem .5rem; }
.cc-sess { padding: .58rem .68rem; }
.cc-sess-title { font-size: .88rem; }
.cc-sess-meta { font-size: .73rem; gap: .5rem; margin-top: .3rem; }
.cc-sess-server { max-width: 150px; font-size: .7rem; }
.cc-cb { font-size: .84rem; }
.cc-sess-from { font-style: italic; background: #FFF; }

/* neutral, professional approval card (no amber/red) */
.cc-approve {
  background: #FFF; border: 1px solid var(--line-strong); border-left: 3px solid #C9C2B2;
  border-radius: var(--radius-sm);
}
.cc-approve-head { color: #3D3929; }
.cc-approve-item { border: 1px solid var(--line); }
.cc-no {
  background: #FFF; color: #55503F; border: 1px solid #D9CFC2;
}
.cc-no:hover { background: #F0EEE8; }
.cc-live--wait { background: #9A937F !important; }

/* neutral info message (e.g. "shared with you") */
.cc-infomsg {
  max-width: 920px; margin: .7rem auto; font-size: .8rem; color: #6B6555;
  background: #F0EEE8; border: 1px solid #E2DFD6; border-radius: var(--radius-sm);
  padding: .45rem .7rem; text-align: center;
}

/* share popover */
.cc-head { position: relative; }
.cc-share-pop {
  position: absolute; top: calc(100% + 6px); right: .8rem; z-index: 40;
  width: 300px; background: #FFF; border: 1px solid var(--line-strong);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  padding: .8rem; display: flex; flex-direction: column; gap: .5rem;
  font-size: .82rem;
}
.cc-share-pop[hidden] { display: none; }
.cc-share-pop label { font-weight: 600; color: #3D3929; }
.cc-share-pop select {
  padding: .42rem .5rem; border: 1px solid #D9CFC2; border-radius: 6px; font-size: .84rem;
}
.cc-share-pop .cc-hintxt { margin: 0; line-height: 1.45; }

/* --- Claude Agent v8: stop button ----------------------------------------- */
.cc-send--stop { background: #3D3929; border-color: #3D3929; font-size: .72rem; }
.cc-send--stop:hover:not(:disabled) { background: #29261B; }
