:root {
  --bg:          #e8eaf0;
  --surface:     #ffffff;
  --dark:        #1c1f2e;
  --dark-2:      #262a3d;
  --dark-3:      #2f3347;
  --lime:        #cef53c;
  --lime-dim:    #b8e030;
  --lime-soft:   rgba(206,245,60,0.15);
  --text-primary:   #111827;
  --text-secondary: #6b7280;
  --text-muted:     #9ca3af;
  --text-light:     rgba(255,255,255,0.85);
  --text-light-dim: rgba(255,255,255,0.45);
  --border:      #e5e7eb;
  --border-dark: rgba(255,255,255,0.08);
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --radius-xl:   22px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg:   0 12px 40px rgba(0,0,0,0.14);
  --font:        'DM Sans', sans-serif;
  --font-display:'Syne', sans-serif;
  --font-mono:   'DM Mono', monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { background: var(--bg); font-family: var(--font); color: var(--text-primary); min-height: 100vh; overflow-x: hidden; }
 
/* TOP NAV */
.topnav {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 20px; height: 52px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 100;
}
.nav-brand {
  font-family: var(--font-display); font-size: 15px; font-weight: 800;
  color: var(--text-primary); display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.brand-dot {
  width: 24px; height: 24px; background: var(--lime); border-radius: 7px;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.nav-tabs {
  display: flex; align-items: center; gap: 2px;
  flex: 1; overflow-x: auto; scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  padding: 5px 13px; border-radius: 100px; font-size: 12.5px; font-weight: 500;
  cursor: pointer; white-space: nowrap; color: var(--text-secondary);
  transition: all 0.2s; border: none; background: none; font-family: var(--font);
}
.nav-tab:hover { background: var(--bg); color: var(--text-primary); }
.nav-tab.active { background: var(--lime); color: #111; font-weight: 700; }
.nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-icon-btn {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 13px; transition: background 0.15s;
}
.nav-icon-btn:hover { background: var(--bg); }
.btn-create {
  padding: 6px 13px; background: var(--dark); color: white;
  border: none; border-radius: var(--radius-md); font-family: var(--font);
  font-size: 12px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 5px; transition: opacity 0.2s;
}
.btn-create:hover { opacity: 0.82; }
 
/* PAGE HEADER */
.page-header {
  padding: 18px 20px 10px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.page-title { font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.progress-dots { display: flex; gap: 5px; align-items: center; }
.p-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); transition: background 0.3s; }
.p-dot.done { background: var(--lime); }
.p-dot.partial { background: var(--lime-dim); opacity: 0.5; }
.prog-label { font-size: 11px; color: var(--text-muted); margin-left: 6px; }
 
/* STAT CARDS */
.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; padding: 0 20px 14px;
}
@media (max-width: 860px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats-row { grid-template-columns: 1fr 1fr; } }
.stat-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 14px 16px; box-shadow: var(--shadow-sm); transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card.accent { background: var(--dark); }
.stat-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 5px; }
.stat-card.accent .stat-label { color: var(--text-light-dim); }
.stat-value { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; }
.stat-card.accent .stat-value { color: white; }
.stat-sub { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
.stat-card.accent .stat-sub { color: var(--text-light-dim); }
.stat-progress { margin-top: 8px; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.stat-progress-fill { height: 100%; background: var(--lime); border-radius: 2px; transition: width 0.4s ease; }
.stat-lime-badge {
  display: inline-flex; align-items: center; background: var(--lime);
  color: #111; padding: 2px 9px; border-radius: 100px;
  font-size: 11px; font-weight: 700; margin-top: 6px;
}
 
/* FILTER BAR */
.filter-bar {
  padding: 0 20px 10px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.filter-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.filter-count {
  background: var(--dark); color: white; width: 17px; height: 17px;
  border-radius: 50%; font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.filter-select {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 5px 26px 5px 9px; font-family: var(--font); font-size: 12px; color: var(--text-primary);
  cursor: pointer; outline: none; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center;
  box-shadow: var(--shadow-sm); transition: border-color 0.2s;
}
.filter-select:focus { border-color: var(--lime-dim); }
.filter-spacer { flex: 1; }
.search-box {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 5px 9px; box-shadow: var(--shadow-sm);
}
.search-box input {
  border: none; outline: none; font-family: var(--font);
  font-size: 12px; color: var(--text-primary); background: none; width: 130px;
}
.search-box input::placeholder { color: var(--text-muted); }
 
/* MAIN SPLIT */
.main-split {
  display: grid; grid-template-columns: 300px 1fr;
  gap: 10px; padding: 0 20px 20px;
  min-height: calc(100vh - 195px);
}
@media (max-width: 780px) {
  .main-split { grid-template-columns: 1fr; padding: 0 12px 20px; }
  .stats-row { padding: 0 12px 12px; }
  .filter-bar { padding: 0 12px 10px; }
  .page-header { padding: 14px 12px 8px; }
  .topnav { padding: 0 12px; }
}
 
/* LEFT PANEL */
.left-panel {
  background: var(--dark); border-radius: var(--radius-xl);
  overflow: hidden; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.panel-tabs {
  display: flex; align-items: center; padding: 12px 12px 0; gap: 4px;
}
.panel-tab {
  padding: 5px 11px; border-radius: 100px; font-size: 12px; font-weight: 500;
  cursor: pointer; color: var(--text-light-dim); border: none; background: none;
  transition: all 0.2s; font-family: var(--font);
}
.panel-tab.active { background: var(--lime); color: #111; font-weight: 700; }
.panel-tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; background: rgba(255,255,255,0.12);
  border-radius: 50%; font-size: 9px; margin-left: 3px;
}
.panel-tab.active .panel-tab-count { background: rgba(0,0,0,0.2); }
.section-list { flex: 1; overflow-y: auto; padding: 8px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.08) transparent; }
.section-list::-webkit-scrollbar { width: 3px; }
.section-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.section-item {
  display: flex; align-items: center; padding: 10px 11px;
  border-radius: var(--radius-md); cursor: pointer; margin-bottom: 2px;
  transition: background 0.15s; gap: 9px;
}
.section-item:hover { background: rgba(255,255,255,0.05); }
.section-item.active { background: rgba(206,245,60,0.10); }
.section-avatar {
  width: 30px; height: 30px; border-radius: 9px;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.section-item.active .section-avatar { background: var(--lime); }
.section-info { flex: 1; min-width: 0; }
.section-name { font-size: 12.5px; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.section-item.active .section-name { color: var(--lime); }
.section-desc { font-size: 10.5px; color: var(--text-light-dim); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.section-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 100px;
  background: rgba(255,255,255,0.08); color: var(--text-light-dim); flex-shrink: 0;
}
.section-item.active .section-badge { background: var(--lime); color: #111; }
.section-item.done .section-badge { background: rgba(206,245,60,0.15); color: var(--lime); }
 
/* RIGHT PANEL */
.right-panel {
  background: var(--surface); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md); overflow: hidden;
  display: flex; flex-direction: column;
}
.detail-header {
  padding: 16px 22px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between;
}
.detail-ref { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); margin-bottom: 3px; }
.detail-title { font-family: var(--font-display); font-size: 19px; font-weight: 800; letter-spacing: -0.02em; display: inline; }
.detail-status {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 100px;
  font-size: 10.5px; font-weight: 700; background: var(--dark); color: white;
  margin-left: 9px; vertical-align: middle;
}
.detail-status.done { background: var(--lime-soft); color: var(--lime-dim); }
.detail-actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn {
  width: 30px; height: 30px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text-secondary); transition: background 0.15s;
}
.icon-btn:hover { background: var(--bg); }
 
/* FORM BODY */
.detail-body {
  flex: 1; overflow-y: auto; padding: 18px 22px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.detail-body::-webkit-scrollbar { width: 3px; }
.detail-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.field-section { margin-bottom: 20px; }
.field-section-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 9px;
  display: flex; align-items: center; gap: 8px;
}
.field-section-title::after { content:''; flex:1; height:1px; background:var(--border); }
.fields-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 9px; }
.field-group { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-size: 10.5px; font-weight: 600; color: var(--text-secondary); }
.field-select, .field-textarea {
  background: var(--bg); border: 1.5px solid transparent;
  border-radius: var(--radius-sm); padding: 7px 28px 7px 9px;
  font-family: var(--font); font-size: 12.5px; color: var(--text-primary);
  outline: none; width: 100%; appearance: none; -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center;
  transition: border-color 0.2s, background 0.2s;
}
.field-select option { background: white; }
.field-select:focus, .field-textarea:focus { border-color: var(--lime-dim); background-color: rgba(206,245,60,0.05); }
.field-select.has-value { border-color: var(--lime-dim); font-weight: 500; }
.field-textarea { resize: vertical; min-height: 70px; padding: 8px 10px; background-image: none !important; line-height: 1.5; }
 
/* PLACEMENT */
.placement-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); gap: 5px; }
.placement-chip {
  padding: 6px 9px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--bg); font-size: 11px; color: var(--text-secondary);
  cursor: pointer; text-align: center; transition: all 0.15s; user-select: none; font-weight: 500;
}
.placement-chip:hover { border-color: var(--lime-dim); color: var(--text-primary); }
.placement-chip.active { background: var(--lime); border-color: var(--lime-dim); color: #111; font-weight: 700; }
 
/* MULTI CHIPS */
.chip-wrap { display: flex; flex-wrap: wrap; gap: 5px; }
.m-chip {
  padding: 5px 11px; border-radius: 100px; border: 1.5px solid var(--border);
  background: var(--bg); font-size: 11.5px; color: var(--text-secondary);
  cursor: pointer; user-select: none; transition: all 0.15s; font-weight: 500;
}
.m-chip:hover { border-color: var(--lime-dim); color: var(--text-primary); }
.m-chip.active { background: var(--dark); border-color: var(--dark); color: white; }
 
/* PROMPT BAR */
.prompt-bar { border-top: 1px solid var(--border); padding: 13px 22px; background: var(--surface); }
.prompt-output {
  background: var(--bg); border-radius: var(--radius-md); padding: 11px 13px;
  font-family: var(--font-mono); font-size: 11px; line-height: 1.65;
  color: var(--text-secondary); min-height: 60px; max-height: 110px;
  overflow-y: auto; margin-bottom: 9px; border: 1.5px solid var(--border);
  transition: border-color 0.25s; word-break: break-word;
}
.prompt-output.has-content { border-color: var(--lime-dim); color: var(--text-primary); }
.prompt-placeholder { color: var(--text-muted); font-style: italic; }
.prompt-actions { display: flex; gap: 7px; align-items: center; }
.prompt-actions .spacer { flex: 1; }
.btn {
  padding: 7px 16px; border-radius: var(--radius-md); border: none; cursor: pointer;
  font-family: var(--font); font-size: 12.5px; font-weight: 700;
  display: flex; align-items: center; gap: 5px; transition: all 0.15s;
}
.btn-lime { background: var(--lime); color: #111; box-shadow: 0 2px 8px rgba(206,245,60,0.25); }
.btn-lime:hover { background: var(--lime-dim); transform: translateY(-1px); }
.btn-dark { background: var(--dark); color: white; }
.btn-dark:hover { opacity: 0.82; }
.btn-ghost { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--border); color: var(--text-primary); }
.btn:active { transform: scale(0.97); }
 
/* TOAST */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--dark); color: white;
  padding: 8px 20px; border-radius: 100px;
  font-size: 12.5px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all 0.25s;
  z-index: 1000; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 7px;
}
.toast .t-lime { color: var(--lime); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
 
/* RESPONSIVE EXTRAS */
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .search-box { display: none; }
  .page-title { font-size: 22px; }
}