/* ===== NetFiber Tropical Haven Ops Portal — Master Stylesheet ===== */
/* Enhanced with deep visual immersion, glass morphism, and particle effects */

/* --- CSS Variables / Dark Theme --- */
:root {
  --bg: #08111c;
  --bg-alt: #0b1522;
  --panel: #0e1a2a;
  --panel-2: #132338;
  --line: rgba(255,255,255,.08);
  --text: #eef5ff;
  --muted: #93a7c3;
  --green: #39d98a;
  --green-2: #1fbf72;
  --blue: #4f8cff;
  --cyan: #00e5ff;
  --orange: #ff9f43;
  --gold: #d4b063;
  --red: #ff6b6b;
  --purple: #a78bfa;
  --shadow: 0 24px 80px rgba(0,0,0,.38);
  --shadow-heavy: 0 32px 100px rgba(0,0,0,.55);
  --radius: 22px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Fira Code", monospace;
  --glass: rgba(14,26,42,.65);
  --glass-border: rgba(255,255,255,.06);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  min-height: 100vh;
}
body {
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(79,140,255,.12), transparent),
    radial-gradient(ellipse 60% 40% at 80% 90%, rgba(0,229,255,.08), transparent),
    radial-gradient(ellipse 50% 30% at 50% 50%, rgba(167,139,250,.06), transparent),
    linear-gradient(180deg, #07101a 0%, #08111c 35%, #09131d 100%);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; height: auto; }

/* --- Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .6; }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(57,217,138,.4); }
  50%      { box-shadow: 0 0 24px rgba(57,217,138,.8); }
}
@keyframes pulseScale {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}
@keyframes rotateGlow {
  0%   { transform: rotate(0deg) scale(1); box-shadow: 0 0 8px var(--cyan); }
  50%  { transform: rotate(180deg) scale(1.2); box-shadow: 0 0 20px var(--cyan); }
  100% { transform: rotate(360deg) scale(1); box-shadow: 0 0 8px var(--cyan); }
}
@keyframes flowRight {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to   { opacity: 1; max-height: 1200px; }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes scanline {
  0%   { top: -100%; }
  100% { top: 200%; }
}

.animate-in { animation: fadeInUp .6s ease both; }
.animate-in-delay-1 { animation-delay: .1s; }
.animate-in-delay-2 { animation-delay: .2s; }
.animate-in-delay-3 { animation-delay: .3s; }
.animate-in-delay-4 { animation-delay: .4s; }
.animate-in-delay-5 { animation-delay: .5s; }

/* --- Layout: App Shell --- */
.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  position: relative;
}

/* --- Background Ambient Orbs --- */
.bg-particles {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0; overflow: hidden;
}
.bg-particles .orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); animation: float 12s ease-in-out infinite; opacity: .3;
}
.bg-particles .orb-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(79,140,255,.2), transparent 60%);
  top: 10%; left: -5%;
}
.bg-particles .orb-2 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(0,229,255,.15), transparent 60%);
  top: 60%; right: -3%; animation-delay: -4s;
}
.bg-particles .orb-3 {
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(167,139,250,.12), transparent 60%);
  bottom: 10%; left: 30%; animation-delay: -8s;
}

/* --- Sidebar / Navigation --- */
.sidebar {
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--glass-border);
  background: linear-gradient(180deg, rgba(14,26,42,.85), rgba(14,26,42,.7));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 20px 16px;
  display: flex; flex-direction: column; gap: 12px;
  overflow-y: auto; z-index: 30;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border: 1px solid var(--line);
  border-radius: 20px; background: rgba(255,255,255,.03);
  position: relative; overflow: hidden;
}
.brand::after {
  content: ''; position: absolute;
  top: 0; left: -100%; width: 200%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.04), transparent);
  animation: shimmer 6s infinite;
}
.brand-mark {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, #1fe08c, #0c7e54);
  display: grid; place-items: center;
  font-weight: 900; font-size: 15px; color: #062716;
  box-shadow: 0 8px 24px rgba(31,224,140,.25);
  flex-shrink: 0; position: relative; z-index: 1;
}
.brand h1 { font-size: 16px; line-height: 1.15; margin: 0; position: relative; z-index: 1; }
.brand small { display: block; color: var(--muted); margin-top: 2px; font-size: 11px; position: relative; z-index: 1; }

