@import url("/static/tokens.css?v=1");


* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(18, 135, 255, .22), transparent 34%),
    radial-gradient(circle at 90% 10%, rgba(139, 92, 246, .16), transparent 30%),
    linear-gradient(135deg, #020817 0%, #061428 48%, #020817 100%);
  color: var(--text);
}

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

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(3, 12, 27, .72);
  backdrop-filter: blur(18px);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

.brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 900;
  background: linear-gradient(135deg, #0ea5e9, #1d4ed8);
  box-shadow: 0 18px 50px rgba(18, 135, 255, .34);
}

.brand strong {
  display: block;
  font-size: 28px;
  letter-spacing: -0.05em;
}

.brand span {
  display: block;
  font-size: 13px;
  color: #93c5fd;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav a {
  padding: 13px 14px;
  border-radius: 14px;
  color: #e5eefc;
  transition: .15s ease;
}

.nav a:hover,
.nav a.active {
  background: linear-gradient(135deg, rgba(18,135,255,.32), rgba(29,78,216,.28));
  outline: 1px solid rgba(59, 130, 246, .38);
}

.nav-title {
  color: var(--muted);
  font-size: 12px;
  margin: 18px 4px 6px;
  letter-spacing: .08em;
}

.admin-box {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(18, 135, 255, .20);
  color: #bfdbfe;
  font-weight: 900;
}

.admin-box span {
  display: block;
  color: #4ade80;
  font-size: 13px;
  margin-top: 4px;
}

.main {
  padding: 34px 36px 42px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 22px;
  margin-bottom: 26px;
}

h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.055em;
}

.topbar p,
.panel p,
.upload-panel p {
  color: var(--muted);
  margin: 8px 0 0;
}

.today-box {
  min-width: 170px;
  border: 1px solid var(--line);
  background: rgba(10, 24, 48, .74);
  border-radius: 18px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 0 10px;
  align-items: center;
}

.today-box span { grid-row: span 2; font-size: 26px; }
.today-box small { color: var(--muted); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.kpi-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 20px;
  padding: 22px;
  display: flex;
  gap: 16px;
  align-items: center;
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
}

.kpi-card .icon {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 30px;
}

.kpi-card.blue .icon { background: linear-gradient(135deg, #0ea5e9, #1d4ed8); }
.kpi-card.green .icon { background: linear-gradient(135deg, #16a34a, #064e3b); }
.kpi-card.purple .icon { background: linear-gradient(135deg, #8b5cf6, #4c1d95); }
.kpi-card.orange .icon { background: linear-gradient(135deg, #f97316, #7c2d12); }

.kpi-card span {
  display: block;
  color: #dbeafe;
  font-size: 13px;
  text-transform: uppercase;
}

.kpi-card strong {
  display: block;
  font-size: 28px;
  margin-top: 8px;
  letter-spacing: -0.04em;
}

.kpi-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.content-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 18px;
  margin-bottom: 22px;
}

.panel,
.upload-panel,
.bottom-banner {
  border: 1px solid var(--line);
  background: var(--panel2);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(0,0,0,.24);
}

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

.panel h2,
.upload-panel h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.035em;
}

.pill,
.badge,
.temu-dot {
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.ok { background: rgba(34,197,94,.16); color: #4ade80; }
.missing { background: rgba(239,68,68,.15); color: #fca5a5; }
.warn { background: rgba(249,115,22,.18); color: #fdba74; }
.temu-dot { background: rgba(249,115,22,.20); color: #fdba74; }

.market-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.market-row {
  border-top: 1px solid rgba(148,163,184,.13);
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.market-row strong { display: block; }
.market-row span { color: var(--muted); font-size: 13px; margin-top: 5px; display: block; }

.big-number {
  font-size: 46px;
  font-weight: 900;
  letter-spacing: -0.06em;
  margin-top: 12px;
}

.action {
  display: block;
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: 14px;
  text-align: center;
  font-weight: 900;
}

.action.orange { background: linear-gradient(135deg, rgba(249,115,22,.75), rgba(154,52,18,.70)); }
.action.blue { background: linear-gradient(135deg, rgba(14,165,233,.75), rgba(29,78,216,.70)); }

.upload-panel {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 26px;
  align-items: start;
  margin-bottom: 22px;
}

label {
  display: block;
  margin: 0 0 8px;
  color: #dbeafe;
  font-weight: 800;
}

input[type=file] {
  width: 100%;
  margin-bottom: 16px;
  padding: 13px;
  background: rgba(2, 8, 23, .8);
  border: 1px dashed rgba(147,197,253,.38);
  border-radius: 13px;
  color: var(--muted);
}

button {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 15px 18px;
  color: white;
  font-weight: 900;
  font-size: 15px;
  background: linear-gradient(135deg, #0ea5e9, #1d4ed8);
  cursor: pointer;
}

.bottom-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, rgba(18,135,255,.20), rgba(10,24,48,.82));
}

.bottom-banner strong,
.bottom-banner span {
  display: block;
}

.bottom-banner span {
  color: var(--muted);
  margin-top: 5px;
}

.bottom-banner a {
  min-width: 170px;
  padding: 14px 18px;
  border-radius: 14px;
  text-align: center;
  font-weight: 900;
  background: linear-gradient(135deg, #0ea5e9, #1d4ed8);
}

@media (max-width: 1150px) {
  .kpi-grid,
  .content-grid {
    grid-template-columns: 1fr 1fr;
  }
  .upload-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .main { padding: 24px; }
  .topbar { flex-direction: column; }
  .kpi-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }
}


.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.round-btn {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: rgba(10, 24, 48, .74);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 18px 50px rgba(0,0,0,.25);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.module-card {
  min-height: 210px;
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
}

.module-card h2 {
  margin: 14px 0 10px;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.module-card p {
  color: #cbd5e1;
  line-height: 1.45;
  max-width: 280px;
}

.module-card small {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  color: #e2e8f0;
  font-weight: 800;
  font-size: 12px;
}

.module-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(255,255,255,.12);
  font-size: 22px;
}

.module-illustration {
  align-self: center;
  font-size: 76px;
  filter: drop-shadow(0 24px 28px rgba(0,0,0,.38));
  transform: rotate(-8deg);
  opacity: .95;
}

.module-illustration.robot {
  font-size: 86px;
  transform: rotate(4deg);
}

.green-card {
  background:
    radial-gradient(circle at 80% 20%, rgba(34,197,94,.35), transparent 35%),
    linear-gradient(135deg, rgba(5,46,22,.92), rgba(10,24,48,.88));
  border-color: rgba(34,197,94,.35);
}

.purple-card {
  background:
    radial-gradient(circle at 80% 20%, rgba(168,85,247,.40), transparent 35%),
    linear-gradient(135deg, rgba(49,20,91,.92), rgba(10,24,48,.88));
  border-color: rgba(168,85,247,.35);
}

.blue-card {
  background:
    radial-gradient(circle at 80% 20%, rgba(14,165,233,.38), transparent 35%),
    linear-gradient(135deg, rgba(8,47,73,.92), rgba(10,24,48,.88));
  border-color: rgba(14,165,233,.35);
}

.kpi-card,
.panel,
.upload-panel,
.bottom-banner,
.module-card {
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.kpi-card:hover,
.panel:hover,
.module-card:hover {
  transform: translateY(-3px);
  border-color: rgba(147,197,253,.48);
  box-shadow: 0 30px 90px rgba(0,0,0,.34);
}

@media (max-width: 1150px) {
  .module-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .top-actions {
    width: 100%;
    flex-wrap: wrap;
  }
}


.nav a.disabled {
  opacity: .48;
  cursor: not-allowed;
}

.assistant-hero {
  display: grid;
  grid-template-columns: 86px 1fr auto;
  gap: 20px;
  align-items: center;
  margin-bottom: 22px;
  padding: 24px;
  border-radius: 26px;
  border: 1px solid rgba(168, 85, 247, .35);
  background:
    radial-gradient(circle at 10% 0%, rgba(168,85,247,.32), transparent 35%),
    radial-gradient(circle at 95% 10%, rgba(14,165,233,.24), transparent 32%),
    linear-gradient(135deg, rgba(30, 18, 70, .92), rgba(10,24,48,.86));
  box-shadow: 0 28px 90px rgba(0,0,0,.32);
}

.assistant-bot {
  width: 86px;
  height: 86px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  font-size: 54px;
  background: rgba(255,255,255,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 18px 50px rgba(0,0,0,.28);
}

.assistant-hero span {
  color: #c4b5fd;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .08em;
}

.assistant-hero h2 {
  margin: 8px 0 8px;
  font-size: 28px;
  letter-spacing: -0.045em;
}

.assistant-hero p {
  margin: 0;
  color: #cbd5e1;
}

.assistant-hero a {
  padding: 14px 18px;
  border-radius: 16px;
  font-weight: 900;
  background: linear-gradient(135deg, #8b5cf6, #2563eb);
  white-space: nowrap;
}

@media (max-width: 820px) {
  .assistant-hero {
    grid-template-columns: 1fr;
  }

  .assistant-hero a {
    text-align: center;
  }
}

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

.page-head h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.055em;
}

.page-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.page-action {
  width: auto;
  min-width: 210px;
}

@media (max-width: 820px) {
  .page-head {
    flex-direction: column;
  }
  .page-action {
    width: 100%;
  }
}


.todo-panel {
  margin-bottom: 22px;
  border: 1px solid var(--line);
  background: rgba(10, 24, 48, .76);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(0,0,0,.24);
}

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

.todo-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,.16);
  background: rgba(2,8,23,.38);
}

.todo-row > span {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.08);
}

.todo-row strong {
  display: block;
  font-size: 15px;
}

.todo-row small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.todo-row em {
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 10px;
  border-radius: 999px;
}

.todo-ok em {
  color: #86efac;
  background: rgba(34,197,94,.14);
}

.todo-warn em {
  color: #fdba74;
  background: rgba(249,115,22,.16);
}

.todo-bad em {
  color: #fca5a5;
  background: rgba(239,68,68,.16);
}

@media (max-width: 900px) {
  .todo-list {
    grid-template-columns: 1fr;
  }
}


.activity-panel {
  margin-bottom: 22px;
  border: 1px solid var(--line);
  background: rgba(10, 24, 48, .76);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(0,0,0,.24);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-row {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid rgba(148,163,184,.14);
}

.activity-row:first-child {
  border-top: 0;
}

.activity-row > span {
  color: #93c5fd;
  font-weight: 900;
  font-size: 13px;
}

.activity-row strong {
  display: block;
}

.activity-row small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}


.health-panel {
  margin-bottom: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 92% 12%, rgba(34,197,94,.16), transparent 30%),
    rgba(10, 24, 48, .76);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(0,0,0,.24);
}

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

.health-item {
  padding: 16px;
  border-radius: 18px;
  background: rgba(2,8,23,.38);
  border: 1px solid rgba(148,163,184,.16);
}

.health-item span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.health-item strong {
  display: block;
  font-size: 18px;
  letter-spacing: -0.03em;
}

@media (max-width: 1000px) {
  .health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .health-grid {
    grid-template-columns: 1fr;
  }
}


.notifications-panel {
  margin-bottom: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 92% 12%, rgba(139,92,246,.16), transparent 30%),
    rgba(10, 24, 48, .76);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(0,0,0,.24);
}

.notification-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notification-row {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 14px;
  align-items: center;
  padding: 15px 16px;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,.16);
  background: rgba(2,8,23,.38);
}

.notification-row.success {
  border-color: rgba(34,197,94,.24);
}

.notification-row.info {
  border-color: rgba(14,165,233,.24);
}

.notification-row.warning {
  border-color: rgba(249,115,22,.28);
}

.notification-row.error {
  border-color: rgba(239,68,68,.28);
}

.notification-row strong {
  display: block;
}

.notification-row small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.notification-row > span {
  color: #93c5fd;
  font-weight: 900;
  font-size: 13px;
  text-align: right;
}


.events-panel {
  margin-bottom: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 92% 12%, rgba(14,165,233,.16), transparent 30%),
    rgba(10, 24, 48, .76);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(0,0,0,.24);
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 15px 0;
  border-top: 1px solid rgba(148,163,184,.14);
}

.event-row:first-child {
  border-top: 0;
}

.event-row > span {
  color: #93c5fd;
  font-weight: 900;
  font-size: 13px;
}

.event-row strong {
  display: block;
}

.event-row small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.temu-top-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.temu-top-actions .action {
  width: auto;
}

.panel {
  border: 1px solid var(--line);
  background: rgba(10, 24, 48, .76);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(0,0,0,.24);
  margin-bottom: 22px;
}

.card .action,
.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 900;
}

.action.blue {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: white;
}

.card form button {
  margin-top: 10px;
}

/* ===== Temu / Knowledge UI cleanup ===== */

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

.page-head h1 {
  margin: 0;
  font-size: 34px;
}

.page-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.temu-top-actions,
.card-actions,
.knowledge-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 14px 0 22px;
}

.action,
.card .action {
  width: auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 11px 15px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.18);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.action.blue {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: #fff;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card h2 {
  line-height: 1.25;
}

.card img {
  display: block;
}

.card form {
  margin: 0;
}

.card form button,
.card button {
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
}

.status {
  min-height: auto;
  line-height: 1.55;
}

.panel {
  margin-top: 18px;
}

@media (max-width: 760px) {
  .page-head {
    flex-direction: column;
  }

  .temu-top-actions,
  .card-actions,
  .knowledge-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .action,
  .card .action {
    width: 100%;
  }
}

/* ===== Knowledge Temu fixed layout ===== */

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.knowledge-card {
  min-height: 430px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 22px;
  background: rgba(2,8,23,.46);
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(0,0,0,.18);
}

.knowledge-image-wrap {
  height: 170px;
  padding: 12px;
  background: #020617;
  border-bottom: 1px solid rgba(148,163,184,.14);
  display: flex;
  align-items: center;
  justify-content: center;
}

.knowledge-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
}

.knowledge-image-empty {
  color: var(--muted);
  font-weight: 800;
}

.knowledge-body {
  flex: 1;
  padding: 16px;
}

.knowledge-body h3 {
  margin: 0 0 14px;
  min-height: 72px;
  max-height: 72px;
  overflow: hidden;
  font-size: 18px;
  line-height: 1.32;
  letter-spacing: -0.03em;
}

.knowledge-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.knowledge-meta div {
  padding: 10px;
  border-radius: 14px;
  background: rgba(15,23,42,.78);
  border: 1px solid rgba(148,163,184,.12);
}

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

.knowledge-meta strong {
  display: block;
  font-size: 18px;
}

.knowledge-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 16px 16px;
  min-height: 44px;
  border-radius: 14px;
  text-decoration: none;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border-radius: 22px;
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(2,8,23,.46);
}

/* ===== Temu catalog cleanup ===== */

.temu-page {
  max-width: 1440px;
}

.temu-page h1 {
  font-size: 34px;
  margin: 12px 0 4px;
}

.temu-page .subtitle {
  margin-bottom: 22px;
}

.temu-page .upload {
  margin-top: 22px;
  padding: 24px;
  border-radius: 24px;
  background: rgba(10,24,48,.72);
  border: 1px solid rgba(96,165,250,.22);
  box-shadow: 0 24px 70px rgba(0,0,0,.22);
}

.temu-page .upload h2 {
  margin-top: 0;
}

.temu-page .upload > div[style*="display:grid"] {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
  gap: 18px !important;
}

.temu-page .recognition-card {
  display: flex;
  flex-direction: column;
  min-height: 410px;
  padding: 14px !important;
  border-radius: 22px !important;
  background: rgba(2,8,23,.55) !important;
}

.temu-page .recognition-card img {
  height: 190px !important;
  object-fit: contain !important;
  background: #fff !important;
}

.temu-page input[type="text"],
.temu-page input[type="search"],
.temu-page input[type="file"],
.temu-page select {
  height: 42px;
  border-radius: 12px !important;
  background: rgba(2,8,23,.82) !important;
  border: 1px solid rgba(148,163,184,.24) !important;
  color: white !important;
  padding: 0 12px !important;
}

.temu-page button,
.temu-page .btn,
.temu-page .action {
  height: 44px;
  border-radius: 14px !important;
  font-weight: 900;
}

.temu-page form button {
  margin-top: 10px !important;
}

.temu-page table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  margin-top: 14px;
}

.temu-page th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  text-align: left;
  padding: 0 12px 6px;
}

.temu-page td {
  background: rgba(2,8,23,.55);
  border-top: 1px solid rgba(148,163,184,.14);
  border-bottom: 1px solid rgba(148,163,184,.14);
  padding: 14px 12px;
  vertical-align: middle;
}

.temu-page td:first-child {
  border-left: 1px solid rgba(148,163,184,.14);
  border-radius: 16px 0 0 16px;
}

.temu-page td:last-child {
  border-right: 1px solid rgba(148,163,184,.14);
  border-radius: 0 16px 16px 0;
}

.temu-page img {
  max-width: 100%;
}

.temu-page .temu-top-actions {
  margin-bottom: 20px;
}

/* Product modal fallback */
#temu-product-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
}

#temu-product-modal.open {
  display: block;
}

#temu-product-modal .knowledge-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2,8,23,.78);
  backdrop-filter: blur(6px);
}

#temu-product-modal .knowledge-modal-box {
  position: absolute;
  inset: 40px;
  background: #020817;
  border: 1px solid rgba(148,163,184,.25);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
}

#temu-product-modal iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

#temu-product-modal .knowledge-modal-close {
  position: absolute;
  right: 18px;
  top: 14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(15,23,42,.9);
  color: white;
  font-size: 28px;
  cursor: pointer;
}

/* ===== Temu product detail clean ===== */

.product-detail-page {
  max-width: 1100px;
}

.product-detail-panel {
  margin-top: 22px;
}

.product-detail-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: start;
}

.product-detail-image {
  height: 360px;
  border-radius: 22px;
  background: #020617;
  border: 1px solid rgba(148,163,184,.18);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  border-radius: 16px;
}

