:root {
  --bg: #0f1117;
  --panel: #151926;
  --accent: #5dd39e;
  --text: #e5e7ef;
  --muted: #8b92a6;
  --border: #1f2433;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

#app-root {
  min-height: 100vh;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.layout.sidebar-collapsed {
  grid-template-columns: 86px 1fr;
}

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition: width 0.2s ease, padding 0.2s ease;
}

.content-area {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

main#app,
main#view {
  flex: 1;
  padding: 2rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.placeholder {
  color: var(--muted);
  font-size: 0.95rem;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  background: linear-gradient(135deg, #5dd39e, #3ba7f1);
  color: #0c0f19;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title {
  font-weight: 800;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.85rem;
}

.collapse-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.collapse-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(93, 211, 158, 0.08);
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  width: 100%;
}

.nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.nav-button:hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.02);
  transform: translateX(2px);
}

.nav-item.active .nav-button {
  background: rgba(93, 211, 158, 0.1);
  border-color: rgba(93, 211, 158, 0.35);
}

.nav-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--text);
}

.nav-label {
  font-weight: 600;
}

.sidebar.collapsed {
  width: 82px;
  padding: 1rem 0.65rem;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .collapse-toggle,
.sidebar.collapsed .nav-label {
  display: none;
}

.sidebar.collapsed .nav-button {
  justify-content: center;
}

.sidebar.collapsed .nav-button:hover {
  transform: none;
}

.page-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(93, 211, 158, 0.15);
}

.user-email {
  color: var(--text);
}

.form-card {
  max-width: 420px;
  margin: 2rem auto;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-form input {
  background: #0c0f19;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  color: var(--text);
}

.auth-form input:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}

.auth-form button {
  background: var(--accent);
  color: #0c0f19;
  border: none;
  border-radius: 8px;
  padding: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.auth-form button:hover:enabled {
  opacity: 0.9;
  transform: translateY(-1px);
}

.auth-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-error {
  background: #2b1b1b;
  color: #f7a7a7;
  border: 1px solid #4a2626;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-top: 0.5rem;
}

.form-helper {
  margin-top: 1rem;
  color: var(--muted);
  text-align: center;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-link {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
}

.section-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.item-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
}

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid var(--border);
}

.item-row:last-child {
  border-bottom: none;
}

.item-title {
  color: var(--text);
  font-weight: 700;
}

.item-title:hover {
  text-decoration: underline;
}

.item-meta {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.projects-card h1 {
  margin-bottom: 0.35rem;
}

.project-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.project-form input {
  background: #0c0f19;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  color: var(--text);
}

.project-form input:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}

.preset-form,
.preset-inline-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.preset-form input,
.preset-form textarea,
.preset-inline-form input,
.preset-inline-form textarea {
  background: #0c0f19;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  color: var(--text);
  font-family: inherit;
}

.preset-form textarea,
.preset-inline-form textarea {
  resize: vertical;
  min-height: 120px;
}

.preset-form input:focus,
.preset-form textarea:focus,
.preset-inline-form input:focus,
.preset-inline-form textarea:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-error {
  margin-top: 0.25rem;
}

.project-list {
  margin-top: 0.5rem;
}

.item-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.item-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.preset-config {
  background: #0c0f19;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin-top: 0.35rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow: auto;
  color: var(--muted);
  font-size: 0.95rem;
}

.button {
  background: var(--accent);
  color: #0c0f19;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.button:hover:enabled {
  opacity: 0.9;
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.button.ghost {
  background: transparent;
  color: var(--text);
}

.button.danger {
  border-color: #f08c84;
  color: #f08c84;
  background: rgba(240, 140, 132, 0.08);
}

.project-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.project-details h2 {
  margin: 0;
}

.project-details .detail-row {
  color: var(--muted);
  font-size: 0.95rem;
}