.project-pill {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(79,140,255,.16), rgba(31,224,140,.1));
  border: 1px solid rgba(255,255,255,.08);
}
.project-pill strong { font-size: 14px; }
.project-pill span { font-size: 11px; color: var(--muted); }

.nav { display: grid; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 12px 14px;
  background: transparent; color: var(--text);
  border: 1px solid transparent; border-radius: 14px;
  cursor: pointer; text-align: left; font-size: 14px;
  transition: all .25s ease; position: relative; overflow: hidden;
}
.nav a::before {
  content: ''; position: absolute;
  left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--blue), var(--cyan));
  border-radius: 0 4px 4px 0; opacity: 0; transition: opacity .25s;
}
.nav a:hover { background: rgba(255,255,255,.045); border-color: var(--line); }
.nav a.active { background: rgba(79,140,255,.12); border-color: rgba(79,140,255,.2); color: #fff; }
.nav a.active::before { opacity: 1; }
.nav a i { width: 20px; text-align: center; font-size: 14px; color: var(--muted); transition: color .25s; }
.nav a.active i { color: var(--blue); }

.sidebar-footer {
  margin-top: auto; padding: 14px;
  border: 1px solid var(--line); border-radius: 16px;
  background: rgba(255,255,255,.028);
}
.sidebar-footer p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* --- Save Status Indicator --- */
.save-status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  border: 1px solid var(--line); background: rgba(255,255,255,.03);
  transition: all .3s ease; opacity: 0;
}
.save-status.visible { opacity: 1; }
.save-status.saving { border-color: rgba(79,140,255,.3); color: var(--blue); }
.save-status.saved { border-color: rgba(57,217,138,.3); color: var(--green); }
.save-status.error { border-color: rgba(255,107,107,.3); color: var(--red); }

.last-updated {
  font-size: 11px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}

