/* ==========================================================================
   DTF Dashboard - shared stylesheet
   Layered on top of AdminLTE 3.2. Every page links this one file, so a
   change here applies everywhere instead of being copy-pasted per template.

   Light and dark are driven by CSS variables swapped on html.dtf-dark,
   rather than a second wall of overrides.
   ========================================================================== */

:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --text: #1e293b;
  --text-strong: #0f172a;
  --muted: #64748b;

  --brand: #1e3a5f;
  --brand-ink: #ffffff;
  --primary: #2563eb;
  --primary-soft: #eff6ff;

  --new: #2563eb;      --new-soft: #eff6ff;
  --printed: #b45309;  --printed-soft: #fffbeb;
  --packed: #047857;   --packed-soft: #ecfdf5;
  --problem: #b91c1c;  --problem-soft: #fef2f2;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .07);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .16);
  --tap: 40px;
}

html.dtf-dark {
  --bg: #0f172a;
  --surface: #111827;
  --surface-2: #0d1424;
  --surface-3: #1f2937;
  --border: #334155;
  --border-strong: #475569;

  --text: #e5e7eb;
  --text-strong: #f8fafc;
  --muted: #94a3b8;

  --brand: #0b1220;
  --primary: #60a5fa;
  --primary-soft: #172554;

  --new: #93c5fd;      --new-soft: #172554;
  --printed: #fcd34d;  --printed-soft: #422006;
  --packed: #6ee7b7;   --packed-soft: #052e16;
  --problem: #fca5a5;  --problem-soft: #450a0a;

  --shadow: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .6);
}

/* --------------------------------------------------------------- base --- */

