/* ============================================================
   GetSolar PH — Agent Portal
   Loaded after ../admin/assets/admin.css: the layout, tokens, cards,
   tables, buttons and modals all come from the Admin Portal. This file
   only adds the components the agent modules need.
   ============================================================ */

/* ---------- Shell additions ---------- */
.chip-btn { background: none; padding: 4px 8px 4px 4px; border-radius: 999px; transition: background .2s; }
.chip-btn:hover { background: var(--light); }

.side-help {
  margin: 0 12px 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  font-size: .78rem;
}
.side-help:empty { display: none; }
.side-help .sh-title { color: var(--white); font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.side-help a { color: var(--yellow); font-weight: 600; }
.side-help .sh-sub { color: rgba(255,255,255,0.55); font-size: .72rem; }

.sidebar-scrim { display: none; }
@media (max-width: 900px) {
  .sidebar-scrim.show { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(15,30,53,.45); }
  .topbar h1 { font-size: 1rem; }
  .topbar #agentName { display: none; }
}

/* ---------- Welcome banner ---------- */
.welcome {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 60%, var(--blue-dark) 100%);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  display: flex; gap: 24px; align-items: center; flex-wrap: wrap;
}
.welcome .w-text { flex: 1 1 380px; }
.welcome h2 { font-size: 1.25rem; font-weight: 800; margin-bottom: 4px; }
.welcome h2 i { color: var(--yellow); }
.welcome p { font-size: .86rem; color: rgba(255,255,255,.75); max-width: 640px; }
.welcome .w-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-yellow { background: var(--yellow); color: var(--dark); }
.btn-yellow:hover { background: #ffb300; }
.btn-outline-light { background: rgba(255,255,255,.08); color: var(--white); border: 1px solid rgba(255,255,255,.2); }
.btn-outline-light:hover { background: rgba(255,255,255,.16); }

/* ---------- Tabs / filter chips ---------- */
.tab-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tab-bar .tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--light); color: var(--dark);
  font-size: .82rem; font-weight: 600; transition: .2s;
}
.tab-bar .tab:hover { background: var(--gray-light); }
.tab-bar .tab.active { background: var(--blue); color: var(--white); }
.tab-bar .tab .count {
  font-size: .7rem; padding: 1px 7px; border-radius: 999px;
  background: rgba(15,30,53,.08);
}
.tab-bar .tab.active .count { background: rgba(255,255,255,.22); }
.tab-bar .tab .soon { font-size: .66rem; font-weight: 700; color: var(--orange); text-transform: uppercase; letter-spacing: .04em; }
.tab-bar .tab.active .soon { color: var(--yellow); }

/* Large sub-tabs (Learning Center) */
.sub-tabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--light); overflow-x: auto; }
.sub-tabs .sub-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 16px; background: none; color: var(--gray);
  font-size: .88rem; font-weight: 600; white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -1px; transition: .2s;
}
.sub-tabs .sub-tab:hover { color: var(--dark); }
.sub-tabs .sub-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--light); }
.toolbar .tab-bar { flex: 1 1 auto; }
.search-box { position: relative; }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray); font-size: .8rem; }
.search-box input {
  padding: 9px 12px 9px 34px; border: 1px solid var(--gray-light); border-radius: 9px;
  font-size: .84rem; min-width: 220px; background: var(--white); color: var(--dark); font-family: var(--font);
}
.search-box input:focus { outline: none; border-color: var(--blue); }
@media (max-width: 560px) { .search-box, .search-box input { width: 100%; min-width: 0; } }

.empty-state { padding: 48px 20px; text-align: center; color: var(--gray); font-size: .9rem; }
.empty-state i { font-size: 1.6rem; color: var(--gray-light); display: block; margin-bottom: 10px; }