/* --- Main Content Area --- */
.main { padding: 24px 28px 40px; min-width: 0; position: relative; z-index: 1; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.mobile-toggle { display: none; }
.page-title h2 { margin: 0; font-size: 28px; line-height: 1.1; }
.page-title p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* --- Buttons --- */
.btn {
  border: none; cursor: pointer;
  padding: 12px 18px; border-radius: 14px;
  font-weight: 700; letter-spacing: .01em;
  transition: all .25s ease; font-size: 13px;
  display: inline-flex; align-items: center; gap: 8px;
  position: relative; overflow: hidden;
}
.btn:hover { transform: translateY(-1px); }
.btn::after {
  content: ''; position: absolute;
  top: 0; left: -100%; width: 200%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
  transition: left .5s;
}
.btn:hover::after { left: 100%; }
.btn.primary {
  background: linear-gradient(135deg, var(--green), var(--green-2));
  color: #062716; box-shadow: 0 12px 32px rgba(31,224,140,.22);
}
.btn.primary:hover { box-shadow: 0 16px 44px rgba(31,224,140,.35); }
.btn.secondary {
  background: rgba(255,255,255,.06); color: var(--text);
  border: 1px solid var(--line);
}
.btn.secondary:hover { background: rgba(255,255,255,.1); }
.btn.blue {
  background: linear-gradient(135deg, var(--blue), #3571e0);
  color: #fff; box-shadow: 0 12px 32px rgba(79,140,255,.22);
}
.btn.sm { padding: 8px 14px; font-size: 12px; border-radius: 10px; }

/* --- Editable Stat Input --- */
.editable-stat {
  background: transparent; border: 1px solid transparent;
  border-radius: 10px; color: inherit; font-size: inherit;
  font-weight: inherit; font-family: inherit; width: 100%;
  padding: 4px 8px; text-align: center; transition: all .2s;
  -webkit-text-fill-color: inherit; -moz-appearance: textfield;
}
.editable-stat::-webkit-inner-spin-button,
.editable-stat::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.editable-stat:hover { border-color: rgba(255,255,255,.15); background: rgba(255,255,255,.04); }
.editable-stat:focus {
  outline: none; border-color: var(--blue);
  background: rgba(79,140,255,.08); box-shadow: 0 0 0 3px rgba(79,140,255,.15);
}

/* --- Cards & Panels --- */
.panel {
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.015));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .3s;
  position: relative; overflow: hidden;
}
.panel::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
}
.panel:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-heavy);
  border-color: rgba(79,140,255,.15);
}
.panel h3 { margin: 0 0 8px; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.panel h3 i { color: var(--blue); font-size: 16px; }
.panel .lead { margin: 0 0 14px; color: var(--muted); line-height: 1.6; font-size: 14px; }

.cards-grid { display: grid; gap: 18px; }
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.cards-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.cards-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* --- Hero Section --- */
.hero {
  padding: 24px; border: 1px solid var(--line); border-radius: 28px;
  background: linear-gradient(135deg, rgba(79,140,255,.14), rgba(31,224,140,.08) 48%, rgba(255,255,255,.025));
  box-shadow: var(--shadow); overflow: hidden; position: relative; margin-bottom: 22px;
}
.hero::after {
  content: ""; position: absolute; right: -120px; top: -80px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(255,255,255,.08), transparent 58%);
  pointer-events: none;
}
.hero::before {
  content: ''; position: absolute; top: -50%; left: -20%;
  width: 60%; height: 200%;
  background: linear-gradient(45deg, transparent, rgba(79,140,255,.04), transparent);
  animation: scanline 8s linear infinite; pointer-events: none;
}
.hero h3 { margin: 0 0 8px; font-size: 24px; position: relative; z-index: 1; }
.hero p { margin: 0; color: #cfddf2; line-height: 1.65; font-size: 14px; position: relative; z-index: 1; }

/* --- Stats Cards --- */
.stat-card {
  padding: 18px; border-radius: 18px;
  background: rgba(5,10,18,.5); border: 1px solid rgba(255,255,255,.08);
  transition: all .3s ease; position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(79,140,255,.3), transparent);
  opacity: 0; transition: opacity .3s;
}
.stat-card:hover { border-color: rgba(79,140,255,.25); }
.stat-card:hover::after { opacity: 1; }
.stat-card .label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); display: flex; align-items: center; gap: 6px;
}
.stat-card .label i { font-size: 12px; }
.stat-card .value {
  font-size: 32px; font-weight: 800; margin-top: 6px;
  background: linear-gradient(135deg, #fff, #c5d8f0);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-card .sub { font-size: 12px; color: #8ea5c4; margin-top: 4px; }
.stat-card.highlight { border-color: rgba(57,217,138,.25); }
.stat-card.highlight .value {
  background: linear-gradient(135deg, var(--green), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* --- Badge / Status --- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid rgba(255,255,255,.08); padding: 6px 10px;
  border-radius: 999px; font-size: 11px; color: #d9e6f9;
  background: rgba(255,255,255,.03);
}
.status-pill {
  display: inline-flex; padding: 6px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; border: 1px solid transparent;
  cursor: pointer; user-select: none; transition: all .2s;
}
.status-pill:hover { filter: brightness(1.2); }
.status-pill.complete { background: rgba(57,217,138,.12); color: #7af0b4; border-color: rgba(57,217,138,.24); }
.status-pill.in-progress { background: rgba(79,140,255,.12); color: #9cc0ff; border-color: rgba(79,140,255,.24); }
.status-pill.not-started { background: rgba(212,176,99,.12); color: #f3d6a0; border-color: rgba(212,176,99,.24); }
.status-pill.ready { background: rgba(57,217,138,.12); color: #7af0b4; border-color: rgba(57,217,138,.24); }

/* --- Progress Bar --- */
.progress-bar {
  width: 100%; height: 10px; background: rgba(255,255,255,.06);
  border-radius: 999px; overflow: hidden; position: relative;
}
.progress-bar .fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--blue));
  transition: width .6s ease; position: relative;
}
.progress-bar .fill::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
  animation: shimmer 3s infinite; background-size: 200% 100%;
}

/* --- Chart Container --- */
.chart-wrap {
  position: relative; width: 100%;
  background: rgba(5,10,18,.4); border: 1px solid rgba(255,255,255,.06);
  border-radius: 18px; padding: 16px;
}
.chart-wrap canvas { width: 100% !important; }

/* --- Accordion (Task List) --- */
.accordion { display: grid; gap: 10px; }
.accordion-item {
  border: 1px solid var(--line); border-radius: 18px;
  background: rgba(255,255,255,.02); overflow: hidden; transition: border-color .3s;
}
.accordion-item.open { border-color: rgba(79,140,255,.25); }
.accordion-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; cursor: pointer; background: rgba(255,255,255,.025);
  transition: background .2s; user-select: none;
}
.accordion-header:hover { background: rgba(255,255,255,.05); }
.accordion-header h4 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.accordion-header h4 i { color: var(--blue); }
.accordion-header .chevron { transition: transform .3s ease; color: var(--muted); font-size: 14px; }
.accordion-item.open .accordion-header .chevron { transform: rotate(180deg); }
.accordion-body {
  max-height: 0; overflow: hidden;
  transition: max-height .4s ease, padding .3s ease; padding: 0 20px;
}
.accordion-item.open .accordion-body { max-height: 4000px; padding: 0 20px 20px; }

/* --- Task Items --- */
.task-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.task-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.04);
  transition: all .25s;
}
.task-item:hover { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.08); }
.task-item > i { color: var(--blue); margin-top: 3px; font-size: 13px; flex-shrink: 0; }
.task-item .task-content { flex: 1; }
.task-item .task-name { font-weight: 600; font-size: 14px; }
.task-item .task-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.task-item .task-assignee {
  font-size: 11px; font-weight: 600; color: var(--cyan); margin-top: 4px;
  display: flex; align-items: center; gap: 5px;
}
.task-item .task-days { font-size: 12px; font-weight: 700; color: var(--orange); white-space: nowrap; margin-top: 3px; }
.task-item .task-actions { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }

