@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ================================================================
   SCROLLBARS (global)
================================================================ */
* {
  scrollbar-width: thin;                 /* Firefox */
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.35); }

/* ================================================================
   BASE
================================================================ */
body {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-base);
}

/* ================================================================
   SIDEBAR
================================================================ */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: var(--sp-4) 0 var(--sp-4);
  overflow-y: auto;
}

#sidebar-header {
  padding: 0 var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-4);
}

#logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.logo-icon {
  font-size: 1.2rem;
  color: var(--accent);
}

.logo-text {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
}

/* ---- Project Selector ---- */
#project-selector-wrap {
  padding: 0 var(--sp-4) var(--sp-4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-3);
}

/* ---- Mode Nav ---- */
#mode-nav {
  flex: 1;
  padding: 0 var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: var(--sp-2) var(--sp-2) var(--sp-1);
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
  width: 100%;
  text-align: left;
}

.mode-btn:hover {
  background: var(--surface);
  color: var(--text);
}

.mode-btn.active {
  background: var(--accent-dim);
  color: var(--accent-2);
}

.mode-icon {
  font-size: 1rem;
  width: 18px;
  flex-shrink: 0;
}

.mode-btn span:not(.mode-icon):not(.mode-badge) {
  flex: 1;
}

.mode-badge {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-3);
  opacity: 0.7;
}

.mode-btn.active .mode-badge {
  color: var(--accent);
  opacity: 0.8;
}

.mode-btn.mode-btn-locked {
  opacity: 0.35;
  pointer-events: none;
  cursor: not-allowed;
}

/* ---- Phase Status Indicators ---- */
.mode-status {
  font-size: 0.7rem;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--r-full);
  color: transparent;
  transition: color var(--t-fast), background var(--t-fast);
}

.mode-status--done {
  color: var(--green, #22c55e);
  background: color-mix(in srgb, var(--green, #22c55e) 15%, transparent);
  font-weight: 700;
}

/* ---- Sidebar Footer ---- */
#sidebar-footer {
  padding: var(--sp-4) var(--sp-4) 0;
  border-top: 1px solid var(--border);
  margin-top: var(--sp-3);
}

.sidebar-link {
  font-size: var(--text-xs);
  color: var(--text-3);
  transition: color var(--t-fast);
}

.sidebar-link:hover { color: var(--text-2); }

/* ================================================================
   MAIN CONTENT
================================================================ */
#content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  height: 100vh;
}

/* ---- Mode Panels ---- */
.mode-panel {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  padding: var(--sp-8);
}

.mode-panel.active {
  display: flex;
}

/* ---- Panel Header ---- */
.panel-header {
  margin-bottom: var(--sp-6);
}

.panel-header h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-1);
}

.panel-desc {
  color: var(--text-2);
  font-size: var(--text-sm);
  max-width: 640px;
}

/* ---- Panel Body ---- */
.panel-body {
  flex: 1;
  display: flex;
  gap: var(--sp-6);
}

.panel-body.two-col .panel-left  { width: 360px; min-width: 320px; display: flex; flex-direction: column; gap: var(--sp-4); }
.panel-body.two-col .panel-right { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-4); }

/* ================================================================
   TOAST
================================================================ */
#toast-container {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  z-index: 1000;
}
