/* ============================================================
   PROPAK ARCHITECTURAL GLAZING — brand kit — propak-glazing.css
   Sister kit to Propak Sheet Metal: SAME structure & class names,
   retokenised to the glazing palette (slate + orange).
   Link it in any web page:  <link rel="stylesheet" href="propak-glazing.css">
   Everything is driven by the design tokens in :root below —
   change a value there and it updates everywhere.
   ============================================================ */

:root {
  /* ---- Brand ---- */
  --pk-accent:      #F27D12;   /* PAG brand orange — primary actions, accents */
  --pk-accent-dark: #D96A08;   /* hover / pressed */
  --pk-accent-soft: #FEF1E4;   /* faint orange tint (selected rows, highlights) */

  /* ---- Neutrals ---- */
  --pk-slate:      #262C2D;   /* darkest neutral — dark bars, footers (matches logo) */
  --pk-slate-2:    #333B3C;   /* secondary dark surface */
  --pk-ink:        #262C2D;   /* body text */
  --pk-muted:      #8C8C8C;   /* secondary text, labels */
  --pk-muted-2:    #A6A6A6;   /* faint text on dark */
  --pk-line:       #D0D0D0;   /* hairline borders */
  --pk-line-strong:#B9B9B9;   /* stronger borders, inputs */
  --pk-paper:      #F4F4F2;   /* page background (cool off-white) */
  --pk-card:       #FFFFFF;   /* cards, panels, inputs */
  --pk-fill:       #F2F2F2;   /* subtle fills, hover, section headers */

  /* ---- Status ---- */
  --pk-ok:         #2C7A34;   --pk-ok-bg:   #E4F1E2;
  --pk-warn:       #9A6100;   --pk-warn-bg: #FBEECB;   /* gold, kept distinct from brand orange */
  --pk-danger:     #C0392B;   --pk-danger-bg:#FBE7E4;
  --pk-info:       #245C8A;   --pk-info-bg: #E3EDF5;

  /* ---- Type ---- */
  --pk-font:  system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --pk-mono:  "Consolas", "Courier New", "DejaVu Sans Mono", monospace;
  --pk-fs:    15px;           /* base font size */

  /* ---- Shape & depth ---- */
  --pk-radius:    8px;        /* cards, buttons */
  --pk-radius-sm: 6px;        /* inputs, small controls */
  --pk-shadow:    0 1px 2px rgba(20,22,24,.06), 0 4px 14px rgba(20,22,24,.05);

  /* ---- Spacing scale ---- */
  --pk-space-1: 4px;  --pk-space-2: 8px;  --pk-space-3: 12px;
  --pk-space-4: 16px; --pk-space-5: 20px; --pk-space-6: 24px;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--pk-font);
  font-size: var(--pk-fs);
  line-height: 1.45;
  color: var(--pk-ink);
  background: var(--pk-paper);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--pk-info); text-decoration: none; }
a:hover { text-decoration: underline; }

.pk-mono   { font-family: var(--pk-mono); }
.pk-muted  { color: var(--pk-muted); }
.pk-eyebrow{ font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em;
             color: var(--pk-muted); font-weight: 700; }
.pk-hidden { display: none !important; }

