/* ממשק ניהול החברה — מעל עיצוב הבסיס של styles/admin.css */

/* ---------- שכבת החברה ---------- */
body.hq #nav { background: radial-gradient(120% 60% at 100% 0%, #6b4a10 0%, transparent 60%), radial-gradient(90% 50% at 0% 100%, #1d3a8a 0%, transparent 60%), #0d0f1c; }
body.hq #nav nav a.on::before { background: #ffcf5a; }
.company-login { background: radial-gradient(70% 60% at 85% 0%, #6b4a10, transparent 60%), radial-gradient(60% 50% at 0% 100%, #1d3a8a, transparent 60%), #0d0f1c; }
.stats.five { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 20px; }
.stat b small { font-size: 16px; color: var(--ink3); font-weight: 600; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .tabs { margin: 0; }
.search { height: 40px; width: min(340px, 100%); border-radius: 12px; border: 1px solid var(--line); padding: 0 14px; background: #fff; }
.table.bld tbody tr { cursor: pointer; transition: background .12s; }
.table.bld tbody tr:hover { background: #f8f9fd; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c5cad8; margin-inline-end: 6px; vertical-align: 1px; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(20, 164, 108, .15); }
.pill.overdue { background: #fdecea; color: var(--red); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; align-items: center; }
.kv span { color: var(--ink3); }
.kv code { background: #f3f5fa; padding: 4px 8px; border-radius: 8px; font-size: 12px; word-break: break-all; text-align: left; }
h3.sec { font-size: 14px; color: var(--ink3); font-weight: 700; margin: 8px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.drawer-sub b { display: block; font-size: 17px; }
.drawer-sub small { color: var(--ink3); }
.footer-preview {
  height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 14px;
  color: rgba(226, 234, 255, .6); background: #0b1430; border-top: 1px solid rgba(255, 255, 255, .12);
}
@media (max-width: 1280px) { .stats.five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .stats.five { grid-template-columns: 1fr 1fr; } }


/* קודי כניסה לשליחה בלחיצה */
#otp-panel {
  position: fixed; left: 20px; bottom: 20px; z-index: 40; width: min(420px, calc(100vw - 40px)); background: #fff;
  border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 50px rgba(10, 17, 40, .2); overflow: hidden;
}
#otp-panel.has-pending { border-color: #25d366; box-shadow: 0 0 0 4px rgba(37, 211, 102, .18), 0 20px 50px rgba(10, 17, 40, .2); }
#otp-panel header { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: #f3fbf6; border-bottom: 1px solid var(--line); }
#otp-panel header .ic { color: #128c4a; }
#otp-panel header em { font-style: normal; background: #25d366; color: #fff; border-radius: 99px; padding: 1px 8px; font-size: 12px; font-weight: 700; }
#otp-panel header .link-btn { margin-inline-start: auto; font-size: 12px; }
#otp-panel ul { list-style: none; margin: 0; padding: 6px 12px; max-height: 300px; overflow-y: auto; }
#otp-panel li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
#otp-panel li:last-child { border-bottom: 0; }
#otp-panel li.sent { opacity: .55; }
#otp-panel li b { display: block; font-size: 14px; }
#otp-panel li small { color: var(--ink3); font-size: 12px; }
#otp-panel code { font-size: 18px; font-weight: 800; letter-spacing: .12em; color: var(--ink); }
.wa-send { background: #25d366 !important; border-color: #25d366 !important; color: #fff !important; }
.sent-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--green); font-size: 13px; font-weight: 600; }
.otp-note { display: block; padding: 8px 16px 12px; color: var(--ink3); font-size: 12px; }

.open-company {
  margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; font-weight: 700;
  color: #ffe7a6; border: 1px solid rgba(255, 207, 90, .35); background: rgba(255, 207, 90, .08);
}
.open-company + .open-screen { margin-top: 8px; }

/* קוד בניין */
.code-cell { white-space: nowrap; }
.code-cell code, .code-box code { font-size: 17px; font-weight: 800; letter-spacing: .14em; color: var(--ink); background: #f3f5fa; padding: 4px 8px; border-radius: 8px; }
.code-cell .icon-btn { width: 28px; height: 28px; vertical-align: middle; }
.code-box { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 12px; background: #fffaf0; border: 1px solid #f4e2b8; }
.code-box > div { flex: 1; }
.code-box small { display: block; color: var(--ink3); font-size: 12px; margin-bottom: 4px; }
.code-box code { font-size: 26px; background: transparent; padding: 0; }

.link-short { font-size: 13px; font-weight: 700; }
.code-box.link code { font-size: 14px; letter-spacing: 0; word-break: break-all; }

/* חבילות ותמחור */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-bottom: 20px; align-items: stretch; }
.plan-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.plan-card.hi { border: 2px solid var(--accent); box-shadow: 0 10px 30px rgba(43, 89, 255, .14); }
.plan-badge { position: absolute; top: -12px; inset-inline-start: 20px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 99px; }
.plan-card h3 { margin: 0; font-size: 20px; }
.plan-price { display: flex; align-items: baseline; gap: 6px; margin-top: 10px; }
.plan-price b { font-size: 38px; font-weight: 800; letter-spacing: -.02em; }
.plan-price span { color: var(--ink3); font-size: 14px; }
.plan-terms { font-size: 13px; color: var(--ink2); line-height: 1.6; }
.plan-hw { display: flex; gap: 8px; align-items: flex-start; background: #f3f6ff; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 8px 0 4px; }
.plan-hw .ic { flex: none; color: var(--accent); }
.plan-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 14px; flex: 1; }
.plan-card li { display: flex; gap: 8px; align-items: flex-start; }
.plan-card li .ic { flex: none; width: 16px; height: 16px; color: #13a37f; margin-top: 2px; }
.plan-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 10px; font-size: 13px; color: var(--ink3); }
.calc-in { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.calc-in input { width: 90px; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 8px; }
.calc-grid label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.table.compact td, .table.compact th { padding: 8px 10px; }
.rows.market li { align-items: center; }
.tag.muted-tag { background: #eef0f5; color: var(--ink2); }
.price-sum { background: #f3f6ff; border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.price-sum b { font-size: 18px; }
.checks { display: grid; gap: 6px; }
.addon-row { display: grid; grid-template-columns: 1fr 100px 110px; gap: 8px; }
.btn.danger { color: #d23b3b; }

/* הצעות מחיר */
.rows.market.cols { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.back-link { font-size: 13px; color: var(--ink3); text-decoration: none; }
.q-layout { display: grid; grid-template-columns: minmax(320px, 400px) 1fr; gap: 20px; align-items: start; }
.q-form { margin: 0; }
.q-form h3.sec.first { border-top: 0; padding-top: 0; margin-top: 0; }
.q-plans { display: grid; gap: 8px; }
.q-addon { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.q-addon input[type=number] { width: 64px; }
.q-preview { position: sticky; top: 0; background: #e9ecf3; border-radius: var(--r); padding: 24px; }
.quote-doc { background: #fff; max-width: 794px; margin: 0 auto; padding: 44px 48px; box-shadow: 0 6px 30px rgba(15, 23, 42, .12); color: #172033; font-size: 13px; line-height: 1.55; }
.qd-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 18px; border-bottom: 3px solid var(--accent); }
.qd-brand { display: flex; gap: 12px; align-items: center; }
.qd-logo { width: 56px; height: 56px; display: block; }
.company-logo { background: none; padding: 0; } /* הלוגו של החברה (לוגו/logo-icon.svg) */
.qd-brand b { display: block; font-size: 18px; font-weight: 800; }
.qd-brand small { color: #5b6476; }
.qd-meta { text-align: left; display: grid; gap: 2px; color: #5b6476; }
.qd-meta h1 { margin: 0; font-size: 26px; color: #172033; font-weight: 800; }
.qd-to { display: grid; gap: 2px; margin: 20px 0; }
.qd-to small { color: #5b6476; }
.qd-to b { font-size: 16px; }
.qd-hero { display: grid; grid-template-columns: 1fr 210px; gap: 24px; background: #f5f7ff; border-radius: 14px; padding: 20px 22px; }
.qd-hero small { color: #5b6476; }
.qd-hero h2 { margin: 2px 0 0; font-size: 22px; }
.qd-hero p { margin: 2px 0 8px; color: #3b4459; }
.qd-hero ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.qd-hero li, .qd-hw { display: flex; gap: 6px; align-items: flex-start; }
.qd-hero li .ic { width: 14px; height: 14px; color: #13a37f; flex: none; margin-top: 3px; }
.qd-hw { margin-top: 10px !important; font-size: 12px; }
.qd-hw .ic { width: 15px; height: 15px; color: var(--accent); flex: none; margin-top: 2px; }
.qd-price { display: grid; align-content: center; justify-items: center; text-align: center; background: #fff; border-radius: 12px; padding: 14px; border: 1px solid #dfe5f5; }
.qd-price > b { font-size: 36px; font-weight: 800; color: var(--accent); line-height: 1.1; }
.qd-price > span { color: #5b6476; }
.qd-apt { margin: 10px 0 6px; background: #e8f8f2; color: #0d7a5c; border-radius: 10px; padding: 6px 14px; display: grid; }
.qd-apt b { font-size: 20px; }
.qd-table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.qd-table th { text-align: right; font-size: 12px; color: #5b6476; font-weight: 600; border-bottom: 1px solid #dfe5f5; padding: 6px 8px; }
.qd-table td { padding: 6px 8px; border-bottom: 1px solid #eef1f8; }
.qd-table td:not(:first-child), .qd-table th:not(:first-child) { text-align: left; }
.qd-sub td { background: #f7f8fb; font-weight: 700; font-size: 12px; color: #5b6476; }
.qd-total td { font-weight: 800; border-bottom: 2px solid #dfe5f5; }
.qd-disc td { color: #0d7a5c; }
.qd-on td { background: #f5f7ff; font-weight: 700; }
.qd-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.qd-sum div { border: 1px solid #dfe5f5; border-radius: 12px; padding: 10px 14px; display: grid; }
.qd-sum small, .qd-sum span { color: #5b6476; font-size: 12px; }
.qd-sum b { font-size: 20px; }
.quote-doc h3 { font-size: 14px; margin: 22px 0 0; }
.qd-compare .qd-table { margin-top: 6px; }
.qd-notes p, .qd-terms p { margin: 6px 0 0; white-space: pre-line; color: #3b4459; }
.qd-terms p { font-size: 12px; }
.qd-foot { display: flex; justify-content: space-between; margin-top: 26px; padding-top: 12px; border-top: 1px solid #dfe5f5; color: #5b6476; font-size: 12px; }
@media (max-width: 1100px) { .q-layout { grid-template-columns: 1fr; } .q-preview { position: static; padding: 12px; } .rows.market.cols { grid-template-columns: 1fr; } }
@media print {
  @page { size: A4; margin: 0; } /* בלי שוליים הדפדפן לא מוסיף כתובת ותאריך בראש ובתחתית העמוד */
  html, body.hq { display: block !important; background: #fff !important; height: auto !important; overflow: visible !important; }
  body > :not(#view) { display: none !important; }
  #view { height: auto !important; overflow: visible !important; padding: 0 !important; }
  #view > :not(.q-layout), .q-form { display: none !important; }
  .q-layout { display: block !important; }
  .q-preview { position: static !important; padding: 0 !important; background: none !important; border-radius: 0; }
  .quote-doc { box-shadow: none !important; max-width: none; padding: 14mm 16mm !important; -webkit-box-decoration-break: clone; box-decoration-break: clone; } /* הריווח חוזר בכל עמוד */
  .qd-hero, .qd-table tr, .qd-sum, .qd-compare, .qd-terms { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}

/* כתובת קצרה לבניין: הקידומת קבועה, עורכים רק את הסוף */
.slug-field { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.slug-field > span { padding: 0 10px; color: var(--ink3); font-size: 13px; white-space: nowrap; background: #f5f7fb; align-self: stretch; display: flex; align-items: center; }
.slug-field input { border: 0 !important; border-radius: 0 !important; flex: 1; min-width: 0; }
.login-logo.company-logo { width: 72px; height: 72px; background: none; padding: 0; }

/* ספריית מוזיקה */
.music-table .cell-input { width: 100%; min-width: 90px; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 6px 8px; font: inherit; }
.music-table .cell-input:hover, .music-table .cell-input:focus { border-color: var(--line); background: #fff; outline: none; }
.music-table td[dir=ltr] { white-space: nowrap; }
.music-table select { min-width: 120px; font: inherit; padding: 5px 6px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.music-table .icon-btn.playing { color: var(--accent, #4f46e5); }
.music-table .icon-btn.danger:hover { color: var(--red); }
.card.flush > header.pad { padding: 16px 18px 6px; }
@media (max-width: 1280px) { .music-table th:nth-child(5), .music-table td:nth-child(5) { display: none; } }
@media (max-width: 900px) { .music-table th:nth-child(6), .music-table td:nth-child(6), .music-table th:nth-child(3), .music-table td:nth-child(3), .music-table th:nth-child(7), .music-table td:nth-child(7) { display: none; } }

/* טלוויזיה חכמה בהצעה ובמחירון */
.q-tv select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); font: inherit; }
.tv-row { grid-template-columns: 1fr 1fr !important; }
.tv-row label { display: grid; gap: 4px; font-size: 12px; color: var(--ink3); }

/* הדמיות המסך בהצעת המחיר */
.qd-mocks { margin-top: 18px; }
.qd-mocks-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 3px solid var(--accent); margin-bottom: 16px; }
.qd-mocks-head h2 { margin: 0; font-size: 22px; }
.qd-mocks-head span { color: var(--ink3); font-size: 13px; }
.mock-grid { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; }
.mock { margin: 0; flex: 1 1 auto; }
.mock.wide { flex-basis: 100%; }
.mock-wall { position: relative; padding: 22px 26px 30px; border-radius: 14px; background: linear-gradient(180deg, #efe9e1 0%, #e4dccf 78%, #cfc4b3 78.5%, #d8cebf 100%); display: grid; place-items: center; }
.bezel { background: #0b0d12; padding: 6px; border-radius: 9px; box-shadow: 0 16px 30px rgba(40, 30, 10, .28); }
.screen-box { position: relative; overflow: hidden; border-radius: 3px; background: #070b1a; }
.screen-box iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; pointer-events: none; }
.mock figcaption { padding: 8px 2px 0; }
.mock figcaption b { display: block; font-size: 13.5px; }
.mock figcaption span { font-size: 12px; color: var(--ink3); }
.qd-mocks-note { margin: 14px 0 0; font-size: 12px; color: var(--ink3); }
@media print {
  .qd-mocks { break-before: page; }
  .mock { break-inside: avoid; }
}

/* קבלות */
.receipt-doc { position: relative; overflow: hidden; }
.qd-brand small { display: block; }
.rc-copy { display: inline-block; width: fit-content; align-self: flex-start; margin-top: 4px; padding: 2px 10px; border: 1.5px solid var(--accent); color: var(--accent); border-radius: 6px; font-style: normal; font-weight: 700; font-size: 13px; }
.rc-h { margin: 22px 0 8px; font-size: 15px; }
.rc-sum { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; padding: 14px 18px; border-radius: 14px; background: #f3f6ff; }
.rc-sum span { color: var(--ink2); font-weight: 600; }
.rc-sum b { font-size: 26px; color: var(--accent); }
.rc-note { margin: 12px 0 0; font-size: 13px; color: var(--ink3); }
.rc-note.rc-cancel { color: var(--red); font-weight: 600; }
.rc-sign { display: flex; align-items: flex-end; gap: 10px; margin: 40px 0 10px; font-size: 13px; color: var(--ink3); }
.rc-sign i { flex: 0 0 200px; border-bottom: 1px solid #aab2c4; height: 1px; }
.rc-stamp { position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); font-size: 64px; font-weight: 900; color: rgba(220, 50, 50, .14);
  border: 6px solid rgba(220, 50, 50, .14); border-radius: 18px; padding: 6px 28px; white-space: nowrap; pointer-events: none; z-index: 2; }
.rc-rows { display: grid; gap: 8px; }
.rc-row { display: grid; grid-template-columns: 1fr 110px auto; gap: 8px; align-items: center; }
.rc-row.rc-pay { grid-template-columns: 130px 1fr 140px 100px auto; }
.rc-row input, .rc-row select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; min-width: 0; background: #fff; }
.rc-links { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.rc-check { font-size: 13px; color: var(--green, #11834f); display: inline-flex; align-items: center; gap: 4px; }
.rc-check.bad { color: var(--red); }
.warn-card { border: 1px solid #f5d29a; background: #fff8ec; margin-bottom: 16px; }
@media (max-width: 900px) { .rc-row.rc-pay { grid-template-columns: 1fr 1fr; } }
@media print { .rc-stamp { color: rgba(220, 50, 50, .18); } .rc-sum, .qd-table tr { break-inside: avoid; } }
