/* Placeholder brand colors — replace with client branding when supplied. */
:root {
  --color-primary: #5b4cf5;
  --color-primary-dark: #4638d6;
  --color-bg: #f6f7fb;
  --color-surface: #ffffff;
  --color-border: #e4e6ef;
  --color-text: #22263a;
  --color-muted: #6b7086;
  --color-danger: #e2445c;
  --color-danger-dark: #c02f45;
  --status-todo: #8b91a8;
  --status-in-progress: #fdab3d;
  --status-done: #00c875;
  --sidebar-width: 220px;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(34, 38, 58, 0.08), 0 4px 12px rgba(34, 38, 58, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.6rem; margin: 0 0 0.25rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }
h3 { font-size: 0.95rem; margin: 0; }
.muted { color: var(--color-muted); }

body.with-sidebar {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: #1b1d2b;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.5rem 1.5rem;
}

.brand-name { font-weight: 700; font-size: 1.1rem; }

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.nav-link {
  color: #c6c9db;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
}

.nav-link:hover { background: rgba(255, 255, 255, 0.08); text-decoration: none; }
.nav-link--active { background: var(--color-primary); color: #fff; }

.sidebar-signout { margin-top: auto; }

.link-button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.sidebar .link-button {
  color: #c6c9db;
  padding: 0.6rem 0.75rem;
  width: 100%;
  text-align: left;
}
.sidebar .link-button:hover { background: rgba(255, 255, 255, 0.08); }

.link-button--danger { color: var(--color-danger); }

.main {
  flex: 1;
  padding: 2rem 2.5rem;
  max-width: 1100px;
}

body.centered {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.auth-logo { margin-bottom: 0.5rem; }

.stacked-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
  margin-top: 1rem;
}

.stacked-form label { font-size: 0.85rem; font-weight: 600; margin-top: 0.5rem; }

input, textarea, select {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  color: var(--color-text);
}

input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.select-sm { padding: 0.3rem 0.5rem; font-size: 0.85rem; }

.hint { font-size: 0.78rem; color: var(--color-muted); margin: -0.2rem 0 0.2rem; }

.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-primary { background: var(--color-primary); color: #fff; margin-top: 0.75rem; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-secondary { background: #eceefb; color: var(--color-text); }
.btn-secondary:hover { background: #dfe1f5; }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: var(--color-danger-dark); }

.form-error {
  background: #fdeaec;
  color: var(--color-danger-dark);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

.flash {
  border-radius: 8px;
  padding: 0.7rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}
.flash--success { background: #e3faf0; color: #067a4d; }
.flash--error { background: #fdeaec; color: var(--color-danger-dark); }
.flash--info { background: #eaf0ff; color: #2b4fd6; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.breadcrumb { font-size: 0.85rem; margin: 0 0 0.25rem; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.project-card {
  display: block;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  color: inherit;
  transition: transform 0.12s ease;
}
.project-card:hover { transform: translateY(-2px); text-decoration: none; }
.project-card-bar { height: 5px; background: linear-gradient(90deg, var(--color-primary), #8f7bff); }
.project-card-body { padding: 1.1rem; }
.project-card-desc { font-size: 0.85rem; min-height: 2.4em; }

.progress-track {
  background: var(--color-border);
  border-radius: 999px;
  height: 6px;
  margin: 0.6rem 0;
  overflow: hidden;
}
.progress-fill { background: var(--status-done); height: 100%; }

.project-card-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--color-muted);
}

.empty-state, .empty-state-sm { color: var(--color-muted); font-size: 0.9rem; }

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.board-column {
  background: #eef0f8;
  border-radius: var(--radius);
  padding: 0.9rem;
  min-height: 200px;
}

.board-column-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-muted);
}

.count-pill {
  background: #fff;
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  font-size: 0.75rem;
}

.task-card {
  background: var(--color-surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 0.75rem;
  margin-bottom: 0.65rem;
}

.task-card-title { font-weight: 600; font-size: 0.9rem; }
.task-card-desc { font-size: 0.8rem; color: var(--color-muted); margin-top: 0.2rem; }

.task-inline-form { margin-top: 0.5rem; }
.task-delete-form { margin-top: 0.4rem; text-align: right; }

.panel {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th, .data-table td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--color-border);
}

.inline-form { display: inline-block; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 35, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal[hidden] { display: none; }

.modal-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

@media (max-width: 720px) {
  body.with-sidebar { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; padding: 0.75rem 1rem; }
  .nav-links { flex-direction: row; }
  .sidebar-signout { margin-top: 0; margin-left: auto; }
  .main { padding: 1.25rem; }
  .board { grid-template-columns: 1fr; }
}