.product-detail-info {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.detail-grid div {
  padding: 16px;
  border-radius: 18px;
  background: rgba(2,8,23,.48);
  border: 1px solid rgba(148,163,184,.14);
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.detail-grid strong {
  display: block;
  font-size: 16px;
  line-height: 1.35;
  word-break: break-word;
}

.detail-open-link {
  width: fit-content;
}

@media (max-width: 850px) {
  .product-detail-layout {
    grid-template-columns: 1fr;
  }

  .product-detail-image {
    height: 260px;
  }

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

/* Recognition Center card layout fix */
.recognition-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(300px, 320px)) !important;
  gap: 18px !important;
  justify-content: flex-start !important;
  align-items: stretch !important;
}

.recognition-card {
  width: 100% !important;
  min-height: 430px !important;
  display: flex !important;
  flex-direction: column !important;
}

.recognition-image {
  height: 180px !important;
  padding: 10px !important;
  background: #020617 !important;
  border-radius: 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.recognition-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  background: #fff !important;
  border-radius: 12px !important;
}

.recognition-info {
  padding-top: 12px !important;
}

.recognition-count {
  font-size: 22px !important;
  font-weight: 900 !important;
  color: #fbbf24 !important;
}

.recognition-meta {
  margin-top: 8px !important;
  color: var(--muted) !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
}

.recognition-card .associate-form {
  margin-top: auto !important;
}

.recognition-card .ts-wrapper,
.recognition-card select,
.recognition-card button {
  width: 100% !important;
}

.empty-recognition {
  grid-column: 1 / -1;
  min-height: 220px;
  border-radius: 22px;
  border: 1px dashed rgba(148,163,184,.28);
  background: rgba(2,8,23,.42);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
}

.empty-recognition .empty-icon {
  font-size: 42px;
  margin-bottom: 10px;
}

.empty-recognition h3 {
  margin: 0;
  font-size: 24px;
}

.empty-recognition p {
  margin: 8px 0 0;
  color: var(--muted);
}

/* Temu recognition + import side by side */
.temu-work-row {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(340px, 1fr);
  gap: 18px;
  align-items: stretch;
}

.temu-work-row .panel {
  margin-top: 0;
}

.temu-work-row .recognition-grid {
  grid-template-columns: minmax(300px, 1fr) !important;
}

.temu-work-row .recognition-card {
  max-width: 380px;
}

.temu-import-panel {
  display: flex;
  flex-direction: column;
}

.temu-import-panel .temu-upload-form {
  margin-top: auto;
}

.temu-import-panel input[type=file] {
  margin-top: 18px;
}

.temu-import-panel button {
  margin-top: 18px;
}

@media (max-width: 980px) {
  .temu-work-row {
    grid-template-columns: 1fr;
  }

  .temu-work-row .recognition-card {
    max-width: none;
  }
}

/* Knowledge modal fallback */
#knowledge-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
}

#knowledge-modal.open {
  display: block;
}

#knowledge-modal .knowledge-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2,8,23,.78);
  backdrop-filter: blur(6px);
}

#knowledge-modal .knowledge-modal-box {
  position: absolute;
  inset: 40px;
  background: #020817;
  border: 1px solid rgba(148,163,184,.25);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
}

#knowledge-modal iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

#knowledge-modal .knowledge-modal-close {
  position: absolute;
  right: 18px;
  top: 14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(15,23,42,.9);
  color: white;
  font-size: 28px;
  cursor: pointer;
}

.product-ranking {
  display: grid;
  gap: 10px;
}

.ranking-row {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(15, 23, 42, .55);
  border: 1px solid rgba(148, 163, 184, .18);
}

.ranking-row strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.ranking-row small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 700;
}

.product-ranking {
  display: grid;
  gap: 12px;
}

.ranking-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}

.ranking-position {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 16px;
  background: linear-gradient(135deg, #f97316, #facc15);
  color: #111827;
}

.ranking-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.ranking-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-qty {
  font-weight: 900;
  font-size: 18px;
  white-space: nowrap;
}

.product-ranking-grid {
  align-items: stretch;
}

.ranking-panel {
  overflow: hidden;
}

.ranking-panel .panel-head {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, .16);
}

.product-ranking {
  display: grid;
  gap: 0;
}

.ranking-row {
  display: grid;
  grid-template-columns: 76px 72px minmax(0, 1fr) 86px;
  align-items: center;
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
  background: transparent;
}

.product-ranking-compact .ranking-row {
  grid-template-columns: 54px 54px minmax(0, 1fr) 74px;
  gap: 14px;
  padding: 8px 0;
}

.ranking-row:last-child {
  border-bottom: 0;
}

.ranking-position {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 950;
  color: #fff;
  background: rgba(51, 65, 85, .85);
  border: 1px solid rgba(148, 163, 184, .35);
}

.ranking-row:nth-child(1) .ranking-position {
  color: #facc15;
  border-color: rgba(250, 204, 21, .7);
  box-shadow: 0 0 22px rgba(250, 204, 21, .22);
}

.ranking-row:nth-child(2) .ranking-position {
  color: #f8fafc;
}

.ranking-row:nth-child(3) .ranking-position {
  color: #fb923c;
  border-color: rgba(249, 115, 22, .6);
}

.product-ranking-compact .ranking-position {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  font-size: 20px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
}

.ranking-thumb {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,.92);
  display: grid;
  place-items: center;
}

.product-ranking-compact .ranking-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
}

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

.ranking-thumb span {
  color: #0f172a;
  font-weight: 900;
  font-size: 22px;
}

.ranking-main {
  min-width: 0;
}

.ranking-title {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 18px;
  line-height: 1.25;
}

.product-ranking-compact .ranking-title {
  font-size: 15px;
}

.ranking-main small {
  display: block;
  margin-top: 6px;
  color: rgba(226, 232, 240, .78);
  font-size: 15px;
}

.product-ranking-compact .ranking-main small {
  margin-top: 3px;
  font-size: 13px;
}

.ranking-qty {
  text-align: right;
  white-space: nowrap;
}

.ranking-qty strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  color: #facc15;
}

.product-ranking-compact .ranking-qty strong {
  font-size: 22px;
  color: #a855f7;
}

.ranking-qty span {
  display: block;
  margin-top: 4px;
  color: rgba(226, 232, 240, .82);
  font-size: 14px;
}

.ranking-empty {
  padding: 18px 0;
  color: var(--muted);
}

.ranking-panel {
  padding: 22px;
}

.product-ranking-large .ranking-row {
  min-height: 92px;
  padding: 14px 0;
  grid-template-columns: 66px 62px minmax(0, 1fr) 72px;
  gap: 14px;
}

.product-ranking-large .ranking-position {
  width: 48px;
  height: 48px;
  font-size: 26px;
}

.product-ranking-large .ranking-thumb {
  width: 58px;
  height: 58px;
  border-radius: 12px;
}

.product-ranking-large .ranking-title {
  font-size: 14px;
}

.product-ranking-large .ranking-main small {
  font-size: 13px;
}

.product-ranking-large .ranking-qty strong {
  font-size: 28px;
}

.product-ranking-large .ranking-qty span {
  font-size: 12px;
}

.product-ranking-compact .ranking-row {
  min-height: 54px;
  padding: 5px 0;
  grid-template-columns: 44px 44px minmax(0, 1fr) 58px;
  gap: 10px;
}

.product-ranking-compact .ranking-position {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 16px;
}

.product-ranking-compact .ranking-thumb {
  width: 38px;
  height: 38px;
  border-radius: 9px;
}

.product-ranking-compact .ranking-title {
  font-size: 13px;
  line-height: 1.15;
}

.product-ranking-compact .ranking-main small {
  font-size: 11px;
  margin-top: 2px;
}

.product-ranking-compact .ranking-qty strong {
  font-size: 18px;
}

.product-ranking-compact .ranking-qty span {
  font-size: 10px;
}

.product-ranking-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
}

.product-ranking-grid .panel {
  width: 100%;
  min-width: 0;
}

@media (max-width: 1100px) {
  .product-ranking-grid {
    grid-template-columns: 1fr;
  }
}

.reorder-list {
  display: grid;
  gap: 12px;
}

.reorder-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 90px 120px;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(148, 163, 184, .14);
}

.reorder-row:last-child {
  border-bottom: 0;
}

.reorder-thumb {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,.92);
  display: grid;
  place-items: center;
}

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

.reorder-main {
  min-width: 0;
}

.reorder-main strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reorder-main small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.reorder-qty {
  text-align: right;
}

.reorder-qty strong {
  display: block;
  font-size: 30px;
  line-height: 1;
  color: #facc15;
}

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

.accrediti-upload-form {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 160px;
  gap: 14px;
  align-items: end;
  padding: 16px 0 22px;
}

.accrediti-upload-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
}

.accrediti-upload-form select,
.accrediti-upload-form input[type="file"] {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, .22);
  background: rgba(15, 23, 42, .65);
  color: #e5eefc;
  border-radius: 14px;
  padding: 12px 14px;
}

.accrediti-import-head {
  margin-top: 10px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, .14);
}

@media (max-width: 900px) {
  .accrediti-upload-form {
    grid-template-columns: 1fr;
  }
}

.accrediti-focus {
  margin-top: 18px;
}

.accrediti-table {
  display: grid;
  gap: 8px;
}

.accrediti-head,
.accrediti-line {
  display: grid;
  grid-template-columns: 140px 1fr 90px 150px;
  gap: 14px;
  align-items: center;
}

.accrediti-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  padding: 6px 0 10px;
  border-bottom: 1px solid rgba(148, 163, 184, .16);
}

.accrediti-line {
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, .10);
}

.accrediti-line strong:last-child {
  text-align: right;
  color: #facc15;
  font-size: 18px;
}

@media (max-width: 900px) {
  .accrediti-head,
  .accrediti-line {
    grid-template-columns: 1fr;
  }
}

.accrediti-calendar {
  display: grid;
  gap: 16px;
}

.accrediti-day {
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 20px;
  background: rgba(15, 23, 42, .42);
}

.accrediti-day-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, .14);
}

.accrediti-day-head strong {
  display: block;
  font-size: 20px;
}

.accrediti-day-head span {
  color: var(--muted);
  font-weight: 700;
}

.accrediti-day-total {
  font-size: 24px;
  font-weight: 950;
  color: #facc15;
  white-space: nowrap;
}

.accrediti-day-lines {
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.accrediti-day-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px 140px;
  align-items: center;
  gap: 12px;
}

.accrediti-day-line small {
  color: var(--muted);
  font-weight: 700;
}

.accrediti-day-line strong {
  text-align: right;
}

@media (max-width: 760px) {
  .accrediti-day-head {
    display: grid;
  }

  .accrediti-day-line {
    grid-template-columns: 1fr;
  }

  .accrediti-day-line strong {
    text-align: left;
  }
}

.accrediti-three-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr) minmax(0, .9fr);
  gap: 18px;
  align-items: start;
}

.compact-calendar {
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.compact-calendar .accrediti-day {
  padding: 12px;
  border-radius: 16px;
}

.compact-calendar .accrediti-day-head {
  padding-bottom: 8px;
}

.compact-calendar .accrediti-day-head strong {
  font-size: 15px;
}

.compact-calendar .accrediti-day-total {
  font-size: 17px;
}

.compact-calendar .accrediti-day-line {
  grid-template-columns: minmax(0, 1fr) 42px 90px;
  gap: 8px;
  font-size: 13px;
}

@media (max-width: 1200px) {
  .accrediti-three-grid {
    grid-template-columns: 1fr;
  }
}

.accrediti-bottom-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.accrediti-chart-wrap {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  min-height: 260px;
}

#accreditiPie {
  width: 220px !important;
  height: 220px !important;
}

.accrediti-three-grid .panel,
.accrediti-bottom-grid .panel {
  min-height: 100%;
}

.accrediti-three-grid {
  margin-top: 18px;
}

.accrediti-three-grid .panel {
  border-radius: 22px;
}

.compact-calendar {
  max-height: 430px;
}

@media (max-width: 1100px) {
  .accrediti-bottom-grid,
  .accrediti-chart-wrap {
    grid-template-columns: 1fr;
  }

  #accreditiPie {
    margin: 0 auto;
  }
}

/* ===== Accrediti visual polish ===== */

.accrediti-three-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .9fr) minmax(0, .9fr);
}

.compact-calendar {
  max-height: none !important;
  overflow: visible !important;
  padding-right: 0 !important;
}

.compact-calendar .accrediti-day:nth-child(n+7) {
  display: none;
}

.compact-calendar .accrediti-day {
  background: rgba(2, 6, 23, .38);
  border: 1px solid rgba(148, 163, 184, .12);
  margin-bottom: 10px;
}

.compact-calendar .accrediti-day-lines {
  gap: 6px;
}

.compact-calendar .accrediti-day-line {
  grid-template-columns: 26px minmax(0, 1fr) 38px 88px;
}

.accrediti-mp-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, .18);
  font-size: 13px;
}

.accrediti-chart-wrap {
  grid-template-columns: 300px minmax(0, 1fr) !important;
  min-height: 320px;
}

#accreditiPie {
  width: 300px !important;
  height: 300px !important;
}

.accrediti-legend .market-row {
  padding: 14px 0;
}

.accrediti-bottom-grid .panel {
  min-height: 330px;
}

@media (max-width: 1300px) {
  .accrediti-three-grid {
    grid-template-columns: 1fr;
  }
}

.compact-calendar .accrediti-day:nth-child(n+7) {
  display: block;
}

.accrediti-calendar-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, .14);
}

.accrediti-calendar-pager button {
  border: 1px solid rgba(148, 163, 184, .18);
  background: rgba(15, 23, 42, .75);
  color: #e5eefc;
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
}

.accrediti-calendar-pager button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.accrediti-calendar-pager span {
  color: var(--muted);
  font-weight: 900;
}

.accrediti-bars {
  display: grid;
  gap: 18px;
  padding-top: 8px;
}

.accrediti-bar-row {
  display: grid;
  gap: 10px;
}

.accrediti-bar-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.accrediti-bar-top strong {
  display: block;
  font-size: 16px;
}

.accrediti-bar-top span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

.accrediti-bar-top > div:last-child {
  text-align: right;
}

.accrediti-bar-track {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 23, 42, .9);
  border: 1px solid rgba(148, 163, 184, .14);
}

.accrediti-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #38bdf8);
  min-width: 4px;
}

.accrediti-donut-panel {
  overflow: hidden;
}

.accrediti-donut-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 26px;
  align-items: center;
}

.accrediti-donut-box {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 0 auto;
}

#accreditiDonut {
  width: 260px !important;
  height: 260px !important;
}

.accrediti-donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
}

.accrediti-donut-center strong {
  font-size: 36px;
  line-height: 1;
  font-weight: 950;
  color: #f8fafc;
}

.accrediti-donut-center span {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 900;
}

.accrediti-donut-legend {
  display: grid;
  gap: 12px;
}

.accrediti-donut-legend-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(148, 163, 184, .10);
}

.accrediti-donut-legend-row:last-child {
  border-bottom: 0;
}

.accrediti-donut-legend-row strong {
  display: block;
}

.accrediti-donut-legend-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 800;
}

.accrediti-donut-legend-row em {
  font-style: normal;
  font-weight: 950;
  color: #facc15;
  white-space: nowrap;
}

.donut-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: block;
}

.donut-dot-1 { background: #22c55e; }
.donut-dot-2 { background: #38bdf8; }
.donut-dot-3 { background: #a855f7; }
.donut-dot-4 { background: #f97316; }
.donut-dot-5 { background: #facc15; }
.donut-dot-6 { background: #14b8a6; }
.donut-dot-7 { background: #ef4444; }
.donut-dot-8 { background: #64748b; }

@media (max-width: 900px) {
  .accrediti-donut-layout {
    grid-template-columns: 1fr;
  }
}

.accrediti-donut-center strong {
  font-size: 26px !important;
  line-height: 1.05 !important;
  font-weight: 900 !important;
  letter-spacing: -0.04em;
}

.accrediti-donut-center span {
  font-size: 12px !important;
  margin-top: 8px !important;
  max-width: 150px;
  line-height: 1.15;
}

.accrediti-donut-legend-row em::before {
  content: "Netto ";
  color: var(--muted);
  font-weight: 800;
}

.reconciliation-coverage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.coverage-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(15, 23, 42, .45);
  border: 1px solid rgba(148, 163, 184, .14);
}

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

.coverage-head strong {
  font-size: 17px;
}

.coverage-head span {
  font-weight: 950;
  color: #facc15;
}

.coverage-track {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(2, 6, 23, .75);
  border: 1px solid rgba(148, 163, 184, .12);
}

.coverage-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #38bdf8);
  min-width: 4px;
}

.coverage-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

.coverage-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .reconciliation-coverage {
    grid-template-columns: 1fr;
  }
}

/* ===== ACCREDITI V2 ===== */

.accrediti-hero{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:24px;
}

.eyebrow{
    color:#38bdf8;
    font-size:12px;
    font-weight:800;
    letter-spacing:.15em;
}

.hero-total{
    min-width:300px;
    padding:22px;
    border-radius:22px;
    background:linear-gradient(135deg,#0f172a,#1e293b);
}

.hero-total strong{
    display:block;
    margin:8px 0;
    font-size:42px;
}

.accrediti-top-grid{
    display:grid;
    grid-template-columns:2fr 1fr;
    gap:22px;
    margin-top:22px;
}

.cashflow-chart-wrap{
    height:360px;
    margin-top:18px;
}

.cashflow-strip{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:12px;
    margin-top:18px;
}

.cashflow-chip{
    padding:14px;
    border-radius:16px;
    background:#111827;
}

.cashflow-chip strong{
    display:block;
    font-size:20px;
    margin:6px 0;
}

.vertical{
    display:flex;
    flex-direction:column;
    gap:24px;
}

.accrediti-main-grid{
    display:grid;
    grid-template-columns:2fr 1fr;
    gap:22px;
    margin-top:22px;
}

.accrediti-detail-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:22px;
    margin-top:22px;
}

@media(max-width:1200px){

.accrediti-top-grid,
.accrediti-main-grid,
.accrediti-detail-grid{

grid-template-columns:1fr;

}

.cashflow-strip{

grid-template-columns:repeat(2,1fr);

}

}

@media(max-width:700px){

.cashflow-strip{

grid-template-columns:1fr;

}

.cashflow-chart-wrap{

height:250px;

}

.hero-total{

min-width:100%;

}

}

/* Cashflow native chart */
.cashflow-bars {
  display: grid;
  grid-template-columns: repeat(17, minmax(34px, 1fr));
  align-items: end;
  gap: 10px;
  padding: 18px 14px 12px;
  min-height: 360px;
}

.cashflow-bar-col {
  display: grid;
  grid-template-rows: 34px 1fr 24px;
  min-height: 320px;
  text-align: center;
}

.cashflow-bar-value {
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  transform: rotate(-35deg);
  transform-origin: center;
}

.cashflow-bar-track {
  display: flex;
  align-items: end;
  justify-content: center;
  height: 250px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.12);
  overflow: hidden;
}

.cashflow-bar {
  width: 100%;
  min-height: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, #38bdf8, #2563eb);
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.28);
}

.cashflow-bar-date {
  margin-top: 8px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
}

@media(max-width:1200px){
  .cashflow-bars {
    grid-template-columns: repeat(9, minmax(34px, 1fr));
    overflow-x: auto;
  }
}

@media(max-width:700px){
  .cashflow-bars {
    grid-template-columns: repeat(17, 42px);
    overflow-x: auto;
  }
}

/* Command Center v1 */
.command-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  margin-bottom: 22px;
  border-radius: 30px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.92));
  box-shadow: var(--shadow);
}

.command-hero h1 {
  margin: 6px 0 6px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
  letter-spacing: -0.06em;
}

.command-hero h2 {
  margin: 0;
  font-size: 24px;
  color: var(--text);
}

