/* ==========================================================
   NOP AI Training System - Design System
   Monochrome black/white. Editorial serif headlines paired
   with clean sans UI text. Flat panels, hairline borders,
   no gradients, no drop shadows, no colored accent bars.
   ========================================================== */

:root {
    --ink: #111111;
    --white: #FFFFFF;
    --paper: #FAFAFA;
    --line: #E5E5E5;
    --line-strong: #D4D4D4;
    --mute: #6B6B6B;
    --green: #1F8A54;
    --red: #C0392B;
    --radius: 6px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0 0 0.4em;
    color: var(--ink);
}

h1 { font-size: 2.1rem; font-weight: 480; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; font-weight: 600; font-family: 'Inter', sans-serif; }

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }

p { max-width: 62ch; color: var(--mute); }

/* ---------------- Layout shells ---------------- */

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    padding: 24px;
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 44px 40px;
    width: 100%;
    max-width: 400px;
}

.auth-card .status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ink);
    margin-right: 8px;
}

.auth-logo {
    display: block;
    max-width: 220px;
    width: 100%;
    height: auto;
    margin: 0 auto 20px;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 230px;
    flex-shrink: 0;
    background: var(--ink);
    color: #A8A8A8;
    padding: 28px 18px;
    display: flex;
    flex-direction: column;
}

.sidebar .brand {
    color: #fff;
    font-family: 'Fraunces', serif;
    font-weight: 500;
    font-size: 1.15rem;
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}

.sidebar .brand-sub {
    color: #797979;
    font-size: 0.78rem;
    margin-bottom: 30px;
    display: block;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar nav a {
    color: #B8B8B8;
    padding: 10px 12px;
    border-radius: 5px;
    font-size: 0.92rem;
    text-decoration: none;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sidebar .sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.12);
    font-size: 0.85rem;
}

.sidebar .sidebar-footer a { color: #B8B8B8; text-decoration: none; }
.sidebar .sidebar-footer a:hover { color: #fff; }

.main {
    flex: 1;
    padding: 36px 44px;
    max-width: 1120px;
}

.main-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 28px;
}

/* ---------------- Scorecards (uniform, no color accents) ---------------- */

.scoreboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    margin-bottom: 36px;
}

.scorecard {
    background: var(--white);
    padding: 22px 24px;
}

.scorecard .value {
    font-family: 'Fraunces', serif;
    font-size: 2.1rem;
    font-weight: 500;
    color: var(--ink);
    display: block;
    line-height: 1;
    margin-bottom: 6px;
}

.scorecard .label {
    color: var(--mute);
    font-size: 0.85rem;
}

/* ---------------- Panels & tables ---------------- */

.panel {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
    margin-bottom: 24px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 12px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 0.92rem;
}

th {
    color: var(--mute);
    font-weight: 500;
    font-size: 0.8rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
}

.status-pill::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mute);
}

.status-pill.active::before { background: var(--green); }
.status-pill.inactive::before { background: var(--red); }

/* ---------------- Forms ---------------- */

label {
    display: block;
    font-size: 0.85rem;
    color: var(--mute);
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    font-size: 0.95rem;
    font-family: inherit;
    margin-bottom: 16px;
    background: #fff;
    color: var(--ink);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--ink);
}

button, .btn {
    display: inline-block;
    background: var(--ink);
    color: #fff;
    border: none;
    padding: 11px 22px;
    border-radius: 5px;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
}

button:hover, .btn:hover { background: #2b2b2b; color: #fff; }

.btn-amber { background: var(--ink); color: #fff; }
.btn-amber:hover { background: #2b2b2b; }

.btn-link {
    background: none;
    color: var(--red);
    padding: 0;
    font-size: 0.85rem;
    text-decoration: none;
}
.btn-link:hover { color: #8f2c20; background: none; text-decoration: underline; }

/* ---------------- Flash messages ---------------- */

.flash {
    padding: 13px 16px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    border: 1px solid;
}

.flash.success { background: #F1F8F4; color: var(--green); border-color: #CBE7D5; }
.flash.error   { background: #FBEEEC; color: var(--red); border-color: #F0CFC8; }

/* ---------------- Empty states ---------------- */

.empty-state {
    text-align: center;
    padding: 52px 20px;
    color: var(--mute);
}

.empty-state h3 { color: var(--ink); margin-bottom: 6px; font-family: 'Fraunces', serif; font-weight: 500; }

/* ---------------- Course library (editorial, monochrome) ---------------- */

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 26px;
}

.course-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: block;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease;
}

a.course-card:hover {
    border-color: var(--ink);
    color: inherit;
}

.course-cover {
    height: 150px;
    background: #EDEDED;
    background-size: cover;
    background-position: center;
    filter: grayscale(15%);
}

.course-cover span {
    display: none;
}

.course-card-body {
    padding: 18px 20px 20px;
}

.course-card-body h3 {
    margin-bottom: 5px;
    font-size: 1.15rem;
    font-family: 'Fraunces', serif;
    font-weight: 500;
}

.course-card-body p {
    color: var(--mute);
    margin: 0 0 14px;
    font-size: 0.88rem;
}

.course-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--mute);
    margin-top: 10px;
}

/* ---------------- Progress bars ---------------- */

.progress-track {
    background: var(--line);
    border-radius: 999px;
    height: 4px;
    overflow: hidden;
}

.progress-fill {
    background: var(--ink);
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* ---------------- Video / media embeds ---------------- */

.video-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: var(--ink);
    border-radius: 5px;
    overflow: hidden;
}

.video-wrap iframe,
.video-wrap video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}

/* ---------------- AI Coach chat ---------------- */

.chat-question {
    align-self: flex-end;
    background: var(--ink);
    color: #fff;
    padding: 11px 15px;
    border-radius: 10px 10px 2px 10px;
    max-width: 75%;
    font-size: 0.9rem;
}

.chat-answer {
    align-self: flex-start;
    background: var(--paper);
    border: 1px solid var(--line);
    padding: 11px 15px;
    border-radius: 10px 10px 10px 2px;
    max-width: 75%;
    font-size: 0.9rem;
    color: var(--ink);
}

#chatLog { align-items: stretch; }
#chatLog .chat-question { align-self: flex-end; }
#chatLog .chat-answer { align-self: flex-start; }

@media (max-width: 760px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; }
    .main { padding: 24px; }
}