/* --- Phase Tab Navigation --- */
.phase-tabs {
  display: flex; gap: 4px; padding: 4px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line);
  border-radius: 16px; margin-bottom: 18px;
}
.phase-tab {
  flex: 1; padding: 12px 18px; border-radius: 12px; border: none;
  background: transparent; color: var(--muted); font-weight: 700;
  font-size: 14px; cursor: pointer; transition: all .25s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.phase-tab:hover { background: rgba(255,255,255,.04); color: var(--text); }
.phase-tab.active { background: rgba(79,140,255,.15); color: #fff; box-shadow: 0 4px 16px rgba(79,140,255,.15); }
.phase-tab.active.p1 { background: rgba(0,229,255,.15); }
.phase-tab.active.p2 { background: rgba(167,139,250,.15); }
.phase-tab.active.p3 { background: rgba(255,159,67,.15); }
.phase-tab .tab-badge { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.1); }

/* --- Phase Metric Sliders --- */
.metric-slider-group { margin-bottom: 20px; }
.metric-slider-group .metric-label {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.metric-slider-group .metric-label .label-text {
  font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.metric-slider-group .metric-label .label-text i { font-size: 12px; }
.metric-slider-group .metric-label .metric-value {
  font-size: 18px; font-weight: 900; font-family: var(--mono);
}
.metric-slider-group .metric-label .metric-value.pct {
  background: linear-gradient(135deg, var(--cyan), var(--green));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.metric-slider-group .metric-label .metric-value.num { color: var(--orange); }
.metric-slider {
  width: 100%; -webkit-appearance: none; appearance: none;
  height: 8px; border-radius: 999px; background: rgba(255,255,255,.08);
  outline: none; transition: background .2s;
}
.metric-slider:hover { background: rgba(255,255,255,.12); }
.metric-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  cursor: pointer; box-shadow: 0 0 16px rgba(0,229,255,.4), 0 2px 8px rgba(0,0,0,.4);
  border: 2px solid rgba(255,255,255,.3); transition: transform .15s, box-shadow .15s;
}
.metric-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15); box-shadow: 0 0 24px rgba(0,229,255,.6), 0 4px 12px rgba(0,0,0,.5);
}
.metric-slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  cursor: pointer; box-shadow: 0 0 16px rgba(0,229,255,.4);
  border: 2px solid rgba(255,255,255,.3);
}
.metric-slider.orange::-webkit-slider-thumb { background: linear-gradient(135deg, var(--orange), #ffbe76); box-shadow: 0 0 16px rgba(255,159,67,.4), 0 2px 8px rgba(0,0,0,.4); }
.metric-slider.purple::-webkit-slider-thumb { background: linear-gradient(135deg, var(--purple), #c4b5fd); box-shadow: 0 0 16px rgba(167,139,250,.4), 0 2px 8px rgba(0,0,0,.4); }
.metric-slider.green::-webkit-slider-thumb { background: linear-gradient(135deg, var(--green), var(--green-2)); box-shadow: 0 0 16px rgba(57,217,138,.4), 0 2px 8px rgba(0,0,0,.4); }
.metric-slider.blue::-webkit-slider-thumb { background: linear-gradient(135deg, var(--blue), #6ea5ff); box-shadow: 0 0 16px rgba(79,140,255,.4), 0 2px 8px rgba(0,0,0,.4); }
.metric-sub { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }

/* --- Inline Editable Number --- */
.inline-edit {
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  color: var(--text); padding: 6px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 700; font-family: var(--mono);
  width: 80px; text-align: center; transition: all .2s; -moz-appearance: textfield;
}
.inline-edit::-webkit-inner-spin-button,
.inline-edit::-webkit-outer-spin-button { -webkit-appearance: none; }
.inline-edit:focus { outline: none; border-color: var(--blue); background: rgba(79,140,255,.08); box-shadow: 0 0 0 3px rgba(79,140,255,.12); }

/* --- Assignee Input --- */
.assignee-input {
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  color: var(--cyan); padding: 6px 10px; border-radius: 8px;
  font-size: 12px; font-weight: 600; width: 140px; transition: all .2s;
}
.assignee-input::placeholder { color: rgba(255,255,255,.2); }
.assignee-input:focus { outline: none; border-color: var(--cyan); background: rgba(0,229,255,.06); }

/* --- Audit Log --- */
.audit-log { max-height: 400px; overflow-y: auto; display: grid; gap: 4px; }
.audit-entry {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.03);
  font-size: 12px; transition: background .2s;
}
.audit-entry:hover { background: rgba(255,255,255,.04); }
.audit-entry .audit-time { color: var(--muted); font-size: 10px; font-family: var(--mono); white-space: nowrap; min-width: 60px; }
.audit-entry .audit-user { font-weight: 700; color: var(--cyan); white-space: nowrap; }
.audit-entry .audit-action { color: var(--text); flex: 1; }

/* --- User Identity Modal --- */
.user-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  backdrop-filter: blur(8px); display: flex; align-items: center;
  justify-content: center; z-index: 9999; animation: fadeIn .3s;
}
.user-modal {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid rgba(79,140,255,.2); border-radius: 28px;
  padding: 40px; max-width: 420px; width: 90%; text-align: center;
  box-shadow: 0 40px 120px rgba(0,0,0,.6), 0 0 60px rgba(79,140,255,.1);
}
.user-modal h3 { margin: 0 0 8px; font-size: 24px; }
.user-modal p { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.user-modal input {
  width: 100%; padding: 14px 18px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(255,255,255,.04);
  color: var(--text); font-size: 16px; font-weight: 600;
  text-align: center; margin-bottom: 16px; transition: all .2s;
}
.user-modal input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(79,140,255,.15); }
.user-modal .btn { width: 100%; justify-content: center; }

/* --- Phase Summary Cards --- */
.phase-summary-card {
  padding: 22px; border-radius: 22px;
  border: 1px solid rgba(255,255,255,.06);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  transition: all .3s; position: relative; overflow: hidden;
}
.phase-summary-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: 22px 22px 0 0;
}
.phase-summary-card.p1::before { background: linear-gradient(90deg, var(--cyan), var(--green)); }
.phase-summary-card.p2::before { background: linear-gradient(90deg, var(--purple), #c4b5fd); }
.phase-summary-card.p3::before { background: linear-gradient(90deg, var(--orange), #ffbe76); }
.phase-summary-card:hover { border-color: rgba(79,140,255,.2); transform: translateY(-3px); box-shadow: var(--shadow-heavy); }
.phase-summary-card .phase-title { font-size: 16px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.phase-summary-card .phase-metrics { display: grid; gap: 8px; }
.phase-summary-card .pm-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.04); font-size: 12px;
}
.phase-summary-card .pm-row:last-child { border-bottom: none; }
.phase-summary-card .pm-row .pm-label { color: var(--muted); }
.phase-summary-card .pm-row .pm-val { font-weight: 800; font-family: var(--mono); }

/* --- Deploy Panel (Map Editor) --- */
.deploy-panel { border-top: 1px solid var(--line); padding: 16px 18px; }
.deploy-panel h4 { margin: 0 0 12px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.deploy-panel .deploy-form { display: grid; gap: 10px; }
.deploy-panel select,
.deploy-panel input,
.deploy-panel textarea {
  width: 100%; background: rgba(255,255,255,.04); border: 1px solid var(--line);
  color: var(--text); padding: 9px 12px; border-radius: 10px;
  font-size: 13px; font-family: var(--font); transition: all .2s;
}
.deploy-panel select option { background: #0e1a2a; }
.deploy-panel input:focus,
.deploy-panel textarea:focus,
.deploy-panel select:focus { outline: none; border-color: var(--blue); background: rgba(79,140,255,.06); }
.deploy-panel textarea { min-height: 60px; resize: vertical; }

/* --- Interactive Map Container --- */
.map-container {
  position: relative; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--bg-alt);
  overflow: hidden; cursor: grab; min-height: 500px;
}
.map-container:active { cursor: grabbing; }
.map-viewport { position: relative; width: 100%; height: 100%; transform-origin: 0 0; transition: transform .1s ease; }
.map-svg { width: 100%; height: auto; display: block; }

/* --- Map Controls --- */
.map-controls {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: 16px;
  background: rgba(5,10,18,.6); border: 1px solid var(--line); flex-wrap: wrap;
}
.map-controls label { font-size: 13px; font-weight: 600; color: var(--muted); }
.map-controls .slider-wrap { flex: 1; min-width: 200px; }
.map-controls input[type="range"] {
  width: 100%; height: 6px; -webkit-appearance: none; appearance: none;
  background: rgba(255,255,255,.1); border-radius: 999px; outline: none;
}
.map-controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--blue));
  cursor: pointer; box-shadow: 0 0 12px rgba(57,217,138,.4);
}
.map-controls .progress-val {
  font-size: 20px; font-weight: 800;
  background: linear-gradient(135deg, var(--orange), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  min-width: 50px; text-align: right;
}

/* --- Map Setpoints --- */
.setpoint {
  position: absolute; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(120,130,150,.4); border: 2px solid rgba(120,130,150,.6);
  transform: translate(-50%, -50%); transition: all .5s ease; cursor: pointer; z-index: 5;
}
.setpoint .sp-label {
  position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%);
  font-size: 9px; white-space: nowrap; color: var(--muted); font-weight: 600;
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.setpoint:hover .sp-label { opacity: 1; }
.setpoint.active {
  background: rgba(0,229,255,.3); border-color: var(--cyan);
  animation: pulseScale 2s infinite ease-in-out; box-shadow: 0 0 16px rgba(0,229,255,.5);
}
.setpoint .sp-ring { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid transparent; transition: all .5s; }
.setpoint.active .sp-ring { border-color: rgba(0,229,255,.3); animation: rotateGlow 3s infinite linear; }

/* --- Map Overlays --- */
.conduit-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: 0; transition: opacity .6s; mix-blend-mode: screen; }
.conduit-overlay.visible { opacity: 1; }
.trunk-flow-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 3; opacity: 0; transition: opacity .6s; }
.trunk-flow-overlay.visible { opacity: 1; }

/* --- Map Zoom --- */
.zoom-controls { position: absolute; top: 14px; right: 14px; display: flex; flex-direction: column; gap: 6px; z-index: 10; }
.zoom-btn {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(14,26,42,.9); border: 1px solid var(--line);
  color: var(--text); font-size: 16px; display: grid; place-items: center;
  cursor: pointer; transition: all .2s;
}
.zoom-btn:hover { background: rgba(255,255,255,.1); }

/* --- Section spacing --- */
.section-gap { margin-top: 22px; }

/* --- Tables --- */
.table-wrap { overflow: auto; border-radius: 18px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 650px; background: rgba(255,255,255,.02); }
th, td { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.06); text-align: left; }
th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: rgba(255,255,255,.03); }
td { font-size: 13px; }

/* --- Overlay (mobile) --- */
.overlay { display: none; }
.overlay.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 20; }