/* ---------- Packages ---------- */
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; padding: 20px; }
.pkg-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--light);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; transition: transform .2s, box-shadow .2s;
}
.pkg-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(21,101,192,.16); }
.pkg-card.featured { border-color: var(--blue-light); box-shadow: 0 0 0 2px rgba(30,136,229,.25), var(--shadow); }
.pkg-head {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
  color: var(--white); padding: 18px 20px;
}
.pkg-head .pkg-type { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--yellow); font-weight: 700; }
.pkg-head h3 { font-size: 1.12rem; font-weight: 800; line-height: 1.3; }
.pkg-head .pkg-sub { font-size: .76rem; color: rgba(255,255,255,.7); }
.pkg-ribbon {
  position: absolute; top: 14px; right: 14px;
  background: var(--yellow); color: var(--dark);
  font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  padding: 3px 10px; border-radius: 999px;
}
.pkg-price { padding: 16px 20px 4px; }
.pkg-price .amt { font-size: 1.6rem; font-weight: 800; color: var(--blue); line-height: 1.1; }
.pkg-price .note { font-size: .74rem; color: var(--gray); }
.pkg-ideal {
  margin: 10px 20px 0; padding: 8px 12px; border-radius: 9px;
  background: rgba(67,160,71,.10); color: var(--green); font-size: .78rem; font-weight: 600;
  display: flex; gap: 8px; align-items: center;
}
.pkg-specs { padding: 14px 20px 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.pkg-specs .sp b { display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gray); font-weight: 600; }
.pkg-specs .sp span { font-size: .84rem; font-weight: 600; }
.pkg-incl { padding: 10px 20px 16px; font-size: .8rem; flex: 1; }
.pkg-incl li { display: flex; gap: 8px; padding: 3px 0; }
.pkg-incl li i { color: var(--green-light); margin-top: 4px; font-size: .74rem; }
.pkg-actions { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--light); flex-wrap: wrap; }
.pkg-actions .btn { flex: 1 1 auto; justify-content: center; }
.pkg-card.soon .pkg-head { background: linear-gradient(135deg, var(--gray) 0%, #475569 100%); }
.pkg-card.soon .pkg-price .amt { color: var(--gray); }

.pkg-detail { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; }
.pkg-detail .flyer-thumb { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--light); cursor: zoom-in; }
.pkg-detail .flyer-thumb img { display: block; width: 100%; }
@media (max-width: 720px) { .pkg-detail { grid-template-columns: 1fr; } }
.check-list li { display: flex; gap: 8px; padding: 4px 0; font-size: .86rem; }
.check-list li i { color: var(--green-light); margin-top: 5px; font-size: .76rem; }

/* ---------- Lessons ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; padding: 20px; }
.lesson-card {
  display: flex; flex-direction: column; gap: 8px; text-align: left;
  background: var(--white); border: 1px solid var(--light); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
  color: var(--dark);
}
.lesson-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(21,101,192,.16); }
.lesson-card .lc-top { display: flex; align-items: center; gap: 10px; }
.lesson-card .lc-icon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--light); font-size: .95rem;
}
.lesson-card .lc-cat { font-size: .72rem; font-weight: 600; color: var(--gray); flex: 1; }
.lesson-card .lc-done { color: var(--green-light); font-size: 1rem; }
.lesson-card h3 { font-size: .98rem; font-weight: 700; line-height: 1.35; }
.lesson-card p { font-size: .8rem; color: var(--gray); flex: 1; }
.lesson-card .lc-meta { display: flex; gap: 14px; font-size: .72rem; color: var(--gray); }
.lesson-card .lc-meta i { margin-right: 4px; }

.progress { height: 8px; background: var(--light); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue-light), var(--green-light)); border-radius: 999px; transition: width .3s; }

/* ---------- Rich text (lessons/posts) ---------- */
.md { font-size: .9rem; line-height: 1.7; color: var(--dark); }
.md h3 { font-size: .98rem; font-weight: 700; margin: 18px 0 6px; color: var(--blue-dark); }
.md h3:first-child { margin-top: 0; }
.md p { margin-bottom: 10px; }
.md ul, .md ol { margin: 0 0 12px 20px; }
.md ul { list-style: disc; }
.md ol { list-style: decimal; }
.md li { margin-bottom: 4px; }
.md b { font-weight: 700; }

.lesson-nav { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--light); margin-top: 18px; padding-top: 16px; }
.lesson-nav .spacer { flex: 1; }

