/* ==========================================================
   BuildTrack — Core Stylesheet
   Design tokens:
   - Ink (primary dark):    #10293D  — blueprint navy
   - Accent (action):       #F0A202  — site-safety amber
   - Success:               #2F7D5C
   - Danger:                #C1432B
   - Surface:               #FFFFFF
   - Surface-alt/bg:        #EEF1F3  — light concrete gray
   - Border:                #D7DCE1
   - Text muted:            #5B6B7A
   Type: system-ui stack (fast on-site on mobile data), monospace for data/codes
   ========================================================== */

:root {
    --ink: #10293D;
    --accent: #F0A202;
    --accent-dark: #C8830A;
    --success: #2F7D5C;
    --danger: #C1432B;
    --surface: #FFFFFF;
    --bg: #EEF1F3;
    --border: #D7DCE1;
    --muted: #5B6B7A;
    --radius: 6px;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--ink); }

/* ---------- Top bar / brand ---------- */
.topbar {
    background: var(--ink);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 56px;
}
.topbar .brand {
    font-weight: 700;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.topbar .brand::before {
    content: "";
    width: 10px;
    height: 10px;
    background: var(--accent);
    display: inline-block;
    transform: rotate(45deg); /* site-marker notch */
}
.topbar nav a {
    color: #C9D6E0;
    text-decoration: none;
    margin-left: 18px;
    font-size: 14px;
}
.topbar nav a:hover, .topbar nav a.active { color: #fff; }
.topbar .user-chip {
    font-size: 13px;
    color: #C9D6E0;
}

/* ---------- Layout ---------- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 3px solid var(--accent);
    padding-bottom: 12px;
}
.page-header h1 { margin: 0; font-size: 22px; }
.page-header .subtitle { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 16px;
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}
.stat-card {
    border-left: 4px solid var(--accent);
}
.stat-card .value { font-size: 26px; font-weight: 700; font-family: var(--font-mono); }
.stat-card .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
tr:hover td { background: #F7F9FA; }
td.num, th.num { font-family: var(--font-mono); text-align: right; }

/* ---------- Status badges ---------- */
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-planning { background: #E5EAF0; color: var(--ink); }
.badge-active   { background: #FDF0D8; color: var(--accent-dark); }
.badge-completed{ background: #E1F0E9; color: var(--success); }
.badge-on_hold  { background: #F6E3E0; color: var(--danger); }

/* ---------- Progress bar ---------- */
.progress-track {
    background: var(--border);
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
}
.progress-fill {
    background: var(--accent);
    height: 100%;
}

/* ---------- Forms ---------- */
form label {
    display: block;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}
input, select, textarea {
    width: 100%;
    padding: 9px 10px;
    margin-top: 5px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font-body);
    background: #fff;
    color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }

button, .btn {
    display: inline-block;
    background: var(--ink);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
button:hover, .btn:hover { background: #0B1D2C; }
.btn-accent { background: var(--accent); color: var(--ink); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--border); }

/* ---------- Alerts ---------- */
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 14px; margin-bottom: 16px; }
.alert-error   { background: #F6E3E0; color: var(--danger); }
.alert-success { background: #E1F0E9; color: var(--success); }

/* ---------- Auth pages ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(var(--ink), var(--ink)),
        repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255,255,255,0.04) 40px),
        repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255,255,255,0.04) 40px);
    /* faint blueprint grid on the ink background */
}
.auth-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 32px 30px;
    width: 100%;
    max-width: 380px;
}
.auth-card h1 { font-size: 18px; margin: 0 0 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .topbar nav a { margin-left: 10px; font-size: 13px; }
    table, thead, tbody, th, td, tr { display: block; }
    thead { display: none; }
    tr { border-bottom: 2px solid var(--border); padding: 8px 0; }
    td { border: none; padding: 4px 0; }
    td::before { content: attr(data-label) ": "; font-weight: 600; color: var(--muted); }
}