body {
  background: var(--bg) !important;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.content-wrapper,
.main-header { margin-left: 0 !important; }

.content-wrapper {
  background: var(--bg) !important;
  color: var(--text);
}

h1, h2, h3, h4, h5 { color: var(--text-strong); letter-spacing: -.01em; }

a:not(.btn) { color: var(--primary); }
a:not(.btn):hover { color: var(--primary); text-decoration: underline; }

hr { border-top-color: var(--border); }

.small-muted,
.text-muted,
.form-text { color: var(--muted) !important; font-size: 12px; }

.nowrap { white-space: nowrap; }

/* Numbers line up column-wise instead of jittering */
.table td, .qty-current, .small-box .inner h3 { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- navbar --- */

.main-header.navbar {
  background: var(--brand) !important;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  min-height: 54px;
}

.navbar-brand {
  font-weight: 600;
  letter-spacing: -.01em;
  color: #fff !important;
}

.main-header .btn-outline-light {
  border-color: rgba(255, 255, 255, .28);
  color: rgba(255, 255, 255, .92);
  font-weight: 500;
  padding: .3rem .7rem;
  border-radius: var(--radius-sm);
}
.main-header .btn-outline-light:hover {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .45);
  color: #fff;
}
.main-header .navbar-text { color: rgba(255, 255, 255, .72) !important; font-size: 13px; }

/* --------------------------------------------------------------- card --- */

.card {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

/* AdminLTE's thick coloured top bar, toned right down */
.card.card-outline { border-top: 3px solid var(--border-strong) !important; }
.card.card-primary.card-outline   { border-top-color: var(--primary) !important; }
.card.card-info.card-outline      { border-top-color: #0891b2 !important; }
.card.card-success.card-outline   { border-top-color: var(--packed) !important; }
.card.card-warning.card-outline   { border-top-color: var(--printed) !important; }
.card.card-danger.card-outline    { border-top-color: var(--problem) !important; }
.card.card-secondary.card-outline { border-top-color: var(--muted) !important; }

.card-header {
  background: transparent !important;
  color: var(--text-strong) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: .7rem 1rem;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0;
}

.card-body { padding: 1rem; }
.card-footer {
  background: var(--surface-2) !important;
  border-top: 1px solid var(--border) !important;
  color: var(--text) !important;
}

/* -------------------------------------------------------------- table --- */

.table {
  color: var(--text) !important;
  margin-bottom: 0;
}

.table thead th {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border) !important;
  border-top: 0 !important;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .6rem .75rem;
  white-space: nowrap;
}

.table td,
.table th {
  border-color: var(--border) !important;
  vertical-align: middle;
  padding: .6rem .75rem;
}

.table-striped tbody tr:nth-of-type(odd) { background-color: var(--surface-2) !important; }
.table-hover tbody tr:hover { background-color: var(--surface-3) !important; }

/* ------------------------------------------------------------ buttons --- */

.btn {
  border-radius: var(--radius-sm);
  font-weight: 500;
  letter-spacing: -.005em;
}

.btn-sm { padding: .28rem .6rem; font-size: 12.5px; }
.btn-lg { padding: .6rem 1.1rem; font-size: 15px; }

.btn-primary   { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { filter: brightness(.94); }

.action-btn { margin: 2px; }

.btn-light, .badge-light {
  background: var(--surface-3) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

/* --------------------------------------------------------------- form --- */

.form-control,
.custom-select,
textarea, input, select {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-sm);
}

.form-control:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14) !important;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder { color: var(--muted) !important; opacity: 1; }

label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .25rem;
}

textarea.form-control { min-height: 80px; }

/* ------------------------------------------------------------- badges --- */

.badge {
  border-radius: 999px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .01em;
  padding: .32em .7em;
}

/* Status colours read as quiet chips rather than solid blocks */
.badge-primary   { background: var(--new-soft) !important;     color: var(--new) !important; }
.badge-info      { background: var(--primary-soft) !important; color: var(--primary) !important; }
.badge-warning   { background: var(--printed-soft) !important; color: var(--printed) !important; }
.badge-success   { background: var(--packed-soft) !important;  color: var(--packed) !important; }
.badge-danger    { background: var(--problem-soft) !important; color: var(--problem) !important; }
.badge-secondary { background: var(--surface-3) !important;    color: var(--muted) !important; }

/* Except in the navbar, where a count badge must pop */
.main-header .badge-danger {
  background: #dc2626 !important;
  color: #fff !important;
}

/* ------------------------------------------------- callouts and alerts --- */

.callout {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-left-width: 4px !important;
  border-radius: var(--radius-sm);
  box-shadow: none;
  padding: .8rem 1rem;
  margin-bottom: 1rem;
}
.callout-info    { border-left-color: var(--primary) !important; }
.callout-danger  { border-left-color: var(--problem) !important; }
.callout-warning { border-left-color: var(--printed) !important; }
.callout-success { border-left-color: var(--packed) !important; }
.callout h5 { font-size: 14px; font-weight: 600; margin-bottom: .35rem; }

.alert { border-radius: var(--radius-sm); border: 1px solid transparent; }
.alert-success { background: var(--packed-soft) !important;  color: var(--packed) !important;  border-color: var(--packed) !important; }
.alert-danger  { background: var(--problem-soft) !important; color: var(--problem) !important; border-color: var(--problem) !important; }
.alert-warning { background: var(--printed-soft) !important; color: var(--printed) !important; border-color: var(--printed) !important; }
.alert-light   { background: var(--surface-2) !important;    color: var(--text) !important;    border-color: var(--border) !important; }

/* ----------------------------------------------------------- stat tile --- */

.small-box {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--surface) !important;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  color: var(--text) !important;
  margin-bottom: 1rem;
}
.small-box .inner { padding: .8rem 1rem; }
.small-box .inner h3 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-strong) !important;
  margin: 0 0 .1rem;
}
.small-box .inner p {
  color: var(--muted) !important;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin: 0;
}
.small-box.bg-info    { border-left-color: #0891b2; }
.small-box.bg-primary { border-left-color: var(--new); }
.small-box.bg-warning { border-left-color: var(--printed); }
.small-box.bg-success { border-left-color: var(--packed); }
.small-box.bg-danger  { border-left-color: var(--problem); }
.small-box .icon { display: none; }

/* --------------------------------------------------------- components --- */

.thumb {
  width: 84px;
  max-height: 66px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.thumb-large {
  max-width: 360px;
  max-height: 260px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.paste-box {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.paste-box:hover { border-color: var(--primary); }
.paste-box:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
.paste-box img { max-width: 100%; max-height: 220px; border-radius: var(--radius-sm); }

.search-box {
  font-size: 20px !important;
  height: 52px !important;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: .02em;
}

.quick-select-group { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-select-btn {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: .3rem .8rem;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .12s;
}
.quick-select-btn:hover { border-color: var(--primary); color: var(--primary); }
.quick-select-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.source-shopee.active   { background: #ee4d2d; border-color: #ee4d2d; }
.source-tiktok.active   { background: #111;    border-color: #111; }
.source-whatsapp.active { background: #25d366; border-color: #25d366; color: #052e16; }
.size-btn.active        { background: var(--primary); border-color: var(--primary); }
.product-btn.active     { background: #7c3aed; border-color: #7c3aed; }

.recent-job-card { border-radius: var(--radius); overflow: hidden; }
.recent-job-card .card-img-top {
  height: 150px;
  object-fit: contain;
  background: var(--surface-2) !important;
  border-bottom: 1px solid var(--border);
}

.sticky-actions {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface) !important;
  color: var(--text) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 12px;
}

.design-input { min-width: 140px; text-transform: uppercase; }
.num-input { width: 80px; }

/* stock page */
.qty-input { max-width: 120px; }
.qty-current { font-size: 17px; font-weight: 600; color: var(--text-strong); }
.cat-head { text-transform: uppercase; letter-spacing: .5px; font-size: 12px; }

/* login */
.login-page { background: var(--bg) !important; }
.login-card-body { background: var(--surface) !important; color: var(--text) !important; border-radius: var(--radius); }
.login-logo, .login-logo a { color: var(--text-strong) !important; font-weight: 600; }
.login-box-msg { color: var(--muted); }
.theme-login-toggle { position: fixed; top: 12px; right: 12px; z-index: 20; }

/* FILE request alert overlay (admin) */
.file-alert-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(2px);
  z-index: 99999;
  /* Hidden until showFileAlert() sets display:flex. Must stay 'none' here -
     the centering below only applies once the script opens it. */
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.file-alert-box {
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 640px; width: 100%;
  max-height: 88vh; overflow: auto;
}
.file-alert-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--border);
}
.file-alert-header h2 { font-size: 17px; font-weight: 600; margin: 0; }
.file-alert-close { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.file-alert-body { background: var(--surface); padding: 1.1rem; }
.file-alert-design { font-size: 26px; font-weight: 700; color: var(--text-strong); }
.file-alert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .7rem; }
.file-alert-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.file-alert-actions { display: flex; gap: .5rem; flex-wrap: wrap; padding-top: .4rem; }
.file-alert-badge-pulse { animation: dtfPulse 1.6s ease-in-out infinite; }
@keyframes dtfPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* low stock row - declared late so it beats the striped/hover rules above */
.table-striped tbody tr.row-low,
.table-hover tbody tr.row-low:hover,
.table tbody tr.row-low { background: var(--problem-soft) !important; }

/* ---------------------------------------------------------- responsive --- */
/* Staff check jobs on a phone, so wide tables become stacked cards.
   Add class="table-stack" to the table and data-label="..." to each cell. */

@media (max-width: 767.98px) {
  body { font-size: 15px; }

  .container-fluid { padding-left: 10px; padding-right: 10px; }
  .card-body { padding: .8rem; }

  .main-header.navbar { padding: .4rem .6rem; }
  .main-header .navbar-nav { flex-wrap: wrap; gap: 4px; }
  .main-header .btn-outline-light { padding: .35rem .6rem; font-size: 12.5px; }
  .navbar-brand { font-size: 15px; }

  .table-stack thead { display: none; }

  .table-stack tbody tr {
    display: block;
    background: var(--surface) !important;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 12px;
    padding: .6rem .8rem;
  }

  .table-stack tbody tr.row-low { border-left: 4px solid var(--problem); }

  .table-stack tbody td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    border: 0 !important;
    padding: .3rem 0 !important;
    text-align: right;
  }

  .table-stack tbody td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-align: left;
  }

  /* cells that carry no label span the full width (previews, action rows) */
  .table-stack tbody td[data-label=""] { display: block; text-align: left; }
  .table-stack tbody td[data-label=""]::before { content: none; }

  /* actions become comfortable tap targets */
  .table-stack tbody td.cell-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: .6rem !important;
    margin-top: .4rem;
    border-top: 1px solid var(--border) !important;
  }
  .table-stack tbody td.cell-actions::before { content: none; }
  .table-stack tbody td.cell-actions .btn,
  .table-stack tbody td.cell-actions .badge {
    flex: 1 1 auto;
    min-height: var(--tap);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-size: 14px;
  }

  .table-stack .thumb { width: 100%; max-height: 150px; }

  .search-box { font-size: 17px !important; height: 48px !important; }

  .small-box .inner { padding: .6rem .7rem; }
  .small-box .inner h3 { font-size: 22px; }
  .small-box .inner p { font-size: 10.5px; }

  .qty-input { max-width: 100%; }

  .btn-block-mobile { display: block; width: 100%; }
}

@media (max-width: 400px) {
  .table-stack tbody td.cell-actions .btn { flex: 1 1 100%; }
}

/* --------------------------------------------- job detail search card --- */
/* Rendered by searchJob() on the staff page: everything stored about a job. */

.jd-card { margin-bottom: .7rem; }

.jd-top { display: flex; gap: 14px; align-items: flex-start; }
.jd-img { flex: 0 0 auto; }
.jd-main { flex: 1 1 auto; min-width: 0; }

.jd-thumb { width: 110px; max-height: 90px; }
.jd-noimg {
  width: 110px; height: 74px;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 11px;
  background: var(--surface-2);
}

.jd-headline { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.jd-design {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text-strong);
  line-height: 1.1;
}
.jd-sub { color: var(--muted); font-size: 11.5px; margin: 2px 0 8px; }

.jd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 5px 18px;
}
.jd-item { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dotted var(--border); padding-bottom: 3px; }
.jd-label { color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.jd-value { font-size: 12.5px; text-align: right; word-break: break-word; }

.jd-notes { margin-top: 10px; }
.jd-notes-text {
  margin: 3px 0 0;
  padding: 7px 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 160px;
  overflow-y: auto;
}

.jd-actions {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 10px; padding-top: 9px;
  border-top: 1px solid var(--border);
}
.jd-actions .action-btn { margin: 0; }

@media (max-width: 767.98px) {
  .jd-top { flex-direction: column; gap: 10px; }
  .jd-thumb, .jd-noimg { width: 100%; max-height: 170px; height: auto; }
  .jd-noimg { height: 70px; }
  .jd-grid { grid-template-columns: 1fr; }
  .jd-actions .btn { flex: 1 1 auto; min-height: var(--tap); display: inline-flex; align-items: center; justify-content: center; }
}

/* ---------------------------------------------- mini quick-entry app --- */
/* Used by /floating, which runs inside a Picture-in-Picture window or a
   small popup. Deliberately compact: it sits beside WhatsApp all day. */

.mini-body {
  background: var(--bg);
  color: var(--text);
  margin: 0;
  font-size: 13px;
}

.mini-wrap { display: flex; flex-direction: column; height: 100vh; }

.mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--brand);
  color: #fff;
  flex: 0 0 auto;
}
.mini-title { font-weight: 600; font-size: 14px; line-height: 1.2; }
.mini-status { font-size: 11px; color: rgba(255, 255, 255, .75); }
.mini-theme {
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .25);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  cursor: pointer;
  font-size: 13px;
}

