:root{
  --bg:#0f172a;
  --panel:#111c33;
  --panel2:#0b1222;
  --border:#263450;
  --text:#e5edf8;
  --muted:#94a3b8;
  --accent:#38bdf8;
  --green:#22c55e;
  --yellow:#E6F101;
  --yellow-text:#111827;
  --orange:#f97316;
  --red:#ef4444;
  --purple:#a855f7;
  --gray:#64748b;
  --blue:#60a5fa;
  --app-bg:radial-gradient(circle at top left,#1e3a5f 0,#0f172a 38%,#070b14 100%);
  --topbar-bg:rgba(7,11,20,.84);
  --input-bg:#07111f;
  --brand-bg:#07111f;
  --panel-gradient:linear-gradient(180deg,rgba(17,28,51,.94),rgba(11,18,34,.94));
  --kpi-bg:#091425;
  --task-bg:rgba(8,20,38,.72);
  --task-hover-bg:rgba(15,35,61,.78);
  --command-bg:#16243a;
  --command-hover-bg:#1e3a5f;
}
[data-theme="light"]{
  --bg:#e0f2fe;
  --panel:#ffffff;
  --panel2:#f8fafc;
  --border:#cbd5e1;
  --text:#0f172a;
  --muted:#475569;
  --accent:#0284c7;
  --green:#16a34a;
  --yellow:#facc15;
  --yellow-text:#1f2937;
  --orange:#ea580c;
  --red:#dc2626;
  --purple:#7c3aed;
  --gray:#64748b;
  --blue:#2563eb;
  --app-bg:linear-gradient(135deg,#e0f2fe 0,#f8fafc 44%,#e2e8f0 100%);
  --topbar-bg:rgba(248,250,252,.9);
  --input-bg:#ffffff;
  --brand-bg:#ffffff;
  --panel-gradient:linear-gradient(180deg,rgba(255,255,255,.96),rgba(241,245,249,.96));
  --kpi-bg:#ffffff;
  --task-bg:rgba(255,255,255,.86);
  --task-hover-bg:rgba(226,232,240,.92);
  --command-bg:#e2e8f0;
  --command-hover-bg:#cbd5e1;
}
[data-theme="light"] button.secondary{background:#e2e8f0;color:var(--text)}
[data-theme="light"] .theme-switcher{background:rgba(255,255,255,.74)}
[data-theme="light"] .theme-option:hover{background:#e0f2fe;color:var(--text)}
[data-theme="light"] .panel{background:var(--panel-gradient)}
[data-theme="light"] .kpi-floating-menu,
[data-theme="light"] .date-picker-popup,
[data-theme="light"] .modal{background:linear-gradient(180deg,#ffffff,#f8fafc);box-shadow:0 22px 52px rgba(15,23,42,.18)}
[data-theme="light"] .kpi-task-item,
[data-theme="light"] .sidebar-command-group,
[data-theme="light"] .task-filter-bar,
[data-theme="light"] .sidebar-filter-bar,
[data-theme="light"] .task-filter-bar select,
[data-theme="light"] .task-filter-bar input,
[data-theme="light"] .task-filter-chip,
[data-theme="light"] .task-filter-count,
[data-theme="light"] .kanban-column,
[data-theme="light"] .kanban-column-head,
[data-theme="light"] .phase,
[data-theme="light"] .phase.open,
[data-theme="light"] .kanban-phase,
[data-theme="light"] .kanban-phase.compact,
[data-theme="light"] .kanban-phase.open,
[data-theme="light"] .phase-title,
[data-theme="light"] .phase-done-toggle,
[data-theme="light"] .phase-timeline-number,
[data-theme="light"] .cycle-mode-card,
[data-theme="light"] .cycle-mode-section,
[data-theme="light"] .cycle-card,
[data-theme="light"] .date-picker-day,
[data-theme="light"] th,
[data-theme="light"] .history-item,
[data-theme="light"] .phase-order-row,
[data-theme="light"] .phase-order-position,
[data-theme="light"] .phase-order-label b,
[data-theme="light"] .export-fields-panel,
[data-theme="light"] .export-group-name,
[data-theme="light"] .export-group-select,
[data-theme="light"] .export-field-option{background:#ffffff;color:var(--text)}
[data-theme="light"] .kanban-column-head,
[data-theme="light"] th{background:#f8fafc}
[data-theme="light"] .command-btn,
[data-theme="light"] .date-picker-btn,
[data-theme="light"] .phase-edit-btn,
[data-theme="light"] .kanban-phase .phase-edit-btn,
[data-theme="light"] .step-card-edit-btn,
[data-theme="light"] .task-order-btn,
[data-theme="light"] .brand-order-btn{background:#e2e8f0;color:#075985;border-color:var(--border)}
[data-theme="light"] .command-btn:hover,
[data-theme="light"] .date-picker-btn:hover,
[data-theme="light"] .phase-edit-btn:hover,
[data-theme="light"] .kanban-phase .phase-edit-btn:hover,
[data-theme="light"] .step-card-edit-btn:hover,
[data-theme="light"] .task-order-btn:hover:not(:disabled),
[data-theme="light"] .brand-order-btn:hover{background:#bae6fd;color:#0f172a}
[data-theme="light"] .task-group-title{background:linear-gradient(90deg,#e0f2fe,#f8fafc);color:#075985;border-color:#bae6fd;box-shadow:inset 3px 0 0 #0284c7}
[data-theme="light"] .task-group-title strong{color:#0f172a}
[data-theme="light"] .task-group-edit-btn{background:#e0f2fe;color:#075985;border-color:#bae6fd}
[data-theme="light"] .task-group-code{background:#0284c7;color:#ffffff;border-color:#bae6fd}
[data-theme="light"] .modal-backdrop{background:rgba(226,232,240,.72)}
[data-theme="light"] input.readonly-field{background:#e2e8f0;color:#64748b}
[data-theme="light"] .toast{background:#e0f2fe;box-shadow:0 18px 40px rgba(15,23,42,.18)}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  min-height:100vh;
  background:var(--app-bg);
  color:var(--text);
  font-family:Inter,system-ui,Segoe UI,sans-serif;
  overflow:hidden;
}
button,input,select,textarea{font:inherit}
button{
  border:0;
  border-radius:10px;
  background:var(--accent);
  color:#05101d;
  font-weight:800;
  padding:9px 13px;
  cursor:pointer;
}
button.secondary{background:#233149;color:var(--text)}
input,select,textarea{
  width:100%;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--input-bg);
  color:var(--text);
  padding:10px;
}
.topbar{
  height:64px;
  position:relative;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:8px 10px;
  border-bottom:1px solid var(--border);
  background:var(--topbar-bg);
  backdrop-filter:blur(10px);
}
.topbar-title{flex:0 1 390px;min-width:300px;max-width:390px;min-inline-size:0;display:flex;align-items:center;gap:9px}
.topbar h1{font-size:18px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:0 0 auto}
.topbar .eyebrow{display:none}
.topbar-cycle-info{min-width:0;padding-left:9px;border-left:1px solid rgba(56,189,248,.28)}
.topbar .topbar-cycle-info .eyebrow{display:block;margin:0;color:var(--accent);font-size:8px;line-height:1;text-transform:uppercase;letter-spacing:.12em}
.topbar-cycle-info h2{font-size:13px;line-height:1.05;margin:1px 0 1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px}
.topbar-cycle-info .muted{display:block;font-size:9px;line-height:1.05;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:190px;margin:0}
.topbar-actions{position:absolute;left:50%;transform:translateX(-50%);width:675px;max-width:calc(100vw - 24px);min-width:0;display:flex;justify-content:center;align-items:center;gap:10px}
.topbar-buttons{display:none}
.theme-switcher{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:4px;
  padding:3px;
  border:1px solid var(--border);
  border-radius:999px;
  background:rgba(15,23,42,.32);
  position:relative;
  z-index:2;
}
.theme-option{
  min-width:58px;
  height:28px;
  padding:0 9px;
  border-radius:999px;
  background:transparent;
  color:var(--muted);
  font-size:10px;
  font-weight:900;
}
.theme-option[aria-pressed="true"]{background:var(--accent);color:#04111f;box-shadow:0 0 0 1px rgba(255,255,255,.18)}
.theme-option:hover{color:var(--text);background:rgba(148,163,184,.16)}
.theme-option[aria-pressed="true"]:hover{color:#04111f;background:var(--accent)}
.auth-user-menu{display:flex;align-items:center;gap:6px;position:relative;z-index:2;color:var(--muted);font-size:10.5px;font-weight:850;white-space:nowrap}
.auth-user-menu button{height:26px;padding:0 8px;border-radius:8px;font-size:10px}
.auth-gear-btn{width:26px;min-width:26px;padding:0!important;font-size:13px!important}
.login-overlay{position:fixed;inset:0;z-index:20000;display:flex;align-items:center;justify-content:center;padding:18px;background:rgba(7,11,20,.86);backdrop-filter:blur(10px)}
.login-card{width:min(380px,calc(100vw - 32px));display:grid;gap:10px;padding:22px;border:1px solid var(--border);border-radius:20px;background:var(--panel-gradient);box-shadow:0 28px 80px rgba(0,0,0,.48)}
.login-card h2{font-size:22px;margin:0 0 4px;letter-spacing:-.03em}
.login-card label{display:grid;gap:5px;color:var(--muted);font-size:12px;font-weight:800}
.login-card button{width:100%;margin-top:4px}
.login-error{min-height:18px;margin:0;color:#fecaca;font-size:12px;font-weight:800}
[data-theme="light"] .login-overlay{background:rgba(226,232,240,.82)}
h2{font-size:16px;margin:0}
.eyebrow{
  text-transform:uppercase;
  letter-spacing:.1em;
  color:var(--accent);
  font-size:9px;
  font-weight:800;
  margin:0;
}
.muted{color:var(--muted)}
.layout{
  height:calc(100vh - 64px);
  padding:12px;
  overflow:hidden;
  display:grid;
  grid-template-columns:280px minmax(0,1fr);
  gap:12px;
}
.hybrid-sidebar{
  min-width:0;
  height:100%;
  display:grid;
  grid-template-rows:auto auto auto minmax(0,1fr);
  gap:8px;
  overflow:hidden;
  padding-right:2px;
}
.hybrid-brand{
  min-height:42px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:0 12px;
  border:1px solid var(--border);
  border-radius:16px;
  background:var(--brand-bg);
  color:var(--text);
  font-size:18px;
  font-weight:950;
  letter-spacing:-.03em;
}
.brand-order-btn{
  width:26px;
  height:24px;
  min-width:26px;
  padding:0;
  border-radius:8px;
  border:1px solid rgba(56,189,248,.24);
  background:var(--command-bg);
  color:var(--accent);
  font-size:12px;
  line-height:1;
  box-shadow:none;
}
.brand-order-btn:hover{background:var(--command-hover-bg);border-color:rgba(56,189,248,.48)}
.panel-soft{
  min-width:0;
  border:1px solid var(--border);
  border-radius:18px;
  background:var(--panel-gradient);
  box-shadow:0 16px 44px rgba(0,0,0,.25);
  padding:16px;
}
.hybrid-next-action h2{font-size:20px;line-height:1.08;margin:9px 0 8px;letter-spacing:-.03em}
.hybrid-next-action p{margin:0;font-size:12px;line-height:1.35}
.hybrid-next-action button{width:100%;margin-top:14px;text-align:center}
.hybrid-next-action.panel-soft{padding:10px}
.hybrid-next-action h2{font-size:17px;margin:4px 0 5px}
.hybrid-next-action p{font-size:11px;line-height:1.2}
.hybrid-next-action button{height:28px;margin-top:8px;padding:0 10px}
.workspace{
  height:100%;
  min-width:0;
  display:grid;
  grid-template-rows:auto 1fr auto;
  gap:12px;
  overflow:hidden;
}
.panel{
  min-width:0;
  background:linear-gradient(180deg,rgba(17,28,51,.94),rgba(11,18,34,.94));
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:0 20px 60px rgba(0,0,0,.28);
}
.cycle-summary{
  min-height:96px;
  max-height:none;
  display:grid;
  grid-template-columns:minmax(0,1fr);
  align-items:center;
  gap:0;
  padding:8px 10px;
  overflow:visible;
}
.cycle-info{min-width:0}
.cycle-info h2{font-size:16px;margin:2px 0 3px}
.cycle-info p{margin:0}
.cycle-info .muted{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.phase-timeline{
  position:relative;
  min-width:0;
  width:100%;
  display:flex;
  justify-content:safe center;
  align-items:flex-start;
  gap:7px;
  overflow-x:auto;
  overflow-y:visible;
  padding:14px 2px 8px;
}
.timeline-phase-group{
  --timeline-group-color:#38bdf8;
  position:relative;
  flex:0 0 auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  min-width:0;
  padding-top:0;
}
.timeline-phase-group-bracket{
  padding:38px 8px 0;
}
.timeline-phase-group-single{
  padding:38px 0 0;
}
.timeline-group-items{
  display:flex;
  align-items:flex-start;
  justify-content:center;
  gap:7px;
  min-width:0;
}
.timeline-group-bracket{
  position:absolute;
  left:12px;
  right:12px;
  top:15px;
  height:20px;
  border-top:3px solid var(--timeline-group-color);
  border-left:3px solid var(--timeline-group-color);
  border-right:3px solid var(--timeline-group-color);
  border-radius:12px 12px 0 0;
  filter:drop-shadow(0 0 9px color-mix(in srgb,var(--timeline-group-color) 44%,transparent));
  pointer-events:none;
}
.timeline-group-title{
  position:absolute;
  left:50%;
  top:12px;
  transform:translateX(-50%);
  z-index:2;
  max-width:calc(100% - 34px);
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
  padding:1px 6px;
  border:1px solid color-mix(in srgb,var(--timeline-group-color) 70%,transparent);
  border-radius:7px;
  background:color-mix(in srgb,var(--timeline-group-color) 72%,#ffffff);
  color:#061222;
  box-shadow:0 0 0 2px rgba(6,18,34,.95);
  font-size:10px;
  font-weight:950;
  line-height:1.15;
  font-family:inherit;
  cursor:pointer;
  white-space:nowrap;
}
.timeline-group-date{
  position:absolute;
  left:50%;
  top:-7px;
  transform:translateX(-50%);
  z-index:3;
  padding:1px 6px;
  border:1px solid color-mix(in srgb,var(--timeline-group-color) 70%,transparent);
  border-radius:999px;
  background:color-mix(in srgb,var(--timeline-group-color) 62%,#ffffff);
  color:#061222;
  box-shadow:0 0 0 2px rgba(6,18,34,.95);
  font-size:9px;
  font-weight:900;
  line-height:1.15;
  white-space:nowrap;
}
.timeline-group-title span{
  min-width:0;
  max-width:min(22ch, calc(100vw - 160px));
  overflow:hidden;
  text-overflow:ellipsis;
}
.timeline-group-title b{
  flex:0 0 auto;
  padding-left:6px;
  border-left:1px solid color-mix(in srgb,var(--timeline-group-color) 45%,transparent);
  color:#061222;
  font-size:9px;
  font-weight:900;
}
.timeline-phase-group.timeline-group-active .timeline-group-bracket{
  border-color:#fb4b5f;
  border-top-width:4px;
  border-left-width:4px;
  border-right-width:4px;
  filter:drop-shadow(0 0 8px rgba(251,75,95,.92)) drop-shadow(0 0 18px rgba(244,63,94,.72));
}
.timeline-phase-group.timeline-group-active .timeline-group-title{
  border-color:#fb7185;
  color:#061222;
}
.timeline-phase-group.timeline-group-active .timeline-group-date{
  border-color:#fb7185;
}
.timeline-item{
  flex:0 0 58px;
  width:58px;
  max-width:58px;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:3px;
  overflow:visible;
  position:relative;
}
.timeline-item-circle{
  flex:0 0 58px;
  min-width:58px;
  align-items:center;
}
.timeline-item-diamond{
  flex:0 0 58px;
  min-width:58px;
  align-items:center;
}
.timeline-deadline{
  align-self:center;
  min-width:58px;
  max-width:74px;
  padding:0 4px;
  border:0;
  border-radius:0;
  background:transparent;
  color:#d8dee9;
  box-shadow:none;
  font-size:9px;
  font-weight:400;
  line-height:1;
  letter-spacing:.04em;
  text-align:center;
  white-space:nowrap;
  pointer-events:none;
}
.timeline-step{
  --timeline-bg:#0d1a30;
  --chevron-notch:12.6px;
  --chevron-point:12.6px;
  flex:0 0 58px;
  width:58px;
  max-width:58px;
  height:36px;
  display:grid;
  place-items:center;
  text-align:center;
  border:0;
  border-radius:8px;
  padding:0 15px 0 15px;
  color:var(--text);
  background:var(--timeline-bg);
  clip-path:polygon(0 0,calc(100% - var(--chevron-point)) 0,100% 50%,calc(100% - var(--chevron-point)) 100%,0 100%,var(--chevron-notch) 50%);
  filter:drop-shadow(0 4px 8px rgba(0,0,0,.18)) drop-shadow(0 0 0 rgba(255,255,255,.95));
  position:relative;
  isolation:isolate;
  overflow:hidden;
}
.timeline-item .timeline-step{flex:0 0 auto;width:100%}
.timeline-step:first-child{clip-path:polygon(0 0,calc(100% - var(--chevron-point)) 0,100% 50%,calc(100% - var(--chevron-point)) 100%,0 100%,var(--chevron-notch) 50%)}
.timeline-item:first-child .timeline-step{clip-path:polygon(0 0,calc(100% - var(--chevron-point)) 0,100% 50%,calc(100% - var(--chevron-point)) 100%,0 100%,var(--chevron-notch) 50%)}
.timeline-item:first-child .timeline-step.timeline-circle{clip-path:circle(50% at 50% 50%)}
.timeline-item:first-child .timeline-step.timeline-diamond{clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}
.timeline-step.timeline-circle{
  flex:0 0 36px;
  min-width:36px;
  width:36px;
  border-radius:50%;
  clip-path:circle(50% at 50% 50%);
  padding:0;
}
.timeline-step:first-child.timeline-circle{clip-path:circle(50% at 50% 50%)}
.timeline-step:first-child.timeline-diamond{clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}
.timeline-step > *{position:relative;z-index:1}
.timeline-dot{display:none}
.timeline-label{font-size:14px;font-weight:950;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.timeline-meta{display:none}
.timeline-step{color:#fff}
.timeline-step .timeline-label{color:#fff}
.timeline-not-started{--timeline-bg:rgba(51,65,85,.62);background:var(--timeline-bg);color:#cbd5e1}
.timeline-not-started .timeline-label{color:#cbd5e1}
.timeline-in-progress{--timeline-bg:var(--yellow);background:var(--timeline-bg);color:var(--yellow-text)}
.timeline-done{--timeline-bg:var(--green);background:var(--timeline-bg)}
.timeline-late{
  background:var(--red);
  filter:drop-shadow(0 4px 8px rgba(0,0,0,.18)) drop-shadow(0 0 8px rgba(239,68,68,.38));
}
.timeline-late::before{
  content:"";
  position:absolute;
  inset:3px 18px 3px 4px;
  clip-path:inherit;
  background:var(--timeline-bg);
  z-index:0;
}
.timeline-item:first-child .timeline-step.timeline-late::before{inset:3px 18px 3px 3px}
.timeline-item.timeline-active{
  z-index:3;
}
.timeline-item.timeline-active .timeline-step{
  transform:translateY(-1px);
  outline:none;
  filter:drop-shadow(0 0 8px rgba(251,75,95,.92)) drop-shadow(0 0 18px rgba(244,63,94,.72));
  overflow:visible;
}
.timeline-item.timeline-active .timeline-step:not(.timeline-circle)::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:3;
  pointer-events:none;
  background-repeat:no-repeat;
  background-position:center;
  background-size:100% 100%;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 58 36' preserveAspectRatio='none'%3E%3Cpolygon points='2,2 44,2 56,18 44,34 2,34 14,18' fill='none' stroke='%23fb4b5f' stroke-width='4' stroke-linejoin='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
}
.timeline-item.timeline-active .timeline-step.timeline-circle{
  border-style:solid;
  border-color:#fb4b5f;
  border-width:4px;
  box-shadow:0 0 8px rgba(251,75,95,.92),0 0 18px rgba(244,63,94,.72);
  outline:none;
}
.timeline-item.timeline-active .timeline-step.timeline-diamond{
  outline:none;
}
.timeline-item.timeline-active .timeline-step.timeline-diamond::after{
  inset:0;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 42 42' preserveAspectRatio='none'%3E%3Cpolygon points='21,3 39,21 21,39 3,21' fill='none' stroke='%23fb4b5f' stroke-width='4' stroke-linejoin='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
}
.timeline-item.timeline-active .timeline-deadline{
  color:#fb7185;
  font-weight:400;
  text-shadow:0 0 10px rgba(251,75,95,.72);
}
.timeline-step.timeline-circle.timeline-late::before{inset:3px;clip-path:circle(50% at 50% 50%)}
.timeline-step.timeline-diamond.timeline-late::before{inset:4px;clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}
.timeline-step.timeline-circle{
  flex:0 0 42px;
  width:42px;
  min-width:42px;
  height:42px;
  margin-top:-3px;
  margin-bottom:-3px;
  border:2px solid rgba(255,255,255,.48);
  box-shadow:0 0 0 4px rgba(148,163,184,.14),0 8px 16px rgba(0,0,0,.28);
  overflow:visible;
}
.timeline-step.timeline-circle.timeline-not-started{
  border-color:#cbd5e1;
  box-shadow:0 0 0 4px rgba(203,213,225,.18),0 0 18px rgba(203,213,225,.16);
}
.timeline-step.timeline-circle.timeline-done{
  background:var(--green);
  border-color:#fff;
  box-shadow:0 0 0 4px rgba(56,189,248,.22),0 0 22px rgba(56,189,248,.38);
}
.timeline-step.timeline-circle.timeline-done .timeline-label{color:#fff}
.timeline-step.timeline-circle.timeline-late{border-color:#fecaca}
.timeline-step.timeline-circle.timeline-late::before{display:none}
.timeline-step.timeline-diamond{
  flex:0 0 42px;
  width:42px;
  min-width:42px;
  height:42px;
  margin-top:-3px;
  margin-bottom:-3px;
  padding:0;
  border-radius:0;
  clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%);
  box-shadow:0 0 0 4px rgba(148,163,184,.14),0 8px 16px rgba(0,0,0,.28);
  overflow:hidden;
}
.timeline-step.timeline-diamond .timeline-label{max-width:30px;text-align:center}
.timeline-step.timeline-diamond.timeline-late::before{display:none}
.timeline-in-progress .timeline-label{color:var(--yellow-text)}
.timeline-not-started .timeline-dot{background:var(--gray)}
.timeline-in-progress .timeline-dot{background:var(--yellow)}
.timeline-done .timeline-dot{background:var(--green)}
.kpis{
  flex:0 0 675px;
  min-width:675px;
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:7px;
}
.kpis .kpi-card{
  min-width:0;
  height:42px;
  display:grid;
  grid-template-columns:22px minmax(0,1fr);
  align-items:center;
  gap:7px;
  background:var(--kpi-bg);
  border:1px solid var(--border);
  border-radius:10px;
  padding:5px 7px;
  text-align:left;
}
.kpis b{display:block;font-size:17px;line-height:1.04}
.kpis span{display:block;color:var(--muted);font-size:9px;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kpis .kpi-body{min-width:0;margin-top:0}
.kpis .kpi-icon{
  width:22px;
  height:22px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-top:0;
  border-radius:8px;
  background:rgba(56,189,248,.12);
  border:1px solid rgba(56,189,248,.22);
  color:var(--accent);
  font-size:12px;
  font-weight:950;
  line-height:1;
  overflow:visible;
}
.kpis .kpi-done .kpi-icon{background:rgba(34,197,94,.13);border-color:rgba(34,197,94,.28);color:var(--green)}
.kpis .kpi-pending .kpi-icon{background:rgba(148,163,184,.13);border-color:rgba(148,163,184,.28);color:#cbd5e1;font-size:11px}
.kpis .kpi-progress .kpi-icon{background:rgba(96,165,250,.13);border-color:rgba(96,165,250,.28);color:var(--blue)}
.kpis .kpi-late .kpi-icon{background:rgba(239,68,68,.14);border-color:rgba(239,68,68,.3);color:var(--red)}
.kpis button.kpi-card{width:100%;height:42px;padding:5px 7px;color:var(--text);cursor:pointer}
.kpis .kpi-clickable:hover{border-color:var(--accent);box-shadow:0 0 0 1px rgba(56,189,248,.28)}
.kpi-floating-menu{
  position:fixed;
  z-index:10030;
  width:min(440px,calc(100vw - 24px));
  max-height:340px;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:16px;
  background:linear-gradient(180deg,#111c33,#081426);
  box-shadow:0 24px 70px rgba(0,0,0,.58);
}
.kpi-floating-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border-bottom:1px solid var(--border)}
.kpi-floating-list{display:grid;gap:7px;max-height:288px;overflow:auto;padding:10px}
.kpi-task-item{width:100%;text-align:left;background:#091425;color:var(--text);border:1px solid var(--border);border-radius:12px;padding:9px;font-weight:700;line-height:1.2}
.kpi-task-item small{display:block;color:var(--muted);font-weight:600;margin-top:4px}
.kpi-task-item:hover{border-color:var(--accent);background:#10223a}
.content-grid{
  min-height:0;
  display:grid;
  grid-template-columns:1fr;
  overflow:hidden;
}
.flow-panel{
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  padding:12px;
}
.panel-header{
  flex:0 0 auto;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:10px;
}
.bulk-save-btn{height:30px;padding:0 12px;font-size:11px;border-radius:8px;white-space:nowrap}
.flow-toolbar{justify-content:flex-start;margin-bottom:8px}
.flow-panel-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.sidebar-controls{display:grid;gap:7px;align-content:start;padding:10px}
.sidebar-command-group{
  display:grid;
  gap:7px;
  padding:9px;
  border:1px solid rgba(38,52,80,.72);
  border-radius:14px;
  background:rgba(6,15,28,.46);
}
.sidebar-command-group .eyebrow{display:flex;align-items:center;gap:6px;margin:0 0 1px;color:#bae6fd}
details.sidebar-command-group summary.eyebrow{cursor:pointer;list-style:none;user-select:none;justify-content:space-between}
details.sidebar-command-group summary.eyebrow::-webkit-details-marker{display:none}
details.sidebar-command-group summary.eyebrow::after{content:'▸';margin-left:auto;color:var(--muted);font-size:11px;transition:transform .16s ease,color .16s ease}
details.sidebar-command-group[open] summary.eyebrow::after{transform:rotate(90deg);color:var(--accent)}
details.sidebar-command-group:not([open]){padding-bottom:6px}
.sidebar-command-list{display:grid;grid-template-columns:1fr;gap:5px;margin-top:0}
.sidebar-command-list .bulk-save-btn,.sidebar-controls .command-btn{width:100%;height:28px;justify-content:flex-start;text-align:left}
.command-btn{
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:0 9px;
  border:1px solid rgba(148,163,184,.18);
  background:var(--command-bg);
  color:#dbeafe;
  font-size:10.5px;
  font-weight:850;
}
.command-btn:hover{background:var(--command-hover-bg);border-color:rgba(56,189,248,.42)}
.command-btn .cmd-icon{width:16px;min-width:16px;display:inline-flex;align-items:center;justify-content:center;font-size:12px;line-height:1}
.danger-command{color:#fecaca;border-color:rgba(239,68,68,.25)}
.danger-command:hover{background:rgba(127,29,29,.52);border-color:rgba(239,68,68,.52)}
.task-filter-bar{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  padding:8px 10px;
  margin:0 0 8px;
  border:1px solid rgba(38,52,80,.75);
  border-radius:14px;
  background:rgba(6,15,28,.62);
  color:var(--muted);
  font-size:11px;
}
.task-filter-bar label{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;font-weight:800}
.sidebar-filter-bar{
  display:grid;
  align-items:stretch;
  gap:8px;
  padding:9px;
  margin:0;
  border:1px solid rgba(38,52,80,.72);
  border-radius:14px;
  background:rgba(6,15,28,.46);
}
.sidebar-filter-bar label{display:grid;gap:4px;white-space:normal}
.sidebar-filter-bar .eyebrow{margin-top:2px}
.sidebar-filter-bar .task-filter-chip,.sidebar-filter-bar .task-filter-count{width:100%;justify-content:center;text-align:center}
.sidebar-filter-bar .bulk-save-btn{width:100%;height:32px}

.sidebar-filter-bar[open]{grid-template-columns:1fr 1fr;gap:5px;padding:7px}
.sidebar-filter-bar[open] summary,.sidebar-filter-bar[open] .task-filter-chip,.sidebar-filter-bar[open] label:first-of-type,.sidebar-filter-bar[open] .task-filter-count,.sidebar-filter-bar[open] .bulk-save-btn{grid-column:1 / -1}
.sidebar-filter-bar[open] label{font-size:10px;gap:3px}
.sidebar-filter-bar[open] .task-filter-chip,.sidebar-filter-bar[open] .task-filter-count{min-height:22px;padding:0 7px}
.sidebar-filter-bar[open] select,.sidebar-filter-bar[open] input{height:24px;font-size:10px;padding:0 6px}
.sidebar-filter-bar[open] .bulk-save-btn{height:26px}
.task-filter-bar select,.task-filter-bar input{
  height:28px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#0d1a30;
  color:var(--text);
  padding:0 8px;
  font-size:11px;
}
.task-filter-chip,.task-filter-count{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:0 9px;
  border-radius:999px;
  border:1px solid rgba(56,189,248,.24);
  background:#0d1a30;
  color:#bfdbfe;
  font-weight:900;
}
.task-filter-count{color:var(--muted);border-color:var(--border)}
.bulk-save-btn:disabled{opacity:.45;cursor:not-allowed}
.flow{
  flex:1;
  min-height:0;
  display:grid;
  grid-template-columns:1.05fr .95fr .95fr;
  gap:12px;
  overflow:auto;
  align-items:stretch;
  padding:2px 2px 10px;
  scroll-snap-type:x proximity;
}
.kanban-column{
  min-width:245px;
  min-height:0;
  overflow:auto;
  padding:10px;
  border:1px solid rgba(38,52,80,.9);
  border-radius:18px;
  background:rgba(7,17,31,.72);
}
.kanban-column-head{
  position:sticky;
  top:0;
  z-index:3;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:-10px -10px 10px;
  padding:11px 12px;
  border-bottom:1px solid var(--border);
  background:rgba(7,17,31,.96);
  backdrop-filter:blur(10px);
}
.kanban-column-head h3{margin:0;color:var(--muted);font-size:12px;letter-spacing:.14em;text-transform:uppercase}
.kanban-column-head span{min-width:24px;height:22px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:#132238;color:#bfdbfe;font-size:12px;font-weight:900}
.kanban-empty{padding:12px;margin:0;font-size:12px}
.status-legend{
  min-height:40px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  gap:10px 16px;
  padding:7px 10px;
  color:var(--muted);
  font-size:11px;
}
.status-legend strong{color:var(--text);font-size:11px}
.legend-item{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.legend-swatch{
  width:18px;
  height:13px;
  border:1px solid rgba(255,255,255,.24);
  border-radius:5px;
  background:transparent;
}
.legend-swatch.not-started{background:transparent}
.legend-swatch.in-progress{background:var(--yellow)}
.legend-swatch.done{background:var(--green)}
.legend-swatch.done-circle{background:var(--green);width:20px;height:15px;border-radius:99px;border:2px solid #fff;box-shadow:0 0 0 1px var(--accent)}
.legend-swatch.late{background:var(--yellow);border:3px solid var(--red);box-shadow:0 0 0 1px rgba(239,68,68,.35)}
.phase{
  flex:1 1 max(190px,var(--phase-width,190px));
  min-width:max(190px,var(--phase-width,190px));
  max-width:none;
  border:1px solid var(--border);
  border-radius:16px;
  background:rgba(8,20,38,.66);
  padding:8px;
  transition:.18s ease;
  scroll-snap-align:start;
}
.phase.nearby{
  flex:1.1 1 max(206px,var(--phase-width,206px));
  min-width:max(206px,var(--phase-width,206px));
  max-width:none;
}
.phase.compact{
  flex:1 1 54px;
  min-width:54px;
  max-width:96px;
  padding:6px;
}
.phase.open{
  flex:1.6 1 max(340px,var(--phase-width,340px));
  min-width:max(340px,var(--phase-width,340px));
  max-width:none;
  background:rgba(8,20,38,.96);
  box-shadow:inset 0 0 0 1px rgba(56,189,248,.18),0 18px 40px rgba(0,0,0,.22);
}
.phase.current-phase{outline:2px solid rgba(56,189,248,.42);outline-offset:2px}
.kanban-phase,
.kanban-phase.compact,
.kanban-phase.open{
  width:100%;
  min-width:0;
  max-width:none;
  flex:none;
  margin:0 0 10px;
  position:relative;
  overflow:hidden;
  border-radius:16px;
  background:rgba(16,27,49,.92);
  box-shadow:0 10px 26px rgba(0,0,0,.22);
}
.kanban-phase::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:4px;
  background:var(--gray);
}
.kanban-phase.board-done::before{background:var(--green)}
.kanban-phase.board-progress::before{background:var(--yellow)}
.kanban-phase.board-idle::before{background:var(--gray)}
.kanban-phase.open{background:rgba(16,27,49,.98);border-color:rgba(56,189,248,.55)}
.phase-title{
  width:100%;
  min-height:74px;
  display:grid;
  grid-template-rows:1fr auto;
  align-items:center;
  gap:5px;
  text-align:left;
  margin:0;
  padding:8px;
  border-radius:12px;
  background:#0d1a30;
  color:#c7d2fe;
  font-weight:900;
}
.phase-head{display:grid;gap:5px;margin:0 0 8px}
.phase-done-toggle{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  min-height:20px;
  padding:2px 7px;
  border:1px solid rgba(56,189,248,.2);
  border-radius:8px;
  background:#091425;
  color:var(--muted);
  font-size:10px;
  font-weight:800;
  cursor:pointer;
}
.phase-timeline-number{
  min-width:18px;
  height:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:6px;
  background:#132238;
  border:1px solid rgba(56,189,248,.28);
  color:var(--accent);
  font-size:10px;
  font-weight:950;
  line-height:1;
  flex:0 0 auto;
}
.phase-done-toggle input,.step-done-toggle input{width:14px;height:14px;accent-color:var(--green);cursor:pointer}
.phase-done-toggle > span:not(.phase-timeline-number){white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.phase.compact .phase-head{margin:0;gap:4px}
.phase.compact .phase-done-toggle{padding:2px;min-height:18px}
.phase.compact .phase-done-toggle > span:not(.phase-timeline-number){display:none}
.phase-title-text{
  display:inline-grid;
  grid-template-columns:auto auto;
  align-items:center;
  justify-content:start;
  gap:8px;
  width:max-content;
  max-width:none;
  white-space:nowrap;
  line-height:1.08;
}
.phase-arrow{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:22px;
  min-width:22px;
  font-size:25px;
  line-height:1;
  color:var(--accent);
}
.phase-title-lines{
  display:grid;
  gap:2px;
  white-space:nowrap;
}
.phase-title-line{
  display:block;
  white-space:nowrap;
  overflow:visible;
  text-overflow:clip;
}
.phase.compact .phase-title{
  min-height:74px;
  margin:0;
  padding:8px 4px;
  place-items:center;
  text-align:center;
}
.phase.compact .phase-compact-label{
  display:block;
  font-size:15px;
  line-height:1;
}
.phase-title-meta{color:var(--muted);font-size:11px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.phase.compact .phase-title-meta{font-size:9px}
.kanban-phase.compact .phase-title,
.kanban-phase.open .phase-title{
  min-height:68px;
  text-align:left;
  place-items:stretch;
  padding:9px 10px;
}
.kanban-phase.compact .phase-compact-label{display:block;text-align:left;font-size:15px;line-height:1;color:var(--text)}
.kanban-phase.compact .phase-title-lines,
.kanban-phase.open .phase-title-lines{display:grid}
.kanban-phase.compact .phase-title-meta{font-size:11px}
.kanban-phase .phase-head{position:relative;z-index:1}
.kanban-phase .phase-done-toggle{justify-content:flex-start;margin-left:4px}
.kanban-phase .phase-edit-btn{position:absolute;right:10px;top:32px;width:24px;height:24px;padding:0;border-radius:8px;background:#1e293b;color:var(--accent);border:1px solid var(--border);font-size:11px}
.kanban-phase .phase-title{padding-right:38px}
.kanban-phase .step-card{margin:8px 0 0}
.phase-collapsed-body{display:grid;gap:6px;padding:8px;color:var(--muted);font-size:12px;line-height:1.25}
.phase-collapsed-body p{margin:0;color:var(--text);font-weight:800}
.phase-collapsed-body small{display:block}
.step-card{
  position:relative;
  display:grid;
  grid-template-columns:1fr auto auto 22px;
  align-items:center;
  gap:8px;
  border:0;
  background:var(--task-bg);
  color:var(--text);
  border-radius:12px;
  padding:6px 7px;
  margin:4px 0;
  transition:.15s background, .15s outline-color;
}
.step-card.pending-change{box-shadow:inset 0 0 0 1px rgba(234,179,8,.45)}
.step-card:hover{background:var(--task-hover-bg)}
.step-card.active{outline:2px solid var(--accent)}
.step-card small{display:block;color:var(--muted);margin-top:1px;font-size:10px;line-height:1.1}
.task-card-title{font-size:11.5px;line-height:1.12;color:var(--text);font-weight:400}
.task-group{margin:8px 0 10px}
.task-group-title{
  display:flex;
  align-items:center;
  gap:6px;
  min-height:24px;
  padding:4px 8px;
  border:1px solid rgba(56,189,248,.26);
  border-radius:8px;
  background:linear-gradient(90deg,rgba(56,189,248,.18),rgba(96,165,250,.07));
  color:#bae6fd;
  box-shadow:inset 3px 0 0 rgba(56,189,248,.78);
  font-size:10px;
  line-height:1.1;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.task-group-title strong{color:#f0f9ff;font-size:10.5px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.task-group-title span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.task-group-edit-btn{
  margin-left:auto;
  width:20px;
  height:20px;
  min-width:20px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
  border-radius:6px;
  border:1px solid rgba(240,249,255,.28);
  background:rgba(15,23,42,.72);
  color:#bae6fd;
  font-size:10px;
  line-height:1;
}
.task-group-edit-btn:hover{background:#38bdf8;color:#02111f}
.task-group-code{
  min-width:20px;
  height:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:5px;
  background:#38bdf8;
  border:1px solid rgba(240,249,255,.72);
  color:#02111f;
  font-size:9px;
  font-weight:950;
  line-height:1;
}
.task-group-cards{padding-left:12px}
.task-card-main{min-width:0;display:grid;gap:0}
.task-card-main .task-card-title,.task-card-main small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.task-card-setup{display:flex;align-items:center;gap:4px;justify-content:flex-end}
.task-card-setup label{
  display:inline-flex;
  align-items:center;
  gap:3px;
  min-height:20px;
  padding:1px 3px;
  border:0;
  border-radius:0;
  background:transparent;
  color:var(--muted);
  font-size:9.5px;
  font-weight:900;
  cursor:pointer;
}
.task-card-setup input{width:12px;height:12px;margin:0;accent-color:var(--green)}
.task-card-order{display:flex;align-items:center;gap:2px}
.task-order-btn{
  width:18px;
  height:20px;
  min-width:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
  border-radius:5px;
  border:1px solid rgba(148,163,184,.22);
  background:rgba(15,23,42,.78);
  color:#bae6fd;
  font-size:10px;
  line-height:1;
}
.task-order-btn:hover:not(:disabled){background:#38bdf8;color:#02111f}
.task-order-btn:disabled{opacity:.32;cursor:not-allowed}
.step-done-toggle{
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.step-card-edit-btn{
  position:static;
  width:20px;
  height:20px;
  border-radius:6px;
  background:#1e293b;
  border:1px solid var(--border);
  color:var(--accent);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:10px;
  line-height:1;
  cursor:pointer;
  padding:0;
}
.step-card-edit-btn:hover{background:var(--accent);color:#05101d}
.status-Não-iniciado{border-left-color:var(--gray)}
.status-Em-andamento{border-left-color:var(--yellow);background:var(--yellow);color:var(--yellow-text)}
.status-Em-andamento .task-card-title,.status-Em-andamento small{color:var(--yellow-text)}
.status-Concluído{border-left-color:var(--green)}
.late{box-shadow:inset 0 0 0 3px var(--red)}
.cycles-list{display:grid;gap:10px;max-height:400px;overflow-y:auto}
.cycle-mode-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;border:0;padding:0;margin:0}
.cycle-mode-card{display:grid!important;grid-template-columns:auto 1fr;gap:4px 8px;border:1px solid var(--border);border-radius:12px;background:#0a1425;padding:10px;cursor:pointer;color:var(--text)}
.cycle-mode-card input{grid-row:1 / span 2;margin-top:2px}
.cycle-mode-card strong{font-size:12px;line-height:1.1}
.cycle-mode-card span{color:var(--muted);font-size:10.5px;line-height:1.25}
.cycle-mode-section{display:grid;gap:8px;border:1px solid rgba(56,189,248,.18);border-radius:12px;background:rgba(8,20,38,.62);padding:10px}
.copy-options-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.copy-options-grid label{display:flex;align-items:center;gap:5px;border:1px solid var(--border);border-radius:8px;background:#091425;padding:6px 7px;font-size:11px;font-weight:800;color:var(--text)}
.copy-options-grid input{accent-color:var(--accent)}
.import-template-actions{display:flex;gap:8px;flex-wrap:wrap}
.link-button{display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
.new-cycle-form textarea{min-height:130px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px}
.cycle-card{border:1px solid var(--border);background:#0a1425;border-radius:16px;padding:12px;cursor:pointer}
.cycle-card.active{outline:2px solid var(--accent)}
.cycle-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.cycle-card-head h3{min-width:0;overflow:hidden;text-overflow:ellipsis}
.cycle-edit-btn{flex:0 0 auto;min-width:auto!important;padding:5px 8px;font-size:11px}
.cycle-card-editing{cursor:default;background:#0d1a30}
.cycle-edit-form{display:grid;gap:8px}
.cycle-edit-form input{padding:7px 9px;border-radius:8px;font-size:12px}
.cycle-card-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:2px}
.cycle-card-actions button{min-width:84px;padding:7px 10px;font-size:12px}
.cycle-card h3{margin:0 0 4px;font-size:16px}
.cycle-card p{margin:3px 0}
.chip{display:inline-flex;align-items:center;border:1px solid var(--border);border-radius:999px;padding:5px 9px;color:var(--muted);font-size:12px}
.step-form{display:grid;gap:8px}
.step-form label{display:grid;gap:4px;color:var(--muted);font-size:12px}
.date-input-wrap{position:relative;display:flex;align-items:center;width:100%}
.date-input-wrap input{padding-right:40px!important;user-select:text}
.date-picker-btn{
  position:absolute;
  right:5px;
  top:50%;
  transform:translateY(-50%);
  width:28px;
  height:28px;
  min-width:28px;
  padding:0;
  border-radius:8px;
  background:#132238;
  color:var(--accent);
  border:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
}
.date-picker-btn:hover{background:var(--accent);color:#05101d}
.date-picker-popup{
  position:fixed;
  z-index:10020;
  width:250px;
  padding:10px;
  border:1px solid var(--border);
  border-radius:14px;
  background:linear-gradient(180deg,#111c33,#081426);
  box-shadow:0 20px 60px rgba(0,0,0,.55);
}
.date-picker-head{display:grid;grid-template-columns:32px 1fr 32px;align-items:center;gap:8px;margin-bottom:8px;text-align:center}
.date-picker-head strong{text-transform:capitalize;font-size:13px;color:var(--text)}
.date-picker-head button{width:32px;height:30px;padding:0;font-size:18px;border-radius:8px}
.date-picker-weekdays,.date-picker-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;text-align:center}
.date-picker-weekdays span{font-size:10px;color:var(--muted);font-weight:800;padding:2px 0}
.date-picker-empty{height:28px}
.date-picker-day{
  width:100%;
  height:28px;
  padding:0;
  border-radius:8px;
  background:#0d1a30;
  color:var(--text);
  border:1px solid transparent;
  font-size:12px;
}
.date-picker-day:hover{border-color:var(--accent);background:#12304d;color:var(--text)}
.date-picker-day.today{border-color:var(--yellow);color:#fde68a}
.date-picker-day.selected{background:var(--accent);color:#05101d;font-weight:900}
.date-picker-footer{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:9px;color:var(--muted)}
.date-picker-footer button{height:28px;padding:0 9px;font-size:11px;border-radius:8px}
.check{display:flex!important;grid-template-columns:auto 1fr;align-items:center}
.check input{width:auto}
.hidden{display:none!important}
.table-wrap{overflow:auto}
table{width:100%;border-collapse:collapse;margin-top:12px;min-width:980px}
th,td{border-bottom:1px solid var(--border);padding:9px;text-align:left;font-size:13px}
th{color:#cbd5e1;background:#0a1425;position:sticky;top:0}
td input,td select{padding:7px;border-radius:8px}
.history-list{display:grid;gap:8px}
.history-item{border:1px solid var(--border);background:#081426;border-radius:12px;padding:10px}
.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(7,11,20,.85);
  backdrop-filter:blur(8px);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
  padding:18px;
}
.modal{
  background:linear-gradient(180deg,#111c33,#0b1222);
  border:1px solid var(--border);
  border-radius:18px;
  width:100%;
  max-width:600px;
  box-shadow:0 25px 50px -12px rgba(0,0,0,.5);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  animation:modal-enter .2s cubic-bezier(.16,1,.3,1);
}
#operationalTableModal .modal{max-width:min(1500px,96vw)}
.operational-modal-header{gap:12px;align-items:center}
.operational-top-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.operational-top-actions button:not(.close-btn){min-width:auto;padding:7px 10px;font-size:12px}
.operational-top-actions .close-btn{margin-left:2px}
#historyModal .modal{max-width:min(900px,90vw)}
.user-panel-modal{max-width:min(980px,94vw)}
.user-panel-body{max-height:calc(100vh - 110px)}
.user-panel-section{display:grid;gap:10px;border:1px solid rgba(56,189,248,.18);border-radius:14px;padding:10px;background:rgba(8,20,38,.38)}
.user-card{display:grid;gap:3px;border:1px solid var(--border);border-radius:12px;padding:10px;background:var(--task-bg);font-size:12px}
.user-card b{color:var(--text);font-size:14px}.reset-required{color:var(--yellow);font-weight:900}.password-change-form{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;align-items:end}.password-change-form label{display:grid;gap:4px;color:var(--muted);font-size:11px;font-weight:800}.password-change-form button{height:34px;white-space:nowrap}.governance-open-btn{height:32px;justify-self:start;font-size:11px}.create-user-form{display:grid;grid-template-columns:1.1fr 1.3fr 1fr 110px auto;gap:7px}.create-user-form input,.create-user-form select{height:32px;padding:6px 8px;font-size:11px}.create-user-form button{height:32px;padding:0 10px;font-size:11px;white-space:nowrap}.users-list{display:grid;gap:7px;max-height:46vh;overflow:auto}.user-row{display:grid;gap:5px;border:1px solid var(--border);border-radius:12px;padding:8px;background:rgba(8,20,38,.62)}.user-row-main{display:grid;grid-template-columns:1.1fr 1.4fr 100px 72px;gap:6px}.user-row-main input,.user-row-main select{height:30px;padding:5px 7px;font-size:11px}.user-active-check{display:flex;align-items:center;gap:4px;color:var(--muted);font-size:10px;font-weight:800}.user-active-check input{width:13px;height:13px}.user-row-meta{color:var(--muted);font-size:10px}.user-row-actions{display:flex;gap:6px;justify-content:flex-end}.user-row-actions button{height:28px;padding:0 8px;font-size:10px}
.governance-modal{max-width:min(760px,94vw)}
.governance-body{max-height:calc(100vh - 110px)}
.governance-users-list{display:grid;gap:7px;max-height:52vh;overflow:auto}
.governance-user-row{display:grid;grid-template-columns:minmax(0,1fr) 110px;gap:8px;align-items:center;border:1px solid var(--border);border-radius:12px;padding:8px;background:rgba(8,20,38,.62)}
.governance-allow{display:flex;align-items:center;gap:8px;min-width:0;color:var(--text);font-size:12px;font-weight:800}
.governance-allow input{width:15px;height:15px;flex:0 0 auto;accent-color:var(--accent)}
.governance-allow span{display:grid;min-width:0}.governance-allow small{color:var(--muted);font-size:10px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.governance-user-role{height:30px;padding:5px 8px;font-size:11px}
[data-theme="light"] .user-panel-section,[data-theme="light"] .user-row,[data-theme="light"] .user-card,[data-theme="light"] .governance-user-row{background:#ffffff}
#editModal.task-edit-popover,
#editPhaseModal.phase-edit-popover,
#phaseOrderModal.phase-order-popover{
  height:auto;
  padding:0;
  align-items:flex-start;
  justify-content:flex-start;
  background:transparent;
  backdrop-filter:none;
  pointer-events:none;
}
#editModal.task-edit-popover{
  inset:82px 18px auto auto;
  width:min(480px,calc(100vw - 36px));
}
#editPhaseModal.phase-edit-popover{
  inset:82px 18px auto auto;
  width:min(430px,calc(100vw - 36px));
}
#phaseOrderModal.phase-order-popover{
  inset:152px auto auto 304px;
  width:min(700px,calc(100vw - 320px));
}
#editModal.task-edit-popover .modal,
#editPhaseModal.phase-edit-popover .modal,
#phaseOrderModal.phase-order-popover .phase-order-modal{
  width:100%;
  pointer-events:auto;
  box-shadow:0 22px 70px rgba(0,0,0,.42),0 0 0 1px rgba(56,189,248,.12);
}
.phase-order-modal{max-width:min(700px,92vw)}
.phase-order-modal .modal-header{padding:8px 12px}
.phase-order-modal .modal-header h2{font-size:13px}
.phase-order-modal .step-form{padding:9px 12px;gap:7px;max-height:calc(100vh - 80px)}
.order-help{margin:0 0 4px;font-size:10.5px;line-height:1.25}
.phase-order-list{display:grid;gap:4px;max-height:52vh;overflow:auto;padding:1px 2px}
.phase-order-row{display:grid;grid-template-columns:26px minmax(160px,1fr) 66px 66px 42px 30px 30px;align-items:center;gap:5px;border:1px solid var(--border);background:#081426;border-radius:9px;padding:5px 6px;min-height:36px}
.phase-order-position{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;background:#0f213a;color:var(--muted);font-weight:900;font-size:10px}
.phase-order-label{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:750;font-size:11px;line-height:1.15}
.phase-order-label b{display:inline-grid;place-items:center;min-width:22px;height:18px;margin-right:6px;border-radius:6px;background:#10223a;color:#fff;font-size:10px}
.phase-order-date{display:grid;gap:1px;color:var(--text);font-size:10px;font-weight:800;line-height:1.05;text-align:center;white-space:nowrap}
.phase-order-date small{color:var(--muted);font-size:8px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.phase-order-meta{color:var(--muted);font-size:9.5px;text-align:right;white-space:nowrap}
.phase-order-btn{height:26px;padding:0;border-radius:7px;font-size:12px;line-height:1}
.phase-order-btn:disabled{opacity:.35;cursor:not-allowed}
#editModal .modal{max-width:480px}
#editPhaseModal .modal{max-width:430px}
#editModal .modal-header{padding:9px 12px}
#editModal .step-form{padding:10px 12px;gap:7px;max-height:calc(100vh - 76px)}
#editModal input,#editModal select,#editModal textarea{padding:6px 8px;border-radius:8px;font-size:12px}
#editModal textarea{height:58px;min-height:58px;resize:vertical}
#editModal .modal-actions{padding-top:9px;margin-top:3px}
#editModal .modal-actions button{padding:7px 10px;font-size:12px;min-width:82px}
@keyframes modal-enter{from{opacity:0;transform:scale(.95) translateY(10px)}to{opacity:1;transform:scale(1) translateY(0)}}
.modal-header{padding:12px 16px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center}
.modal-header h2{margin:0;font-size:16px;font-weight:800}
.close-btn{background:transparent;border:none;color:var(--muted);font-size:22px;cursor:pointer;padding:0;width:28px;height:28px;display:flex;align-items:center;justify-content:center;border-radius:50%}
.close-btn:hover{background:#1e293b;color:var(--text)}
.modal .step-form{padding:16px;display:grid;gap:10px;max-height:calc(100vh - 96px);overflow-y:auto}
.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:6px;border-top:1px solid var(--border);padding-top:12px}
.modal-actions .modal-actions-spacer{flex:1 1 auto}
.modal-actions button{min-width:100px}
.phase-edit-btn{flex:0 0 auto;width:22px;height:22px;padding:0;border-radius:6px;background:#233149;color:var(--text);display:inline-flex;align-items:center;justify-content:center;font-size:10px;line-height:1}
.phase-edit-btn:hover{background:#334155;color:#fff}
input.readonly-field{background:#1e293b;color:#94a3b8;cursor:not-allowed}
#modalStepsTable textarea.setup-notes{width:100%;min-width:220px;min-height:34px;height:34px;padding:6px;resize:vertical;line-height:1.3;font-size:13px;border-radius:6px}
.toast{position:fixed;right:18px;bottom:18px;background:#082f49;border:1px solid var(--accent);border-radius:14px;padding:14px 18px;box-shadow:0 18px 40px #0008;z-index:10000}
@media(max-width:1180px){
  body{overflow:auto}
  .topbar{height:auto;flex-wrap:wrap}
  .topbar-actions{position:static;transform:none;width:100%;max-width:none;flex:1 1 100%}
  .theme-switcher{width:100%;justify-content:center;order:3}
  .layout{height:auto;overflow:visible;grid-template-columns:1fr}
  .hybrid-sidebar{height:auto;grid-template-columns:1fr 1fr;grid-template-rows:auto;align-items:stretch}
  .hybrid-brand{grid-column:1 / -1}
  .workspace{height:auto;overflow:visible}
  .cycle-summary{max-height:none;grid-template-columns:1fr;align-items:stretch}
  .kpis{grid-template-columns:repeat(2,1fr)}
  #editModal.task-edit-popover,
  #editPhaseModal.phase-edit-popover{inset:96px 12px auto 12px;width:auto}
  #phaseOrderModal.phase-order-popover{inset:210px 12px auto 12px;width:auto}
  .flow-panel{height:auto;min-height:520px}
  .flow{min-height:480px;grid-template-columns:repeat(3,minmax(245px,1fr))}
}

.export-fields-panel{border:1px solid var(--border);border-radius:12px;padding:8px 10px;background:#0b1628;margin-bottom:8px}
.export-fields-panel summary{cursor:pointer;font-weight:900;color:var(--text);font-size:12px}
.export-field-actions{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0}
.compact-export-actions button{min-width:auto;padding:6px 8px;font-size:11px}
.export-group-name,.export-group-select{height:30px;min-width:138px;border:1px solid var(--border);border-radius:8px;background:#091425;color:var(--text);padding:5px 8px;font-size:11px}
.export-fields-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(128px,1fr));gap:4px;max-height:112px;overflow:auto}
.export-fields-list.compact{grid-template-columns:repeat(auto-fill,minmax(120px,1fr))}
.export-field-option{display:flex;align-items:center;gap:5px;padding:4px 6px;border:1px solid var(--border);border-radius:7px;background:#091425;font-size:10.5px;line-height:1.05;color:var(--text)}
.export-field-option input{accent-color:var(--accent);width:13px;height:13px;flex:0 0 auto}

@media(max-width: 768px){
  /* Topbar / Header adjustments */
  .topbar{
    height: auto !important;
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 10px !important;
    gap: 10px !important;
  }
  .topbar-title{
    max-width: none !important;
    width: 100% !important;
    text-align: center !important;
    flex: 1 1 auto !important;
  }
  .topbar h1{
    font-size: 16px !important;
    text-align: center !important;
  }
  .topbar-actions{
    width: 100% !important;
    max-width: none !important;
    margin: 4px 0 !important;
  }
  
  /* Horizontal scroll for KPIs on mobile */
  .kpis{
    display: flex !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    padding: 4px 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none; /* Hide scrollbar for IE/Edge */
    scrollbar-width: none; /* Hide scrollbar for Firefox */
  }
  .kpis::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
  }
  .kpis .kpi-card{
    flex: 0 0 135px !important;
    scroll-snap-align: start !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 5px 8px !important;
  }
  
  /* Theme switcher & user menu centering */
  .theme-switcher{
    width: auto !important;
    margin: 4px auto !important;
    justify-content: center !important;
    order: 4 !important;
  }
  .auth-user-menu{
    width: 100% !important;
    justify-content: center !important;
    gap: 8px !important;
    order: 5 !important;
    margin-top: 4px !important;
  }
  
  /* Layout adjustments */
  .layout{
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    padding: 8px !important;
  }
  
  /* Workspace is shown first so the user sees the dashboard content first */
  .workspace{
    order: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }
  
  /* Sidebar containing controls is shown second (at the bottom) */
  .hybrid-sidebar{
    order: 2 !important;
    grid-template-columns: 1fr !important; /* Stack columns vertically on mobile */
    gap: 12px !important;
    padding: 4px !important;
    border-top: 1px solid var(--border) !important;
    padding-top: 16px !important;
    margin-top: 16px !important;
  }
  
  html,
  body{
    width:100% !important;
    max-width:100% !important;
    overflow-x:hidden !important;
  }
  .content-grid,
  .flow-panel{
    width:100% !important;
    max-width:100% !important;
    overflow:visible !important;
  }

  /* Stack Kanban columns on mobile to avoid clipped/sideways content */
  .flow{
    display:grid !important;
    grid-template-columns:1fr !important;
    overflow:visible !important;
    gap:12px !important;
    padding:4px 8px 16px !important;
    width:100% !important;
    max-width:100% !important;
    min-height:0 !important;
    scroll-snap-type:none !important;
  }
  .kanban-column{
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
    overflow:visible !important;
    margin:0 !important;
    box-sizing:border-box !important;
  }
  
  /* Horizontal scroll for timeline on mobile */
  .phase-timeline {
    padding: 14px 4px 4px !important;
    gap: 6px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  
  /* Popovers are turned into comfortable centered modals on mobile */
  #editModal.task-edit-popover,
  #editPhaseModal.phase-edit-popover,
  #phaseOrderModal.phase-order-popover {
    position: fixed !important;
    inset: 12px !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    max-height: calc(100vh - 24px) !important;
    z-index: 10050 !important;
    border-radius: 16px !important;
    box-shadow: 0 24px 64px rgba(0,0,0,.6) !important;
    background: #0d1a30 !important;
    pointer-events: auto !important;
  }
}