.command-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.command-hero-danger {
  border-color: rgba(239, 68, 68, 0.35);
}

.command-hero-warning {
  border-color: rgba(245, 158, 11, 0.35);
}

.command-summary {
  min-width: 230px;
  display: grid;
  gap: 10px;
  align-content: center;
}

.command-summary span {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.74);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: var(--text);
  font-weight: 900;
}

.command-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.command-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: 24px;
  text-decoration: none;
  color: var(--text);
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: var(--shadow-soft);
}

.command-card:hover {
  transform: translateY(-2px);
}

.command-card .icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(56, 189, 248, 0.14);
  font-size: 24px;
}

.command-card span,
.command-card small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.command-card strong {
  display: block;
  margin: 4px 0;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.command-card-danger {
  border-color: rgba(239, 68, 68, 0.35);
}

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

.command-main-grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  margin-bottom: 22px;
}

.command-priority-list {
  display: grid;
  gap: 12px;
}

.command-priority {
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  text-decoration: none;
  color: var(--text);
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.command-priority span {
  font-size: 22px;
}

.command-priority strong,
.command-priority small {
  display: block;
}

.command-priority small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

.command-priority-danger {
  border-color: rgba(239, 68, 68, 0.35);
}

.command-priority-warning {
  border-color: rgba(245, 158, 11, 0.35);
}

.command-briefing p {
  margin-top: 0;
  color: var(--muted);
  font-weight: 800;
}

.command-briefing ul {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--text);
  font-weight: 700;
}

.command-briefing li + li {
  margin-top: 10px;
}

@media (max-width: 1180px) {
  .command-card-grid,
  .command-main-grid {
    grid-template-columns: 1fr;
  }

  .command-hero {
    flex-direction: column;
  }
}

/* Command Center health */
.command-health-panel {
  scroll-margin-top: 24px;
}

.command-health-item {
  text-decoration: none;
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.command-health-item:hover {
  transform: translateY(-2px);
}

.command-health-danger {
  border-color: rgba(239, 68, 68, 0.35);
}

.command-health-warning {
  border-color: rgba(245, 158, 11, 0.35);
}

.command-health-ok {
  border-color: rgba(34, 197, 94, 0.25);
}

/* Command Center mobile */
@media (max-width: 760px) {
  .command-hero {
    padding: 22px;
    border-radius: 24px;
  }

  .command-hero h1 {
    font-size: 34px;
    letter-spacing: -0.04em;
  }

  .command-hero h2 {
    font-size: 18px;
  }

  .command-summary {
    min-width: 0;
  }

  .command-card-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .command-card {
    padding: 18px;
    border-radius: 20px;
  }

  .command-card strong {
    font-size: 24px;
  }

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

  .command-priority {
    padding: 18px;
    border-radius: 18px;
  }

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

  .market-row,
  .event-row,
  .notification-row,
  .activity-row {
    align-items: flex-start;
    gap: 12px;
  }

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

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

/* ARES Enterprise global mobile layout */
@media (max-width: 820px) {
  body {
    overflow-x: hidden;
  }

  .shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: auto;
    min-height: auto;
    margin: 12px;
    padding: 16px;
    border-radius: 24px;
  }

  .brand {
    margin-bottom: 14px;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-title,
  .admin-box {
    display: none;
  }

  .nav a {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 11px 14px;
    border-radius: 999px;
  }

  .nav a.disabled {
    display: none;
  }

  .main {
    padding: 12px;
  }

  .content-grid,
  .module-grid,
  .product-ranking-grid,
  .accrediti-main-grid,
  .command-main-grid {
    grid-template-columns: 1fr !important;
  }

  .panel,
  .health-panel,
  .events-panel,
  .notifications-panel,
  .activity-panel,
  .todo-panel,
  .upload-panel,
  .assistant-hero,
  .bottom-banner {
    border-radius: 22px;
  }

  table {
    min-width: 720px;
  }

  .table-wrap,
  .cashflow-table-wrap,
  .accrediti-table-wrap {
    overflow-x: auto;
  }

  input,
  select,
  button,
  textarea {
    font-size: 16px;
  }
}

/* ARES Adaptive UI: mobile bottom navigation */
.mobile-bottom-nav,
.mobile-fab {
  display: none;
}

@media (max-width: 820px) {
  .main {
    padding-bottom: 96px;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 8px;
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(16px);
  }

  .mobile-bottom-nav a {
    min-width: 0;
    display: grid;
    gap: 2px;
    place-items: center;
    padding: 8px 4px;
    border-radius: 18px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 900;
  }

  .mobile-bottom-nav a.active {
    color: var(--text);
    background: rgba(56, 189, 248, 0.16);
  }

  .mobile-bottom-nav span {
    font-size: 20px;
    line-height: 1;
  }

  .mobile-bottom-nav small {
    font-size: 10px;
    line-height: 1;
  }

  .mobile-fab {
    position: fixed;
    right: 20px;
    bottom: 92px;
    z-index: 81;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    text-decoration: none;
    color: #020617;
    background: linear-gradient(135deg, #22d3ee, #a7f3d0);
    box-shadow: 0 22px 50px rgba(34, 211, 238, 0.28);
    font-size: 30px;
    font-weight: 900;
  }
}

/* Customer Hub */
.customer-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.customer-search input {
  width: 100%;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,.22);
  background: rgba(15, 23, 42, .72);
  color: var(--text);
  font-weight: 800;
}

.customer-search button {
  padding: 16px 22px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #22d3ee, #60a5fa);
  color: #020617;
  font-weight: 900;
}

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

.customer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,.14);
  background: rgba(15,23,42,.62);
  color: var(--text);
  text-decoration: none;
}

.customer-row strong,
.customer-row small {
  display: block;
}

.customer-row small,
.customer-address small {
  color: var(--muted);
  margin-top: 4px;
  font-weight: 700;
}

.customer-metrics {
  text-align: right;
  min-width: 92px;
}

.customer-address {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,.14);
  background: rgba(15,23,42,.52);
  margin-bottom: 10px;
}

@media (max-width: 760px) {
  .customer-search {
    grid-template-columns: 1fr;
  }

  .customer-row {
    grid-template-columns: 1fr;
  }

  .customer-metrics {
    text-align: left;
  }
}

/* Customer Hub v2 */
.customer-hub {
  display: grid;
  gap: 18px;
}

.customer-hub-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: stretch;
  padding: 26px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, .16), transparent 30%),
    linear-gradient(135deg, rgba(15,23,42,.96), rgba(30,41,59,.9));
  border: 1px solid rgba(148,163,184,.18);
  box-shadow: var(--shadow);
}

.customer-hub-head h1 {
  margin: 6px 0;
  font-size: clamp(38px, 5vw, 60px);
}

.customer-hub-head p {
  color: var(--muted);
  font-weight: 800;
}

.customer-hub-stats {
  min-width: 150px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: rgba(15,23,42,.62);
  border: 1px solid rgba(148,163,184,.16);
}

.customer-hub-stats strong {
  font-size: 42px;
}

.customer-search-pro {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(15,23,42,.82);
  border: 1px solid rgba(148,163,184,.18);
}

.customer-search-pro input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.customer-card-grid {
  display: grid;
  gap: 12px;
}

.customer-card-pro {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(148,163,184,.16);
  background: rgba(15,23,42,.72);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.customer-card-pro:hover {
  transform: translateY(-2px);
  border-color: rgba(56,189,248,.38);
}



.customer-card-main strong,
.customer-card-main small,
.customer-card-main span {
  display: block;
}

.customer-card-main small,
.customer-card-main span,
.customer-tabs small,
.customer-profile-head p {
  color: var(--muted);
  font-weight: 700;
  margin-top: 4px;
}

.customer-card-kpis {
  min-width: 110px;
  text-align: right;
}

.customer-card-kpis b,
.customer-card-kpis small {
  display: block;
}

.customer-drawer-backdrop {
  display: none;
}

.customer-drawer-backdrop.open {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(2, 6, 23, .55);
  backdrop-filter: blur(4px);
}

.customer-drawer {
  position: fixed;
  top: 14px;
  right: 14px;
  bottom: 14px;
  width: min(720px, calc(100vw - 28px));
  z-index: 91;
  transform: translateX(calc(100% + 30px));
  transition: transform .22s ease;
  border-radius: 30px;
  background: rgba(8, 18, 38, .98);
  border: 1px solid rgba(148,163,184,.22);
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
  overflow: hidden;
}

.customer-drawer.open {
  transform: translateX(0);
}

.customer-drawer-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 16px;
  background: rgba(15,23,42,.9);
  color: var(--text);
  font-size: 28px;
  cursor: pointer;
}

.customer-drawer-content {
  height: 100%;
  overflow: auto;
  padding: 28px;
}

.customer-profile-head {
  display: flex;
  gap: 18px;
  align-items: center;
  padding-right: 50px;
}

.customer-profile-head h2 {
  margin: 4px 0;
  font-size: 34px;
  letter-spacing: -.04em;
}

.customer-profile-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 22px 0;
}

.customer-profile-kpis div {
  padding: 18px;
  border-radius: 20px;
  background: rgba(15,23,42,.72);
  border: 1px solid rgba(148,163,184,.14);
}

.customer-profile-kpis strong,
.customer-profile-kpis small {
  display: block;
}

.customer-tabs h3 {
  margin: 22px 0 10px;
}

.customer-mini-row,
.customer-address-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(15,23,42,.62);
  border: 1px solid rgba(148,163,184,.12);
  margin-bottom: 10px;
}

.customer-address-card {
  display: grid;
}

.customer-drawer-empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
}

@media (max-width: 820px) {
  .customer-hub-head {
    flex-direction: column;
  }

  .customer-card-pro {
    grid-template-columns: auto 1fr;
  }

  .customer-card-kpis {
    grid-column: 1 / -1;
    text-align: left;
  }

  .customer-drawer {
    inset: 0;
    width: 100vw;
    border-radius: 0;
  }

  .customer-profile-kpis {
    grid-template-columns: 1fr;
  }
}

.customer-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

.customer-pagination button {
  padding: 12px 16px;
  border: 0;
  border-radius: 14px;
  background: rgba(15,23,42,.82);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
  border: 1px solid rgba(148,163,184,.18);
}

.customer-pagination button:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.customer-pagination span {
  color: var(--muted);
  font-weight: 900;
}

.intelligence-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-intelligence-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0 22px;
}

.customer-intelligence-strip > div {
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.35);
}

.customer-intelligence-strip small {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.customer-intelligence-strip strong {
  display: block;
  font-size: 0.92rem;
  line-height: 1.35;
}

@media (max-width: 720px) {
  .intelligence-kpis,
  .customer-intelligence-strip {
    grid-template-columns: 1fr;
  }
}

.customer-profile-head {
  align-items: flex-start;
}

.customer-profile-head h2 {
  margin-bottom: 6px;
}

.customer-profile-head p {
  margin: 4px 0;
}

.customer-profile-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.customer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 0.78rem;
  font-weight: 700;
}

.customer-pill.active {
  border-color: rgba(34, 197, 94, 0.45);
}

.customer-pill.risk {
  border-color: rgba(245, 158, 11, 0.5);
}

.customer-pill.lost {
  border-color: rgba(239, 68, 68, 0.5);
}

.customer-overview-hero {
  margin: 18px 0;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.78), rgba(30, 41, 59, 0.48));
}

.customer-overview-hero small {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.customer-overview-hero strong {
  display: block;
  font-size: 1rem;
  line-height: 1.35;
}

.customer-tabs-nav {
  display: flex;
  gap: 8px;
  margin: 18px 0 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.customer-tab-button {
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.42);
  color: inherit;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.customer-tab-button.active {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.55);
}

.customer-tab-panel {
  display: none;
}

.customer-tab-panel.active {
  display: block;
}

.customer-timeline-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.customer-timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-top: 5px;
  background: rgba(59, 130, 246, 0.85);
}

.customer-ai-box {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.35);
}

@media (max-width: 720px) {
  .customer-tabs-nav {
    margin-left: -4px;
    margin-right: -4px;
  }
}

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.22), transparent 34%),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.14), transparent 30%),
    #020617;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 440px);
  padding: 34px;
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.82);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.login-brand {
  margin-bottom: 26px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 2rem;
}

.login-card p {
  color: var(--muted);
  margin-bottom: 24px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label,
.admin-panel label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.login-form input,
.admin-panel input,
.admin-panel select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.72);
  color: inherit;
  padding: 12px 14px;
}

.login-form button,
.admin-panel button {
  border: 0;
  border-radius: 14px;
  padding: 13px 16px;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  cursor: pointer;
}

.login-error {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  margin-bottom: 16px;
}

.login-help {
  display: inline-block;
  margin-top: 18px;
  color: #93c5fd;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 18px;
}

.admin-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.36);
}

.admin-user-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.admin-user-row small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

@media (max-width: 900px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

.permission-grid {
  display: grid;
  gap: 10px;
}

.permission-check {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px !important;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.28);
}

.permission-check input {
  width: auto !important;
}

.portal-hero {
  padding: 28px;
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.2), transparent 34%),
    rgba(15, 23, 42, 0.42);
  margin-bottom: 24px;
}

.portal-hero h1 {
  margin: 8px 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.portal-hero p {
  color: var(--muted);
  max-width: 720px;
}

.portal-module-grid {
  margin-top: 16px;
}

.admin-users-layout {
  display: grid;
  grid-template-columns: minmax(320px, 460px) 1fr;
  gap: 20px;
}

.admin-users-layout.single {
  grid-template-columns: minmax(320px, 620px) minmax(280px, 420px);
}

.admin-create-card,
.admin-list-card {
  align-self: start;
}

.admin-form-grid {
  display: grid;
  gap: 14px;
}

.admin-note {
  color: var(--muted);
  line-height: 1.4;
}

.admin-user-list {
  display: grid;
  gap: 12px;
}

.admin-user-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.28);
}

.admin-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 900;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
}

.admin-user-main strong,
.admin-user-main small {
  display: block;
}

.admin-user-main small {
  color: var(--muted);
  margin-top: 4px;
}

.admin-permission-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.admin-permission-tags span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.24);
  font-size: 0.72rem;
}

.status-pill {
  display: inline-flex;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.75rem;
  font-weight: 800;
}

.status-pill.active {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}

.status-pill.inactive {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
}

.link-button {
  border: 0;
  background: transparent;
  color: #93c5fd;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}

.danger-button {
  margin-top: 12px;
  background: linear-gradient(135deg, #dc2626, #ef4444) !important;
}

@media (max-width: 1100px) {
  .admin-users-layout,
  .admin-users-layout.single {
    grid-template-columns: 1fr;
  }

  .admin-user-card {
    grid-template-columns: 44px 1fr;
  }

  .admin-user-actions {
    grid-column: 1 / -1;
    text-align: left;
  }
}

/* Admin Console V2 */
.admin-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 24px;
  padding: 26px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.94));
  color: #f8fafc;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
}

.admin-hero h1 {
  margin: 6px 0 8px;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.04em;
}

.admin-hero p {
  max-width: 720px;
  margin: 0;
  color: rgba(226, 232, 240, 0.78);
}

.admin-hero-stats {
  min-width: 140px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
}

.admin-hero-stats span {
  display: block;
  font-size: 34px;
  font-weight: 850;
}

.admin-hero-stats small {
  color: rgba(226, 232, 240, 0.75);
}

.admin-panel .panel-head p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
}

.permission-box {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 22px;
  background: rgba(248, 250, 252, 0.78);
}

.permission-box-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.permission-box-head small {
  max-width: 360px;
  color: #64748b;
  text-align: right;
}

.permission-check span {
  display: grid;
  gap: 2px;
}

.permission-check span b {
  color: #0f172a;
  font-size: 13px;
}

.permission-check span small {
  color: #64748b;
  font-size: 11px;
}

.account-active-check {
  margin-top: 16px;
}

.admin-user-title-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.admin-user-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  min-width: 142px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  border: 0;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary-action {
  background: #0f172a;
  color: #fff;
}

.secondary-action {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #fff;
  color: #0f172a;
}

.full {
  width: 100%;
}

.admin-security-card {
  align-self: start;
}

.admin-note-box {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  padding: 14px;
  border-radius: 18px;
  background: #f8fafc;
  color: #475569;
}

.admin-note-box strong {
  color: #0f172a;
}

.admin-note-box small {
  line-height: 1.45;
}

.admin-permission-tags .muted {
  color: #94a3b8;
  background: #f8fafc;
}

@media (max-width: 900px) {
  .admin-hero,
  .permission-box-head,
  .admin-user-title-row {
    flex-direction: column;
  }

  .permission-box-head small {
    text-align: left;
  }

  .admin-user-actions {
    width: 100%;
  }
}

/* Enterprise Topbar */
.main {
  position: relative;
}

.enterprise-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  margin: -32px -32px 28px;
  padding: 16px 28px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(248, 250, 252, 0.88);
  backdrop-filter: blur(18px);
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(460px, 45vw);
  padding: 10px 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  background: #fff;
  color: #94a3b8;
}

.topbar-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #64748b;
  font-weight: 650;
}

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

.topbar-icon {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  background: #fff;
  opacity: 0.55;
}

.account-menu-wrap {
  position: relative;
}

.account-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 6px 10px 6px 6px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}





.account-trigger-text {
  display: grid;
  gap: 1px;
  text-align: left;
}

.account-trigger-text strong {
  max-width: 160px;
  overflow: hidden;
  color: #0f172a;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-trigger-text small {
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
}

.account-chevron {
  color: #94a3b8;
  font-weight: 900;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 310px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.account-dropdown-head {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 24px 18px 18px;
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.14), transparent 32%),
    #f8fafc;
  text-align: center;
}

.account-dropdown-head strong {
  margin-top: 6px;
  color: #0f172a;
}

.account-dropdown-head small,
.account-dropdown-head em {
  max-width: 250px;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-dropdown-links {
  display: grid;
  padding: 10px;
}

.account-dropdown-links a,
.account-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border-radius: 14px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.account-dropdown-links a:hover,
.account-logout:hover {
  background: #f1f5f9;
}

.account-logout {
  margin: 0 10px 10px;
  color: #b91c1c;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.sidebar-foot {
  margin-top: auto;
  padding: 14px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.05);
}

.sidebar-foot small {
  display: block;
  color: #0f172a;
  font-weight: 850;
}

.sidebar-foot span {
  color: #64748b;
  font-size: 12px;
}

@media (max-width: 900px) {
  .enterprise-topbar {
    position: static;
    margin: -18px -18px 22px;
    padding: 14px;
  }

  .topbar-search {
    display: none;
  }

  .account-trigger-text,
  .account-chevron {
    display: none;
  }

  .account-dropdown {
    right: 0;
    width: min(310px, 90vw);
  }
}