/* ---------- Community posts ---------- */
.feed { padding: 20px; display: grid; gap: 16px; max-width: 860px; }
.post-card { background: var(--white); border: 1px solid var(--light); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.post-card.pinned { border-color: rgba(255,143,0,.45); background: linear-gradient(180deg, rgba(255,193,7,.06), var(--white) 60%); }
.post-card .pc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.post-card .pc-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--blue); color: var(--white);
  display: flex; align-items: center; justify-content: center; font-size: .9rem;
}
.post-card .pc-who { flex: 1; min-width: 0; }
.post-card .pc-who b { display: block; font-size: .86rem; }
.post-card .pc-who span { font-size: .72rem; color: var(--gray); }
.post-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.post-card .pin { color: var(--orange); font-size: .72rem; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Marketing collateral ---------- */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; padding: 20px; }
.asset-card {
  display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--light); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.asset-thumb {
  aspect-ratio: 4 / 3; background: var(--off-white); overflow: hidden; cursor: zoom-in;
  display: flex; align-items: center; justify-content: center; position: relative; padding: 0;
}
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.asset-card.poster .asset-thumb { aspect-ratio: 3 / 4; }
.asset-card.poster .asset-thumb img { object-fit: contain; }
.asset-thumb:hover img { transform: scale(1.04); }
.asset-thumb .ext {
  position: absolute; left: 10px; top: 10px;
  background: rgba(15,30,53,.75); color: var(--white);
  font-size: .64rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; letter-spacing: .04em;
}
.asset-body { padding: 12px 14px; flex: 1; }
.asset-body h3 { font-size: .86rem; font-weight: 700; line-height: 1.35; }
.asset-body p { font-size: .74rem; color: var(--gray); }
.asset-actions { display: flex; gap: 8px; padding: 0 14px 14px; }
.asset-actions .btn { flex: 1; justify-content: center; }

.caption-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; padding: 20px; }
.caption-card { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--light); border-radius: var(--radius); box-shadow: var(--shadow); }
.caption-card .cc-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 0; }
.caption-card .cc-head h3 { font-size: .9rem; font-weight: 700; flex: 1; }
.caption-card pre {
  margin: 12px 16px; padding: 12px 14px; flex: 1;
  background: var(--off-white); border: 1px solid var(--light); border-radius: 10px;
  font-family: var(--font); font-size: .8rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
  max-height: 240px; overflow-y: auto;
}
.caption-card .asset-actions { padding: 0 16px 16px; }

.lightbox-img { background: var(--off-white); border-radius: var(--radius); overflow: hidden; text-align: center; }
.lightbox-img img { max-height: 70vh; width: auto; margin: 0 auto; display: block; }

.section-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 0; }
.section-head h3 { font-size: .9rem; font-weight: 700; flex: 1; display: flex; align-items: center; gap: 8px; }
.section-head + .asset-grid, .section-head + .caption-grid { padding-top: 14px; }

/* ============================================================
   Quotation builder: mirrors the Admin Portal quotation sheet
   (admin/quotation.html) so both produce the same look and PDF.
   ============================================================ */
:root {
  --q-bg:          #ffffff;
  --q-text:        #000000;
  --q-placeholder: #6b7280;
  --q-border:      #000000;
}
.q-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.q-actions select { min-width: 220px; max-width: 100%; }

.q-in,
.q-client input {
  width: 100%;
  background: var(--q-bg); color: var(--q-text);
  border: 1px solid var(--q-border); border-radius: 8px;
  padding: 10px 12px; font-family: var(--font); font-size: .86rem; line-height: 1.4;
  color-scheme: light; transition: box-shadow .15s;
}
.q-in::placeholder, .q-client input::placeholder { color: var(--q-placeholder); opacity: 1; }
.q-in:hover, .q-client input:hover { box-shadow: 0 0 0 2px rgba(15, 30, 53, .10); }
.q-in:focus, .q-client input:focus { outline: none; box-shadow: 0 0 0 3px rgba(21, 101, 192, .30); }
.q-in.num { text-align: right; font-variant-numeric: tabular-nums; }
.q-client .field label { color: var(--dark); }

table.q-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
@media (min-width: 821px) { table.q-table { min-width: 900px; } }
table.q-table th {
  text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--gray); padding: 10px; border-bottom: 1px solid var(--light);
  background: var(--off-white); white-space: nowrap;
}
table.q-table td { padding: 7px 10px; border-bottom: 1px solid var(--light); vertical-align: middle; }
table.q-table tbody tr:last-child td { border-bottom: none; }
table.q-table .c-no    { width: 64px; white-space: nowrap; text-align: center; color: var(--gray); font-size: .78rem; font-weight: 600; }
table.q-table .c-unit  { width: 100px; }
table.q-table .c-qty   { width: 96px; }
table.q-table .c-price { width: 132px; }
table.q-table .c-total { width: 142px; text-align: right; font-weight: 700; color: var(--dark); white-space: nowrap; font-variant-numeric: tabular-nums; }
table.q-table .c-rem   { width: 200px; }
table.q-table .c-act   { width: 50px; text-align: center; }
tr.q-group td { background: #eef3fb; }
tr.q-group .q-in { font-weight: 700; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; }

.q-row-del {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--light); color: var(--gray);
  border-radius: 8px; font-size: .85rem; transition: .15s;
}
.q-row-del:hover { background: rgba(211, 47, 47, .12); color: var(--red); }
.q-add-wrap { padding: 14px 16px; border-top: 1px solid var(--light); display: flex; gap: 8px; flex-wrap: wrap; }
.q-subtotal {
  display: flex; justify-content: flex-end; align-items: baseline; gap: 18px;
  padding: 14px 18px; background: var(--off-white); border-top: 1px solid var(--light);
  font-size: .84rem; font-weight: 600; color: var(--gray);
}
.q-subtotal .v { font-size: 1.05rem; font-weight: 800; color: var(--dark); font-variant-numeric: tabular-nums; white-space: nowrap; }