.mini-body-scroll { flex: 1 1 auto; overflow-y: auto; padding: 10px 12px 16px; }

.mini-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 3px;
}

.mini-row { display: flex; gap: 6px; align-items: flex-end; }
.mini-row .form-control { flex: 1; }

.mini-body .form-control { height: 34px; font-size: 13px; padding: .25rem .5rem; }
.mini-design { font-size: 17px !important; font-weight: 700; height: 40px !important; letter-spacing: .02em; }
.mini-hint { font-size: 10.5px; color: var(--muted); margin-bottom: 6px; min-height: 14px; }

.mini-body .quick-select-btn { padding: .22rem .55rem; font-size: 11.5px; }

.mini-save { height: 42px; font-size: 15px; font-weight: 600; margin-top: 4px; }

.mini-result { font-size: 12px; margin-top: 6px; min-height: 16px; font-weight: 600; }
.mini-result.is-good { color: var(--packed); }
.mini-result.is-bad { color: var(--problem); }

.mini-suggest {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  max-height: 150px;
  overflow-y: auto;
  margin-top: 4px;
}
.mini-suggest-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 6px 8px;
  font-size: 11.5px;
  cursor: pointer;
}
.mini-suggest-item:last-child { border-bottom: 0; }
.mini-suggest-item:hover { background: var(--surface-3); }