/* Enterprise Topbar Dark Fix */
.enterprise-topbar {
  background: linear-gradient(135deg, #061426, #0b1f38) !important;
  border-bottom: 1px solid rgba(59, 130, 246, 0.22) !important;
}

.topbar-search {
  display: none !important;
}

.topbar-icon {
  display: none !important;
}

.account-trigger {
  background: rgba(15, 23, 42, 0.92) !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
  box-shadow: none !important;
}

.account-trigger-text strong {
  color: #f8fafc !important;
}

.account-trigger-text small,
.account-chevron {
  color: #93c5fd !important;
}

.account-dropdown {
  background: #071527 !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
  color: #f8fafc;
}

.account-dropdown-head {
  background: linear-gradient(135deg, #071527, #0f2744) !important;
}

.account-dropdown-head strong {
  color: #f8fafc !important;
}

.account-dropdown-head small,
.account-dropdown-head em {
  color: #cbd5e1 !important;
}

.account-dropdown-links a,
.account-logout {
  color: #e2e8f0 !important;
}

.account-dropdown-links a:hover,
.account-logout:hover {
  background: rgba(59, 130, 246, 0.14) !important;
}

.account-logout {
  color: #fca5a5 !important;
  border-top-color: rgba(148, 163, 184, 0.18) !important;
}



.account-page {
  display: grid;
  gap: 22px;
}

.account-profile-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 34px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 28px;
  background: linear-gradient(135deg, #071527, #0f2744);
  color: #f8fafc;
  text-align: center;
}

.account-profile-card h1 {
  margin: 10px 0 0;
}

.account-profile-card p,
.account-profile-card span {
  margin: 0;
  color: #cbd5e1;
}

.admin-hero.compact {
  margin-bottom: 0;
}

/* ===== Enterprise Topbar Layout Fix ===== */

.enterprise-topbar{
    display:flex !important;
    justify-content:flex-end !important;
    align-items:center !important;
    gap:18px !important;
}

.topbar-search{
    display:none !important;
}

.topbar-actions{
    width:100%;
    display:flex;
    justify-content:flex-end;
    align-items:center;
}

.topbar-icon{
    display:none !important;
}

.account-menu-wrap{
    margin-left:auto;
    position:relative;
}

.account-trigger{
    min-width:220px;
    justify-content:flex-start;
}

.account-trigger-text{
    flex:1;
}

.account-dropdown{
    right:0;
    left:auto;
}


/* ===== Account Trigger Enterprise Polish ===== */

.account-trigger {
  min-width: 240px !important;
  padding: 7px 12px 7px 7px !important;
  border-radius: 999px !important;
}

.account-trigger .ares-avatar {
  position: relative;
}

.account-trigger .ares-avatar::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border: 2px solid #071527;
  border-radius: 999px;
  background: #22c55e;
}

.account-trigger-text strong {
  font-size: 13px !important;
  line-height: 1.1;
}

.account-trigger-text small {
  font-size: 10px !important;
  letter-spacing: .08em;
}

.account-chevron {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.14);
}

.account-dropdown {
  margin-top: 6px;
}

.account-dropdown::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 28px;
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  background: #071527;
  border-left: 1px solid rgba(59, 130, 246, 0.35);
  border-top: 1px solid rgba(59, 130, 246, 0.35);
}

.account-dropdown-links a,
.account-logout {
  transition: background .16s ease, transform .16s ease;
}

.account-dropdown-links a:hover,
.account-logout:hover {
  transform: translateX(2px);
}

@media (max-width: 900px) {
  .account-trigger {
    min-width: 46px !important;
    padding: 6px !important;
  }
}

/* Avatar upload */






.avatar-upload-form {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: 18px;
}

.avatar-upload-form small {
  color: #cbd5e1;
}



.account-password-panel {
  max-width: 620px;
}

.account-password-panel label {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: #0f172a;
  font-weight: 800;
}

.account-password-panel input {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
}

.form-alert {
  margin: 14px 0;
  padding: 13px 15px;
  border-radius: 14px;
  font-weight: 750;
}

.form-alert.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ===== Account Password Form Fix ===== */

.account-password-panel label{
    display:flex;
    flex-direction:column;
    gap:8px;
    margin-top:18px;
    color:#e2e8f0 !important;
    font-size:14px;
    font-weight:700;
}

.account-password-panel input{
    height:46px;
    padding:0 14px;
    border:1px solid rgba(148,163,184,.28);
    border-radius:14px;
    background:#0f172a;
    color:#f8fafc;
}

.account-password-panel input::placeholder{
    color:#94a3b8;
}

.account-password-panel input:focus{
    outline:none;
    border-color:#3b82f6;
    box-shadow:0 0 0 3px rgba(59,130,246,.18);
}

.account-password-panel p{
    color:#94a3b8;
}


/* Password Fields */

.password-field{
    position:relative;
}

.password-field input{
    width:100%;
    padding-right:52px;
}

.toggle-password{
    position:absolute;
    top:50%;
    right:12px;
    transform:translateY(-50%);
    border:0;
    background:none;
    cursor:pointer;
    font-size:18px;
    opacity:.75;
}

.toggle-password:hover{
    opacity:1;
}

.account-password-panel label span{
    display:block;
    font-weight:700;
    color:#f8fafc;
}

.account-password-panel label small{
    display:block;
    margin:4px 0 8px;
    color:#94a3b8;
}

.password-rules{
    margin:22px 0;
    padding:18px;
    border-radius:18px;
    background:rgba(59,130,246,.08);
    border:1px solid rgba(59,130,246,.15);
}

.password-rules strong{
    display:block;
    margin-bottom:10px;
    color:#f8fafc;
}

.password-rules ul{
    margin:0;
    padding-left:18px;
    color:#cbd5e1;
}


/* Password strength meter */
.toggle-password svg {
  width: 21px;
  height: 21px;
  fill: #cbd5e1;
}

.password-strength {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.password-strength-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
}

.password-strength-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: #64748b;
  transition: width .2s ease, background .2s ease;
}

.password-strength.weak .password-strength-track span {
  width: 33%;
  background: #ef4444;
}

.password-strength.medium .password-strength-track span {
  width: 66%;
  background: #f59e0b;
}

.password-strength.strong .password-strength-track span {
  width: 100%;
  background: #22c55e;
}

.password-strength small {
  color: #94a3b8;
}

.password-rules li {
  margin: 6px 0;
  color: #94a3b8;
}

.password-rules li.ok {
  color: #86efac;
}

.password-rules li.ok::marker {
  content: "✓ ";
}

.password-match {
  margin-top: 8px;
  min-height: 18px;
}

.password-match.ok {
  color: #86efac !important;
}

.password-match.error {
  color: #fca5a5 !important;
}

/* Fix password eye button size */
.password-field {
  position: relative !important;
  display: block !important;
}

.password-field input {
  width: 100% !important;
  box-sizing: border-box !important;
  padding-right: 54px !important;
}

.password-field .toggle-password {
  position: absolute !important;
  top: 50% !important;
  right: 12px !important;
  transform: translateY(-50%) !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  max-width: 34px !important;
  max-height: 34px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: transparent !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
}

.password-field .toggle-password:hover {
  background: rgba(255,255,255,.08) !important;
}

.password-field .toggle-password svg {
  width: 19px !important;
  height: 19px !important;
  fill: #cbd5e1 !important;
  pointer-events: none;
}

.auth-card input[name="code"] {
  text-align: center;
  font-size: 28px;
  letter-spacing: 0.35em;
  font-weight: 900;
}

/* Login 2FA page polish */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-verify-card {
  width: min(460px, 100%);
}

.verify-form {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.verify-form label {
  display: grid;
  gap: 10px;
  color: #f8fafc;
  font-weight: 800;
}

.verify-form input[name="code"] {
  width: 100%;
  box-sizing: border-box;
  height: 58px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.78);
  color: #f8fafc;
  text-align: center;
  font-size: 26px;
  letter-spacing: 0.32em;
  font-weight: 900;
}

.verify-form input[name="code"]:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.18);
}

.verify-form button {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: white;
  font-weight: 900;
  cursor: pointer;
}

.login-verify-card .auth-link {
  display: inline-flex;
  margin-top: 18px;
  color: #93c5fd;
  text-decoration: none;
  font-weight: 800;
}

.login-verify-card .eyebrow {
  display: inline-block;
  margin-top: 20px;
}

/* ARES Todo V1 detail panel layout fix */
.todo-detail {
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.todo-detail * {
  box-sizing: border-box !important;
}

.todo-detail-form {
  width: 100% !important;
  max-width: 100% !important;
}

.todo-detail-form input,
.todo-detail-form textarea,
.todo-detail-form select {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

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

.todo-detail-form textarea {
  resize: vertical !important;
}

.todo-detail .todo-primary-btn {
  width: 100% !important;
}

.todo-comments {
  max-width: 100% !important;
}

.todo-comment-form textarea {
  width: 100% !important;
  max-width: 100% !important;
}

.todo-shell {
  grid-template-columns: 220px minmax(520px, 1fr) minmax(360px, 440px) !important;
}

@media (min-width: 1400px) {
  .todo-shell {
    grid-template-columns: 220px minmax(600px, 1fr) 460px !important;
  }
}

.todo-danger-btn {
  border: 1px solid rgba(248, 113, 113, .25);
  border-radius: 13px;
  background: rgba(239, 68, 68, .12);
  color: #fecaca;
  padding: 11px 14px;
  font-weight: 900;
  cursor: pointer;
}

.todo-danger-btn:hover {
  background: rgba(239, 68, 68, .22);
}

/* ARES Todo V1 action buttons + small completion circle fix */
.todo-check-form button.todo-check,
button.todo-check,
.todo-check {
  width: 14px !important;
  min-width: 14px !important;
  max-width: 14px !important;
  height: 14px !important;
  min-height: 14px !important;
  max-height: 14px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 999px !important;
  line-height: 1 !important;
  font-size: 0 !important;
  display: inline-block !important;
  appearance: none !important;
}

.todo-check.done {
  font-size: 9px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.todo-projects-title {
  margin: 16px 10px 8px;
  color: #38bdf8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
}

.todo-project-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.todo-label-picker {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.todo-label-picker > strong {
  color: #bfdbfe;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.todo-label-picker > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.todo-label-chip {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  width: auto !important;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .16);
  background: rgba(15, 23, 42, .72);
  color: #dbeafe !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

.todo-label-chip input {
  width: 13px !important;
  height: 13px !important;
}

.todo-project-row {
  position: relative;
}

.todo-project-row {
  display: grid;
  grid-template-columns: 1fr 30px;
  gap: 4px;
  align-items: center;
}

.todo-project-row .todo-view {
  min-width: 0;
}

.todo-mini-manage summary {
  list-style: none;
  cursor: pointer;
  color: #93c5fd;
  text-align: center;
  border-radius: 10px;
  padding: 8px 0;
}

.todo-mini-manage summary::-webkit-details-marker,
.todo-manage-box summary::-webkit-details-marker,
.todo-label-manage summary::-webkit-details-marker {
  display: none;
}

.todo-mini-manage[open],
.todo-manage-box[open],
.todo-label-manage[open] {
  background: rgba(15, 23, 42, .65);
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 14px;
  padding: 8px;
  margin: 6px 0;
}

.todo-manage-box summary,
.todo-label-manage summary {
  cursor: pointer;
  color: #cbd5e1;
  font-weight: 800;
  padding: 9px 10px;
  border-radius: 12px;
}

.todo-manage-box summary:hover,
.todo-label-manage summary:hover,
.todo-mini-manage summary:hover {
  background: rgba(59, 130, 246, .14);
}

.todo-mini-manage form,
.todo-manage-box form,
.todo-label-manage form {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.todo-mini-manage input,
.todo-mini-manage select,
.todo-manage-box input,
.todo-manage-box select,
.todo-label-manage input,
.todo-label-manage select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, .16);
  background: rgba(2, 6, 23, .48);
  color: #e5eefc;
  border-radius: 10px;
  padding: 8px 9px;
}

.todo-mini-manage button,
.todo-manage-box button,
.todo-label-manage button {
  border: 1px solid rgba(96, 165, 250, .28);
  background: rgba(37, 99, 235, .18);
  color: #dbeafe;
  border-radius: 10px;
  padding: 8px 9px;
  font-weight: 900;
  cursor: pointer;
}

.todo-mini-manage button.danger,
.todo-manage-box button.danger,
.todo-label-manage button.danger {
  border-color: rgba(248, 113, 113, .25);
  background: rgba(239, 68, 68, .14);
  color: #fecaca;
}

/* ARES Todo project/label manage compact fix */
.todo-rail {
  overflow: visible !important;
}

.todo-project-row {
  grid-template-columns: minmax(0, 1fr) 32px !important;
  position: relative !important;
}

.todo-mini-manage {
  position: relative !important;
}

.todo-mini-manage[open] {
  position: absolute !important;
  right: 0 !important;
  top: 38px !important;
  z-index: 30 !important;
  width: 210px !important;
  padding: 10px !important;
  background: rgba(15, 23, 42, .98) !important;
  border: 1px solid rgba(96, 165, 250, .28) !important;
  border-radius: 16px !important;
  box-shadow: 0 22px 55px rgba(0,0,0,.45) !important;
}

.todo-mini-manage summary {
  width: 32px !important;
  height: 32px !important;
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
}

.todo-mini-manage[open] summary {
  margin-left: auto !important;
  margin-bottom: 8px !important;
}

.todo-mini-manage form {
  width: 100% !important;
}

.todo-mini-manage input,
.todo-mini-manage select,
.todo-mini-manage button {
  width: 100% !important;
  max-width: 100% !important;
  font-size: 13px !important;
}

.todo-mini-manage button {
  height: 36px !important;
}

.todo-label-manage[open],
.todo-manage-box[open] {
  width: 100% !important;
  max-width: 100% !important;
}

.todo-label-manage input,
.todo-label-manage select,
.todo-label-manage button,
.todo-manage-box input,
.todo-manage-box select,
.todo-manage-box button {
  max-width: 100% !important;
  font-size: 13px !important;
}

.todo-side-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 34px !important;
  gap: 6px !important;
  align-items: center !important;
}

.todo-side-more {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #93c5fd;
  text-decoration: none;
  font-weight: 900;
}

.todo-side-more:hover {
  background: rgba(59, 130, 246, .16);
  color: #f8fafc;
}

.todo-label-side {
  min-width: 0;
  color: #cbd5e1;
  font-weight: 800;
  padding: 10px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.todo-add-link {
  display: block;
  margin: 8px 8px 14px;
  padding: 10px 12px;
  border-radius: 13px;
  color: #93c5fd;
  text-decoration: none;
  font-weight: 900;
}

.todo-add-link:hover {
  background: rgba(59, 130, 246, .14);
  color: #f8fafc;
}

.todo-mini-manage,
.todo-manage-box,
.todo-label-manage {
  display: none !important;
}

/* ARES Todo V2 project colors + collapsible labels + readable priorities */
.todo-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 7px;
  vertical-align: middle;
  box-shadow: 0 0 0 3px rgba(255,255,255,.04);
}

.todo-color-blue { background: #60a5fa; }
.todo-color-green { background: #34d399; }
.todo-color-orange { background: #fb923c; }
.todo-color-purple { background: #a78bfa; }
.todo-color-cyan { background: #22d3ee; }
.todo-color-slate { background: #94a3b8; }
.todo-color-red { background: #fb7185; }
.todo-color-amber { background: #fbbf24; }

.todo-collapse {
  margin-top: 12px;
}

.todo-collapse summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 16px 10px 8px;
  color: #38bdf8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
}

.todo-collapse summary::-webkit-details-marker {
  display: none;
}

.todo-collapse summary strong {
  min-width: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(59, 130, 246, .18);
  color: #93c5fd;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0;
}

.todo-collapse[open] summary {
  margin-bottom: 10px;
}

.todo-priority {
  min-width: 70px;
  text-align: center;
  font-size: 11px !important;
  letter-spacing: .02em;
}

.todo-row-title {
  align-items: flex-start !important;
}

.todo-row-title strong {
  padding-top: 2px;
}

.todo-priority.p1::before,
.todo-priority.p2::before,
.todo-priority.p3::before,
.todo-priority.p4::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 5px;
  vertical-align: 1px;
}

.todo-priority.p1::before { background: #fb7185; }
.todo-priority.p2::before { background: #fb923c; }
.todo-priority.p3::before { background: #60a5fa; }
.todo-priority.p4::before { background: #94a3b8; }

/* Todo close button fix */
.todo-close {
  width: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  font-size: 22px !important;
  font-weight: 900 !important;
  text-decoration: none !important;
}

/* Checklist visibility improvement */
.todo-subtodos {
  background: rgba(15, 23, 42, .36);
  border: 1px solid rgba(96, 165, 250, .16);
  border-radius: 18px;
  padding: 16px;
}

.todo-subtodos h3::before {
  content: "☑ ";
}

.todo-subtodo-form {
  margin-top: 14px !important;
}

.todo-subtodo-form input {
  height: 44px;
}

.todo-subtodo-form button {
  height: 44px;
}

/* Checklist outside main edit form */
.todo-detail-form + .todo-subtodos {
  margin-top: 18px;
}

.todo-detail-form .todo-detail-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
}

.todo-detail-form label {
  display: grid !important;
  gap: 6px !important;
}

.todo-detail-form select,
.todo-detail-form input,
.todo-detail-form textarea {
  width: 100% !important;
  max-width: 100% !important;
}

/* Checklist delete button fix */
.todo-subtodo-delete {
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  border: 1px solid rgba(248, 113, 113, .28) !important;
  background: rgba(239, 68, 68, .14) !important;
  color: #fecaca !important;
  box-shadow: none !important;
}

.todo-subtodo-delete:hover {
  background: rgba(239, 68, 68, .26) !important;
  border-color: rgba(248, 113, 113, .45) !important;
}

.todo-subtodo-row {
  grid-template-columns: 28px 1fr 34px !important;
}

.todo-subtodo-row form {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.todo-timeline {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, .14);
}

.todo-timeline h3 {
  color: #f8fafc;
  margin: 0 0 12px;
}

.todo-timeline-list {
  display: grid;
  gap: 12px;
}

.todo-timeline-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 10px;
  color: #dbeafe;
}

.todo-timeline-item > span {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 999px;
  background: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, .13);
}

.todo-timeline-item strong {
  display: block;
  color: #f8fafc;
  font-size: 13px;
}

.todo-timeline-item p {
  margin: 4px 0;
  color: #cbd5e1;
  font-size: 13px;
}

.todo-timeline-item small {
  color: #93c5fd;
  font-size: 12px;
}

/* Checklist add form refinement */
.todo-subtodo-form {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 130px !important;
  gap: 10px !important;
  align-items: center !important;
}

.todo-subtodo-form input {
  height: 48px !important;
  min-height: 48px !important;
  padding: 0 16px !important;
  border-radius: 16px !important;
  font-size: 15px !important;
}

.todo-subtodo-form button {
  height: 48px !important;
  min-height: 48px !important;
  padding: 0 16px !important;
  border-radius: 16px !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
  background: linear-gradient(135deg, #2563eb, #38bdf8) !important;
  border: 0 !important;
}

@media (max-width: 900px) {
  .todo-subtodo-form {
    grid-template-columns: 1fr !important;
  }
}



/* ARES Notification Center */
.notification-menu-wrap {
  position: relative;
}

.notification-trigger {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 19px;
  box-shadow: 0 8px 18px rgba(239, 68, 68, .35);
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 380px;
  max-width: calc(100vw - 40px);
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 22px;
  background: rgba(8, 13, 28, .98);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .45);
  backdrop-filter: blur(18px);
  overflow: hidden;
  z-index: 80;
}

.notification-dropdown-head,
.notification-dropdown-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, .16);
}

.notification-dropdown-head strong {
  color: #f8fafc;
  font-size: 15px;
}

.notification-dropdown-head small {
  color: #38bdf8;
  font-weight: 800;
}

.notification-dropdown-list {
  max-height: 390px;
  overflow-y: auto;
}

.notification-dropdown-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  padding: 14px 18px;
  text-decoration: none;
  border-bottom: 1px solid rgba(148, 163, 184, .10);
  background: rgba(15, 23, 42, .18);
}

.notification-dropdown-item:hover {
  background: rgba(37, 99, 235, .16);
}

.notification-dropdown-item.unread {
  background: rgba(37, 99, 235, .22);
}

.notification-dropdown-item > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(59, 130, 246, .16);
}

.notification-dropdown-item strong {
  display: block;
  color: #f8fafc;
  font-size: 13px;
  line-height: 1.25;
}

.notification-dropdown-item p {
  margin: 4px 0 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.35;
}

.notification-dropdown-item small {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.notification-dropdown-empty {
  padding: 24px 18px;
  text-align: center;
}

.notification-dropdown-empty strong {
  color: #f8fafc;
}

.notification-dropdown-empty p {
  margin: 6px 0 0;
  color: #94a3b8;
  font-size: 13px;
}

.notification-dropdown-foot {
  border-top: 1px solid rgba(148, 163, 184, .16);
  border-bottom: 0;
}

.notification-dropdown-foot a,
.notification-dropdown-foot button {
  border: 0;
  background: transparent;
  color: #38bdf8;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
}

.notification-page-card {
  display: grid;
  gap: 12px;
}

.notification-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, .16);
  background: rgba(15, 23, 42, .62);
}

.notification-row.unread {
  border-color: rgba(56, 189, 248, .38);
  background: rgba(37, 99, 235, .18);
}

.notification-row-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(59, 130, 246, .16);
  font-size: 20px;
}

.notification-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification-row-head strong {
  color: #f8fafc;
}

.notification-row-head span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .12);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.notification-row-body p {
  margin: 6px 0 0;
  color: #cbd5e1;
}

.notification-row-body small {
  display: block;
  margin-top: 8px;
  color: #64748b;
  font-weight: 700;
}

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



/* Notification bell visibility fix */
.notification-menu-wrap {
  display: inline-flex !important;
  align-items: center !important;
  position: relative !important;
}

.notification-trigger {
  display: inline-grid !important;
  place-items: center !important;
  color: #f8fafc !important;
  opacity: 1 !important;
  visibility: visible !important;
}



/* ARES Notification Bell final placement */
.enterprise-topbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.topbar-actions {
  margin-left: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 12px !important;
}

.notification-menu-wrap {
  order: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  position: relative !important;
}

.account-menu-wrap {
  order: 3 !important;
}

.notification-trigger.topbar-icon {
  width: 48px !important;
  height: 48px !important;
  border-radius: 18px !important;
  border: 1px solid rgba(56, 189, 248, .22) !important;
  background: rgba(15, 23, 42, .78) !important;
  color: #f8fafc !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 12px 30px rgba(0,0,0,.20) !important;
}

.notification-trigger.topbar-icon:hover {
  border-color: rgba(56, 189, 248, .46) !important;
  background: rgba(30, 41, 59, .92) !important;
}

.notification-dropdown {
  right: 0 !important;
  left: auto !important;
}

/* ARES Notification Bell clean final fix */
.enterprise-topbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.topbar-search {
  flex: 1 1 auto !important;
}

.topbar-actions {
  width: auto !important;
  min-width: 0 !important;
  flex: 0 0 auto !important;
  margin-left: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 14px !important;
}

.notification-menu-wrap {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
}

.notification-trigger.topbar-icon {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  color: #cbd5e1 !important;
  font-size: 20px !important;
  border-radius: 999px !important;
  padding: 0 !important;
}

.notification-trigger.topbar-icon:hover {
  background: rgba(148, 163, 184, .12) !important;
  color: #f8fafc !important;
  border: 0 !important;
  box-shadow: none !important;
}

.notification-badge {
  top: 0 !important;
  right: 0 !important;
}




/* ARES Todo People Card */
.todo-people-card {
  margin: 14px 0 18px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(56, 189, 248, .16);
  background: rgba(15, 23, 42, .54);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.todo-people-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #f8fafc;
}

.todo-people-title strong {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.todo-person-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  background: rgba(2, 6, 23, .28);
}

.todo-person-row + .todo-person-row {
  margin-top: 8px;
}

.todo-person-row.featured {
  background: rgba(37, 99, 235, .16);
  border: 1px solid rgba(56, 189, 248, .20);
}

.todo-person-row strong {
  display: block;
  color: #f8fafc;
  font-size: 14px;
  line-height: 1.2;
}

.todo-person-row small {
  display: block;
  margin-top: 3px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
}

.todo-person-avatar {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, .22);
  background: rgba(15, 23, 42, .9);
}

.todo-person-avatar.fallback {
  display: grid;
  place-items: center;
  color: #f8fafc;
  font-weight: 900;
  background: linear-gradient(135deg, rgba(37, 99, 235, .9), rgba(56, 189, 248, .72));
}



/* ARES Todo Enterprise Detail V2 */
.todo-enterprise-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}

.todo-enterprise-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 13px;
  border-radius: 18px;
  background: rgba(2, 6, 23, .28);
  border: 1px solid rgba(148, 163, 184, .13);
}

