/* ============================================================================
   PENOBSCOT FLOORING & DECKS — "Timber & Trade" identity.
   Loaded only for the flooring pack. A warm, premium woodworking look: warm
   PARCHMENT field with a faint horizontal PLANK motif (evokes flooring/decking
   boards), deep WALNUT/ESPRESSO surfaces & table headers (the brand anchor),
   warm OAK accent, slate secondary, Zilla Slab display (a sturdy SLAB SERIF —
   unique among the packs; reads like a lumber stamp), 8px radii. Deliberately
   unlike fence ("Craftsman Editorial" bone + Fraunces serif), construction
   (industrial steel/orange) and lawncare (forest green / contour).
   ============================================================================ */
:root {
    --accent: #b07a3c;            /* warm oak */
    --accent-bright: #c8924f;     /* honey */
    --accent-deep: #6e4a22;       /* walnut */
    --accent-soft: #f0e4d2;       /* pale oak */
    --slate: #51616b;             /* tool-steel secondary */
    --slate-soft: #e3e8ea;
    --bg: #f5efe5;                /* warm parchment */
    --panel: #fffdf9;
    --ink: #2a1d12;              /* espresso */
    --ink-soft: #6b5a48;
    --line: #e7dccb;
    --side: #2a1c10;             /* dark walnut rail */
    --side-ink: #b9a890;
    --side-ink-bright: #ffffff;
    --display-font: "Zilla Slab", Georgia, serif;
    --radius: 8px;
    --shadow: 0 1px 2px rgba(42,29,18,.06), 0 14px 30px -22px rgba(42,29,18,.5);
}

body {
    font-family: "Inter", -apple-system, "Segoe UI", sans-serif;
    color: var(--ink);
    background-color: var(--bg);
    /* faint horizontal plank lines — flooring/decking boards, very subtle */
    background-image:
        repeating-linear-gradient(0deg, rgba(110,74,34,.05) 0, rgba(110,74,34,.05) 1px, transparent 1px, transparent 38px),
        repeating-linear-gradient(0deg, rgba(110,74,34,.025) 0, rgba(110,74,34,.025) 1px, transparent 1px, transparent 9.5px),
        radial-gradient(900px 520px at 100% -10%, rgba(200,146,79,.10), transparent 60%);
    background-attachment: fixed;
}

/* ---------------- Sidebar: dark walnut rail ---------------- */
.side { background: linear-gradient(185deg, #33220f, #1f1409 92%); border-right: 1px solid rgba(0,0,0,.3); }
.brand { border-bottom: 1px solid rgba(255,255,255,.08); margin: -2px -6px 14px; padding: 6px 14px 16px; }
.brand-mark {
    background: linear-gradient(155deg, var(--accent-bright), var(--accent-deep));
    border-radius: 8px; color: #fff; font-family: var(--display-font); font-weight: 700;
    box-shadow: 0 4px 12px -3px rgba(176,122,60,.6);
}
.brand-name { font-family: var(--display-font); font-weight: 700; letter-spacing: -.1px; font-size: 16px; }
.brand-pack { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-bright); opacity: .95; }
.nav-link { border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--side-ink); }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: linear-gradient(90deg, var(--accent-deep), var(--accent)); color: #fff; box-shadow: 0 4px 14px -5px rgba(176,122,60,.7); }
.nav-link.active .nav-ico { opacity: 1; }
.side-foot { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; opacity: .5; }

/* ---------------- Topbar ---------------- */
.topbar { background: var(--panel); border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(42,29,18,.03); }
.client-id strong { font-family: var(--display-font); font-weight: 700; letter-spacing: -.1px; }
.client-id .dot { background: var(--accent-bright); box-shadow: 0 0 0 4px rgba(200,146,79,.18); }

/* ---------------- Page header ---------------- */
.page-head { margin-bottom: 22px; }
.page-head h1 { font-family: var(--display-font); font-weight: 700; letter-spacing: -.2px; font-size: 27px; color: var(--ink); }
.page-head .sub { color: var(--ink-soft); font-size: 13px; margin-top: 4px; }
.page-head .back { color: var(--accent-deep); font-weight: 600; }
.page-head.row .head-tools .btn { border-radius: 7px; }

/* ---------------- KPI cards ---------------- */
.kpis { gap: 14px; }
.kpi-card {
    position: relative; border: 1px solid var(--line); border-radius: 10px;
    background: var(--panel); box-shadow: var(--shadow); padding: 18px 20px; overflow: hidden;
}
.kpi-card::before {                              /* oak plank top-edge */
    content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-bright));
}
.kpi-ic { color: var(--accent-deep); background: var(--accent-soft); border-radius: 8px; padding: 6px; top: 15px; right: 15px; opacity: 1; }
.kpi-ic svg { width: 18px; height: 18px; }
.kpi-lab { text-transform: uppercase; letter-spacing: .07em; font-size: 10.5px; font-weight: 700; color: var(--ink-soft); }
.kpi-num { font-family: var(--display-font); font-weight: 700; font-size: 31px; letter-spacing: -.5px; color: var(--ink); margin-top: 4px; }
.kpi-delta { font-size: 11.5px; margin-top: 5px; font-weight: 600; color: var(--ink-soft); }
.kpi-delta.up { color: #4f7a3a; } .kpi-delta.down { color: #b4502f; }

/* ---------------- Panels ---------------- */
.rpanel { border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--panel); }
.panel-h { background: var(--panel); border-bottom: 1px solid var(--line); padding: 14px 18px; }
.panel-h h3 {
    font-family: var(--display-font); font-weight: 700; font-size: 15px; letter-spacing: -.1px; color: var(--ink);
    display: flex; align-items: center; gap: 9px;
}
.panel-h h3::before {                            /* plank-end notch */
    content: ""; width: 12px; height: 9px; flex: none; border-radius: 2px;
    background: linear-gradient(120deg, var(--accent-bright), var(--accent-deep));
}
.panel-sub { font-weight: 400; }
.panel-act a { color: var(--accent-deep); font-weight: 700; font-size: 12px; }