.mini-sep { border-top-color: var(--border); margin: 12px 0 10px; }

.mini-find { margin-top: 6px; max-height: 190px; overflow-y: auto; }
.mini-find-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 5px 8px;
  margin-bottom: 5px;
  font-size: 12px;
}
.mini-find-sub { color: var(--muted); font-size: 10.5px; margin-top: 1px; }
.mini-find-empty { color: var(--muted); font-size: 11.5px; padding: 4px 2px; }

/* each result expands to the full job record */
.mini-find-row summary { cursor: pointer; list-style: none; }
.mini-find-row summary::-webkit-details-marker { display: none; }
.mini-find-row summary::after {
  content: "▾";
  float: right;
  color: var(--muted);
  font-size: 10px;
  margin-left: 6px;
}
.mini-find-row[open] summary::after { content: "▴"; }

.mini-flag {
  background: var(--problem-soft);
  color: var(--problem);
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  margin-left: 4px;
}

.mini-find-detail {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.mini-find-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  padding: 1px 0;
}
.mini-find-line span:first-child {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 9.5px;
  letter-spacing: .04em;
  white-space: nowrap;
}
.mini-find-line span:last-child { text-align: right; word-break: break-word; }
.mini-find-notes {
  margin-top: 5px;
  padding: 5px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 90px;
  overflow-y: auto;
}