.todo-enterprise-card > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(37, 99, 235, .16);
}

.todo-enterprise-card small {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.todo-enterprise-card strong {
  display: block;
  margin-top: 3px;
  color: #f8fafc;
  font-size: 13px;
  line-height: 1.25;
}

.todo-enterprise-tags {
  margin: 0 0 18px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(15, 23, 42, .42);
  border: 1px solid rgba(148, 163, 184, .13);
}

.todo-enterprise-tags > strong {
  display: block;
  margin-bottom: 10px;
  color: #f8fafc;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.todo-enterprise-tags div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.todo-enterprise-tags span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .16);
  color: #dbeafe;
  font-size: 12px;
  font-weight: 800;
}

/* ARES Todo Enterprise Detail V2 */
.todo-detail-hero {
  align-items: flex-start !important;
  padding: 18px 4px 22px !important;
  margin-bottom: 14px !important;
  border-bottom: 1px solid rgba(148, 163, 184, .12) !important;
}

.todo-hero-badges {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 7px !important;
  max-width: 100% !important;
  overflow: hidden !important;
  margin: 0 0 18px !important;
}

.todo-hero-badges span {
  display: inline-flex !important;
  align-items: center !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
  max-width: 130px !important;
  height: 27px !important;
  min-height: 27px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  border: 1px solid rgba(148, 163, 184, .14) !important;
}

.todo-hero-priority.p1 {
  color: #fecaca !important;
  background: rgba(239, 68, 68, .18) !important;
  border-color: rgba(239, 68, 68, .32) !important;
}

.todo-hero-priority.p2 {
  color: #fed7aa !important;
  background: rgba(249, 115, 22, .16) !important;
  border-color: rgba(249, 115, 22, .30) !important;
}

.todo-hero-priority.p3 {
  color: #bfdbfe !important;
  background: rgba(59, 130, 246, .16) !important;
  border-color: rgba(59, 130, 246, .28) !important;
}

.todo-hero-priority.p4 {
  color: #cbd5e1 !important;
  background: rgba(148, 163, 184, .12) !important;
}

.todo-hero-status.open,
.todo-hero-date {
  color: #bae6fd !important;
  background: rgba(14, 165, 233, .16) !important;
  border-color: rgba(14, 165, 233, .34) !important;
}

.todo-hero-status.done {
  color: #bbf7d0 !important;
  background: rgba(34, 197, 94, .14) !important;
  border-color: rgba(34, 197, 94, .30) !important;
}

.todo-hero-reminder {
  color: #fde68a !important;
  background: rgba(245, 158, 11, .16) !important;
  border-color: rgba(245, 158, 11, .34) !important;
}

.todo-hero-project,
.todo-hero-label {
  color: #ddd6fe !important;
  background: rgba(124, 58, 237, .16) !important;
  border-color: rgba(124, 58, 237, .34) !important;
}

.todo-detail-hero h2 {
  font-size: 42px !important;
  line-height: 1.04 !important;
  letter-spacing: -0.055em !important;
  color: #f8fafc !important;
  margin: 0 0 16px !important;
  max-width: 100% !important;
  word-break: break-word !important;
}

.todo-hero-description {
  margin-top: 14px !important;
  padding: 16px 18px !important;
  border-radius: 18px !important;
  background: rgba(2, 6, 23, .36) !important;
  border: 1px solid rgba(56, 189, 248, .14) !important;
  color: #dbeafe !important;
  font-size: 16px !important;
  line-height: 1.58 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035) !important;
}

.todo-people-card,
.todo-edit-details,
.todo-subtodos,
.todo-comments,
.todo-timeline {
  border-radius: 18px !important;
  background: rgba(15, 23, 42, .42) !important;
  border: 1px solid rgba(148, 163, 184, .12) !important;
}

.todo-people-card {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
  padding: 14px !important;
}

.todo-people-title {
  grid-column: 1 / -1 !important;
  margin-bottom: 0 !important;
}

.todo-person-row {
  display: grid !important;
  grid-template-columns: 38px minmax(0, 1fr) !important;
  gap: 10px !important;
  min-height: 74px !important;
  padding: 8px !important;
  border-radius: 14px !important;
}

.todo-person-avatar {
  width: 38px !important;
  height: 38px !important;
  border-radius: 12px !important;
}

.todo-person-row strong {
  font-size: 15px !important;
}

.todo-person-row small {
  font-size: 12px !important;
}

.todo-edit-details {
  margin: 14px 0 18px !important;
  overflow: hidden !important;
}

.todo-edit-details > summary {
  list-style: none !important;
  cursor: pointer !important;
  padding: 16px 18px !important;
  color: #f8fafc !important;
  font-size: 18px !important;
  font-weight: 900 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.todo-edit-details > summary::-webkit-details-marker {
  display: none !important;
}

.todo-edit-details > summary::after {
  content: "⌄" !important;
  color: #38bdf8 !important;
  font-size: 18px !important;
  transition: transform .18s ease !important;
}

.todo-edit-details[open] > summary::after {
  transform: rotate(180deg) !important;
}

.todo-edit-details .todo-detail-form {
  padding: 0 16px 16px !important;
}

.todo-detail-form label {
  margin-top: 10px !important;
}

.todo-detail-form input,
.todo-detail-form textarea,
.todo-detail-form select {
  font-size: 14px !important;
}

.todo-subtodos {
  padding: 18px !important;
}

.todo-subtodos h3,
.todo-comments h3,
.todo-timeline h3 {
  font-size: 22px !important;
  line-height: 1.2 !important;
}

.todo-subtodos .muted {
  font-size: 16px !important;
}

.todo-subtodo-form {
  grid-template-columns: minmax(0, 1fr) 120px !important;
}

.todo-subtodo-form input,
.todo-subtodo-form button {
  height: 44px !important;
  min-height: 44px !important;
  font-size: 14px !important;
}

.todo-enterprise-meta,
.todo-enterprise-tags {
  display: none !important;
}


/* ARES Todo Attachments */
.todo-attachments-card {
  border-radius: 18px;
  background: rgba(15, 23, 42, .42);
  border: 1px solid rgba(148, 163, 184, .12);
  padding: 18px;
}

.todo-attachments-card h3 {
  font-size: 22px;
  line-height: 1.2;
  margin: 0 0 14px;
  color: #f8fafc;
}

.todo-attachment-list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.todo-attachment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(2, 6, 23, .28);
  border: 1px solid rgba(148, 163, 184, .10);
}

.todo-attachment-main {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.todo-attachment-main strong {
  display: block;
  color: #f8fafc;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.todo-attachment-main small {
  display: block;
  margin-top: 3px;
  color: #94a3b8;
  font-size: 12px;
}

.todo-attachment-thumb,
.todo-attachment-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.todo-attachment-thumb {
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, .16);
}

.todo-attachment-icon {
  display: grid;
  place-items: center;
  background: rgba(37, 99, 235, .16);
  color: #dbeafe;
  font-size: 19px;
}

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

.todo-attachment-actions a,
.todo-attachment-actions button {
  border: 1px solid rgba(148, 163, 184, .14);
  background: rgba(15, 23, 42, .66);
  color: #dbeafe;
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.todo-attachment-actions button {
  color: #fecaca;
}

.todo-attachment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
}

.todo-attachment-form input,
.todo-attachment-form button {
  min-height: 44px;
  border-radius: 14px;
}

.todo-attachment-form input {
  border: 1px solid rgba(148, 163, 184, .14);
  background: rgba(2, 6, 23, .26);
  color: #cbd5e1;
  padding: 10px 12px;
}

.todo-attachment-form button {
  border: 0;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  color: white;
  font-weight: 800;
  cursor: pointer;
  min-height: 36px;
  height: 36px;
  min-width: 92px;
  width: auto;
  padding: 0 14px;
  border-radius: 10px;
  justify-self: start;
}

/* ARES Todo Create Attachments */
.todo-create-attachments {
  margin: 18px 0;
  padding: 16px;
  border-radius: 18px;
  background: rgba(2, 6, 23, .26);
  border: 1px solid rgba(148, 163, 184, .12);
}

.todo-create-attachments strong {
  display: block;
  color: #f8fafc;
  font-size: 15px;
  margin-bottom: 4px;
}

.todo-create-attachments p {
  margin: 0 0 12px;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.4;
}

.todo-create-attachments input {
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, .14);
  background: rgba(15, 23, 42, .68);
  color: #cbd5e1;
  padding: 10px 12px;
}

/* ARES Todo create modal scroll fix */
body.todo-create-open {
  overflow: hidden;
}

.todo-create-panel {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  overflow-y: auto !important;
  padding: 34px 14px !important;
  overscroll-behavior: contain !important;
}

.todo-create-card {
  max-height: calc(100vh - 68px) !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
}

.todo-create-card .todo-primary-btn {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 2 !important;
  margin-top: 18px !important;
}

/* ARES Security - Turnstile login layout */
.login-form .cf-turnstile {
  display: flex;
  justify-content: center;
  margin: 8px 0 14px;
}

.login-form .cf-turnstile iframe {
  max-width: 100%;
}

/* Fix ARES Todo create modal scrollbar */
.todo-create-panel {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.55) rgba(15, 23, 42, 0.55);
}

.todo-create-panel::-webkit-scrollbar,
.todo-create-card::-webkit-scrollbar {
  width: 10px;
}

.todo-create-panel::-webkit-scrollbar-track,
.todo-create-card::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.55);
  border-radius: 999px;
}

.todo-create-panel::-webkit-scrollbar-thumb,
.todo-create-card::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.55);
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.85);
}

.todo-create-panel::-webkit-scrollbar-thumb:hover,
.todo-create-card::-webkit-scrollbar-thumb:hover {
  background: rgba(203, 213, 225, 0.75);
}

/* Account Session Manager */
.account-shell {
  display: grid;
  gap: 22px;
}

.account-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.72));
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.26);
}

.sessions-list {
  display: grid;
  gap: 14px;
}

.session-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.76);
}

.session-card.current {
  border-color: rgba(34, 197, 94, 0.45);
  background: linear-gradient(135deg, rgba(20, 83, 45, 0.22), rgba(15, 23, 42, 0.82));
}

.session-main {
  display: flex;
  gap: 14px;
  min-width: 0;
}

.session-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 16px;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.2);
}

.session-title {
  color: #f8fafc;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 8px;
}

.session-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: #94a3b8;
  font-size: 12px;
}

.session-user-agent {
  margin-top: 10px;
  max-width: 880px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.session-badge {
  padding: 7px 10px;
  border-radius: 999px;
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.28);
  font-size: 12px;
  font-weight: 800;
}

.danger-outline-btn {
  border: 1px solid rgba(248, 113, 113, 0.38);
  background: rgba(127, 29, 29, 0.16);
  color: #fecaca;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}

.danger-outline-btn:hover {
  border-color: rgba(248, 113, 113, 0.72);
  background: rgba(127, 29, 29, 0.28);
}

.danger-outline-btn.small {
  padding: 8px 12px;
  font-size: 12px;
}

/* ===========================
   ARES Audit Console
   =========================== */

.audit-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 24px 0;
    align-items: center;
}

.audit-filters input {
    min-width: 180px;
    flex: 1;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(148,163,184,.18);
    background: rgba(15,23,42,.55);
    color: #fff;
}

.audit-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.audit-card {
    background: rgba(15,23,42,.72);
    border: 1px solid rgba(148,163,184,.14);
    border-radius: 16px;
    padding: 18px;
    transition: .18s ease;
}

.audit-card:hover {
    border-color: rgba(99,102,241,.45);
    transform: translateY(-1px);
}

.audit-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
}

.audit-card-top strong {
    font-size: 15px;
    color: #fff;
}

.audit-card-top span {
    color: #94a3b8;
    font-size: 13px;
}

.audit-description {
    margin: 10px 0;
    color: #e2e8f0;
    line-height: 1.5;
}

.audit-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    font-size: 13px;
    color: #94a3b8;
}

.audit-meta b {
    color: #f8fafc;
}

.audit-details {
    margin-top: 14px;
}

.audit-details summary {
    cursor: pointer;
    color: #818cf8;
    font-weight: 600;
    margin-bottom: 8px;
}

.audit-details pre {
    margin-top: 10px;
    padding: 14px;
    border-radius: 12px;
    background: #020617;
    color: #cbd5e1;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.45;
}


/* ===========================
   ARES Security Center
   =========================== */

.security-center {
    max-width: 1280px;
}

.security-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0 24px;
    padding: 8px;
    border-radius: 16px;
    background: rgba(15, 23, 42, .58);
    border: 1px solid rgba(148, 163, 184, .14);
}

.security-tabs a {
    padding: 10px 14px;
    border-radius: 12px;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: .18s ease;
}

.security-tabs a:hover {
    color: #e2e8f0;
    background: rgba(148, 163, 184, .10);
}

.security-tabs a.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(99, 102, 241, .95), rgba(14, 165, 233, .88));
    box-shadow: 0 14px 28px rgba(37, 99, 235, .22);
}

