/* VetCPA Dashboard — "forest ledger" theme
   Brand: green #2a554b (surfaces), salmon #dda695 (UI accent), cream ink.
   Chart palette (validated): #d0765a #4d8ecb #b7882e #b06fa5 */

:root {
    --bg:        #1d3b34;
    --surface:   #2a554b;
    --raised:    #316054;
    --line:      rgba(245, 241, 235, 0.09);
    --ink:       #f5f1eb;
    --ink-2:     rgba(245, 241, 235, 0.62);
    --ink-3:     rgba(245, 241, 235, 0.38);
    --accent:    #dda695;
    --accent-ink:#22453c;
    --good:      #8fd0ae;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background:
        radial-gradient(1100px 500px at 85% -10%, rgba(221, 166, 149, 0.07), transparent 60%),
        radial-gradient(900px 600px at -10% 110%, rgba(0, 0, 0, 0.25), transparent 55%),
        var(--bg);
    color: var(--ink);
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 14px;
    min-height: 100vh;
}

/* ── Login ─────────────────────────────────────────── */
.login-body {
    display: flex; align-items: center; justify-content: center;
    background: #2a554b url('/bg.png') center/cover no-repeat fixed;
}
.login-card {
    text-align: center; padding: 44px 48px; width: min(440px, 92vw);
    background: rgba(42, 85, 75, 0.62); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px; backdrop-filter: blur(3px);
}
.login-logo { width: min(320px, 72vw); display: block; margin: 0 auto 20px; }
.login-sub { color: var(--ink-2); letter-spacing: 0.04em; }
.login-card form { margin-top: 26px; }
.login-card input[type=password] {
    width: 100%; padding: 12px 16px; font-size: 1rem; text-align: center; letter-spacing: 0.12em;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.25);
    border-radius: 10px; color: #fff; outline: none; transition: border-color 0.2s;
}
.login-card input[type=password]:focus { border-color: var(--accent); }
.login-card button {
    width: 100%; margin-top: 14px; padding: 12px; border: none; border-radius: 10px;
    background: var(--accent); color: var(--accent-ink); font-family: inherit;
    font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
    cursor: pointer; transition: filter 0.2s;
}
.login-card button:hover { filter: brightness(1.06); }
.login-err { margin-top: 12px; color: #ffb4a4; font-size: 0.78rem; }

/* ── Shell ─────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }

.sb {
    width: 248px; flex: 0 0 248px; padding: 26px 18px;
    display: flex; flex-direction: column; gap: 20px;
    background: rgba(0, 0, 0, 0.16); border-right: 1px solid var(--line);
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sb-logo img { width: 132px; display: block; }
.sb nav { display: flex; flex-direction: column; gap: 2px; }
.sb nav a {
    color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: 9px;
    font-size: 0.86rem; font-weight: 500; transition: background 0.15s, color 0.15s;
}
.sb nav a:hover { background: rgba(255,255,255,0.05); color: var(--ink); }
.sb nav a.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.sb-h {
    font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em;
    color: var(--ink-3); padding: 16px 12px 6px;
}
.sb-w { display: flex; justify-content: space-between; align-items: center; }
.sb-w em {
    font-style: normal; font-size: 0.7rem; font-weight: 600; color: var(--ink-3);
    background: rgba(255,255,255,0.06); border-radius: 20px; padding: 1px 8px;
}
.sb-w.on em { color: var(--accent-ink); background: rgba(0,0,0,0.12); }
.sb-src { margin-top: auto; }
.src {
    display: flex; align-items: center; gap: 8px; padding: 5px 12px;
    font-size: 0.76rem; color: var(--ink-2);
}
.src i { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.src.live i { background: var(--good); }
.src.wait i { background: var(--accent); animation: pulse 2.2s ease-in-out infinite; }
.src b { margin-left: auto; font-size: 0.62rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ── Main ──────────────────────────────────────────── */
main { flex: 1; padding: 30px 36px 40px; min-width: 0; }

.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 26px; }
.top h1 {
    font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.7rem; letter-spacing: 0.005em;
}
.top-sub { color: var(--ink-3); font-size: 0.8rem; margin-top: 5px; }
.top-act { display: flex; gap: 8px; flex: 0 0 auto; }

