/* HMSC custom fixes */

/* ---- Print fix: sirf .hmsc-print-root ke andar ka content print hoga, chahe wo kितनी bhi nesting me ho ----
   Pura module (header, sidebar, navigation, box-header, footer) print me nahi aayega. */
@media print {
    body * { visibility: hidden !important; }
    .hmsc-print-root, .hmsc-print-root * { visibility: visible !important; }
    .hmsc-print-root {
        position: absolute !important; left: 0; top: 0; width: 100%; margin: 0; padding: 0;
        box-shadow: none !important; border: none !important;
    }
    .hmsc-no-print { display: none !important; }
    body { background: #fff !important; }
}

/* ---- Bill / receipt look (GST-bill style) ---- */
.hmsc-bill { max-width: 800px; margin: 0 auto; background: #fff; border: 1px solid #ddd; padding: 25px 30px; font-family: Arial, Helvetica, sans-serif; color: #222; }
.hmsc-bill-head { text-align: center; border-bottom: 2px solid #333; padding-bottom: 12px; margin-bottom: 15px; }
.hmsc-bill-head h2 { margin: 0 0 4px 0; letter-spacing: .5px; }
.hmsc-bill-head p { margin: 2px 0; font-size: 12.5px; color: #555; }
.hmsc-bill-meta { display: flex; justify-content: space-between; flex-wrap: wrap; margin-bottom: 15px; font-size: 13px; }
.hmsc-bill-meta div { min-width: 45%; margin-bottom: 6px; }
.hmsc-bill-meta strong { display: inline-block; min-width: 110px; }
.hmsc-bill table.hmsc-bill-items { width: 100%; border-collapse: collapse; margin: 15px 0; }
.hmsc-bill table.hmsc-bill-items th, .hmsc-bill table.hmsc-bill-items td { border: 1px solid #ccc; padding: 8px 10px; font-size: 13px; text-align: left; }
.hmsc-bill table.hmsc-bill-items th { background: #f5f5f5; }
.hmsc-bill table.hmsc-bill-items td.hmsc-amt, .hmsc-bill table.hmsc-bill-items th.hmsc-amt { text-align: right; }
.hmsc-bill-total-row td { font-weight: bold; font-size: 14px; background: #fafafa; }
.hmsc-bill-foot { margin-top: 25px; display: flex; justify-content: space-between; align-items: flex-end; font-size: 12.5px; }
.hmsc-bill-sign { text-align: center; }
.hmsc-bill-sign .hmsc-sign-line { margin-top: 40px; border-top: 1px solid #333; padding-top: 4px; width: 160px; }
.hmsc-bill-note { margin-top: 15px; font-size: 11.5px; color: #777; text-align: center; }

/* ===================== Doctor Panel dashboard widgets ===================== */
.hmsc-stat-grid { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 20px 0; }
.hmsc-stat-card { flex: 1 1 190px; min-width: 170px; background: #fff; border: 1px solid #e3e6ea; border-radius: 6px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); display: flex; align-items: center; gap: 14px; transition: box-shadow .15s ease, transform .15s ease; }
.hmsc-stat-card:hover { box-shadow: 0 4px 10px rgba(0,0,0,0.08); transform: translateY(-1px); }
.hmsc-stat-icon { width: 44px; height: 44px; min-width: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff; }
.hmsc-stat-value { font-size: 22px; font-weight: 700; line-height: 1.1; color: #2b2f33; }
.hmsc-stat-label { font-size: 12.5px; color: #79828a; margin-top: 2px; }
.hmsc-stat-blue   { background: #3b8bdb; }
.hmsc-stat-green  { background: #38b06a; }
.hmsc-stat-orange { background: #e2932a; }
.hmsc-stat-red    { background: #d9534f; }
.hmsc-stat-purple { background: #8f6fd6; }
.hmsc-stat-teal   { background: #2ba6a4; }

.hmsc-quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 20px 0; }
.hmsc-quick-actions a { flex: 1 1 140px; min-width: 130px; text-align: center; background: #fff; border: 1px solid #e3e6ea; border-radius: 6px; padding: 12px 8px; color: #45494d; text-decoration: none; font-size: 12.5px; transition: background .15s ease, border-color .15s ease; }
.hmsc-quick-actions a:hover { background: #f4f8fd; border-color: #3b8bdb; color: #2f6fb0; text-decoration: none; }
.hmsc-quick-actions a i { display: block; font-size: 18px; margin-bottom: 6px; }

.hmsc-badge { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 11px; font-weight: 600; letter-spacing: .2px; color: #fff; white-space: nowrap; }
.hmsc-badge-scheduled, .hmsc-badge-ordered { background: #3b8bdb; }
.hmsc-badge-completed { background: #38b06a; }
.hmsc-badge-cancelled { background: #d9534f; }
.hmsc-badge-no-show   { background: #9b9b9b; }
.hmsc-badge-checked-in { background: #e2932a; }
.hmsc-badge-in-consultation { background: #38b06a; }
.hmsc-badge-processing{ background: #e2932a; }
.hmsc-badge-new       { background: #2ba6a4; }
.hmsc-badge-follow-up { background: #8f6fd6; }
.hmsc-badge-routine   { background: #6c757d; }
.hmsc-badge-urgent    { background: #e2932a; }
.hmsc-badge-stat      { background: #d9534f; }
.hmsc-badge-walkin    { background: #2f6fb0; }
.hmsc-badge-ready     { background: #38b06a; }
.hmsc-badge-waiting   { background: #e2932a; }

.hmsc-empty-state { padding: 22px 10px; text-align: center; color: #9aa0a6; font-size: 13px; }
.hmsc-empty-state i { display: block; font-size: 22px; margin-bottom: 8px; color: #c7ccd1; }

.hmsc-mini-table { width: 100%; border-collapse: collapse; }
.hmsc-mini-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: #9aa0a6; padding: 6px 8px; border-bottom: 1px solid #eceff1; }
.hmsc-mini-table td { padding: 8px; border-bottom: 1px solid #f2f4f6; font-size: 13px; vertical-align: middle; }
.hmsc-mini-table tr:last-child td { border-bottom: none; }

.hmsc-section-title { font-size: 13.5px; font-weight: 700; color: #45494d; }
.hmsc-section-title i { margin-right: 6px; }
.hmsc-view-all { float: right; font-size: 12px; }

/* ---- GST Tax Invoice (Param Hospital style) ---- */
.hmsc-tinv { max-width: 900px; margin: 0 auto; background: #fff; border: 1px solid #c7d3e0; padding: 22px 26px; font-family: Arial, Helvetica, sans-serif; color: #1f2937; font-size: 13px; }
.hmsc-tinv-top { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #12406f; padding-bottom: 14px; margin-bottom: 14px; gap: 16px; }
.hmsc-tinv-brand { display: flex; gap: 12px; align-items: flex-start; }
.hmsc-tinv-brand-text h1 { margin: 0 0 3px; font-size: 20px; letter-spacing: .3px; color: #12406f; }
.hmsc-tinv-brand-text p { margin: 1px 0; font-size: 12px; color: #444; }
.hmsc-tinv-brand-text .hmsc-tinv-reg { margin-top: 6px; font-size: 11.5px; color: #333; }
.hmsc-tinv-badge { text-align: right; min-width: 260px; }
.hmsc-tinv-badge-head { background: #12406f; color: #fff; padding: 8px 14px; border-radius: 4px; font-weight: bold; font-size: 15px; margin-bottom: 8px; }
.hmsc-tinv-badge-head small { font-weight: normal; font-size: 10.5px; }
.hmsc-tinv-meta { width: 100%; font-size: 12px; border-collapse: collapse; }
.hmsc-tinv-meta td { padding: 2px 0; text-align: left; }
.hmsc-tinv-meta td:first-child { color: #555; white-space: nowrap; padding-right: 8px; }
.hmsc-tinv-meta td:last-child { font-weight: bold; }
.hmsc-tinv-paid { color: #16a34a; }

.hmsc-tinv-mid { display: flex; gap: 14px; align-items: stretch; margin-bottom: 14px; }
.hmsc-tinv-box { flex: 1; border: 1px solid #c7d3e0; border-radius: 4px; overflow: hidden; }
.hmsc-tinv-box-head { background: #12406f; color: #fff; font-size: 11.5px; font-weight: bold; letter-spacing: .3px; padding: 6px 10px; }
.hmsc-tinv-kv { width: 100%; border-collapse: collapse; font-size: 12px; }
.hmsc-tinv-kv td { padding: 5px 10px; vertical-align: top; }
.hmsc-tinv-kv td:first-child { color: #555; white-space: nowrap; width: 40%; }
.hmsc-tinv-qr { flex: 0 0 150px; text-align: center; border: 1px solid #c7d3e0; border-radius: 4px; padding: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hmsc-tinv-qr img { display: block; margin-bottom: 6px; }
.hmsc-tinv-qr p { margin: 0; font-size: 11px; color: #555; }

.hmsc-tinv-table-wrap { overflow-x: auto; margin-bottom: 14px; }
table.hmsc-tinv-items { width: 100%; border-collapse: collapse; font-size: 11.5px; min-width: 760px; }
table.hmsc-tinv-items th, table.hmsc-tinv-items td { border: 1px solid #c7d3e0; padding: 6px 7px; text-align: center; }
table.hmsc-tinv-items th { background: #eaf1fa; color: #12406f; font-weight: bold; }
table.hmsc-tinv-items td:nth-child(2) { text-align: left; }
table.hmsc-tinv-items td.hmsc-amt { text-align: right; }

.hmsc-tinv-summary-row { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 16px; align-items: flex-start; }
.hmsc-tinv-words-col { flex: 1 1 320px; display: flex; flex-direction: column; gap: 10px; }
.hmsc-tinv-words { font-size: 12.5px; color: #333; }
.hmsc-tinv-totals-col { flex: 0 0 320px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hmsc-tinv-totals { width: 100%; border-collapse: collapse; font-size: 12.5px; border: 1px solid #c7d3e0; }
.hmsc-tinv-totals td { padding: 6px 12px; border-bottom: 1px solid #e3e9f1; }
.hmsc-tinv-totals td:last-child { text-align: right; }
.hmsc-tinv-totals tr.hmsc-tinv-grand td { background: #12406f; color: #fff; font-weight: bold; font-size: 14px; border-bottom: none; }

.hmsc-tinv-pay-box { width: 100%; }
.hmsc-tinv-stamp { flex: 0 0 auto; text-align: center; border: 3px solid #16a34a; color: #16a34a; border-radius: 8px; padding: 8px 6px; transform: rotate(-6deg); align-self: center; }
.hmsc-tinv-stamp span { display: block; font-size: 18px; font-weight: bold; letter-spacing: 2px; }
.hmsc-tinv-stamp small { display: block; font-size: 10px; letter-spacing: 1px; margin-top: 2px; }

.hmsc-tinv-foot-row { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; flex-wrap: wrap; }
.hmsc-tinv-terms { flex: 1 1 260px; }
.hmsc-tinv-terms ul { margin: 6px 10px; padding-left: 16px; font-size: 11px; color: #444; }
.hmsc-tinv-terms li { margin-bottom: 3px; }
.hmsc-tinv-sign { flex: 0 0 220px; text-align: center; border: 1px solid #c7d3e0; border-radius: 4px; padding-bottom: 10px; }
.hmsc-tinv-sign .hmsc-tinv-box-head { text-align: left; }
.hmsc-tinv-sign-space { height: 46px; }
.hmsc-tinv-sign p { margin: 4px 0 0; font-size: 11.5px; color: #333; }
.hmsc-tinv-pay-qr { flex: 0 0 170px; text-align: center; border: 1px solid #c7d3e0; border-radius: 4px; padding-bottom: 10px; }
.hmsc-tinv-pay-qr .hmsc-tinv-box-head { text-align: left; }
.hmsc-tinv-pay-qr img { margin: 8px 0 6px; }
.hmsc-tinv-upi { font-size: 11px; margin: 6px 0 0; color: #333; }

.hmsc-tinv-note { text-align: center; background: #eaf1fa; color: #12406f; padding: 10px; border-radius: 4px; font-size: 12.5px; margin-top: 6px; }

@media print {
    .hmsc-tinv { border: none; padding: 0; }
    .hmsc-tinv-stamp { transform: rotate(-6deg) !important; }
}
@media (max-width: 700px) {
    .hmsc-tinv-top, .hmsc-tinv-mid, .hmsc-tinv-summary-row, .hmsc-tinv-foot-row { flex-direction: column; }
    .hmsc-tinv-badge { text-align: left; }
}

/* ---- Bill Items block (collect payment) ---- */
.ph-app-shell .form-horizontal .bill-items-block { grid-column: 1 / -1; }
.bill-items-block #items_table { margin-bottom: 10px; }
.bill-items-block #items_table td, .bill-items-block #items_table th { vertical-align: middle; }
.bill-items-block #items_table select,
.bill-items-block #items_table input { width: 100% !important; min-height: 32px !important; padding: 5px 8px !important; }
.hmsc-row-actions { text-align: center !important; }
.hmsc-row-remove-btn {
    width: 26px; height: 26px; line-height: 24px; padding: 0;
    border: 1px solid #e3b0b0; background: #fdecec; color: #c0392b;
    border-radius: 6px; font-size: 15px; cursor: pointer;
}
.hmsc-row-remove-btn:hover { background: #f8d4d4; }
.hmsc-add-item-btn {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid #2468ed; background: #eaf1ff; color: #12406f;
    font-size: 12.5px; font-weight: 700; padding: 6px 14px;
    border-radius: 6px; cursor: pointer; box-shadow: none;
}
.hmsc-add-item-btn:hover { background: #dbe9ff; }

/* AM/PM time picker */
.hmsc-ampm-time { display: inline-flex; align-items: center; gap: 4px; }
.hmsc-ampm-time select { padding: 4px 6px; height: 32px; border: 1px solid #ccc; border-radius: 4px; }
.hmsc-ampm-time .hmsc-ampm-mer { font-weight: 700; }

/* Manage Department table: compact description column + single-line action buttons */
.hmsc-desc-col {
	max-width: 220px;
	white-space: normal;
	word-wrap: break-word;
	overflow-wrap: break-word;
}
.hmsc-options-col { white-space: nowrap; }
.hmsc-options-cell {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: center;
	gap: 4px;
}
.hmsc-options-cell .btn {
	padding: 4px 8px;
	margin: 0;
}