/* ---------- top bar (canonical: dark slate bar, knockout logo, orange underline) ---------- */
.pk-topbar {
  display: flex; align-items: center; gap: 16px;
  background: var(--pk-slate);
  border-bottom: 3px solid var(--pk-accent);
  padding: 14px 24px;
  position: sticky; top: 0; z-index: 20;
  box-shadow: var(--pk-shadow);
}
.pk-topbar .pk-logo { height: 40px; width: auto; display: block; }
.pk-topbar .pk-appname {
  color: #CDD0D4; font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: .09em;
  border-left: 1px solid #454B4C; padding-left: 12px;
}
.pk-topbar nav { display: flex; gap: 4px; margin-left: auto; }
.pk-topbar nav a {
  padding: 7px 13px; border-radius: var(--pk-radius-sm);
  color: #CDD0D4; font-weight: 600;
}
.pk-topbar nav a:hover,
.pk-topbar nav a.active { background: var(--pk-slate-2); color: #fff; text-decoration: none; }

/* Wordmark fallback when no logo image is available (white type, orange accent) */
.pk-wordmark { font-weight: 800; letter-spacing: .02em; font-size: 19px; color: #fff; }
.pk-wordmark b { color: var(--pk-accent); }

/* Optional white/light variant of the bar */
.pk-topbar.pk-light { background: var(--pk-card); }
.pk-topbar.pk-light .pk-appname { color: var(--pk-muted); border-color: var(--pk-line); }
.pk-topbar.pk-light nav a { color: var(--pk-ink); }
.pk-topbar.pk-light nav a:hover,
.pk-topbar.pk-light nav a.active { background: var(--pk-fill); color: var(--pk-ink); }
.pk-topbar.pk-light .pk-wordmark { color: var(--pk-ink); }

/* ---------- layout ---------- */
.pk-wrap { max-width: 1180px; margin: 0 auto; padding: 22px 24px 60px; }
.pk-head { display: flex; align-items: flex-end; justify-content: space-between;
           gap: 16px; margin-bottom: 18px; }
.pk-head h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }

/* ---------- buttons ---------- */
.pk-btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid var(--pk-line-strong); background: #fff; color: var(--pk-ink);
  padding: 8px 14px; border-radius: var(--pk-radius); font-weight: 600; font-size: 13.5px;
}
.pk-btn:hover { border-color: var(--pk-muted); background: var(--pk-fill); text-decoration: none; }
.pk-btn.primary { background: var(--pk-accent); border-color: var(--pk-accent); color: #fff; }
.pk-btn.primary:hover { background: var(--pk-accent-dark); border-color: var(--pk-accent-dark); }
.pk-btn.dark { background: var(--pk-slate); border-color: var(--pk-slate); color: #fff; }
.pk-btn.dark:hover { background: #000; }
.pk-btn.ok { background: var(--pk-ok); border-color: var(--pk-ok); color: #fff; }
.pk-btn.ghost { border-color: transparent; background: transparent; }
.pk-btn.sm { padding: 5px 10px; font-size: 12.5px; }
.pk-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- stat / KPI cards ---------- */
.pk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 14px; margin-bottom: 22px; }
.pk-stat {
  background: var(--pk-card); border: 1px solid var(--pk-line);
  border-radius: var(--pk-radius); padding: 14px 16px; box-shadow: var(--pk-shadow);
  position: relative; overflow: hidden;
}
.pk-stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0;
                   width: 4px; background: var(--pk-line-strong); }
.pk-stat.accent::before  { background: var(--pk-accent); }
.pk-stat.ok::before      { background: var(--pk-ok); }
.pk-stat.warn::before    { background: var(--pk-warn); }
.pk-stat.danger::before  { background: var(--pk-danger); }
.pk-stat.info::before    { background: var(--pk-info); }
.pk-stat .n { font-family: var(--pk-mono); font-size: 28px; font-weight: 600; line-height: 1; }
.pk-stat .l { margin-top: 6px; font-size: 12px; color: var(--pk-muted); font-weight: 700;
              text-transform: uppercase; letter-spacing: .05em; }

/* ---------- panels / cards ---------- */
.pk-card-box, .pk-panel {
  background: var(--pk-card); border: 1px solid var(--pk-line);
  border-radius: var(--pk-radius); box-shadow: var(--pk-shadow); margin-bottom: 22px;
}
.pk-panel-head { padding: 12px 16px; border-bottom: 1px solid var(--pk-line);
                 display: flex; align-items: center; gap: 10px; }
.pk-panel-head h2 { font-size: 14px; margin: 0; }
.pk-panel-head .count { font-family: var(--pk-mono); font-size: 12px; color: var(--pk-muted); }
.pk-panel-body { padding: 4px 0; }

/* section header with orange spine (forms / minutes sections) */
.pk-section { background: #fff; border: 1px solid var(--pk-line); border-radius: var(--pk-radius);
              margin-bottom: 14px; overflow: hidden; box-shadow: var(--pk-shadow); }
.pk-section > h2 {
  margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
  background: var(--pk-fill); color: var(--pk-ink); padding: 10px 14px;
  border-left: 5px solid var(--pk-accent);
}
.pk-section .body { padding: 14px; }

/* ---------- toolbar / search ---------- */
.pk-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
              padding: 14px 16px; margin-bottom: 16px; }
.pk-toolbar input, .pk-toolbar select {
  padding: 9px 11px; border: 1px solid var(--pk-line-strong);
  border-radius: var(--pk-radius-sm); background: #fff;
}
.pk-toolbar input[type=search] { min-width: 220px; }
.pk-toolbar input:focus, .pk-toolbar select:focus {
  outline: 2px solid var(--pk-accent); outline-offset: -1px; border-color: var(--pk-accent); }
.pk-spacer { flex: 1; }

/* filter chips row */
.pk-filters { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.pk-filters button {
  border: 1px solid var(--pk-line-strong); background: #fff; color: var(--pk-muted);
  padding: 6px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.pk-filters button.active { background: var(--pk-slate); border-color: var(--pk-slate); color: #fff; }

/* ---------- tables ---------- */
table.pk-grid { width: 100%; border-collapse: collapse; background: #fff;
                border-radius: var(--pk-radius); overflow: hidden; }
.pk-grid th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--pk-muted); font-weight: 700; padding: 9px 16px;
  border-bottom: 1px solid var(--pk-line); white-space: nowrap;
}
.pk-grid td { padding: 10px 16px; border-bottom: 1px solid #efefed;
              font-size: 14px; vertical-align: middle; }
.pk-grid tr:last-child td { border-bottom: none; }
.pk-grid tr:hover td { background: #faf9f7; }
.pk-grid .num  { font-family: var(--pk-mono); text-align: right; white-space: nowrap; }
.pk-grid .name { font-weight: 600; }

/* Dark-header table variant */
table.pk-grid.pk-dark-head th { background: var(--pk-slate); color: #fff; border-bottom: none; }

/* ---------- chips / pills / tags ---------- */
.pk-chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px;
           border-radius: 20px; text-transform: uppercase; letter-spacing: .04em; }
.pk-chip.ok     { background: var(--pk-ok-bg);     color: var(--pk-ok); }
.pk-chip.warn   { background: var(--pk-warn-bg);   color: var(--pk-warn); }
.pk-chip.danger { background: var(--pk-danger-bg); color: var(--pk-danger); }
.pk-chip.info   { background: var(--pk-info-bg);   color: var(--pk-info); }
.pk-chip.neutral{ background: var(--pk-fill);      color: var(--pk-muted); }

.pk-tag { display: inline-block; font-family: var(--pk-mono); font-size: 11.5px; padding: 2px 7px;
          border: 1px solid var(--pk-line-strong); border-radius: 4px;
          background: #fbfaf8; color: #3c3f42; white-space: nowrap; }

/* ---------- forms ---------- */
.pk-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.pk-field label { font-size: 12px; font-weight: 700; color: var(--pk-muted);
                  text-transform: uppercase; letter-spacing: .05em; }
.pk-field input, .pk-field select, .pk-field textarea {
  padding: 9px 11px; border: 1px solid var(--pk-line-strong);
  border-radius: var(--pk-radius-sm); background: #fff; width: 100%;
}
.pk-field input:focus, .pk-field select:focus, .pk-field textarea:focus {
  outline: 2px solid var(--pk-accent); outline-offset: -1px; border-color: var(--pk-accent); }
.pk-field textarea { resize: vertical; min-height: 52px; }
.pk-field .help { font-size: 12px; color: var(--pk-muted); }
.pk-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- modal ---------- */
.pk-modal-bg { position: fixed; inset: 0; background: rgba(20,22,24,.5);
               display: flex; align-items: flex-start; justify-content: center;
               padding: 40px 16px; z-index: 50; overflow: auto; }
.pk-modal { background: #fff; border-radius: 10px; width: 100%; max-width: 520px;
            box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.pk-modal.wide { max-width: 720px; }
.pk-modal-head { padding: 16px 20px; border-bottom: 1px solid var(--pk-line);
                 display: flex; align-items: center; justify-content: space-between; }
.pk-modal-head h3 { margin: 0; font-size: 16px; }
.pk-modal-head .x { background: none; border: none; font-size: 22px; cursor: pointer;
                    color: var(--pk-muted); line-height: 1; }
.pk-modal-body { padding: 18px 20px; }
.pk-modal-foot { padding: 14px 20px; border-top: 1px solid var(--pk-line);
                 display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- toast ---------- */
.pk-toasts { position: fixed; bottom: 20px; right: 20px; display: flex;
             flex-direction: column; gap: 8px; z-index: 100; }
.pk-toast { background: var(--pk-slate); color: #fff; padding: 11px 16px;
            border-radius: var(--pk-radius); box-shadow: var(--pk-shadow);
            font-size: 13.5px; border-left: 3px solid var(--pk-ok); max-width: 340px; }
.pk-toast.err { border-left-color: var(--pk-danger); }

/* ---------- login card ---------- */
.pk-login-wrap { min-height: 100vh; display: flex; align-items: center;
                 justify-content: center; background: var(--pk-slate); }
.pk-login-card { background: #fff; border-radius: 10px; width: 100%; max-width: 360px;
                 box-shadow: 0 20px 60px rgba(0,0,0,.4); overflow: hidden; }
.pk-login-card .head { background: var(--pk-slate); color: #fff; padding: 22px 24px;
                       border-bottom: 3px solid var(--pk-accent); }
.pk-login-card form { padding: 22px 24px; }

/* ---------- print ---------- */
@media print {
  .pk-topbar, .pk-toolbar, .no-print, .pk-head .pk-btn { display: none !important; }
  body { background: #fff; }
  .pk-panel, .pk-section, .pk-card-box { box-shadow: none; border-color: #bbb; break-inside: avoid; }
  .pk-section > h2 { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pk-wrap { max-width: none; padding: 0; }
}

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .pk-field-row { grid-template-columns: 1fr; }
}