.security-panel {
    margin-top: 8px;
}

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

.security-card {
    min-height: 150px;
    padding: 20px;
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, .18), transparent 36%),
        rgba(15, 23, 42, .72);
    border: 1px solid rgba(148, 163, 184, .14);
    box-shadow: 0 18px 42px rgba(2, 6, 23, .20);
}

.security-card span {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 5px 9px;
    border-radius: 999px;
    color: #bfdbfe;
    background: rgba(59, 130, 246, .14);
    border: 1px solid rgba(59, 130, 246, .22);
    font-size: 12px;
    font-weight: 800;
}

.security-card strong {
    display: block;
    color: #fff;
    font-size: 20px;
    margin-bottom: 8px;
}

.security-card p {
    margin: 0;
    color: #94a3b8;
    line-height: 1.5;
}

.security-card a {
    display: inline-flex;
    margin-top: 16px;
    color: #818cf8;
    text-decoration: none;
    font-weight: 800;
}

.security-card a:hover {
    color: #c7d2fe;
}

@media (max-width: 1180px) {
    .security-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .security-grid {
        grid-template-columns: 1fr;
    }

    .security-tabs {
        gap: 6px;
    }

    .security-tabs a {
        flex: 1;
        text-align: center;
    }
}


.security-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.security-kpi-card {
    padding: 18px;
    border-radius: 18px;
    background: rgba(15, 23, 42, .76);
    border: 1px solid rgba(148, 163, 184, .14);
    box-shadow: 0 18px 42px rgba(2, 6, 23, .20);
}

.security-kpi-card span {
    display: block;
    margin-bottom: 10px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.security-kpi-card strong {
    display: block;
    color: #fff;
    font-size: 34px;
    line-height: 1;
    margin-bottom: 10px;
}

.security-kpi-card p {
    margin: 0;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.45;
}

.security-kpi-card.danger {
    border-color: rgba(248, 113, 113, .28);
    background:
        radial-gradient(circle at top right, rgba(248, 113, 113, .16), transparent 42%),
        rgba(15, 23, 42, .76);
}

.security-shortcuts {
    margin-top: 8px;
}

.security-import-card {
    margin-top: 22px;
}

.security-import-list {
    display: grid;
    gap: 12px;
}

.security-import-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(15, 23, 42, .55);
    border: 1px solid rgba(148, 163, 184, .12);
}

.security-import-row strong {
    display: block;
    color: #fff;
    margin-bottom: 5px;
}

.security-import-row p {
    margin: 0;
    color: #94a3b8;
    font-size: 13px;
}

.security-import-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    color: #cbd5e1;
    font-size: 13px;
    white-space: nowrap;
}

.security-import-meta span:first-child {
    font-weight: 800;
    color: #bfdbfe;
}

.security-import-row.muted-row {
    opacity: .72;
}

@media (max-width: 1180px) {
    .security-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .security-kpi-grid {
        grid-template-columns: 1fr;
    }

    .security-import-row {
        flex-direction: column;
    }

    .security-import-meta {
        align-items: flex-start;
        white-space: normal;
    }
}

.todo-subtodo-form button[disabled],
.todo-attachment-form button[disabled],
.todo-detail-form button[disabled] {
    opacity: .55;
    cursor: not-allowed;
}

.todo-row-expanded {
    width: 100%;
    padding: 0 18px 18px 54px;
}

.todo-inline-checklist {
    margin-top: 10px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(15, 23, 42, .48);
    border: 1px solid rgba(148, 163, 184, .14);
}

.todo-inline-checklist-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.todo-inline-checklist-head strong {
    color: #e5e7eb;
}

.todo-inline-checklist-head span {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
}

.todo-subtodo-list.inline {
    margin-bottom: 12px;
}

.todo-subtodo-form.inline {
    display: flex;
    gap: 10px;
}

.todo-subtodo-form.inline input {
    flex: 1;
    min-width: 0;
}

.todo-subtodos-moved {
    opacity: .78;
}

@media (max-width: 820px) {
    .todo-row-expanded {
        padding: 0 12px 14px 12px;
    }

    .todo-subtodo-form.inline {
        flex-direction: column;
    }
}

.todo-row.selected {
    flex-wrap: wrap;
}

.todo-row.selected .todo-row-body {
    flex: 1;
    min-width: 0;
}

.todo-row-expanded {
    flex-basis: 100%;
    width: 100%;
    padding: 12px 18px 18px 54px;
}

.todo-inline-checklist {
    width: 100%;
    max-width: none;
}