.q-grand {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
  color: var(--white); border-radius: var(--radius-lg);
  padding: 24px 28px; box-shadow: var(--shadow); margin-bottom: 24px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 44px; align-items: end;
}
.q-grand .lines { display: grid; gap: 7px; font-size: .82rem; min-width: 0; }
.q-grand .lines span { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding-bottom: 7px; border-bottom: 1px dashed rgba(255, 255, 255, .15); }
.q-grand .lines span:last-child { border-bottom: none; padding-bottom: 0; }
.q-grand .lines .k { color: rgba(255, 255, 255, .72); min-width: 0; }
.q-grand .lines b { color: var(--white); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.q-grand .total-box { text-align: right; }
.q-grand .total-box .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255, 255, 255, .72); margin-bottom: 4px; }
.q-grand .total-box .val { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800; color: var(--yellow); line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-grand .total-box .btn { margin-top: 12px; }

/* Product catalog picker */
.cat-list { max-height: 420px; overflow-y: auto; }
.cat-item { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--light); }
.cat-item:last-child { border-bottom: none; }
.cat-item .ci-img { width: 42px; height: 42px; border-radius: 9px; background: var(--light); flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--gray); }
.cat-item .ci-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-item .ci-name { flex: 1; min-width: 0; }
.cat-item .ci-name b { display: block; font-size: .84rem; font-weight: 600; }
.cat-item .ci-name span { font-size: .72rem; color: var(--gray); }
.cat-item .ci-price { font-size: .86rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cat-item .ci-qty { width: 70px; padding: 7px 8px; border: 1px solid var(--gray-light); border-radius: 8px; font-family: var(--font); font-size: .84rem; text-align: right; }
.cat-list .ci-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px;
  padding: 9px 20px; background: var(--off-white); border-bottom: 1px solid var(--light);
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--dark);
}
.cat-list .ci-sub { padding: 8px 20px 2px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--blue-light); }
.cat-item .ci-name em { font-style: normal; color: var(--orange); }
.q-source { gap: 6px; }
.q-source .tab { flex: 1 1 0; justify-content: center; }
.q-source[hidden] { display: none; }

/* Drag-to-reorder handle and the row being dragged */
.q-drag {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 30px;
  margin-right: 4px; border: none; border-radius: 6px; background: transparent; color: var(--gray);
  cursor: grab; touch-action: none; font-size: .85rem; vertical-align: middle;
}
.q-drag:hover { background: var(--light); color: var(--blue); }
.q-drag:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(21, 101, 192, .30); color: var(--blue); }
table.q-table tr.q-dragging { position: relative; z-index: 2; box-shadow: 0 10px 28px rgba(15, 30, 53, .18); }
table.q-table tr.q-dragging td { background: #f5f9ff; }
body.q-drag-active, body.q-drag-active * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.source-note { font-size: .72rem; color: var(--gray); display: inline-flex; align-items: center; gap: 6px; }
.source-note .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-light); }
.source-note.offline .dot { background: var(--orange); }

.q-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.q-side { position: sticky; top: 84px; }
.q-main, .q-side { min-width: 0; }
@media (max-width: 1180px) { .q-layout { grid-template-columns: minmax(0, 1fr); } .q-side { position: static; } }

.recent-item { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--light); font-size: .82rem; }
.recent-item:last-child { border-bottom: none; }
.recent-item .ri-main { flex: 1; min-width: 0; cursor: pointer; }
.recent-item .ri-main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item .ri-main span { font-size: .72rem; color: var(--gray); }