/* ---------------- Tables: WALNUT header (brand anchor) ---------------- */
table.data.card, table.data { border-radius: 8px; }
table.data thead th {
    background: linear-gradient(180deg, #4a3119, #2f1f10);
    color: #f3e7d6; border-bottom: none;
    text-transform: uppercase; letter-spacing: .06em; font-size: 10px; font-weight: 600; padding: 12px 14px;
}
table.data thead th:first-child { border-top-left-radius: 8px; }
table.data thead th:last-child  { border-top-right-radius: 8px; }
table.data td { border-bottom: 1px solid #f1e9da; font-size: 13px; }
table.data tbody tr:nth-child(even) td { background: #faf6ee; }
table.data tbody tr.clickable:hover td { background: var(--accent-soft); }

/* ---------------- Badges ---------------- */
.badge { border-radius: 5px; text-transform: uppercase; letter-spacing: .03em; font-size: 10px; font-weight: 700; padding: 3px 9px; }
/* success / green */
.badge-approved, .badge-won, .badge-paid, .badge-complete, .badge-received,
.badge-active, .badge-done { background: #dcecd2; color: #4a6e34; }
/* danger / red */
.badge-declined, .badge-lost, .badge-rejected, .badge-overdue, .badge-expired,
.badge-canceled, .badge-backordered, .badge-blocked { background: #f4ddd4; color: #b04527; }
/* warm / oak (in-motion — the brand color) */
.badge-sold, .badge-in-progress, .badge-ordered, .badge-partial, .badge-material-ordered,
.badge-scheduled, .badge-sent, .badge-contacted, .badge-quoted, .badge-claimed,
.badge-expiring, .badge-estimate-scheduled { background: var(--accent-soft); color: #8a5a22; }
/* neutral / parchment-tan */
.badge-draft, .badge-new, .badge-pending, .badge-cold, .badge-on-hold, .badge-punch-list,
.badge-invoiced, .badge-progress { background: #ece3d4; color: #6b5a44; }
/* slate (types / structural) */
.badge-deposit, .badge-final, .badge-manufacturer, .badge-labor-workmanship, .badge-finish,
.badge-homeowner, .badge-builder-gc, .badge-property-manager, .badge-commercial, .badge-designer,
.badge-single-family, .badge-condo, .badge-multi-family, .badge-new-construction { background: var(--slate-soft); color: #3f4d55; }

/* project_type + product category tints */
.badge-flooring, .badge-hardwood, .badge-engineered, .badge-flooring-labor { background: var(--accent-soft); color: #8a5a22; }
.badge-deck, .badge-deck-build, .badge-decking, .badge-railing, .badge-deck-labor { background: #e9ddc7; color: #715a2c; }
.badge-lvp, .badge-laminate, .badge-vinyl { background: #e4ebdb; color: #54683f; }
.badge-tile, .badge-tile-labor, .badge-grout { background: #dde7ea; color: #3d5560; }
.badge-carpet { background: #ece0e6; color: #6e455c; }
.badge-stairs, .badge-trim, .badge-underlayment, .badge-fasteners, .badge-adhesive,
.badge-stain-finish, .badge-demo, .badge-prep, .badge-haul-away, .badge-repair, .badge-design { background: #ece3d4; color: #6b5a44; }
.badge-flooring-deck { background: #e9ddc7; color: #715a2c; }

/* photo phases */
.badge-before, .badge-after { background: var(--slate-soft); color: #3f4d55; }
.badge-subfloor, .badge-progress { background: #ece3d4; color: #6b5a44; }

/* ---------------- Atoms / buttons ---------------- */
.pill { border-radius: 5px; background: var(--accent-soft); color: var(--accent-deep); border-color: transparent; font-weight: 600; font-size: 11px; }
.rprogress { height: 8px; background: #e7ddcc; border-radius: 999px; }
.rprogress i { background: linear-gradient(90deg, var(--accent-deep), var(--accent-bright)); }
.datebox { background: linear-gradient(170deg, var(--accent), var(--accent-deep)); color: #fff; border-radius: 8px; }
.datebox b { font-family: var(--display-font); font-weight: 700; }
.datebox span { color: #f0dcc1; }
.avatar { border-radius: 8px; background: linear-gradient(155deg, var(--accent), var(--accent-deep)); font-family: var(--display-font); font-weight: 700; }
.feed-dot { background: var(--accent-bright); }
.btn { border-radius: 7px; font-weight: 700; }
.btn-primary { background: var(--accent-deep); border-color: var(--accent-deep); box-shadow: 0 6px 16px -7px rgba(110,74,34,.8); }
.btn-primary:hover { background: var(--accent); }
.detail.card { border-radius: 8px; }
.detail-key { background: #f6f0e6; font-weight: 600; }
