/* ==========================================================================
   TaskManager — Core Design System
   Design tokens, reset, typography, base layout
   ========================================================================== */

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

/* ----- Design tokens ----- */
:root {
  /* Dark theme (default) — "workspace at night" */
  --bg: #0d0e14;
  --bg-elevated: #12141c;
  --surface: #161821;
  --surface-hover: #1c1e2a;
  --border: #262838;
  --border-strong: #32354a;

  --text-primary: #edeef2;
  --text-secondary: #a8abc0;
  --text-muted: #6f7288;

  --accent: #f5a623;          /* warm amber — the "lamp" */
  --accent-dim: #f5a62333;
  --accent-strong: #ffb84d;

  --success: #3ecf8e;
  --success-dim: #3ecf8e22;
  --warning: #f59e0b;
  --warning-dim: #f59e0b22;
  --danger: #ef5350;
  --danger-dim: #ef535022;
  --info: #5b9df5;
  --info-dim: #5b9df522;

  --priority-high: #ef5350;
  --priority-medium: #f59e0b;
  --priority-low: #3ecf8e;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 0 1px var(--accent-dim), 0 8px 24px rgba(245, 166, 35, 0.12);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --header-h: 68px;
}

[data-theme="light"] {
  --bg: #f7f5f1;
  --bg-elevated: #fdfcfa;
  --surface: #ffffff;
  --surface-hover: #f1efe9;
  --border: #e6e2d8;
  --border-strong: #d6d1c2;

  --text-primary: #1a1b23;
  --text-secondary: #5c5e6e;
  --text-muted: #9395a3;

  --accent: #db8a13;
  --accent-dim: #db8a1322;
  --accent-strong: #b8720c;

  --shadow-sm: 0 1px 2px rgba(20, 20, 20, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 20, 20, 0.08);
  --shadow-lg: 0 20px 48px rgba(20, 20, 20, 0.12);
  --shadow-glow: 0 0 0 1px var(--accent-dim), 0 8px 24px rgba(219, 138, 19, 0.1);
}

/* ----- Reset ----- */
* , *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-dim), transparent);
  background-repeat: no-repeat;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button { cursor: pointer; }

ul, ol { list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ----- Scrollbar ----- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ----- Layout shell ----- */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(13, 14, 20, 0.7);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  position: sticky;
  top: 0;
  z-index: 100;
}

[data-theme="light"] .app-header {
  background: rgba(247, 245, 241, 0.75);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  color: #14151b;
  font-weight: 700;
  font-size: 15px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.main-content {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 36px 28px 80px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-heading h1 {
  font-size: 28px;
  margin-bottom: 4px;
}

.page-heading p {
  color: var(--text-secondary);
  font-size: 14px;
}

.text-mono {
  font-family: var(--font-mono);
}

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
