/* NRL SESR&D ATS — Navy/Vantage theme */
:root {
    --navy-1:     #0a2240;   /* US Navy deep blue */
    --navy-2:     #14305c;
    --navy-3:     #1f4b8e;
    --navy-gold:  #c5a572;   /* warm gold */
    --silver:     #B9BAC2;
    --space-deep: #061226;
    --bg:         #f4f6fb;
    --panel:      #ffffff;
    --text:       #0f1424;
    --muted:      #5b6478;
    --border:     #d9dde7;
    --good:       #1f8a4f;
    --warn:       #b78103;
    --bad:        #b3261e;
    --shadow:     0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(8,18,46,.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
}

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

/* ---- Login screen ---- */
.login-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 460px;
    background: var(--space-deep);
}
.login-hero {
    background:
        linear-gradient(135deg, rgba(6,18,38,.55), rgba(10,34,64,.85)),
        url("../img/hero.svg") center/cover no-repeat, var(--space-deep);
    color: #fff;
    padding: 64px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.login-hero h1 { font-size: 56px; margin: 0 0 12px; letter-spacing: 2px; }
.login-hero h2 { font-weight: 400; font-size: 18px; opacity: .92; margin: 0 0 24px; max-width: 540px; }
.login-hero .badge-row { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.login-hero .badge {
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.25);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: .5px;
}
.login-hero .stamp {
    color: var(--navy-gold);
    font-weight: 700;
    letter-spacing: 3px;
    font-size: 12px;
    margin-bottom: 8px;
}
.login-hero footer { font-size: 12px; opacity: .7; }

.login-card {
    background: #fff;
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.login-card h3 { margin: 0 0 6px; font-size: 22px; }
.login-card .sub { color: var(--muted); margin-bottom: 32px; }
.login-card label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: 13px; }
.login-card input[type=text], .login-card input[type=password] {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px;
}
.login-card input:focus { outline: 2px solid var(--navy-3); outline-offset: 0; border-color: var(--navy-3); }
.login-card button {
    margin-top: 20px; width: 100%; padding: 12px;
    background: var(--navy-1); color: #fff; border: none; border-radius: 6px;
    font-size: 14px; font-weight: 600; letter-spacing: .5px; cursor: pointer;
}
.login-card button:hover { background: var(--navy-2); }
.login-card .err { color: var(--bad); font-size: 13px; margin-top: 12px; min-height: 18px; }
.login-card .test-hint { font-size: 12px; color: var(--muted); margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); }
.login-card .test-hint code { background: #eef2fa; padding: 1px 6px; border-radius: 3px; }

@media (max-width: 900px) {
    .login-wrap { grid-template-columns: 1fr; }
    .login-hero { padding: 32px; min-height: 280px; }
    .login-hero h1 { font-size: 40px; }
}

/* ---- App shell ---- */
.topbar {
    background: var(--navy-1);
    color: #fff;
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 3px solid var(--navy-gold);
    position: sticky; top: 0; z-index: 50;
}
.topbar .brand { font-weight: 700; letter-spacing: 3px; font-size: 18px; }
.topbar .brand-sub { color: var(--navy-gold); margin-left: 12px; font-size: 11px; letter-spacing: 2px; opacity: .9; }
.topbar nav { margin-left: 32px; display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.topbar nav a {
    color: #fff; padding: 8px 14px; border-radius: 4px; font-size: 13px;
    text-decoration: none; opacity: .85;
}
.topbar nav a:hover, .topbar nav a.active { background: rgba(255,255,255,.15); opacity: 1; }
.topbar .user {
    margin-left: auto; font-size: 12px; display: flex; align-items: center; gap: 12px; color: #cfd6e4;
}
.topbar .user .name { color: #fff; font-weight: 600; }
.topbar .user a { color: var(--navy-gold); }

.container { max-width: 1400px; margin: 0 auto; padding: 24px; }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-head h2 { margin: 0; font-size: 22px; }
.page-head .actions { display: flex; gap: 8px; }

/* Cards & tables */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 16px;
}
.card h3 { margin: 0 0 12px; font-size: 15px; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.kpi .val { font-size: 28px; font-weight: 700; color: var(--navy-1); }

table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data th { background: #f7f9fd; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
table.data tr:hover td { background: #fafbfd; }

button.btn, .btn {
    background: var(--navy-1); color: #fff; border: none; border-radius: 5px;
    padding: 7px 14px; font-size: 13px; cursor: pointer; font-weight: 500;
}
button.btn:hover { background: var(--navy-2); }
button.btn-sm, .btn-sm { padding: 4px 10px; font-size: 12px; }
button.btn-secondary { background: #fff; color: var(--navy-1); border: 1px solid var(--navy-1); }
button.btn-secondary:hover { background: #f0f4fc; }
button.btn-danger  { background: var(--bad); }
button.btn-success { background: var(--good); }
button.btn-warn    { background: var(--warn); }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], select, textarea {
    width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 5px; font-size: 13px;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy-3); outline-offset: 0; border-color: var(--navy-3); }
label { font-size: 12px; font-weight: 600; color: #333; display: block; margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(6,18,38,.55); z-index: 100; display: none; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 40px 20px; }
.modal-bg.open { display: flex; }
.modal { background: #fff; border-radius: 8px; max-width: 760px; width: 100%; box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head button.x { background: transparent; color: #888; font-size: 22px; border: none; cursor: pointer; }
.modal-body { padding: 20px; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* Pills */
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .3px; }
.pill-blue   { background: #e0eaff; color: #1d3a8a; }
.pill-green  { background: #dcf3e3; color: #185c33; }
.pill-amber  { background: #fff1cc; color: #6e4d00; }
.pill-red    { background: #ffd8d4; color: #7d1410; }
.pill-gray   { background: #e7e9ee; color: #444; }
.pill-gold   { background: var(--navy-gold); color: #3a2c00; }

.disp-ACTIVE    { background: #e0eaff; color: #1d3a8a; }
.disp-REJECTED  { background: #ffd8d4; color: #7d1410; }
.disp-WITHDRAWN { background: #e7e9ee; color: #555; }
.disp-HIRED     { background: var(--good); color: #fff; }

/* Milestone checklist */
.milestone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 6px;
    margin-top: 8px;
}
.milestone-row {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px 10px;
    background: #fafbfd;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.milestone-row.done { background: #dcf3e3; border-color: #9fd5b4; }
.milestone-row label { margin: 0; cursor: pointer; flex: 1; font-weight: 600; }
.milestone-row .meta { font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.milestone-row input[type=checkbox] { margin-top: 2px; }
.progress {
    height: 6px; background: #eef; border-radius: 3px; overflow: hidden; margin-top: 4px;
}
.progress > span { display: block; height: 100%; background: var(--navy-3); }

.toast {
    position: fixed; bottom: 20px; right: 20px;
    background: #222; color: #fff; padding: 10px 16px; border-radius: 5px;
    font-size: 13px; max-width: 360px;
    z-index: 200; opacity: 0; transform: translateY(10px); transition: all .25s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { background: var(--bad); }
.toast.ok { background: var(--good); }

.empty { text-align: center; padding: 32px; color: var(--muted); }

/* Tabs */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 16px; gap: 4px; }
.tabs a { padding: 8px 16px; border-bottom: 2px solid transparent; margin-bottom: -2px; color: var(--muted); }
.tabs a.active { border-bottom-color: var(--navy-1); color: var(--navy-1); font-weight: 600; }

.flex { display: flex; gap: 12px; }
.flex-grow { flex: 1; }
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.small { font-size: 12px; }
hr.div { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
pre.preview { font-size: 11px; max-height: 280px; overflow: auto; background: #f7f9fd; padding: 10px; border-radius: 4px; border: 1px solid var(--border); }