/* Mobile: every item row becomes a self-contained card (same as admin) */
@media (max-width: 820px) {
  .q-actions { width: 100%; }
  .q-actions select { flex: 1 1 100%; min-width: 0; width: 100%; }
  .q-actions .btn { flex: 1 1 auto; justify-content: center; }
  .q-in, .q-client input { font-size: 16px; padding: 11px 13px; }
  .q-tbl-scroll { overflow: visible; }
  table.q-table, table.q-table tbody { display: block; }
  table.q-table thead { display: none; }
  table.q-table tr {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; align-items: start;
    background: var(--white); border: 1px solid var(--light); border-radius: 12px;
    padding: 14px; margin: 14px 14px 0;
  }
  table.q-table td { display: block; padding: 0; border: none; min-width: 0; }
  table.q-table .c-no, table.q-table .c-unit, table.q-table .c-qty, table.q-table .c-price,
  table.q-table .c-total, table.q-table .c-rem, table.q-table .c-act { width: auto; }
  table.q-table td::before {
    content: attr(data-label); display: block; margin-bottom: 5px;
    font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gray);
  }
  table.q-table .c-no { grid-row: 1; grid-column: 1 / span 2; align-self: center; display: flex; align-items: baseline; gap: 6px; text-align: left; font-size: .85rem; font-weight: 800; color: var(--blue); }
  table.q-table .c-no::before { content: "Item"; margin: 0; }
  table.q-table .c-act { grid-row: 1; grid-column: 3; justify-self: end; align-self: center; }
  table.q-table .c-act::before { content: none; }
  table.q-table .q-row-del { width: 40px; height: 40px; font-size: .95rem; }
  table.q-table tr > td:nth-child(2) { grid-row: 2; grid-column: 1 / -1; }
  table.q-table .c-unit  { grid-row: 3; grid-column: 1; }
  table.q-table .c-qty   { grid-row: 3; grid-column: 2; }
  table.q-table .c-price { grid-row: 3; grid-column: 3; }
  table.q-table .c-total { grid-row: 4; grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; background: var(--off-white); border-radius: 8px; padding: 11px 13px; font-size: 1.05rem; text-align: right; }
  table.q-table .c-total::before { margin: 0; }
  table.q-table .c-rem { grid-row: 5; grid-column: 1 / -1; }
  table.q-table tr.q-group { grid-template-columns: auto minmax(0, 1fr) auto; background: #eef3fb; }
  table.q-table tr.q-group td { background: transparent; }
  table.q-table tr.q-group .c-no { grid-row: 1; grid-column: 1; }
  table.q-table tr.q-group .c-no::before { content: none; }
  table.q-table tr.q-group > td:nth-child(2) { grid-row: 1; grid-column: 2; }
  table.q-table tr.q-group > td:nth-child(2)::before { content: none; }
  table.q-table tr.q-group .c-act { grid-row: 1; grid-column: 3; }
  table.q-table .q-drag { order: -1; width: 36px; height: 36px; margin: 0; background: var(--light); }
  table.q-table tr > td.table-empty { grid-row: 1; grid-column: 1 / -1; padding: 22px 0; }
  table.q-table tr > td.table-empty::before { content: none; }
  .q-add-wrap { padding: 14px; }
  .q-add-wrap .btn { flex: 1 1 auto; justify-content: center; padding: 12px; }
  .q-subtotal { justify-content: space-between; padding: 14px; gap: 12px; }
  .q-grand { grid-template-columns: 1fr; padding: 20px 18px; gap: 16px; }
  .q-grand .total-box { text-align: left; border-top: 1px solid rgba(255, 255, 255, .2); padding-top: 15px; }
  .q-grand .total-box .btn { width: 100%; justify-content: center; }
  .welcome { padding: 20px 18px; }
  .pkg-grid, .card-grid, .asset-grid, .caption-grid, .feed { padding: 14px; gap: 14px; }
  .toolbar { padding: 14px; }
  .sub-tabs { padding: 0 8px; }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat-card { padding: 14px; }
  .stat-card .s-value { font-size: 1.2rem; }
}
@media (max-width: 460px) {
  table.q-table tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  table.q-table .c-no    { grid-row: 1; grid-column: 1; }
  table.q-table .c-act   { grid-row: 1; grid-column: 2; }
  table.q-table .c-unit  { grid-row: 3; grid-column: 1 / -1; }
  table.q-table .c-qty   { grid-row: 4; grid-column: 1; }
  table.q-table .c-price { grid-row: 4; grid-column: 2; }
  table.q-table .c-total { grid-row: 5; }
  table.q-table .c-rem   { grid-row: 6; }
  .asset-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .asset-actions { flex-direction: column; }
  .pkg-specs { grid-template-columns: 1fr 1fr; }
}