/* --- Phase Scope Banner --- */
.phase-scope {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 14px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06); margin-bottom: 14px;
}
.phase-scope i { font-size: 16px; }
.phase-scope .scope-text { font-size: 13px; color: var(--muted); }
.phase-scope .scope-text strong { color: var(--text); }

/* --- Map Info --- */
.map-info { display: grid; gap: 10px; }
.info-row {
  display: flex; justify-content: space-between; padding: 10px 14px;
  border-radius: 12px; background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.04); font-size: 13px;
}
.info-row .val { font-weight: 700; }

/* --- Loading --- */
.loading-overlay { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 40px; color: var(--muted); font-size: 14px; }
.loading-overlay i { font-size: 20px; animation: pulse 1.5s infinite; }

/* --- Toast --- */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--panel-2); border: 1px solid rgba(79,140,255,.2);
  border-radius: 14px; padding: 14px 20px; font-size: 13px; font-weight: 600;
  color: var(--text); box-shadow: 0 12px 40px rgba(0,0,0,.5);
  z-index: 9990; animation: fadeInUp .4s ease; display: flex; align-items: center; gap: 10px;
}
.toast.success { border-color: rgba(57,217,138,.3); }
.toast.success i { color: var(--green); }

/* --- Responsive --- */
@media (max-width: 1200px) {
  .cards-3, .cards-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 280px;
    transform: translateX(-105%); transition: transform .3s ease; z-index: 30;
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 12px;
    background: rgba(255,255,255,.06); border: 1px solid var(--line);
    color: var(--text); cursor: pointer; font-size: 18px;
  }
  .topbar { align-items: flex-start; }
  .page-title h2 { font-size: 22px; }
  .cards-3, .cards-2, .cards-4 { grid-template-columns: 1fr; }
  .main { padding: 16px 14px 34px; }
  .phase-tabs { flex-direction: column; }
}
@media (max-width: 600px) {
  .hero { padding: 18px; }
  .hero h3 { font-size: 20px; }
  .map-controls { flex-direction: column; align-items: stretch; }
}

/* --- Utility --- */
.text-green { color: var(--green); }
.text-blue { color: var(--blue); }
.text-orange { color: var(--orange); }
.text-cyan { color: var(--cyan); }
.text-purple { color: var(--purple); }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 18px; }
.mt-3 { margin-top: 28px; }
.gap-sm { gap: 10px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid { display: grid; }
.small { font-size: 12px; color: var(--muted); }
.hidden { display: none !important; }