.todo-subtodo-list.inline {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.todo-subtodo-list.inline .todo-subtodo-row {
    width: 100%;
    max-width: none;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
}

.todo-subtodo-list.inline .todo-subtodo-row span {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.35;
}

.todo-subtodo-form.inline {
    width: 100%;
}

.todo-subtodo-form.inline input {
    width: 100%;
}

@media (max-width: 820px) {
    .todo-row.selected {
        display: flex;
        flex-wrap: wrap;
    }

    .todo-row-expanded {
        flex-basis: 100%;
        padding: 10px 12px 14px 12px;
    }
}

/* Todo inline expanded checklist - override finale */
.todo-list-v1 .todo-row.selected {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: start !important;
}

.todo-list-v1 .todo-row.selected .todo-check-form {
    grid-column: 1;
    grid-row: 1;
}

.todo-list-v1 .todo-row.selected .todo-row-body {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    min-width: 0;
}

.todo-list-v1 .todo-row.selected .todo-row-expanded {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100% !important;
    max-width: none !important;
    padding: 14px 18px 18px 42px !important;
    box-sizing: border-box;
}

.todo-list-v1 .todo-row.selected .todo-inline-checklist {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
}

.todo-list-v1 .todo-subtodo-list.inline {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.todo-list-v1 .todo-subtodo-list.inline .todo-subtodo-row {
    width: 100% !important;
    max-width: none !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
}

.todo-list-v1 .todo-subtodo-list.inline .todo-subtodo-row > span {
    width: 100%;
    min-width: 0;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    line-height: 1.35;
}

.todo-list-v1 .todo-subtodo-form.inline {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.todo-list-v1 .todo-subtodo-form.inline input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

@media (max-width: 820px) {
    .todo-list-v1 .todo-row.selected {
        grid-template-columns: auto minmax(0, 1fr) !important;
    }

    .todo-list-v1 .todo-row.selected .todo-row-expanded {
        padding: 12px !important;
    }

    .todo-list-v1 .todo-subtodo-form.inline {
        grid-template-columns: 1fr;
    }
}

.todo-row-expanded[hidden] {
    display: none !important;
}

.todo-row-expanded {
    animation: todoExpandIn .16s ease-out;
}

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

/* Global page-load flash reduction */
html {
  min-height: 100%;
  background: #020817;
}

body {
  min-height: 100vh;
  background-color: #020817;
  background-attachment: fixed;
}

.shell {
  background: transparent;
  animation: aresPageIn .12s ease-out;
}

@keyframes aresPageIn {
  from {
    opacity: .96;
  }
  to {
    opacity: 1;
  }
}

/* Todo sidebar sticky fix */
.todo-shell .todo-rail {
    position: sticky !important;
    top: 88px !important;
    align-self: start;
    max-height: calc(100vh - 108px);
    overflow-y: auto;
    scrollbar-width: thin;
    z-index: 5;
}

.todo-timeline-note {
    margin-top: 12px;
    font-size: 12px;
}

@media (max-width: 980px) {
    .todo-shell .todo-rail {
        position: relative !important;
        top: auto !important;
        max-height: none;
        overflow: visible;
    }
}

/* Todo rail final sticky fix */
.todo-app .todo-shell > .todo-rail {
    position: sticky !important;
    top: 104px !important;
    align-self: start !important;
    height: max-content;
    max-height: calc(100vh - 124px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 20 !important;
    scrollbar-width: thin;
}

.todo-timeline-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, .16);
    font-size: 13px;
}

.todo-timeline-pager a {
    color: #93c5fd;
    font-weight: 800;
}

.todo-timeline-pager span {
    color: #64748b;
}

.todo-timeline-pager strong {
    color: #cbd5e1;
    font-size: 12px;
}

@media (max-width: 980px) {
    .todo-app .todo-shell > .todo-rail {
        position: relative !important;
        top: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
}

.todo-timeline.loading {
    opacity: .55;
    pointer-events: none;
}

/* ===========================
   ARES Todo Mobile UX V1
   =========================== */

@media (max-width: 820px) {
    body {
        overflow-x: hidden;
    }

    .shell {
        display: block !important;
    }

    .sidebar {
        position: relative !important;
        width: 100% !important;
        min-height: auto !important;
        border-right: 0 !important;
        border-bottom: 1px solid rgba(148, 163, 184, .16);
        padding: 16px !important;
    }

    .nav {
        display: none !important;
    }

    .brand {
        justify-content: center;
    }

    .main {
        width: 100% !important;
        padding: 0 !important;
    }

    .topbar {
        position: sticky !important;
        top: 0 !important;
        z-index: 100 !important;
    }

    .todo-app {
        padding: 12px !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    .todo-header {
        display: grid !important;
        gap: 14px !important;
        margin-bottom: 14px !important;
    }

    .todo-header h1 {
        font-size: 28px !important;
        line-height: 1.1 !important;
    }

    .todo-header .muted {
        font-size: 14px !important;
    }

    .todo-primary-btn {
        width: 100% !important;
        justify-content: center !important;
        min-height: 46px !important;
    }

    .todo-shell {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .todo-app .todo-shell > .todo-rail {
        position: relative !important;
        top: auto !important;
        max-height: none !important;
        overflow: visible !important;
        width: 100% !important;
        padding: 10px !important;
        border-radius: 18px !important;
    }

    .todo-rail {
        display: grid !important;
        gap: 8px !important;
    }

    .todo-view {
        min-height: 44px !important;
        padding: 10px 12px !important;
        font-size: 14px !important;
    }

    .todo-projects-title {
        margin-top: 12px !important;
    }

    .todo-collapse summary {
        min-height: 44px !important;
    }

    .todo-main {
        width: 100% !important;
        min-width: 0 !important;
        border-radius: 18px !important;
        padding: 10px !important;
    }

    .todo-toolbar {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .todo-toolbar input[type="search"],
    .todo-toolbar button,
    .todo-toolbar a {
        width: 100% !important;
        min-height: 44px !important;
    }

    .todo-list-v1 {
        display: grid !important;
        gap: 10px !important;
    }

    .todo-list-v1 .todo-row {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) !important;
        gap: 10px !important;
        padding: 12px !important;
        border-radius: 16px !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .todo-list-v1 .todo-row-body {
        min-width: 0 !important;
        width: 100% !important;
    }

    .todo-row-title {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .todo-row-title strong {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        line-height: 1.25 !important;
        font-size: 15px !important;
    }

    .todo-priority {
        width: fit-content !important;
    }

    .todo-row p {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        font-size: 13px !important;
    }

    .todo-meta {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .todo-meta span {
        font-size: 12px !important;
        max-width: 100% !important;
    }

    .todo-check {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
    }

    .todo-list-v1 .todo-row.selected .todo-row-expanded {
        grid-column: 1 / -1 !important;
        padding: 8px 0 0 0 !important;
    }

    .todo-inline-checklist {
        border-radius: 14px !important;
        padding: 12px !important;
    }

    .todo-inline-checklist-head {
        align-items: flex-start !important;
    }

    .todo-subtodo-list.inline .todo-subtodo-row {
        grid-template-columns: auto minmax(0, 1fr) auto !important;
        padding: 10px !important;
    }

    .todo-subtodo-form.inline {
        grid-template-columns: 1fr !important;
    }

    .todo-subtodo-form.inline input,
    .todo-subtodo-form.inline button {
        min-height: 44px !important;
        width: 100% !important;
    }

    .todo-detail {
        width: 100% !important;
        min-width: 0 !important;
        border-radius: 18px !important;
        padding: 12px !important;
    }

    .todo-detail-head,
    .todo-detail-hero {
        display: grid !important;
        gap: 12px !important;
    }

    .todo-detail-hero h2 {
        font-size: 22px !important;
        line-height: 1.15 !important;
        white-space: normal !important;
    }

    .todo-hero-badges {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .todo-people-card,
    .todo-attachments-card,
    .todo-comments,
    .todo-timeline,
    .todo-edit-details {
        width: 100% !important;
        min-width: 0 !important;
    }

    .todo-attachment-row {
        display: grid !important;
        gap: 10px !important;
    }

    .todo-attachment-main {
        min-width: 0 !important;
    }

    .todo-attachment-actions {
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }

    .todo-comment-form textarea,
    .todo-comment-form button {
        width: 100% !important;
    }

    .todo-timeline-pager {
        display: grid !important;
        grid-template-columns: 1fr !important;
        text-align: center !important;
    }

    .todo-create-panel {
        align-items: stretch !important;
        padding: 12px !important;
        overflow-y: auto !important;
    }

    .todo-create-card {
        width: 100% !important;
        max-height: none !important;
        border-radius: 18px !important;
    }
}

.mobile-nav-toggle {
    display: none;
}

@media (max-width: 820px) {
    .mobile-nav-toggle {
        position: sticky;
        top: 0;
        z-index: 300;
        display: flex;
        width: 100%;
        height: 48px;
        align-items: center;
        justify-content: center;
        border: 0;
        background: #0f172a;
        color: #fff;
        font-weight: 900;
        font-size: 15px;
    }

    body.mobile-nav-open .nav {
        display: flex !important;
        margin-top: 14px;
    }

    body.mobile-nav-open .sidebar {
        position: relative !important;
        z-index: 250;
    }

    body.mobile-nav-open .sidebar .nav {
        display: flex !important;
    }
}

/* Todo mobile rail compact fix */
@media (max-width: 820px) {
    .todo-app .todo-shell > .todo-rail {
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 8px !important;
        border-radius: 16px !important;
        max-height: none !important;
        scrollbar-width: none;
    }

    .todo-app .todo-shell > .todo-rail::-webkit-scrollbar {
        display: none;
    }

    .todo-rail > .todo-view {
        flex: 0 0 auto !important;
        min-width: auto !important;
        white-space: nowrap !important;
        padding: 10px 12px !important;
    }

    .todo-rail > .todo-view span {
        white-space: nowrap !important;
    }

    .todo-rail > .todo-view strong {
        margin-left: 8px !important;
    }

    .todo-rail > .todo-side-row,
    .todo-rail > .todo-add-link,
    .todo-rail > .todo-projects-title {
        display: none !important;
    }

    .todo-mobile-section,
    .todo-collapse {
        flex: 0 0 auto !important;
        min-width: 170px !important;
        max-width: 220px !important;
        border-radius: 14px !important;
        background: rgba(15, 23, 42, .42) !important;
        border: 1px solid rgba(148, 163, 184, .14) !important;
    }

    .todo-mobile-section summary,
    .todo-collapse summary {
        min-height: 44px !important;
        padding: 10px 12px !important;
        cursor: pointer !important;
        color: #67e8f9 !important;
        font-weight: 900 !important;
        letter-spacing: .12em !important;
        font-size: 12px !important;
    }

    .todo-mobile-section[open],
    .todo-collapse[open] {
        position: absolute !important;
        left: 12px !important;
        right: 12px !important;
        top: auto !important;
        z-index: 80 !important;
        max-width: none !important;
        background: #0f172a !important;
        box-shadow: 0 24px 70px rgba(0,0,0,.45) !important;
    }

    .todo-mobile-section[open] .todo-side-row,
    .todo-collapse[open] .todo-side-row,
    .todo-mobile-section[open] .todo-add-link,
    .todo-collapse[open] .todo-add-link {
        display: flex !important;
        margin: 6px !important;
    }

    .todo-main {
        margin-top: 0 !important;
    }
}

/* ===========================
   ARES Mobile UI V1
   =========================== */

@media (max-width: 820px) {
    body {
        padding-top: 50px;
        overflow-x: hidden;
    }

    .mobile-nav-toggle {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 500 !important;
        height: 50px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: rgba(2, 8, 23, .96) !important;
        border-bottom: 1px solid rgba(59, 130, 246, .28) !important;
        color: #fff !important;
        font-weight: 900 !important;
        letter-spacing: .02em !important;
    }

    .shell {
        display: block !important;
        min-height: 100vh !important;
    }

    .sidebar {
        position: fixed !important;
        top: 50px !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 82vw !important;
        max-width: 340px !important;
        overflow-y: auto !important;
        transform: translateX(-105%) !important;
        transition: transform .22s ease !important;
        z-index: 450 !important;
        border-right: 1px solid rgba(59, 130, 246, .25) !important;
        border-bottom: 0 !important;
        background: rgba(2, 8, 23, .98) !important;
        padding: 18px !important;
    }

    body.mobile-nav-open .sidebar {
        transform: translateX(0) !important;
    }

    .sidebar .brand {
        justify-content: flex-start !important;
        margin-bottom: 18px !important;
    }

    .sidebar .nav {
        display: flex !important;
    }

    .main {
        width: 100% !important;
        padding: 0 !important;
    }

    .topbar {
        display: flex !important;
        justify-content: flex-end !important;
        min-height: 54px !important;
        padding: 8px 12px !important;
        position: sticky !important;
        top: 50px !important;
        z-index: 250 !important;
    }

    .todo-app {
        padding: 12px !important;
    }

    .todo-header {
        padding: 14px 4px 6px !important;
        margin: 0 !important;
    }

    .todo-header h1 {
        font-size: 26px !important;
    }

    .todo-header .muted {
        display: none !important;
    }

    .todo-header .todo-primary-btn {
        position: fixed !important;
        right: 18px !important;
        bottom: 18px !important;
        z-index: 420 !important;
        width: 58px !important;
        height: 58px !important;
        min-height: 58px !important;
        border-radius: 999px !important;
        padding: 0 !important;
        font-size: 0 !important;
        box-shadow: 0 18px 45px rgba(14, 165, 233, .45) !important;
    }

    .todo-header .todo-primary-btn::before {
        content: "+" !important;
        font-size: 34px !important;
        line-height: 1 !important;
    }

    .todo-shell {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .todo-app .todo-shell > .todo-rail {
        order: 1 !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        max-height: none !important;
        padding: 8px !important;
        border-radius: 18px !important;
        position: sticky !important;
        top: 104px !important;
        z-index: 180 !important;
        scrollbar-width: none !important;
    }

    .todo-app .todo-shell > .todo-rail::-webkit-scrollbar {
        display: none !important;
    }

    .todo-rail > .todo-view {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        min-height: 42px !important;
        border-radius: 14px !important;
    }

    .todo-mobile-section,
    .todo-collapse {
        flex: 0 0 auto !important;
    }

    .todo-main {
        order: 2 !important;
        padding: 10px !important;
        border-radius: 18px !important;
    }

    .todo-detail {
        order: 3 !important;
        padding: 12px !important;
        border-radius: 18px !important;
    }

    .todo-detail-placeholder {
        display: none !important;
    }

    .todo-toolbar {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        margin-bottom: 10px !important;
    }

    .todo-list-v1 .todo-row {
        border-radius: 18px !important;
        padding: 12px !important;
    }

    .todo-row-title strong {
        font-size: 16px !important;
        line-height: 1.25 !important;
    }

    .todo-meta {
        gap: 6px !important;
    }

    .todo-detail-hero h2 {
        font-size: 22px !important;
    }

    .todo-create-panel {
        z-index: 600 !important;
        padding: 12px !important;
        align-items: flex-start !important;
    }

    .todo-create-card {
        margin-top: 20px !important;
        width: 100% !important;
        border-radius: 20px !important;
    }
}

/* Mobile create Todo modal scroll fix */
@media (max-width: 820px) {
    body.todo-create-open {
        overflow: hidden !important;
    }

    .todo-create-panel {
        position: fixed !important;
        inset: 50px 0 0 0 !important;
        height: calc(100dvh - 50px) !important;
        max-height: calc(100dvh - 50px) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        padding: 12px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .todo-create-card {
        width: 100% !important;
        max-height: none !important;
        margin: 0 0 90px 0 !important;
        overflow: visible !important;
    }

    .todo-create-card form {
        display: grid !important;
        gap: 14px !important;
        padding-bottom: 80px !important;
    }

    .todo-create-card input,
    .todo-create-card textarea,
    .todo-create-card select,
    .todo-create-card button {
        min-height: 48px !important;
        font-size: 16px !important;
    }

    .todo-create-card textarea {
        min-height: 110px !important;
    }
}

/* Mobile create Todo labels fix */
@media (max-width: 820px) {
    .todo-label-picker,
    .todo-label-grid,
    .todo-create-labels {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    .todo-label-picker label,
    .todo-label-grid label,
    .todo-create-labels label {
        position: relative !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 8px !important;
        min-height: 42px !important;
        padding: 10px 14px !important;
        border-radius: 999px !important;
        background: rgba(15, 23, 42, .58) !important;
        border: 1px solid rgba(148, 163, 184, .22) !important;
        color: #e5e7eb !important;
        font-weight: 800 !important;
        font-size: 13px !important;
    }

    .todo-label-picker input[type="checkbox"],
    .todo-label-grid input[type="checkbox"],
    .todo-create-labels input[type="checkbox"] {
        position: absolute !important;
        opacity: 0 !important;
        width: 1px !important;
        height: 1px !important;
        pointer-events: none !important;
    }

    .todo-label-picker label:has(input[type="checkbox"]:checked),
    .todo-label-grid label:has(input[type="checkbox"]:checked),
    .todo-create-labels label:has(input[type="checkbox"]:checked) {
        background: linear-gradient(135deg, #2563eb, #06b6d4) !important;
        border-color: rgba(125, 211, 252, .65) !important;
        color: #fff !important;
        box-shadow: 0 12px 28px rgba(14, 165, 233, .25) !important;
    }

    .todo-label-picker label:has(input[type="checkbox"]:checked)::before,
    .todo-label-grid label:has(input[type="checkbox"]:checked)::before,
    .todo-create-labels label:has(input[type="checkbox"]:checked)::before {
        content: "✓";
        font-weight: 900;
    }
}

.todo-create-checklist-add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-top: 10px;
}

.todo-create-checklist-add input {
    width: 100%;
}

.todo-create-checklist-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.todo-create-checklist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, .22);
    background: rgba(15, 23, 42, .58);
    color: #e5e7eb;
    font-weight: 800;
}

.todo-checklist-remove {
    border: 0;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    cursor: pointer;
    background: rgba(239, 68, 68, .16);
    color: #fecaca;
    font-size: 20px;
    line-height: 1;
}

@media (max-width: 820px) {
    .todo-create-checklist-add {
        grid-template-columns: 1fr;
    }

    .todo-create-checklist-add button {
        width: 100%;
    }
}

.todo-inline-edit {
    cursor: text;
    border-radius: 12px;
    transition: background .15s ease, box-shadow .15s ease;
}

.todo-inline-edit:hover {
    background: rgba(59, 130, 246, .10);
    box-shadow: 0 0 0 1px rgba(96, 165, 250, .18);
}

.todo-inline-edit.editing {
    background: rgba(15, 23, 42, .72);
    box-shadow: 0 0 0 1px rgba(96, 165, 250, .32);
}

.todo-inline-edit.saving {
    opacity: .6;
    pointer-events: none;
}

.todo-inline-input {
    width: 100%;
    border: 1px solid rgba(96, 165, 250, .45);
    border-radius: 12px;
    background: rgba(2, 6, 23, .88);
    color: #f8fafc;
    padding: 10px 12px;
    font: inherit;
    outline: none;
}

textarea.todo-inline-input {
    min-height: 110px;
    resize: vertical;
}

.todo-inline-select {
    appearance: none;
    border: 0;
    cursor: pointer;
    font: inherit;
}

.todo-inline-select::after {
    content: " ▾";
    opacity: .75;
}

.todo-inline-select.saving {
    opacity: .55;
    pointer-events: none;
}

.todo-inline-select-menu {
    position: fixed;
    z-index: 9999;
    min-width: 210px;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, .22);
    background: rgba(2, 6, 23, .96);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
    backdrop-filter: blur(18px);
}

.todo-inline-select-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 4px 10px;
    color: #e5e7eb;
}

.todo-inline-select-head button {
    border: 0;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    cursor: pointer;
    background: rgba(148, 163, 184, .12);
    color: #e5e7eb;
    font-size: 20px;
    line-height: 1;
}

.todo-inline-select-list {
    display: grid;
    gap: 6px;
}

.todo-inline-select-option {
    width: 100%;
    border: 0;
    border-radius: 13px;
    padding: 11px 12px;
    cursor: pointer;
    text-align: left;
    background: rgba(15, 23, 42, .72);
    color: #e5e7eb;
    font-weight: 800;
}

.todo-inline-select-option:hover,
.todo-inline-select-option.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, .95), rgba(6, 182, 212, .86));
    color: #fff;
}

@media (max-width: 820px) {
    body.todo-inline-sheet-open {
        overflow: hidden !important;
    }

    .todo-inline-select-menu.mobile-sheet {
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-height: 75dvh;
        overflow-y: auto;
        border-radius: 26px 26px 0 0;
        padding: 18px;
        box-shadow: 0 -24px 70px rgba(0, 0, 0, .55);
    }

    .todo-inline-select-menu.mobile-sheet::before {
        content: "";
        display: block;
        width: 46px;
        height: 5px;
        border-radius: 999px;
        margin: 0 auto 14px;
        background: rgba(148, 163, 184, .5);
    }

    .todo-inline-select-menu.mobile-sheet .todo-inline-select-head {
        padding-bottom: 14px;
        font-size: 18px;
    }

    .todo-inline-select-menu.mobile-sheet .todo-inline-select-option {
        min-height: 52px;
        font-size: 16px;
        border-radius: 16px;
    }
}

.todo-inline-datetime-menu {
    position: fixed;
    z-index: 9999;
    min-width: 260px;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, .22);
    background: rgba(2, 6, 23, .96);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
    backdrop-filter: blur(18px);
}

.todo-inline-datetime-input {
    width: 100%;
    border: 1px solid rgba(96, 165, 250, .45);
    border-radius: 14px;
    background: rgba(15, 23, 42, .86);
    color: #f8fafc;
    padding: 12px;
    font-weight: 800;
}

.todo-inline-datetime-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

@media (max-width: 820px) {
    .todo-inline-datetime-menu.mobile-sheet {
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-height: 75dvh;
        overflow-y: auto;
        border-radius: 26px 26px 0 0;
        padding: 18px;
        box-shadow: 0 -24px 70px rgba(0, 0, 0, .55);
    }

    .todo-inline-datetime-menu.mobile-sheet::before {
        content: "";
        display: block;
        width: 46px;
        height: 5px;
        border-radius: 999px;
        margin: 0 auto 14px;
        background: rgba(148, 163, 184, .5);
    }

    .todo-inline-datetime-input {
        min-height: 54px;
        font-size: 16px;
    }

    .todo-inline-datetime-actions .todo-primary-btn {
        width: 100%;
        min-height: 52px;
    }
}

.todo-update-form-hidden {
    display: none !important;
}

.todo-person-assign {
    width: 100%;
    border: 1px solid rgba(59, 130, 246, .46) !important;
    cursor: pointer !important;
    text-align: left !important;
}

.todo-person-assign::after {
    content: " ▾";
    margin-left: auto;
    opacity: .75;
    font-size: 11px;
}

.todo-person-assign:hover {
    background: rgba(37, 99, 235, .26) !important;
    box-shadow: 0 0 0 1px rgba(96, 165, 250, .25);
}

.todo-hero-badges {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 7px !important;
    overflow: visible !important;
}

.todo-hero-badges .todo-inline-select,
.todo-hero-badges .todo-inline-datetime,
.todo-hero-badges span {
    max-width: 100% !important;
}

@media (max-width: 820px) {
    .todo-hero-badges .todo-inline-datetime {
        font-size: 10px !important;
        padding: 5px 8px !important;
    }

    .todo-person-assign {
        min-height: 58px;
    }
}

.todo-subtodo-inline-edit {
    cursor: text;
    border-radius: 10px;
    padding: 4px 6px;
    margin-left: -6px;
    transition: background .15s ease, box-shadow .15s ease;
}

.todo-subtodo-inline-edit:hover {
    background: rgba(59, 130, 246, .10);
    box-shadow: 0 0 0 1px rgba(96, 165, 250, .18);
}

.todo-subtodo-inline-edit.editing {
    display: block;
    flex: 1;
    background: rgba(15, 23, 42, .72);
    box-shadow: 0 0 0 1px rgba(96, 165, 250, .32);
}

.todo-subtodo-inline-edit.saving {
    opacity: .55;
    pointer-events: none;
}

.todo-subtodo-inline-input {
    width: 100%;
    border: 1px solid rgba(96, 165, 250, .45);
    border-radius: 10px;
    background: rgba(2, 6, 23, .88);
    color: #f8fafc;
    padding: 8px 10px;
    font: inherit;
    font-weight: 800;
    outline: none;
}

@media (max-width: 820px) {
    .todo-subtodo-inline-edit.editing {
        width: 100%;
    }

    .todo-subtodo-inline-input {
        min-height: 46px;
        font-size: 16px;
    }
}

.todo-subtodo-drag {
    cursor: grab;
    color: #94a3b8;
    font-weight: 900;
    padding: 0 4px;
    user-select: none;
}

.todo-subtodo-row.dragging {
    opacity: .45;
    transform: scale(.99);
}

.todo-sortable-subtodos.saving {
    opacity: .65;
    pointer-events: none;
}

.todo-subtodo-row[draggable="true"] {
    touch-action: none;
}

@media (max-width: 820px) {
    .todo-subtodo-drag {
        font-size: 18px;
        padding: 6px 8px;
    }
}

/* Fix Todo checklist DnD layout */
.todo-subtodo-list.inline {
    display: grid !important;
    gap: 8px !important;
}

.todo-subtodo-list.inline .todo-subtodo-row {
    display: grid !important;
    grid-template-columns: 28px 28px minmax(0, 1fr) 34px !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 48px !important;
    padding: 10px 12px !important;
}

.todo-subtodo-list.inline .todo-subtodo-row form {
    margin: 0 !important;
}

.todo-subtodo-list.inline .todo-subtodo-row .todo-subtodo-title {
    min-width: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    line-height: 1.35 !important;
}

.todo-subtodo-list.inline .todo-subtodo-row .todo-subtodo-delete {
    margin: 0 !important;
}

.todo-subtodo-drag {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 32px !important;
    cursor: grab !important;
}

.todo-subtodo-row.dragging {
    opacity: .55 !important;
}

@media (max-width: 820px) {
    .todo-subtodo-list.inline .todo-subtodo-row {
        grid-template-columns: 34px 30px minmax(0, 1fr) 38px !important;
        min-height: 54px !important;
    }
}

/* Todo V3 checklist row layout fix */
.todo-inline-checklist {
    overflow: hidden;
}

.todo-subtodo-list.inline {
    display: grid !important;
    gap: 8px !important;
}

.todo-subtodo-list.inline .todo-subtodo-row {
    display: grid !important;
    grid-template-columns: 24px 28px minmax(0, 1fr) 34px !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 52px !important;
    padding: 10px 12px !important;
}

.todo-subtodo-list.inline .todo-subtodo-row form {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
}


.todo-subtodo-list.inline .todo-subtodo-title {
    display: block !important;
    min-width: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 4px 0 !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    word-break: break-word !important;
}

.todo-subtodo-list.inline .todo-subtodo-delete {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.todo-subtodo-drag {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 22px !important;
    height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: grab !important;
    color: #94a3b8 !important;
    font-size: 18px !important;
    line-height: 1 !important;
}

.todo-subtodo-row.dragging {
    opacity: .55 !important;
}

@media (max-width: 820px) {
    .todo-subtodo-list.inline .todo-subtodo-row {
        grid-template-columns: 30px 30px minmax(0, 1fr) 38px !important;
        min-height: 58px !important;
        padding: 10px !important;
    }

    .todo-subtodo-drag {
        width: 28px !important;
        height: 38px !important;
    }

    .todo-subtodo-list.inline .todo-subtodo-title {
        font-size: 15px !important;
    }
}

/* FINAL override Todo V3 checklist DnD layout */
.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-list.inline.todo-sortable-subtodos {
    display: grid !important;
    gap: 8px !important;
}

.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-list.inline.todo-sortable-subtodos > .todo-subtodo-row {
    display: grid !important;
    grid-template-columns: 22px 24px minmax(0, 1fr) 28px !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 44px !important;
    padding: 8px 10px !important;
}

.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-row > .todo-subtodo-drag {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 22px !important;
    height: 28px !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 15px !important;
    line-height: 1 !important;
    color: #94a3b8 !important;
}

.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-row > form {
    width: 24px !important;
    min-width: 24px !important;
    margin: 0 !important;
    display: flex !important;
    justify-content: center !important;
}


.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-row > .todo-subtodo-title {
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 2px 0 !important;
    display: block !important;
    line-height: 1.3 !important;
    text-align: left !important;
}

.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-row .todo-subtodo-delete {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    padding: 0 !important;
    margin: 0 !important;
}

@media (max-width: 820px) {
    .todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-list.inline.todo-sortable-subtodos > .todo-subtodo-row {
        grid-template-columns: 28px 28px minmax(0, 1fr) 34px !important;
        min-height: 52px !important;
        padding: 9px 10px !important;
    }
}

/* Drag handle stile Notion / ClickUp */
.todo-subtodo-drag{
    display:grid !important;
    grid-template-columns:repeat(2,4px);
    grid-template-rows:repeat(3,4px);
    gap:3px;
    width:18px;
    height:18px;
    align-content:center;
    justify-content:center;
    cursor:grab;
    opacity:.65;
    transition:.15s;
}

.todo-subtodo-drag:hover{
    opacity:1;
    transform:scale(1.08);
}

.todo-subtodo-drag:active{
    cursor:grabbing;
}

.todo-subtodo-drag span{
    width:4px;
    height:4px;
    border-radius:50%;
    background:#94a3b8;
}

.todo-subtodo-row.dragging .todo-subtodo-drag{
    opacity:1;
}


.todo-subtodo-menu-btn {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    background: rgba(148, 163, 184, .10);
    color: #cbd5e1;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.todo-subtodo-menu-btn:hover {
    background: rgba(59, 130, 246, .20);
    color: #f8fafc;
}

.todo-subtodo-menu {
    position: fixed;
    z-index: 10000;
    min-width: 220px;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, .22);
    background: rgba(2, 6, 23, .96);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
    backdrop-filter: blur(18px);
}

.todo-subtodo-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 4px 10px;
    color: #e5e7eb;
}

.todo-subtodo-menu-head button {
    border: 0;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    cursor: pointer;
    background: rgba(148, 163, 184, .12);
    color: #e5e7eb;
    font-size: 20px;
    line-height: 1;
}

.todo-subtodo-menu-list {
    display: grid;
    gap: 6px;
}

.todo-subtodo-menu-action {
    width: 100%;
    border: 0;
    border-radius: 13px;
    padding: 11px 12px;
    cursor: pointer;
    text-align: left;
    background: rgba(15, 23, 42, .72);
    color: #e5e7eb;
    font-weight: 800;
}

.todo-subtodo-menu-action:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, .95), rgba(6, 182, 212, .86));
    color: #fff;
}

.todo-subtodo-menu-action.danger {
    color: #fecaca;
}

.todo-subtodo-menu-action.danger:hover {
    background: rgba(239, 68, 68, .88);
    color: #fff;
}

@media (max-width: 820px) {
    .todo-subtodo-menu.mobile-sheet {
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-height: 75dvh;
        overflow-y: auto;
        border-radius: 26px 26px 0 0;
        padding: 18px;
        box-shadow: 0 -24px 70px rgba(0, 0, 0, .55);
    }

    .todo-subtodo-menu.mobile-sheet::before {
        content: "";
        display: block;
        width: 46px;
        height: 5px;
        border-radius: 999px;
        margin: 0 auto 14px;
        background: rgba(148, 163, 184, .5);
    }

    .todo-subtodo-menu.mobile-sheet .todo-subtodo-menu-head {
        padding-bottom: 14px;
        font-size: 18px;
    }

    .todo-subtodo-menu.mobile-sheet .todo-subtodo-menu-action {
        min-height: 52px;
        font-size: 16px;
        border-radius: 16px;
    }
}

/* Todo V3 final checklist polish */
.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-list.inline.todo-sortable-subtodos > .todo-subtodo-row {
    grid-template-columns: 28px 28px minmax(0, 1fr) 34px !important;
    align-items: center !important;
}

.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-row > form:first-of-type {
    align-self: center !important;
}


.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-row > .todo-subtodo-drag {
    display: grid !important;
    grid-template-columns: repeat(2, 4px) !important;
    grid-template-rows: repeat(3, 4px) !important;
    gap: 3px !important;
    width: 24px !important;
    height: 28px !important;
    place-content: center !important;
    border-radius: 10px !important;
    opacity: .72 !important;
}

.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-row > .todo-subtodo-drag span {
    display: block !important;
    width: 4px !important;
    height: 4px !important;
    border-radius: 999px !important;
    background: rgba(203, 213, 225, .75) !important;
}

.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-row > .todo-subtodo-drag:hover {
    background: rgba(59, 130, 246, .14) !important;
    opacity: 1 !important;
}

.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-row > .todo-subtodo-title {
    align-self: center !important;
}

@media (max-width: 820px) {
    .todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-list.inline.todo-sortable-subtodos > .todo-subtodo-row {
        grid-template-columns: 32px 30px minmax(0, 1fr) 38px !important;
    }
}