/* ------------------------------------------------- customer history --- */

.ch-phone {
  font-weight: 400;
  color: var(--muted);
  font-size: 12.5px;
  margin-left: 8px;
}

.ch-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.ch-stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ch-stat-num { font-size: 17px; font-weight: 700; color: var(--text-strong); }
.ch-stat-lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}

.ch-tags { margin-bottom: 8px; line-height: 1.9; }

.ch-contact {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  font-size: 12.5px;
  color: var(--text);
}

/* ------------------------------------------------- sticker calculator --- */

.sc-inputs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.sc-field { display: flex; flex-direction: column; }
.sc-size { width: 150px; }
.sc-size .form-control { font-size: 22px; font-weight: 700; text-align: center; }
.sc-times { font-size: 26px; color: var(--muted); padding-bottom: 6px; }

.sc-rules {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.sc-rule {
  display: flex; align-items: center; gap: 6px;
  margin: 0; font-weight: 500; color: var(--text); font-size: 13px;
}
.sc-rule .form-control { width: 70px; text-align: center; }
.sc-check input { width: 16px; height: 16px; }

.sc-headline { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.sc-count {
  font-size: 46px; font-weight: 800; line-height: 1;
  color: var(--primary); letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.sc-count.sc-zero { color: var(--problem); }
.sc-meta { font-size: 13px; line-height: 1.5; }
.sc-meta > div:first-child { font-weight: 600; color: var(--text-strong); }

.sc-sheets {
  background: var(--primary-soft);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  margin-bottom: 10px;
  font-size: 13.5px;
}

.sc-svg { display: block; width: 100%; height: auto; max-height: 460px; margin-top: 4px; }
.sc-sheet  { fill: var(--surface); stroke: var(--border-strong); stroke-width: .8; }
.sc-margin { fill: none; stroke: var(--problem); stroke-width: .5; stroke-dasharray: 3 2; opacity: .7; }
.sc-main   { fill: var(--primary-soft); stroke: var(--primary); stroke-width: .5; }
.sc-extra  { fill: var(--printed-soft); stroke: var(--printed); stroke-width: .5; }
.sc-num {
  fill: var(--muted); font-family: inherit; font-weight: 600;
  text-anchor: middle; dominant-baseline: central;
}

.sc-key {
  display: inline-block; width: 12px; height: 12px;
  border-radius: 3px; vertical-align: -2px; margin: 0 3px 0 10px;
}
.sc-key-main   { background: var(--primary-soft); border: 1px solid var(--primary); }
.sc-key-extra  { background: var(--printed-soft); border: 1px solid var(--printed); }
.sc-key-margin { border: 1px dashed var(--problem); }

@media (max-width: 767.98px) {
  .sc-size { width: calc(50% - 26px); }
  .sc-count { font-size: 38px; }
}

/* ------------------------------------------------------------- footer --- */

.main-footer {
  background: var(--surface) !important;
  color: var(--muted) !important;
  border-top: 1px solid var(--border) !important;
  padding: .7rem;
  font-size: 12px;
}

/* Keep focus visible for keyboard users */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

@media print {
  .main-header, .main-footer, .btn, .callout { display: none !important; }
  .card { border: 0 !important; box-shadow: none !important; }
}