.btn {
    display: inline-block; text-decoration: none; padding: 8px 16px; border-radius: 9px;
    font-size: 0.78rem; font-weight: 600;
    background: var(--accent); color: var(--accent-ink);
}
.btn.ghost {
    background: transparent; color: var(--ink-2); border: 1px solid var(--line);
    transition: border-color 0.15s, color 0.15s;
}
.btn.ghost:hover { border-color: var(--accent); color: var(--ink); }

/* ── Tiles ─────────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile {
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
    padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 3px;
    animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.tiles .tile:nth-child(2) { animation-delay: 0.05s; }
.tiles .tile:nth-child(3) { animation-delay: 0.10s; }
.tiles .tile:nth-child(4) { animation-delay: 0.15s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.tile-n { font-family: 'Fraunces', serif; font-size: 2.1rem; font-weight: 700; line-height: 1.1; }
.tile-l { font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }
.tile-s { font-size: 0.7rem; color: var(--ink-3); }
.tile.pend { border-style: dashed; border-color: rgba(221, 166, 149, 0.35); }
.tile.pend .tile-n { color: var(--ink-3); }
.tile.pend .tile-s { color: var(--accent); }

/* ── Cards & grids ─────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
    padding: 20px 22px; margin-bottom: 18px; min-width: 0;
}
.grid-2 .card, .grid-3 .card { margin-bottom: 0; }
.card h2 {
    font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.02rem;
    margin-bottom: 14px; letter-spacing: 0.01em;
}
.ch { position: relative; height: 260px; }
.empty { color: var(--ink-3); font-size: 0.85rem; padding: 20px 0; }

/* pending panels */
.pend-card { border-style: dashed; border-color: rgba(221, 166, 149, 0.3); }
.pend-body { color: var(--ink-2); font-size: 0.82rem; line-height: 1.55; display: flex; gap: 10px; align-items: flex-start; }
.pend-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: 0 0 8px; margin-top: 5px; animation: pulse 2.2s ease-in-out infinite; }

/* ── Insights ──────────────────────────────────────── */
.ins { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.ins li {
    padding: 10px 14px; border-radius: 10px; font-size: 0.85rem; line-height: 1.5;
    background: rgba(255,255,255,0.035); border-left: 3px solid var(--ink-3);
    display: flex; gap: 10px; align-items: baseline;
}
.ins-src { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); flex: 0 0 62px; }
.ins-positive { border-left-color: var(--good); }
.ins-alert    { border-left-color: #e0b54a; }
.ins-pending  { border-left-color: var(--accent); }
.ins strong { color: var(--ink); }

/* ── Tables ────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.tbl th {
    text-align: left; font-size: 0.64rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.12em; color: var(--ink-3); padding: 6px 10px; border-bottom: 1px solid var(--line);
}
.tbl td { padding: 9px 10px; border-bottom: 1px solid rgba(245, 241, 235, 0.05); vertical-align: top; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(255,255,255,0.025); }
.r { text-align: right; }
.mut { color: var(--ink-3); }
.sm { font-size: 0.74rem; }
.lnk { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 0.78rem; }
.lnk:hover { text-decoration: underline; }
.pill {
    display: inline-block; font-size: 0.64rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; padding: 2px 9px; border-radius: 20px;
    background: rgba(255,255,255,0.07); color: var(--ink-2);
}
.pill.ok { background: rgba(143, 208, 174, 0.16); color: var(--good); }

.foot { margin-top: 30px; text-align: center; color: var(--ink-3); font-size: 0.7rem; letter-spacing: 0.06em; }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 1100px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
    .shell { flex-direction: column; }
    .sb { width: 100%; flex: none; height: auto; position: static; }
    .sb-src { margin-top: 8px; }
    .grid-2 { grid-template-columns: 1fr; }
    main { padding: 20px 16px 30px; }
}
