:root {
  --bg: #071426;
  --panel: #10243a;
  --panel-soft: #17314d;
  --text: #f5f6fa;
  --muted: #aebdd0;
  --line: #29445f;
  --accent: #b7ff3c;
  --accent-soft: rgba(183, 255, 60, 0.12);
  --danger: #ffb4a8;
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

button { font: inherit; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 280px;
  background: rgba(5, 17, 34, .96);
  border-right: 1px solid var(--line);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand-block { display: flex; align-items: center; gap: 14px; }
.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text, #f4f1ea);
  font-size: 1.2rem;
  line-height: 1;
  padding: 8px 12px;
  cursor: pointer;
}
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--accent); color: #101411; font-weight: 800;
}
.brand-title { font-weight: 750; letter-spacing: -.02em; }
.brand-subtitle { color: var(--muted); font-size: 14px; margin-top: 2px; }
.nav-menu { display: flex; flex-direction: column; gap: 8px; }
.nav-item {
  width: 100%; border: 0; border-radius: 14px; padding: 13px 14px;
  display: flex; gap: 12px; align-items: center;
  color: var(--muted); background: transparent; cursor: pointer; text-align: left;
}
.nav-item:hover, .nav-item.active { color: var(--text); background: var(--panel-soft); }
.nav-item.active { outline: 1px solid var(--line); }
.nav-item span { width: 20px; text-align: center; color: var(--accent); }
.sidebar-footer { margin-top: auto; color: var(--muted); font-size: 13px; }
.main-content { flex: 1; padding: 28px; overflow: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; gap: 20px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.04em; }
h2 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -.035em; margin-bottom: 10px; }
h3 { margin-bottom: 8px; }
.eyebrow { color: var(--accent); text-transform: uppercase; font-size: 12px; font-weight: 750; letter-spacing: .12em; margin-bottom: 8px; }
.profile-pill, .badge, .status {
  border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  border-radius: 999px; padding: 8px 12px; font-size: 13px; white-space: nowrap;
}
.page { display: none; }
.active-page { display: block; }
.hero-panel, .panel, .table-card, .simple-card, .empty-state, .settings-list {
  background: rgba(14, 32, 53, .92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-panel { padding: 28px; display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 22px; }
.hero-panel p, .page-intro p, .simple-card p, .empty-state p { color: var(--muted); line-height: 1.55; }
.primary-button, .secondary-button, .filter-button, .icon-button {
  border: 0; border-radius: 999px; cursor: pointer; font-weight: 750;
  padding: 11px 16px;
}
.primary-button { background: var(--accent); color: #101411; }
.secondary-button { background: var(--panel-soft); color: var(--text); border: 1px solid var(--line); }
.secondary-button.compact { padding: 8px 12px; font-size: 13px; }
.secondary-button.danger-button { color: var(--danger); border-color: var(--danger); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.metric-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.metric-card strong { display: block; font-size: 38px; letter-spacing: -.04em; margin: 8px 0; }
.metric-label, .metric-card small { color: var(--muted); }
.content-grid.two-column { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
.panel { padding: 22px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.time-tracker-settings-panel { margin-bottom: 22px; }
.inline-settings-form { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.inline-settings-form label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 650; }
.inline-settings-form input {
  width: 140px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  padding: 10px 14px;
  font: inherit;
  outline: none;
}
.inline-settings-form input:focus { border-color: var(--accent); }
.activity-list, .task-list { margin: 0; padding-left: 20px; color: var(--muted); }
.activity-list { list-style: none; padding-left: 0; }
.activity-list li { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.activity-list li:last-child { border-bottom: 0; }
time { color: var(--accent); white-space: nowrap; }
.page-intro { margin-bottom: 20px; max-width: 760px; }
.table-card { overflow: hidden; }
.inline-detail-table-wrap {
  margin-top: 16px;
  overflow-x: auto;
}
.inline-detail-table { width: 100%; min-width: 560px; border-collapse: collapse; }
.inline-detail-table th,
.inline-detail-table td {
  padding: 10px 12px;
  font-size: 13px;
  white-space: nowrap;
}
.inline-detail-table td:nth-child(4) { white-space: normal; min-width: 160px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px 18px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 13px; font-weight: 650; }
tr:last-child td { border-bottom: 0; }
.status.active { color: var(--accent); background: var(--accent-soft); }
.status.trial { color: #f9d783; }
.status.paused { color: var(--danger); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.simple-card { padding: 22px; }
.empty-state { padding: 36px; text-align: center; }
.settings-list { overflow: hidden; }
.settings-list div { display: flex; justify-content: space-between; gap: 20px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.settings-list div:last-child { border-bottom: 0; }
.settings-list span { color: var(--muted); }

@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar { position: static; width: 100%; height: auto; }
  .nav-toggle { display: block; }
  .nav-menu { display: none; grid-template-columns: repeat(2, minmax(0,1fr)); margin-top: 16px; }
  .nav-menu.nav-open { display: grid; }
  .topbar, .hero-panel { align-items: flex-start; flex-direction: column; }
  .metric-grid, .content-grid.two-column, .card-grid { grid-template-columns: 1fr; }
  .main-content { padding: 20px; }
  table { min-width: 680px; }
  .table-card { overflow-x: auto; }
}


.console-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
}
.console-header-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.console-header p {
  color: var(--muted);
  line-height: 1.55;
  max-width: 780px;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 12px;
}
.search-box {
  display: grid;
  gap: 8px;
  min-width: min(420px, 100%);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.search-box input,
.form-preview input,
.form-preview select {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  padding: 16px 18px;
  font: inherit;
  font-size: 15px;
  line-height: 1.35;
  outline: none;
}
.search-box input:focus,
.form-preview input:focus,
.form-preview select:focus,
.form-preview textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-preview select {
  cursor: pointer;
  padding-right: 44px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M3 5l4 4 4-4' stroke='%23aebdd0' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
}
.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.filter-button {
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 9px 13px;
}
.filter-button.active,
.filter-button:hover {
  color: #101411;
  background: var(--accent);
  border-color: var(--accent);
}
.summary-row {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}
.collection-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.table-subtext {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  line-height: 1.35;
}
.over-budget-text {
  color: var(--danger);
  font-weight: 650;
}
.empty-table {
  color: var(--muted);
  text-align: center;
  padding: 28px;
}
.detail-panel {
  margin-top: 18px;
  background: rgba(14, 32, 53, .92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.detail-panel.hidden { display: none; }
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.detail-grid div {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 14px;
}
.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}
.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.modal {
  width: min(720px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 22px;
}
.modal::backdrop { background: rgba(0,0,0,.62); }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}
.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 20px;
}
.form-preview {
  display: grid;
  gap: 24px;
  margin: 24px 0;
}
.form-preview label {
  display: grid;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.form-preview label[hidden] {
  display: none;
}
.form-preview label.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-direction: row;
}
.form-preview label.checkbox-label input {
  width: auto;
  min-height: 0;
  flex-shrink: 0;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
button:disabled,
input:disabled,
select:disabled {
  opacity: .55;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .console-header, .toolbar { flex-direction: column; align-items: stretch; }
  .filter-group { justify-content: flex-start; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .detail-grid { grid-template-columns: 1fr; }
  .modal-actions { flex-direction: column; }
}
.status.planning { color: #9ed4ff; background: rgba(158, 212, 255, 0.10); }
.status.completed { color: #b7ff3c; background: var(--accent-soft); }
.status.archived { color: #a8afc2; background: rgba(168, 175, 194, 0.10); }

.inline-detail-row > td {
  padding: 0 18px 18px;
  background: rgba(15,17,23,.35);
}
.inline-detail-panel {
  margin-top: 0;
  box-shadow: none;
}
.detail-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status.published { color: var(--accent); background: var(--accent-soft); }
.status.draft { color: #f9d783; background: rgba(249, 215, 131, 0.10); }

.status.upcoming { color: #9ed4ff; background: rgba(158, 212, 255, 0.10); }
.status.cancelled { color: var(--danger); background: rgba(255, 180, 168, 0.10); }


.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.settings-panel {
  background: rgba(14, 32, 53, .92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.settings-form {
  display: grid;
  gap: 12px;
}
.settings-form label {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.settings-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}
.compact-list {
  box-shadow: none;
  background: transparent;
  border: none;
  border-radius: 0;
}
.compact-list div {
  padding: 14px 4px;
}
.compact-list div:first-child {
  padding-top: 0;
}
.compact-list div:last-child {
  padding-bottom: 0;
}
.muted {
  color: var(--muted);
}

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


/* Firebase authentication — v0.2.0 */
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top, rgba(183,255,60,.08), transparent 38%), var(--bg);
}
.auth-card {
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.auth-card > p { color: var(--muted); line-height: 1.55; }
.auth-form { display: grid; gap: 10px; margin-top: 24px; }
.auth-form label { color: var(--muted); font-size: 13px; font-weight: 650; margin-top: 5px; }
.auth-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  padding: 13px 14px;
  outline: none;
}
.auth-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-submit { width: 100%; margin-top: 8px; }
.auth-message { min-height: 20px; margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.auth-error { color: var(--danger); }
.access-denied { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.access-denied p { color: var(--muted); line-height: 1.55; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.auth-locked .console-shell,
.auth-checking .console-shell { display: none; }
.auth-unlocked .auth-screen { display: none; }
.auth-unlocked .console-shell { display: flex; }
@media (max-width: 900px) {
  .topbar-actions { width: 100%; justify-content: space-between; }
}


/* Live customer forms — v0.2.1 */
.form-preview textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  min-height: 104px;
  padding: 13px 16px;
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  outline: none;
}
.form-preview .full-width { grid-column: 1 / -1; }
.form-message { min-height: 20px; color: var(--muted); margin: 12px 0 0; }

/* Live resources and uploads — v0.2.3 */
.upload-progress {
  width: 100%;
  height: 10px;
  accent-color: var(--accent);
}
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.form-preview input[type="file"] {
  padding: 10px;
}

/* Library foundations — v0.2.4 */
.checkbox-fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin: 0;
}
.checkbox-fieldset legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  padding: 0 6px;
}
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.checkbox-option {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 9px !important;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  color: var(--text) !important;
}
.checkbox-option input { width: auto; margin: 0; }
@media (max-width: 700px) { .checkbox-grid { grid-template-columns: 1fr; } }

/* Console identity and form spacing — v0.2.5 */
