/* Wise Tech client portal & admin */
.portal-body { background: var(--bg-soft); min-height: 100vh; display: flex; flex-direction: column; }
.portal-main { flex: 1; padding: 36px 0 60px; }
.portal-foot { text-align: center; font-size: .85rem; color: var(--muted); padding: 22px 0; border-top: 1px solid var(--line); background: #fff; }
.nav-links .who span { font-size: .85rem; color: var(--muted); font-weight: 600; }
.btn-sm { padding: 7px 16px !important; font-size: .85rem; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-light { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-light:hover { border-color: var(--blue); color: var(--blue); }

.page-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-title h1 { font-size: 1.7rem; margin: 0; }
.page-title p { margin: 4px 0 0; color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.tile span { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tile strong { display: block; font-size: 1.8rem; color: var(--navy); font-weight: 800; margin-top: 4px; }
.tile.warn strong { color: #b45309; }
.tile.bad strong { color: #b91c1c; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 26px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2 { font-size: 1.1rem; margin: 0; }
.panel-body { padding: 22px; }
.empty { padding: 30px 22px; text-align: center; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 12px 22px; background: #fafbfd; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 13px 22px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td small { display: block; color: var(--muted); }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl .actions { white-space: nowrap; text-align: right; }
.tbl .actions form { display: inline; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; font-weight: 600; cursor: pointer; }
.linkbtn.danger { color: #dc2626; }
.linkbtn + .linkbtn, .actions a + form, .actions a + a, .actions form + a, .actions form + form { margin-left: 12px; }

.badge-s { display: inline-block; font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge-s.ok { background: #dcfce7; color: #166534; }
.badge-s.warn { background: #fef3c7; color: #92400e; }
.badge-s.bad { background: #fee2e2; color: #991b1b; }
.badge-s.info { background: #dbeafe; color: #1e40af; }
.badge-s.mute { background: #eef2f6; color: #475569; }

.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: 1 / -1; }
.field input[type=checkbox] { width: auto; margin-right: 8px; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* Login */
.login-body {
  min-height: 100vh; display: grid; place-items: center; padding: 30px 16px;
  background: radial-gradient(800px 400px at 90% -10%, rgba(14,165,164,.35), transparent 60%),
              radial-gradient(700px 400px at -10% 110%, rgba(37,99,235,.35), transparent 60%), var(--navy);
}
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 20px; padding: 36px; box-shadow: var(--shadow-lg); }
.login-card .brand { justify-content: center; margin-bottom: 8px; }
.login-card h1 { font-size: 1.45rem; text-align: center; margin: 14px 0 4px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: .93rem; margin-bottom: 24px; }
.login-card .btn { width: 100%; justify-content: center; }
.login-foot { text-align: center; font-size: .86rem; color: var(--muted); margin-top: 20px; }
.login-back { display: block; text-align: center; color: #cbd5e1; font-size: .88rem; margin-top: 18px; }

/* Tickets */
.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: #fff; max-width: 88%; }
.msg.admin { background: #eff6ff; border-color: #bfdbfe; align-self: flex-end; }
.msg .meta { font-size: .8rem; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.msg .body { white-space: pre-wrap; word-wrap: break-word; }

/* Invoice print */
.invoice { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; max-width: 820px; margin: 0 auto; }
.inv-top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 30px; }
.inv-top h2 { margin: 0; font-size: 1.8rem; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 28px; font-size: .93rem; }
.inv-parties h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.inv-total { text-align: right; font-size: 1.25rem; font-weight: 800; color: var(--navy); margin-top: 18px; }
.secret { font-family: ui-monospace, Consolas, monospace; background: #fef3c7; padding: 2px 8px; border-radius: 6px; font-weight: 700; }

@media print {
  .site-header, .portal-foot, .no-print, .float-wa { display: none !important; }
  .portal-body, .portal-main { background: #fff; padding: 0; }
  .invoice { border: 0; padding: 0; }
}
@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .nav-links .who { padding: 8px 0; }
}
@media (max-width: 560px) {
  .tiles, .form-grid, .inv-parties { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .invoice { padding: 22px; }
  .msg { max-width: 100%; }
  .tbl th, .tbl td { padding: 11px 14px; }
}

/* Service detail */
.kv-list { display: flex; flex-direction: column; gap: 10px; }
.kv { display: grid; grid-template-columns: 200px 1fr auto; gap: 14px; align-items: center; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfd; }
.kv > span { font-size: .85rem; font-weight: 700; color: var(--muted); }
.kv code, .kv div code { font-family: ui-monospace, Consolas, monospace; font-size: .95rem; color: var(--navy); font-weight: 600; word-break: break-all; }
.kv div { word-break: break-all; }
.copy { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: .8rem; font-weight: 700; color: var(--blue); cursor: pointer; }
.copy:hover { border-color: var(--blue); }
.hint-line { margin: 14px 0 0; font-size: .88rem; color: var(--muted); }
@media (max-width: 560px) {
  .kv { grid-template-columns: 1fr auto; }
  .kv > span { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------- e-Certificates (/cert/) */
.auth-wrap { min-height: calc(100vh - 150px); display: grid; place-items: center; padding: 40px 16px; background: var(--bg-soft); }
.plan-group[hidden] { display: none; }
.plan .price { font-size: 2rem; font-weight: 800; color: var(--navy); margin: 6px 0 2px; }
.plan .price small { font-size: .85rem; font-weight: 600; color: var(--muted); }
.tile-sub { display: block; font-size: .8rem; color: var(--muted); margin-top: 4px; font-weight: 600; }
.tile-of { font-size: 1rem; color: var(--muted); }
.meter { height: 10px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), var(--blue)); border-radius: inherit; transition: width .3s; }
a.card.quick { color: inherit; text-decoration: none; }
a.card.quick h3 { margin-bottom: 6px; }
.checkout-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 26px; align-items: start; }
.checkout-grid .panel { margin-bottom: 0; }
.sum-plan { padding-bottom: 14px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.sum-plan strong { display: block; color: var(--navy); font-size: 1.05rem; }
.sum-plan span { font-size: .88rem; color: var(--muted); }
.sum-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: .94rem; }
.sum-row.total { border-top: 2px solid var(--navy); margin-top: 8px; padding-top: 12px; font-weight: 800; font-size: 1.1rem; color: var(--navy); }
.pay-box { text-align: center; }
.pay-box .amount { font-size: 2.2rem; font-weight: 800; color: var(--navy); }
.pay-box .qr { width: 240px; max-width: 100%; margin: 0 auto; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.pay-box .qr svg { display: block; width: 100%; height: auto; }
.upi-btn { margin-top: 10px; }
@media (min-width: 900px) { .upi-btn { display: none; } }
.inline-input { padding: 8px 12px; border: 1px solid #cfd8e3; border-radius: 10px; font: inherit; font-size: .9rem; background: #fff; }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; font-size: .9rem; color: var(--muted); }
.verify-card { background: #fff; border-radius: 20px; padding: 36px; border: 2px solid; text-align: center; box-shadow: var(--shadow); }
.verify-card.valid { border-color: #86efac; }
.verify-card.revoked { border-color: #fca5a5; }
.verify-card .verify-icon { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 2.2rem; font-weight: 800; color: #fff; }
.verify-card.valid .verify-icon { background: #16a34a; }
.verify-card.revoked .verify-icon { background: #dc2626; }
.verify-card h1 { font-size: 1.7rem; margin-bottom: 6px; }
.verify-card .sub { color: var(--muted); margin-bottom: 22px; }
.verify-card .kv-list { text-align: left; }
.verify-card .kv { grid-template-columns: 150px 1fr auto; }

/* Designer */
.quota-pill { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-size: .88rem; }
.quota-pill.none { background: #fef3c7; border-color: #fde68a; }
.designer { display: grid; grid-template-columns: 430px 1fr; gap: 24px; align-items: start; }
.d-controls { display: flex; flex-direction: column; gap: 16px; }
.d-step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.d-step h3 { font-size: 1rem; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.d-step h3 span { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: .8rem; }
.d-step input[type=file] { width: 100%; font: inherit; font-size: .88rem; }
.d-step .hint { font-size: .82rem; color: var(--muted); margin: 8px 0 0; }
.d-step code { background: #eef2f6; padding: 1px 6px; border-radius: 5px; font-size: .82rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { border: 1px dashed #93c5fd; background: #eff6ff; color: #1e40af; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.chip:hover { background: #dbeafe; }
.row-nav { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: .88rem; font-weight: 600; }
.field-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: #fafbfd; cursor: pointer; }
.field-card.sel { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); background: #fff; }
.fc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .9rem; }
.fc-head .linkbtn { margin-left: auto; font-size: .82rem; }
.fc-head .tag { font-size: .68rem; }
.field-card input[type=text] { width: 100%; padding: 8px 10px; border: 1px solid #cfd8e3; border-radius: 8px; font: inherit; font-size: .9rem; margin-bottom: 8px; }
.fc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fc-grid label, .mini-fields label { display: flex; flex-direction: column; gap: 3px; font-size: .74rem; font-weight: 700; color: var(--muted); }
.fc-grid select, .fc-grid input, .mini-fields select { padding: 6px 8px; border: 1px solid #cfd8e3; border-radius: 7px; font: inherit; font-size: .84rem; width: 100%; background: #fff; }
.fc-grid input[type=color], .mini-fields input[type=color] { padding: 2px; height: 32px; }
.fc-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: .84rem; }
.fc-row .pos { margin-left: auto; font-size: .78rem; font-weight: 700; color: var(--muted); }
.fc-row .pos input { width: 64px; padding: 4px 6px; border: 1px solid #cfd8e3; border-radius: 6px; font: inherit; font-size: .8rem; }
label.check { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-size: .88rem; font-weight: 500; color: var(--ink); cursor: pointer; }
.mini-fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 10px; }
.mini-fields label:not(.check) { flex: 1; min-width: 120px; }
.progress { margin-top: 14px; }
.d-preview { position: sticky; top: 90px; }
.d-canvas-wrap { background: repeating-conic-gradient(#eef2f6 0% 25%, #fff 0% 50%) 50% / 20px 20px; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
#cv { display: block; width: 100%; height: auto; box-shadow: 0 6px 24px rgba(11,27,58,.15); cursor: move; touch-action: none; }

/* GST tax invoice */
.inv-toolbar { max-width: 860px; margin: 20px auto 12px; padding: 0 16px; display: flex; justify-content: space-between; align-items: center; }
.tax-invoice { max-width: 860px; margin: 0 auto 40px; background: #fff; color: #000; border: 1px solid #bbb; border-radius: 4px; padding: 40px; font-size: .92rem; }
.tax-invoice strong, .tax-invoice h1, .tax-invoice h4 { color: #000; }
.ti-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; background: #fff; margin: 0 0 26px; padding: 0 0 18px; border-bottom: 2px solid #000; }
/* Logo has white lettering: invert + greyscale turns it into dark-grey text on white, no background box needed */
.ti-head img { height: 58px; width: auto; filter: grayscale(1) invert(1) contrast(1.2); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ti-head h1 { color: #000; font-size: 1.6rem; margin: 0; text-align: right; letter-spacing: .04em; }
.ti-head .paid { display: inline-block; float: right; margin-top: 6px; color: #000; border: 2px solid #000; padding: 1px 10px; font-weight: 800; letter-spacing: .1em; font-size: .8rem; }
.ti-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 24px; line-height: 1.7; }
.ti-grid h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: #444; margin-bottom: 6px; }
.ti-meta td { padding: 2px 16px 2px 0; }
.ti-meta td:first-child { color: #444; }
.ti-meta td:last-child { font-weight: 700; }
.ti-items { width: 100%; border-collapse: collapse; margin: 10px 0 18px; }
.ti-items th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; border-bottom: 2px solid #000; padding: 8px 6px; }
.ti-items td { padding: 12px 6px; border-bottom: 1px solid #bbb; vertical-align: top; }
.ti-items .num { text-align: right; }
.ti-items small { color: #444; }
.ti-totals { margin-left: auto; width: 320px; max-width: 100%; }
.ti-totals .row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #bbb; }
.ti-totals .grand { font-weight: 800; font-size: 1.05rem; border-bottom: 2px solid #000; }
.ti-totals .due { font-weight: 800; border: 0; }
.ti-words { margin: 16px 0 0; font-size: .88rem; }
.ti-foot { margin-top: 36px; padding-top: 18px; border-top: 1px solid #bbb; text-align: center; color: #444; font-size: .85rem; }
@media print {
  .inv-toolbar { display: none; }
  .tax-invoice { border: 0; margin: 0; padding: 0 10px; max-width: none; }
  .ti-head { margin: 0 0 24px; }
}
@media (max-width: 1100px) {
  .designer { grid-template-columns: 1fr; }
  .d-preview { position: static; order: -1; }
}
@media (max-width: 900px) {
  .checkout-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .fc-grid { grid-template-columns: 1fr 1fr; }
  .ti-grid { grid-template-columns: 1fr; }
  .tax-invoice { padding: 20px; }
  .ti-head { flex-wrap: wrap; }
  .verify-card { padding: 24px 18px; }
  .verify-card .kv { grid-template-columns: 1fr; }
}

/* Google Sign-In on /cert/ login & register */
.g-wrap { display: flex; justify-content: center; min-height: 44px; margin-bottom: 6px; }
.or-line { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .82rem; font-weight: 600; margin: 14px 0 18px; text-transform: uppercase; letter-spacing: .08em; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Paytm online payment box on /cert/pay.php */
.paytm-box .panel-body { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.paytm-box { border: 2px solid #bfdbfe; background: linear-gradient(135deg, #eff6ff, #fff); }