/* Fix definitivo checkbox checklist: niente deformazioni da stili globali */
.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-row > form:first-of-type {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    margin: 0 !important;
    position: static !important;
}



/* Checkbox checklist separata dagli stili globali .todo-check */
.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-check {
    appearance: none !important;
    -webkit-appearance: none !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 999px !important;
    border: 2px solid rgba(148, 163, 184, .9) !important;
    background: transparent !important;
    color: #fff !important;
    line-height: 1 !important;
    font-size: 12px !important;
    cursor: pointer !important;
    flex: 0 0 18px !important;
    position: static !important;
    transform: none !important;
}

.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-check.done {
    background: linear-gradient(135deg, #2563eb, #06b6d4) !important;
    border-color: transparent !important;
    font-weight: 900 !important;
}

.todo-list-v1 .todo-row-expanded .todo-inline-checklist form:has(.todo-subtodo-check) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Todo V3 checklist final alignment */
.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-list.inline.todo-sortable-subtodos > .todo-subtodo-row {
    grid-template-columns: 28px 28px minmax(0, 1fr) 44px !important;
    align-items: center !important;
}

.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-row > form:has(.todo-subtodo-check) {
    display: grid !important;
    place-items: center !important;
    align-self: center !important;
    justify-self: center !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    margin: 0 !important;
}

.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-check {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 999px !important;
    padding: 0 !important;
    margin: 0 !important;
    align-self: center !important;
    justify-self: center !important;
    vertical-align: middle !important;
}

.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-title {
    align-self: center !important;
}

.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-menu-btn {
    justify-self: end !important;
    align-self: center !important;
}

@media (max-width: 820px) {
    .todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-list.inline.todo-sortable-subtodos > .todo-subtodo-row {
        grid-template-columns: 32px 30px minmax(0, 1fr) 44px !important;
    }
}

/* FINAL checkbox checklist alignment - dedicated form class */
.todo-subtodo-row {
    align-items: center !important;
}

.todo-subtodo-check-form {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 0 !important;
}

.todo-subtodo-check-form .todo-subtodo-check {
    box-sizing: border-box !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    border: 2px solid rgba(148, 163, 184, .95) !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    position: static !important;
    transform: none !important;
}

.todo-subtodo-check-form .todo-subtodo-check.done {
    background: linear-gradient(135deg, #2563eb, #06b6d4) !important;
    border-color: transparent !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 900 !important;
}

.todo-subtodo-row > .todo-subtodo-drag,
.todo-subtodo-row > .todo-subtodo-title,
.todo-subtodo-row > .todo-subtodo-menu-btn {
    align-self: center !important;
}

/* Todo checklist V3 hard reset */
.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-row {
    display: grid !important;
    grid-template-columns: 28px 28px minmax(0, 1fr) 44px !important;
    align-items: center !important;
}

.todo-subtodo-check-cell {
    width: 28px !important;
    height: 28px !important;
    display: grid !important;
    place-items: center !important;
}

.todo-subtodo-check-cell form {
    width: 28px !important;
    height: 28px !important;
    display: grid !important;
    place-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

.todo-subtodo-check-cell .todo-subtodo-check {
    all: unset !important;
    box-sizing: border-box !important;
    width: 18px !important;
    height: 18px !important;
    border-radius: 999px !important;
    border: 2px solid rgba(148, 163, 184, .95) !important;
    display: grid !important;
    place-items: center !important;
    cursor: pointer !important;
}

.todo-subtodo-check-cell .todo-subtodo-check.done {
    background: linear-gradient(135deg, #2563eb, #06b6d4) !important;
    border-color: transparent !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 900 !important;
}

/* Final micro alignment for checklist check circle */
.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-check-cell {
    transform: translateY(-4px) !important;
}

.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-drag {
    transform: translateY(-1px) !important;
}

.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-menu-btn {
    transform: translateY(-2px) !important;
}

/* Todo V3 checklist definitive flex alignment */
.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-list.inline.todo-sortable-subtodos > .todo-subtodo-row {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    min-height: 58px !important;
    padding: 12px 16px !important;
}

.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-drag {
    flex: 0 0 22px !important;
    transform: none !important;
}

.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-check-cell {
    flex: 0 0 24px !important;
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transform: none !important;
}

.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-check-cell form {
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-check {
    width: 18px !important;
    height: 18px !important;
    flex: 0 0 18px !important;
}

.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-title {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    align-self: center !important;
}

.todo-list-v1 .todo-row-expanded .todo-inline-checklist .todo-subtodo-menu-btn {
    flex: 0 0 42px !important;
    margin-left: auto !important;
    transform: none !important;
}

/* Todo checklist row v3 - simple dedicated layout */
.todo-checklist-row-v3 {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    min-height: 58px !important;
    padding: 12px 16px !important;
}

.todo-checklist-row-v3 .todo-subtodo-drag {
    flex: 0 0 22px !important;
    width: 22px !important;
    transform: none !important;
}

.todo-checklist-row-v3 .todo-subtodo-check-cell {
    flex: 0 0 24px !important;
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transform: none !important;
}

.todo-checklist-row-v3 .todo-subtodo-check-form {
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.todo-checklist-row-v3 .todo-subtodo-check {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    border-radius: 999px !important;
    transform: none !important;
}

.todo-checklist-row-v3 .todo-subtodo-title {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    align-self: center !important;
}

.todo-checklist-row-v3 .todo-subtodo-menu-btn {
    flex: 0 0 42px !important;
    margin-left: auto !important;
    transform: none !important;
}

/* Notification dropdown UX refinement */
.notification-dropdown {
  width: 360px !important;
}

.notification-dropdown-list {
  max-height: 310px !important;
  overflow-y: auto !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(96, 165, 250, .7) rgba(15, 23, 42, .45);
}

.notification-dropdown-list::-webkit-scrollbar {
  width: 8px;
}

.notification-dropdown-list::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, .45);
  border-radius: 999px;
}

.notification-dropdown-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #2563eb, #38bdf8);
  border-radius: 999px;
}

.notification-dropdown-item {
  padding: 10px 12px !important;
  gap: 10px !important;
}

.notification-dropdown-item strong {
  font-size: 12px !important;
}

.notification-dropdown-item p {
  font-size: 11px !important;
  line-height: 1.35 !important;
  margin: 3px 0 !important;
}

.notification-dropdown-item small {
  font-size: 10px !important;
}

.notification-dropdown-foot {
  gap: 12px !important;
}

/* Fix checklist inline rename layout */
.todo-checklist-row-v3 .todo-subtodo-inline-edit {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: calc(100% - 110px) !important;
}

.todo-checklist-row-v3 .todo-subtodo-inline-input {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.todo-checklist-row-v3 .todo-subtodo-menu-btn {
    position: relative !important;
    z-index: 5 !important;
    flex: 0 0 34px !important;
    width: 34px !important;
    min-width: 34px !important;
}

/* ===== Sidebar Todo - sezione Progetti ===== */

.todo-sidebar-group-toggle{
    display:flex;
    align-items:center;
    justify-content:space-between;
    width:100%;
    gap:8px;
    white-space:nowrap;
}

.todo-sidebar-group-toggle .label{
    display:flex;
    align-items:center;
    gap:8px;
    flex:1;
    min-width:0;
    white-space:nowrap;
}

.todo-sidebar-group-toggle .chevron{
    width:14px;
    flex:0 0 14px;
    text-align:center;
    transition:transform .18s ease;
}

.todo-sidebar-group-toggle[aria-expanded="true"] .chevron{
    transform:rotate(90deg);
}

.todo-sidebar-group-toggle .count{
    flex:0 0 auto;
    margin-left:auto;
}

/* Todo detail hero controls - professional card layout */
.todo-detail-hero .todo-hero-badges {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin-top: 18px !important;
    padding-top: 16px !important;
    border-top: 1px solid rgba(148, 163, 184, .18) !important;
}

.todo-detail-hero .todo-hero-badges > button,
.todo-detail-hero .todo-hero-badges > span {
    min-height: 42px !important;
    width: 100% !important;
    justify-content: flex-start !important;
    align-items: center !important;
    padding: 10px 13px !important;
    border-radius: 14px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    letter-spacing: .01em !important;
    line-height: 1.2 !important;
    border: 1px solid rgba(148, 163, 184, .22) !important;
    background: rgba(15, 23, 42, .62) !important;
    color: rgba(241, 245, 249, .95) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04) !important;
}

.todo-detail-hero .todo-hero-badges > button:hover {
    transform: translateY(-1px) !important;
    border-color: rgba(59, 130, 246, .55) !important;
    background: rgba(30, 41, 59, .82) !important;
}

.todo-detail-hero .todo-hero-badges .todo-hero-priority.p1 {
    background: rgba(127, 29, 29, .45) !important;
    border-color: rgba(248, 113, 113, .42) !important;
}

.todo-detail-hero .todo-hero-badges .todo-hero-priority.p2 {
    background: rgba(124, 45, 18, .42) !important;
    border-color: rgba(251, 146, 60, .4) !important;
}

.todo-detail-hero .todo-hero-badges .todo-hero-priority.p3,
.todo-detail-hero .todo-hero-badges .todo-hero-priority.p4 {
    background: rgba(30, 41, 59, .7) !important;
}

.todo-detail-hero .todo-hero-status.open {
    background: rgba(30, 64, 175, .32) !important;
    border-color: rgba(96, 165, 250, .4) !important;
}

.todo-detail-hero .todo-hero-status.done {
    background: rgba(20, 83, 45, .35) !important;
    border-color: rgba(74, 222, 128, .35) !important;
}

.todo-detail-hero .todo-hero-project,
.todo-detail-hero .todo-hero-label {
    grid-column: span 2 !important;
}

.todo-detail-hero h2 {
    margin-bottom: 10px !important;
}

.todo-detail-hero .todo-hero-description {
    max-width: 100% !important;
    margin-bottom: 0 !important;
    padding: 14px 16px !important;
    border-radius: 16px !important;
    background: rgba(15, 23, 42, .48) !important;
    border: 1px solid rgba(148, 163, 184, .16) !important;
}

@media (max-width: 820px) {
    .todo-detail-hero .todo-hero-badges {
        grid-template-columns: 1fr !important;
    }

    .todo-detail-hero .todo-hero-project,
    .todo-detail-hero .todo-hero-label {
        grid-column: auto !important;
    }
}

/* ===== Todo hero title & description ===== */

.todo-detail-hero h2.todo-inline-edit{
    display:block !important;
    margin:0 0 18px !important;
    font-size:2.6rem !important;
    font-weight:800 !important;
    line-height:1.08 !important;
    letter-spacing:-.03em !important;
    cursor:text !important;
}

.todo-detail-hero .todo-hero-description{
    display:block !important;
    margin:0 !important;
    padding:18px 20px !important;
    background:rgba(15,23,42,.58) !important;
    border:1px solid rgba(148,163,184,.16) !important;
    border-radius:16px !important;
    font-size:15px !important;
    line-height:1.65 !important;
    color:#e5e7eb !important;
    cursor:text !important;
    min-height:78px !important;
}

.todo-detail-hero .todo-hero-description:hover{
    border-color:rgba(59,130,246,.35) !important;
    background:rgba(15,23,42,.72) !important;
}

.todo-detail-hero .todo-hero-description .muted{
    color:#94a3b8 !important;
    font-style:italic !important;
}

/* priorità uguale allo stato */
.todo-detail-hero .todo-hero-priority{
    background:rgba(30,64,175,.32) !important;
    border-color:rgba(96,165,250,.4) !important;
    color:rgba(241,245,249,.95) !important;
}

/* Uniforma completamente il bottone Priorità */
.todo-detail-hero .todo-hero-priority,
.todo-detail-hero .todo-hero-status{
    display:flex !important;
    align-items:center !important;
    justify-content:flex-start !important;
    width:100% !important;
    min-height:44px !important;
    height:44px !important;
    padding:0 14px !important;
    border-radius:12px !important;
    font-size:13px !important;
    font-weight:700 !important;
    line-height:44px !important;
    box-sizing:border-box !important;
    white-space:nowrap !important;
}

.todo-detail-hero .todo-hero-priority.p1,
.todo-detail-hero .todo-hero-priority.p2,
.todo-detail-hero .todo-hero-priority.p3,
.todo-detail-hero .todo-hero-priority.p4{
    min-height:44px !important;
    height:44px !important;
    padding:0 14px !important;
    border-radius:12px !important;
}

/* Fix definitivo: Priorità e Stato stessa dimensione */
.todo-detail-hero .todo-hero-badges{
    align-items:stretch !important;
}

.todo-detail-hero .todo-hero-badges .todo-hero-priority,
.todo-detail-hero .todo-hero-badges .todo-hero-status{
    grid-column:auto !important;
    display:flex !important;
    align-items:center !important;
    justify-content:flex-start !important;
    width:100% !important;
    height:48px !important;
    min-height:48px !important;
    max-height:48px !important;
    padding:0 16px !important;
    margin:0 !important;
    border-radius:14px !important;
    font-size:13px !important;
    font-weight:800 !important;
    line-height:1 !important;
    box-sizing:border-box !important;
    white-space:nowrap !important;
    vertical-align:top !important;
}

.todo-detail-hero .todo-hero-badges .todo-hero-priority.p1,
.todo-detail-hero .todo-hero-badges .todo-hero-priority.p2,
.todo-detail-hero .todo-hero-badges .todo-hero-priority.p3,
.todo-detail-hero .todo-hero-badges .todo-hero-priority.p4{
    height:48px !important;
    min-height:48px !important;
    max-height:48px !important;
    padding:0 16px !important;
    margin:0 !important;
    font-size:13px !important;
    line-height:1 !important;
}

/* Final Todo hero badge sizing */
.todo-detail-hero .todo-hero-badges > .todo-hero-priority,
.todo-detail-hero .todo-hero-badges > .todo-hero-status{
    display:flex !important;
    align-items:center !important;
    justify-content:flex-start !important;
    width:100% !important;
    height:48px !important;
    min-height:48px !important;
    max-height:48px !important;
    padding:0 16px !important;
    border-radius:14px !important;
    font-size:13px !important;
    font-weight:800 !important;
    line-height:1 !important;
    box-sizing:border-box !important;
    max-width:none !important;
}

.todo-detail-hero .todo-hero-badges > .todo-hero-priority::after{
    content:" ▾" !important;
    margin-left:6px !important;
    font-size:11px !important;
    opacity:.7 !important;
}

/* ===== Todo detail: labels/progetto più professionali ===== */

.todo-detail-hero .todo-hero-project{
    grid-column:1 / -1 !important;
    height:46px !important;
    min-height:46px !important;
    border-radius:14px !important;
    background:rgba(15,23,42,.50) !important;
    border:1px solid rgba(148,163,184,.22) !important;
}

.todo-detail-hero .todo-hero-label.todo-inline-labels{
    grid-column:1 / -1 !important;
    width:auto !important;
    min-height:34px !important;
    height:auto !important;
    padding:8px 12px !important;
    border-radius:999px !important;
    justify-self:flex-start !important;
    display:inline-flex !important;
    align-items:center !important;
    gap:6px !important;
    background:rgba(88,28,135,.45) !important;
    border:1px solid rgba(168,85,247,.35) !important;
    color:#f5d0fe !important;
    font-size:12px !important;
    font-weight:800 !important;
    max-width:100% !important;
}

.todo-detail-hero .todo-hero-label.todo-inline-labels:hover{
    background:rgba(107,33,168,.62) !important;
    border-color:rgba(216,180,254,.45) !important;
}

/* Menu etichette più compatto */
.todo-inline-labels-menu{
    min-width:220px !important;
    max-width:260px !important;
}

.todo-inline-labels-menu .todo-inline-select-option{
    min-height:36px !important;
    padding:8px 11px !important;
    border-radius:10px !important;
    font-size:12px !important;
}

.todo-inline-labels-menu .todo-inline-datetime-actions{
    gap:8px !important;
}

.todo-inline-labels-menu .todo-inline-datetime-actions button{
    min-height:38px !important;
    padding:0 13px !important;
    border-radius:11px !important;
    font-size:12px !important;
}

/* Upload allegati più ordinato */
.todo-attachment-form{
    display:grid !important;
    grid-template-columns:1fr auto !important;
    gap:8px !important;
    align-items:center !important;
}

.todo-attachment-form input[type="file"]{
    min-width:0 !important;
    max-width:100% !important;
}

.todo-attachment-form button{
    min-height:36px !important;
    height:36px !important;
    padding:0 14px !important;
    border-radius:10px !important;
    font-size:12px !important;
}

@media (max-width:820px){
    .todo-detail-fields-v4{
        grid-template-columns:1fr;
    }

    .todo-detail-title-v4{
        font-size:2rem !important;
    }
}

/* ===== Todo detail v5: central content + right support column ===== */

.todo-detail.open{
    padding:0 !important;
    overflow:hidden !important;
}

.todo-detail-layout-v5{
    display:grid;
    grid-template-columns:minmax(0,1fr) 330px;
    gap:18px;
    height:100%;
    min-height:0;
    padding:18px;
}

.todo-detail-content-v5,
.todo-detail-sidebar-v5{
    min-width:0;
    min-height:0;
    overflow:auto;
    scrollbar-width:thin;
}

.todo-detail-content-v5{
    display:flex;
    flex-direction:column;
    gap:14px;
}

.todo-detail-sidebar-v5{
    display:flex;
    flex-direction:column;
    gap:14px;
    padding-left:2px;
}

.todo-section-card-v5{
    border-radius:22px;
    background:rgba(15,23,42,.62);
    border:1px solid rgba(148,163,184,.16);
    padding:18px;
}

.todo-section-title-v5{
    display:flex;
    align-items:center;
    gap:9px;
    margin-bottom:14px;
    color:#e2e8f0;
    font-size:13px;
    font-weight:900;
    letter-spacing:.03em;
}

.todo-detail-sidebar-v5 h3,
.todo-detail-sidebar-v5 .todo-people-title{
    margin-top:0 !important;
}

.todo-detail-sidebar-v5 .todo-comment-form textarea{
    min-height:76px !important;
}

.todo-detail-sidebar-v5 .todo-timeline-list{
    max-height:none !important;
}

@media (max-width:1180px){
    .todo-detail-layout-v5{
        grid-template-columns:1fr;
    }

    .todo-detail-sidebar-v5{
        padding-left:0;
    }
}

@media (max-width:820px){
    .todo-detail-layout-v5{
        padding:12px;
        gap:12px;
    }

    .todo-detail-layout-v5 .todo-detail-hero-v4,
    .todo-section-card-v5{
        border-radius:18px !important;
        padding:16px !important;
    }
}

/* ===== ARES Todo version footer ===== */

.todo-version-footer{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    margin:18px auto 0;
    padding:8px 12px;
    color:#64748b;
    font-size:11px;
    font-weight:700;
}

.todo-version-footer strong{
    color:#94a3b8;
    font-weight:900;
}

.todo-version-footer small{
    color:#475569;
}
