.phms-wrap{display:flex;gap:20px;align-items:flex-start}.phms-sidebar{width:240px;min-width:220px;background:#102033;color:#fff;border-radius:14px;padding:18px;position:sticky;top:20px}.phms-sidebar h3{color:#fff;margin:0 0 15px}.phms-sidebar a{display:block;color:#fff;text-decoration:none;padding:10px 12px;border-radius:10px;margin-bottom:6px}.phms-sidebar a.active,.phms-sidebar a:hover{background:#5BD4DB;color:#082030}.phms-content{flex:1;min-width:0}.phms-card{background:#fff;border:1px solid #e6ebf1;border-radius:16px;padding:22px;margin-bottom:22px;box-shadow:0 8px 24px rgba(15,35,60,.06)}.phms-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.phms-field{display:block;margin:0}.phms-field span{display:block;font-weight:600;margin-bottom:5px}.phms-field.full{grid-column:1/-1}.phms-check{display:flex;align-items:center;gap:8px;margin-top:28px}.phms-help{color:#667085;font-size:13px}.phms-stat{border-radius:14px;padding:18px;background:#eef7ff}.phms-stat strong{font-size:30px;display:block}.phms-stat.danger{background:#ffecec}.phms-stat.warning{background:#fff7df}.phms-stat.success{background:#eaffe9}.phms-filters{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin-bottom:18px}.phms-table-wrap{overflow:auto}.phms-actions{display:flex;gap:6px;align-items:center;white-space:nowrap}.phms-actions form{display:inline;margin:0}.phms-alert-row{display:flex;justify-content:space-between;gap:12px;border-bottom:1px solid #eee;padding:10px 0}.phms-repeat-row{border:1px solid #dde5ee;border-radius:14px;padding:14px;margin-bottom:12px;background:#fbfdff}.phms-repeat-row .button{margin-top:8px}.phms-tab-buttons{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 16px}.phms-tab-btn{border:1px solid #d0d7de;background:#f6f8fa;padding:9px 14px;border-radius:10px;cursor:pointer}.phms-tab-btn.active,.phms-tab-btn:hover{background:#37DEBB;border-color:#37DEBB;color:#082030}.phms-tab-panel{display:none}.phms-tab-panel.active{display:block}.phms-mini-tabs{margin-top:12px}.phms-autocomplete{position:relative}.phms-suggest{position:absolute;z-index:9999;left:0;right:0;background:#fff;border:1px solid #d0d7de;border-radius:8px;box-shadow:0 8px 18px rgba(0,0,0,.12);max-height:220px;overflow:auto}.phms-suggest:empty{display:none}.phms-suggest-item{padding:9px 11px;cursor:pointer}.phms-suggest-item:hover{background:#f2fbfa}.phms-other-field{display:none}.phms-repeat-row.is-other .phms-other-field{display:block}.phms-billing-settings h4{margin-top:8px}.phms-countdown{font-weight:700;color:#d35400}@media(max-width:900px){.phms-wrap{display:block}.phms-sidebar{width:auto;position:static;margin-bottom:18px}.phms-grid,.phms-filters{grid-template-columns:1fr}.phms-actions{flex-wrap:wrap}}

/* Billing reports summary and filter UI */
.phms-billing-report-box .phms-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin: 16px 0;
}
.phms-billing-report-box .phms-summary-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.05);
}
.phms-billing-report-box .phms-summary-card span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
}
.phms-billing-report-box .phms-summary-card strong {
    display: block;
    font-size: 22px;
    color: #111827;
}
.phms-billing-report-box .phms-summary-card-dark {
    background: #111827;
    border-color: #111827;
}
.phms-billing-report-box .phms-summary-card-dark span,
.phms-billing-report-box .phms-summary-card-dark strong {
    color: #ffffff;
}
.phms-billing-filters {
    align-items: end;
    margin-top: 10px;
    margin-bottom: 18px;
}
.phms-billing-report-box .phms-small-summary-grid .phms-summary-card strong {
    font-size: 18px;
}

/* PHMS requested layout updates */
.phms-wrap{align-items:flex-start;}
.phms-sidebar{
    position: sticky !important;
    top: 24px !important;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    box-shadow: 0 12px 32px rgba(16,32,51,.18);
}
.phms-form h5{
    grid-column: 1 / -1;
    margin: 28px 0 16px;
    padding: 13px 16px 13px 20px;
    border-radius: 14px;
    background: linear-gradient(90deg,#102033 0%,#166b7a 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .2px;
    border-left: 6px solid #37DEBB;
    box-shadow: 0 8px 20px rgba(16,32,51,.10);
}
.phms-form h5:first-of-type{margin-top:8px;}
.phms-form .phms-grid{
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 16px;
    align-items: start;
}
.phms-form .phms-field input,
.phms-form .phms-field select,
.phms-form .phms-field textarea{
    width: 100%;
    min-height: 42px;
    box-sizing: border-box;
}
.phms-form .phms-field textarea{min-height:86px;}
.phms-form .phms-field span{
    color:#243447;
    font-size: 13px;
}
.phms-repeat-wrap{
    border: 1px solid #e6edf5;
    background: #f8fbfd;
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 18px;
}
.phms-repeat-row{
    background:#ffffff;
}
.phms-tab-buttons{
    background:#f8fbfd;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid #e6edf5;
}
@media(max-width:1200px){
    .phms-form .phms-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:700px){
    .phms-form .phms-grid{grid-template-columns:1fr;}
    .phms-sidebar{position:static !important;max-height:none;}
}

/* PHMS requested field grouping updates */
.phms-form .phms-three-row{
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 14px;
    margin-bottom: 18px;
}
.phms-form .phms-dose-row,
.phms-form .phms-textarea-row{
    grid-column: 1 / -1;
    display: grid;
    gap: 14px 16px;
    align-items: start;
}
.phms-form .phms-dose-row{
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.phms-form .phms-textarea-row{
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.phms-form .phms-dose-row .phms-check{
    margin-top: 28px;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    background: #fff;
}
@media(max-width:1200px){
    .phms-form .phms-three-row,
    .phms-form .phms-dose-row,
    .phms-form .phms-textarea-row{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:700px){
    .phms-form .phms-three-row,
    .phms-form .phms-dose-row,
    .phms-form .phms-textarea-row{grid-template-columns:1fr;}
}

/* All Patients filter buttons: small and together */
.phms-patient-filters .phms-filter-actions{
    display:flex;
    align-items:center;
    gap:6px;
    white-space:nowrap;
}
.phms-patient-filters .phms-filter-actions .btn{
    width:auto !important;
    min-width:64px;
    padding:6px 12px !important;
    font-size:13px !important;
    line-height:1.25 !important;
    border-radius:7px;
    text-align:center;
}
@media(max-width:900px){
    .phms-patient-filters .phms-filter-actions{
        justify-content:flex-start;
    }
}

/* Other Charges section */
.phms-other-charges-section {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px;
    background: #fbfdfe;
    margin-bottom: 18px;
}
.phms-other-dues-field {
    margin-top: 12px;
}
.phms-help {
    color: #64748b;
    font-size: 13px;
    margin: 8px 0 0;
}

/* PHMS Billing UI polish v1.1.8 */
.phms-admin-titlebar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:16px 0 18px;background:linear-gradient(135deg,#102033,#17435b);color:#fff;border-radius:18px;padding:18px 22px;box-shadow:0 10px 26px rgba(16,32,51,.16)}
.phms-admin-titlebar h1{color:#fff;margin:0 0 4px}.phms-admin-titlebar p{margin:0;color:#d7eef4}.phms-top-add-btn{border-radius:999px!important;padding:7px 18px!important;height:auto!important}
.phms-modern-billing{border:0;background:#f8fbff}
.phms-kicker{display:inline-block;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:#098b91;background:#e9fbfb;border-radius:999px;padding:5px 10px;margin-bottom:8px}.phms-billing-actions-top{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.phms-save-top-inline{display:flex;justify-content:flex-end;margin:0 0 16px}.phms-save-top-inline .btn.btn-primary, a.button.button-primary.phms-top-add-btn{border-radius:14px!important;padding:12px 26px!important;height:auto!important;font-size:15px!important;font-weight:800!important;box-shadow:0 12px 24px rgba(24,118,242,.18)!important}.phms-billing-main-tabs{background:#fff;border:1px solid #e3edf6;border-radius:16px;padding:8px;margin-bottom:16px}.phms-billing-main-tabs .phms-tab-btn{font-weight:700}.phms-pill{display:inline-flex;min-width:22px;height:22px;align-items:center;justify-content:center;border-radius:999px;background:#102033;color:#fff;font-size:12px;margin-left:6px;padding:0 6px}.phms-section-head{display:flex;align-items:center;justify-content:space-between;gap:15px;background:#fff;border:1px solid #e3edf6;border-radius:14px;padding:14px 16px;margin-bottom:14px}.phms-section-head.compact{padding:10px 12px}.phms-section-head h4,.phms-section-head h5{margin:0}.phms-section-head p{margin:4px 0 0;color:#667085}.phms-modern-billing .phms-repeat-row{background:#fff;border-color:#e2eaf3;box-shadow:0 8px 20px rgba(15,35,60,.05)}.phms-modern-billing .button,.phms-modern-billing .btn{border-radius:10px}.phms-medicine-filter-row{margin-bottom:12px}.phms-medicine-master-table{background:#fff}.phms-medicine-master-table th{background:#102033!important;color:#fff}.phms-medicine-master-table td{vertical-align:middle}.phms-other-field{background:#fff8e6;border:1px dashed #f0b84a;border-radius:10px;padding:10px}.phms-repeat-row.is-other{border-color:#f0b84a;background:#fffaf0}@media(max-width:782px){.phms-admin-titlebar,.phms-section-head{display:block}.phms-billing-actions-top{margin-top:12px}.phms-admin-titlebar .button{margin-top:12px}.phms-billing-main-tabs{display:block}.phms-billing-main-tabs .phms-tab-btn{width:100%;margin-bottom:6px}}

/* Doctor/Lab billing tab polish v1.1.9 */
.phms-master-panel .phms-section-head{
    background: linear-gradient(135deg,#ffffff 0%,#f1fbfb 100%);
    border-color:#d9eff2;
}
.phms-master-list{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(320px,1fr));
    gap:14px;
}
.phms-master-list .phms-master-card{
    position:relative;
    display:grid;
    grid-template-columns:54px 1fr auto;
    gap:14px;
    align-items:end;
    margin:0;
    padding:16px;
    border-radius:16px;
    border:1px solid #dfeaf2;
    background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%);
    box-shadow:0 10px 24px rgba(15,35,60,.06);
}
.phms-master-card .phms-master-icon{
    width:48px;
    height:48px;
    border-radius:14px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:13px;
    font-weight:800;
    background:#102033;
    color:#ffffff;
    align-self:center;
}
.phms-lab-master-list .phms-master-icon{background:#166b7a;}
.phms-master-grid{
    grid-template-columns:1.4fr .75fr !important;
    gap:12px !important;
}
.phms-master-card .phms-remove-row{
    align-self:center;
    margin-top:0 !important;
    border-radius:999px !important;
    color:#b42318 !important;
    border-color:#fecaca !important;
    background:#fff5f5 !important;
}
.phms-master-card .phms-remove-row:hover{
    background:#fee2e2 !important;
}
.phms-master-panel .phms-field span{
    font-size:12px;
    letter-spacing:.02em;
    text-transform:uppercase;
    color:#475467;
}
.phms-master-panel .form-control{
    min-height:42px;
    border-radius:10px;
}
@media(max-width:782px){
    .phms-master-list{grid-template-columns:1fr;}
    .phms-master-list .phms-master-card{grid-template-columns:1fr;align-items:stretch;}
    .phms-master-card .phms-master-icon{width:auto;height:40px;}
    .phms-master-grid{grid-template-columns:1fr !important;}
}


/* Doctor/Lab row alignment fix v1.2.0 */
.phms-master-list .phms-master-card.phms-no-icon-card{
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items:center !important;
    padding:18px 20px !important;
    gap:16px !important;
}
.phms-master-card.phms-no-icon-card .phms-master-grid{
    display:grid !important;
    grid-template-columns:minmax(260px, 1fr) minmax(130px, 180px) !important;
    align-items:end !important;
    gap:16px !important;
    width:100%;
}
.phms-master-card.phms-no-icon-card .phms-field{
    margin:0 !important;
    display:flex !important;
    flex-direction:column !important;
    gap:7px !important;
}
.phms-master-card.phms-no-icon-card .phms-field span{
    line-height:1.2 !important;
    margin:0 !important;
    white-space:nowrap;
}
.phms-master-card.phms-no-icon-card .form-control{
    width:100% !important;
    min-height:46px !important;
    height:46px !important;
    margin:0 !important;
    box-sizing:border-box !important;
}
.phms-master-card.phms-no-icon-card .phms-remove-row{
    white-space:nowrap;
    align-self:end !important;
    min-height:42px;
    padding:6px 18px !important;
}
@media(max-width:782px){
    .phms-master-list .phms-master-card.phms-no-icon-card{
        grid-template-columns:1fr !important;
    }
    .phms-master-card.phms-no-icon-card .phms-master-grid{
        grid-template-columns:1fr !important;
    }
    .phms-master-card.phms-no-icon-card .phms-remove-row{
        justify-self:start;
    }
}


/* Medicine setup + All tab polish v1.2.1 */
.phms-medicine-setup-panel .phms-section-head,
.phms-all-medicines-panel .phms-section-head{
    background:linear-gradient(135deg,#ffffff 0%,#f1fbfb 100%);
    border-color:#d9eff2;
}
.phms-med-category-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
    gap:16px;
}
.phms-med-category-card{
    background:#fff;
    border:1px solid #dfeaf2;
    border-radius:18px;
    padding:18px;
    box-shadow:0 10px 24px rgba(15,35,60,.06);
}
.phms-med-card-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:14px;
}
.phms-med-card-head span{
    display:block;
    font-size:13px;
    color:#475467;
    text-transform:uppercase;
    letter-spacing:.04em;
    font-weight:800;
}
.phms-med-card-head strong{
    display:inline-flex;
    min-width:42px;
    height:42px;
    align-items:center;
    justify-content:center;
    margin-top:6px;
    border-radius:999px;
    background:#102033;
    color:#fff;
    font-size:20px;
}
.phms-med-preview-list{
    display:grid;
    gap:8px;
}
.phms-med-preview-list > div{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:9px 10px;
    border:1px solid #edf2f7;
    border-radius:12px;
    background:#fbfdff;
}
.phms-med-preview-list span{
    color:#102033;
    font-weight:600;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.phms-med-preview-list b{
    color:#166b7a;
    white-space:nowrap;
}
.phms-all-filter-bar{
    display:grid;
    grid-template-columns:minmax(240px,1fr) minmax(160px,220px);
    gap:12px;
    margin-bottom:14px;
}
.phms-medicine-master-table{
    border-collapse:separate!important;
    border-spacing:0 10px!important;
    border:0!important;
    background:transparent!important;
}
.phms-medicine-master-table thead th{
    border:0!important;
    padding:12px 14px!important;
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.04em;
}
.phms-medicine-master-table tbody tr{
    background:#fff;
    box-shadow:0 8px 20px rgba(15,35,60,.05);
}
.phms-medicine-master-table tbody td{
    border-top:1px solid #e2eaf3!important;
    border-bottom:1px solid #e2eaf3!important;
    padding:12px!important;
    vertical-align:middle!important;
}
.phms-medicine-master-table tbody td:first-child{
    border-left:1px solid #e2eaf3!important;
    border-radius:14px 0 0 14px;
}
.phms-medicine-master-table tbody td:last-child{
    border-right:1px solid #e2eaf3!important;
    border-radius:0 14px 14px 0;
    white-space:nowrap;
}
.phms-medicine-master-table .form-control{
    width:100%!important;
    min-height:44px!important;
    border-radius:10px!important;
    box-sizing:border-box!important;
}
.phms-medicine-master-table .phms-all-med-price{
    max-width:160px;
}
.phms-row-edit-btn{
    border-color:#b7e9ef!important;
    background:#effbfc!important;
    color:#0f6d78!important;
    border-radius:999px!important;
}
.phms-delete-row{
    border-color:#fecaca!important;
    background:#fff5f5!important;
    color:#b42318!important;
    border-radius:999px!important;
}
.phms-delete-row:hover{background:#fee2e2!important;}
@media(max-width:782px){
    .phms-all-filter-bar{grid-template-columns:1fr;}
    .phms-medicine-master-table{border-spacing:0 12px!important;}
    .phms-medicine-master-table thead{display:none;}
    .phms-medicine-master-table tbody tr{display:block;border:1px solid #e2eaf3;border-radius:14px;padding:12px;}
    .phms-medicine-master-table tbody td{display:block;border:0!important;padding:7px!important;}
    .phms-medicine-master-table tbody td:first-child,
    .phms-medicine-master-table tbody td:last-child{border:0!important;border-radius:0;}
    .phms-medicine-master-table .phms-all-med-price{max-width:none;}
}


/* Final billing layout fix v1.2.2 - doctor, lab and medicine setup */
.phms-billing-settings,
.phms-billing-settings *{
    box-sizing:border-box !important;
}
.phms-billing-settings{
    overflow:hidden !important;
}
.phms-master-panel .phms-master-list{
    display:flex !important;
    flex-direction:column !important;
    gap:14px !important;
    width:100% !important;
}
.phms-master-panel .phms-master-card.phms-no-icon-card{
    width:100% !important;
    max-width:100% !important;
    display:grid !important;
    grid-template-columns:minmax(0,1fr) 115px !important;
    gap:14px !important;
    align-items:end !important;
    padding:18px 20px !important;
    margin:0 !important;
    overflow:hidden !important;
}
.phms-master-panel .phms-master-card.phms-no-icon-card .phms-master-grid{
    display:grid !important;
    grid-template-columns:minmax(280px,1fr) minmax(120px,180px) !important;
    gap:16px !important;
    width:100% !important;
    min-width:0 !important;
    align-items:end !important;
}
.phms-master-panel .phms-master-card.phms-no-icon-card .phms-field{
    min-width:0 !important;
    margin:0 !important;
}
.phms-master-panel .phms-master-card.phms-no-icon-card .phms-field span{
    display:block !important;
    margin:0 0 8px !important;
    line-height:1.2 !important;
    white-space:normal !important;
}
.phms-master-panel .phms-master-card.phms-no-icon-card input.form-control{
    width:100% !important;
    max-width:100% !important;
    height:48px !important;
    min-height:48px !important;
    padding:10px 14px !important;
    margin:0 !important;
    border-radius:12px !important;
}
.phms-master-panel .phms-master-card.phms-no-icon-card .phms-remove-row{
    width:100% !important;
    min-width:96px !important;
    height:48px !important;
    min-height:48px !important;
    margin:0 !important;
    padding:8px 14px !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    justify-self:end !important;
    align-self:end !important;
    line-height:1 !important;
}
.phms-medicine-setup-panel .phms-med-category-grid{
    display:grid !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:16px !important;
    width:100% !important;
}
.phms-medicine-setup-panel .phms-med-category-card{
    min-width:0 !important;
    overflow:hidden !important;
}
.phms-medicine-setup-panel .phms-med-card-head{
    align-items:center !important;
}
.phms-medicine-setup-panel .phms-med-preview-list > div{
    min-width:0 !important;
}
.phms-all-medicines-panel .phms-table-wrap{
    width:100% !important;
    overflow-x:auto !important;
    padding-bottom:4px !important;
}
.phms-all-medicines-panel .phms-medicine-master-table{
    min-width:760px !important;
    width:100% !important;
}
.phms-all-medicines-panel .phms-medicine-master-table th:nth-child(1),
.phms-all-medicines-panel .phms-medicine-master-table td:nth-child(1){width:42% !important;}
.phms-all-medicines-panel .phms-medicine-master-table th:nth-child(2),
.phms-all-medicines-panel .phms-medicine-master-table td:nth-child(2){width:18% !important;}
.phms-all-medicines-panel .phms-medicine-master-table th:nth-child(3),
.phms-all-medicines-panel .phms-medicine-master-table td:nth-child(3){width:22% !important;}
.phms-all-medicines-panel .phms-medicine-master-table th:nth-child(4),
.phms-all-medicines-panel .phms-medicine-master-table td:nth-child(4){width:18% !important; white-space:nowrap !important;}
.phms-all-medicines-panel .phms-medicine-master-table .form-control{
    max-width:100% !important;
}
@media(max-width:1100px){
    .phms-medicine-setup-panel .phms-med-category-grid{
        grid-template-columns:1fr !important;
    }
    .phms-master-panel .phms-master-card.phms-no-icon-card .phms-master-grid{
        grid-template-columns:minmax(0,1fr) 150px !important;
    }
}
@media(max-width:700px){
    .phms-master-panel .phms-master-card.phms-no-icon-card{
        grid-template-columns:1fr !important;
    }
    .phms-master-panel .phms-master-card.phms-no-icon-card .phms-master-grid{
        grid-template-columns:1fr !important;
    }
    .phms-master-panel .phms-master-card.phms-no-icon-card .phms-remove-row{
        width:auto !important;
        justify-self:start !important;
    }
    .phms-all-medicines-panel .phms-medicine-master-table{
        min-width:0 !important;
    }
}


/* Medicine setup simplified v1.2.3 - All tab removed, Tablet/Syrup/Injection only */
.phms-all-medicines-panel{display:none!important;}
.phms-medicine-setup-panel .phms-section-head{
    background:linear-gradient(135deg,#ffffff 0%,#f1fbfb 100%) !important;
    border-color:#d9eff2 !important;
}
.phms-medicine-setup-panel .phms-med-edit-grid{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:18px !important;
    width:100% !important;
}
.phms-medicine-setup-panel .phms-med-edit-card{
    width:100% !important;
    max-width:100% !important;
    padding:18px !important;
    overflow:hidden !important;
}
.phms-medicine-setup-panel .phms-med-card-head{
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:14px !important;
    padding-bottom:14px !important;
    margin-bottom:14px !important;
    border-bottom:1px solid #edf2f7 !important;
}
.phms-medicine-setup-panel .phms-med-card-head strong{
    min-width:34px !important;
    height:34px !important;
    font-size:16px !important;
}
.phms-medicine-setup-panel .phms-med-master-list{
    display:flex !important;
    flex-direction:column !important;
    gap:12px !important;
}
.phms-medicine-setup-panel .phms-med-master-card{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) 115px !important;
    gap:14px !important;
    align-items:end !important;
    width:100% !important;
    max-width:100% !important;
    padding:16px !important;
    margin:0 !important;
    background:#fff !important;
    border:1px solid #e2eaf3 !important;
    border-radius:14px !important;
    box-shadow:0 6px 16px rgba(15,35,60,.04) !important;
}
.phms-medicine-setup-panel .phms-med-master-grid{
    display:grid !important;
    grid-template-columns:minmax(260px,1fr) minmax(120px,180px) !important;
    gap:16px !important;
    align-items:end !important;
    width:100% !important;
    min-width:0 !important;
}
.phms-medicine-setup-panel .phms-med-master-card .phms-field{
    margin:0 !important;
    min-width:0 !important;
}
.phms-medicine-setup-panel .phms-med-master-card .phms-field span{
    display:block !important;
    margin:0 0 8px !important;
    font-size:12px !important;
    font-weight:800 !important;
    letter-spacing:.03em !important;
    text-transform:uppercase !important;
    color:#475467 !important;
}
.phms-medicine-setup-panel .phms-med-master-card input.form-control{
    width:100% !important;
    max-width:100% !important;
    height:46px !important;
    min-height:46px !important;
    margin:0 !important;
    border-radius:12px !important;
    box-sizing:border-box !important;
}
.phms-medicine-setup-panel .phms-med-master-card .phms-remove-row{
    width:100% !important;
    height:46px !important;
    min-height:46px !important;
    margin:0 !important;
    padding:8px 14px !important;
    border-radius:999px !important;
    color:#b42318 !important;
    border-color:#fecaca !important;
    background:#fff5f5 !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    align-self:end !important;
}
@media(max-width:700px){
    .phms-medicine-setup-panel .phms-med-card-head{display:block !important;}
    .phms-medicine-setup-panel .phms-med-card-head .button{margin-top:12px !important;}
    .phms-medicine-setup-panel .phms-med-master-card{grid-template-columns:1fr !important;}
    .phms-medicine-setup-panel .phms-med-master-grid{grid-template-columns:1fr !important;}
    .phms-medicine-setup-panel .phms-med-master-card .phms-remove-row{width:auto !important; justify-self:start !important;}
}

/* Medicine Setup category tabs v1.2.4 */
.phms-medicine-setup-panel .phms-med-inner-tabs{
    display:flex !important;
    flex-wrap:wrap !important;
    gap:10px !important;
    align-items:center !important;
    background:#ffffff !important;
    border:1px solid #e3edf6 !important;
    border-radius:16px !important;
    padding:10px !important;
    margin:0 0 16px !important;
}
.phms-medicine-setup-panel .phms-med-inner-tabs .phms-tab-btn{
    min-width:135px !important;
    height:48px !important;
    padding:0 22px !important;
    border-radius:12px !important;
    font-weight:800 !important;
    background:#f8fafc !important;
    border:1px solid #d7e1ec !important;
    color:#102033 !important;
}
.phms-medicine-setup-panel .phms-med-inner-tabs .phms-tab-btn.active{
    background:#37debb !important;
    border-color:#37debb !important;
    color:#071b2c !important;
    box-shadow:0 8px 18px rgba(55,222,187,.22) !important;
}
.phms-medicine-setup-panel .phms-med-tab-panels{
    width:100% !important;
}
.phms-medicine-setup-panel .phms-med-tab-panel{
    margin:0 !important;
}
.phms-medicine-setup-panel .phms-med-category-card{
    width:100% !important;
    max-width:100% !important;
}
.phms-medicine-setup-panel .phms-med-card-head p{
    margin:5px 0 0 !important;
    color:#667085 !important;
    font-size:14px !important;
    font-weight:400 !important;
}
@media(max-width:700px){
    .phms-medicine-setup-panel .phms-med-inner-tabs .phms-tab-btn{
        width:100% !important;
        min-width:0 !important;
    }
}

/* Billing setup search filters v1.2.5 */
.phms-modern-billing .phms-billing-filter-bar{
    display:grid !important;
    grid-template-columns:minmax(220px,1.4fr) minmax(160px,.8fr) auto !important;
    gap:12px !important;
    align-items:end !important;
    background:#ffffff !important;
    border:1px solid #e2eaf3 !important;
    border-radius:14px !important;
    padding:14px !important;
    margin:0 0 14px !important;
    box-shadow:0 6px 16px rgba(15,35,60,.04) !important;
}
.phms-modern-billing .phms-billing-filter-bar label{
    display:block !important;
    margin:0 !important;
}
.phms-modern-billing .phms-billing-filter-bar span{
    display:block !important;
    font-size:12px !important;
    font-weight:800 !important;
    text-transform:uppercase !important;
    letter-spacing:.04em !important;
    color:#344761 !important;
    margin-bottom:7px !important;
}
.phms-modern-billing .phms-billing-filter-bar .form-control{
    width:100% !important;
    height:44px !important;
    border:1px solid #d8e2ec !important;
    border-radius:10px !important;
    padding:8px 12px !important;
    box-shadow:none !important;
    background:#fff !important;
}
.phms-modern-billing .phms-billing-filter-bar .form-control:focus{
    border-color:#37debb !important;
    box-shadow:0 0 0 3px rgba(55,222,187,.15) !important;
    outline:0 !important;
}
.phms-modern-billing .phms-clear-billing-filter{
    min-height:44px !important;
    padding:0 18px !important;
    border-radius:10px !important;
    white-space:nowrap !important;
}
.phms-modern-billing .phms-filter-empty{
    display:none;
    margin:10px 0 16px !important;
    padding:14px 16px !important;
    border:1px dashed #b8c6d8 !important;
    border-radius:12px !important;
    background:#f8fbff !important;
    color:#667085 !important;
    font-weight:600 !important;
    text-align:center !important;
}
.phms-medicine-setup-panel .phms-med-filter-bar{
    margin-top:12px !important;
}
@media(max-width:782px){
    .phms-modern-billing .phms-billing-filter-bar{
        grid-template-columns:1fr !important;
    }
    .phms-modern-billing .phms-clear-billing-filter{
        width:100% !important;
    }
}

/* PHMS Billing colorful search filter v1.2.6 */
.phms-modern-billing .phms-billing-filter-bar{
    position:relative !important;
    display:grid !important;
    grid-template-columns:minmax(240px,1.35fr) minmax(180px,.8fr) auto !important;
    gap:16px !important;
    align-items:end !important;
    background:linear-gradient(135deg,#f0fffb 0%,#f6fbff 48%,#fff7ed 100%) !important;
    border:1px solid rgba(55,222,187,.38) !important;
    border-radius:18px !important;
    padding:18px !important;
    margin:0 0 18px !important;
    box-shadow:0 12px 30px rgba(15,35,60,.08) !important;
    overflow:hidden !important;
}
.phms-modern-billing .phms-billing-filter-bar:before{
    content:"";
    position:absolute;
    top:-36px;
    right:-34px;
    width:110px;
    height:110px;
    border-radius:50%;
    background:rgba(55,222,187,.18);
    pointer-events:none;
}
.phms-modern-billing .phms-billing-filter-bar:after{
    content:"";
    position:absolute;
    left:-28px;
    bottom:-36px;
    width:95px;
    height:95px;
    border-radius:50%;
    background:rgba(91,212,219,.18);
    pointer-events:none;
}
.phms-modern-billing .phms-billing-filter-bar label,
.phms-modern-billing .phms-billing-filter-bar .phms-clear-billing-filter{
    position:relative !important;
    z-index:1 !important;
}
.phms-modern-billing .phms-billing-filter-bar label{
    display:block !important;
    margin:0 !important;
}
.phms-modern-billing .phms-billing-filter-bar span{
    display:flex !important;
    align-items:center !important;
    gap:7px !important;
    font-size:12px !important;
    font-weight:900 !important;
    text-transform:uppercase !important;
    letter-spacing:.06em !important;
    color:#123b5d !important;
    margin-bottom:8px !important;
}
.phms-modern-billing .phms-billing-filter-bar span:before{
    content:"🔎";
    width:24px;
    height:24px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:999px;
    background:#37debb;
    color:#062b3c;
    font-size:12px;
    box-shadow:0 5px 12px rgba(55,222,187,.28);
}
.phms-modern-billing .phms-billing-filter-bar label:nth-of-type(2) span:before{
    content:"₨";
    background:#5bd4db;
}
.phms-modern-billing .phms-billing-filter-bar .form-control{
    width:100% !important;
    height:48px !important;
    border:1px solid #cfe0f0 !important;
    border-radius:14px !important;
    padding:9px 14px !important;
    box-shadow:0 5px 14px rgba(15,35,60,.04) !important;
    background:#fff !important;
    color:#172033 !important;
    font-size:15px !important;
}
.phms-modern-billing .phms-billing-filter-bar .form-control:focus{
    border-color:#37debb !important;
    box-shadow:0 0 0 4px rgba(55,222,187,.18),0 8px 20px rgba(15,35,60,.08) !important;
    outline:0 !important;
}
.phms-modern-billing .phms-clear-billing-filter{
    min-height:48px !important;
    padding:0 22px !important;
    border:0 !important;
    border-radius:14px !important;
    white-space:nowrap !important;
    font-weight:800 !important;
    color:#fff !important;
    background:linear-gradient(135deg,#0d6efd,#09b89d) !important;
    box-shadow:0 10px 22px rgba(13,110,253,.18) !important;
}
.phms-modern-billing .phms-clear-billing-filter:hover,
.phms-modern-billing .phms-clear-billing-filter:focus{
    transform:translateY(-1px);
    filter:brightness(1.03);
    color:#fff !important;
}
.phms-modern-billing .phms-filter-empty{
    display:none;
    margin:12px 0 18px !important;
    padding:15px 16px !important;
    border:1px dashed rgba(13,110,253,.35) !important;
    border-radius:14px !important;
    background:linear-gradient(135deg,#f8fbff,#f0fffb) !important;
    color:#344761 !important;
    font-weight:800 !important;
    text-align:center !important;
}
@media(max-width:782px){
    .phms-modern-billing .phms-billing-filter-bar{
        grid-template-columns:1fr !important;
        gap:12px !important;
    }
    .phms-modern-billing .phms-clear-billing-filter{
        width:100% !important;
    }
}


/* PHMS Billing filter with visible Filter button v1.2.7 */
.phms-modern-billing .phms-billing-filter-bar{
    grid-template-columns:minmax(240px,1.25fr) minmax(180px,.75fr) auto auto !important;
    background:linear-gradient(135deg,#ecfff9 0%,#eef8ff 45%,#fff3e5 100%) !important;
    border:1px solid rgba(55,222,187,.55) !important;
}
.phms-modern-billing .phms-billing-filter-bar label,
.phms-modern-billing .phms-billing-filter-bar .phms-apply-billing-filter,
.phms-modern-billing .phms-billing-filter-bar .phms-clear-billing-filter{
    position:relative !important;
    z-index:2 !important;
}
.phms-modern-billing .phms-apply-billing-filter,
.phms-modern-billing .phms-clear-billing-filter{
    min-height:48px !important;
    padding:0 22px !important;
    border:0 !important;
    border-radius:14px !important;
    white-space:nowrap !important;
    font-weight:900 !important;
    letter-spacing:.01em !important;
    color:#fff !important;
    box-shadow:0 10px 22px rgba(15,35,60,.15) !important;
    cursor:pointer !important;
}
.phms-modern-billing .phms-apply-billing-filter{
    background:linear-gradient(135deg,#37debb,#0d6efd) !important;
}
.phms-modern-billing .phms-clear-billing-filter{
    background:linear-gradient(135deg,#ff7a59,#e11d48) !important;
}
.phms-modern-billing .phms-apply-billing-filter:hover,
.phms-modern-billing .phms-apply-billing-filter:focus,
.phms-modern-billing .phms-clear-billing-filter:hover,
.phms-modern-billing .phms-clear-billing-filter:focus{
    transform:translateY(-1px) !important;
    filter:brightness(1.04) !important;
    color:#fff !important;
}
@media(max-width:900px){
    .phms-modern-billing .phms-billing-filter-bar{
        grid-template-columns:1fr 1fr !important;
    }
    .phms-modern-billing .phms-billing-filter-bar label{
        grid-column:span 2 !important;
    }
}
@media(max-width:520px){
    .phms-modern-billing .phms-billing-filter-bar{
        grid-template-columns:1fr !important;
    }
    .phms-modern-billing .phms-billing-filter-bar label{
        grid-column:auto !important;
    }
    .phms-modern-billing .phms-apply-billing-filter,
    .phms-modern-billing .phms-clear-billing-filter{
        width:100% !important;
    }
}

/* PHMS top save + final filter polish v1.2.8 */
.phms-modern-billing .phms-save-top-inline{
    display:flex !important;
    justify-content:flex-end !important;
    margin:0 0 14px !important;
}
.phms-modern-billing .phms-save-top-inline .btn,
.phms-modern-billing .phms-top-save-btn{
    background:linear-gradient(135deg,#0d6efd,#37debb) !important;
    color:#fff !important;
    border:0 !important;
    border-radius:14px !important;
    font-weight:900 !important;
    padding:12px 22px !important;
    box-shadow:0 10px 24px rgba(13,110,253,.18) !important;
}
.phms-modern-billing .phms-billing-filter-bar{
    grid-template-columns:minmax(240px,1.2fr) minmax(170px,.7fr) auto auto !important;
}
.phms-modern-billing .phms-apply-billing-filter{
    background:linear-gradient(135deg,#05c793,#0d6efd) !important;
}
.phms-modern-billing .phms-clear-billing-filter{
    background:linear-gradient(135deg,#ff8a4c,#e11d48) !important;
}
.phms-modern-billing .phms-filter-hidden{
    display:none !important;
}
@media(max-width:900px){
    .phms-modern-billing .phms-save-top-inline{justify-content:stretch !important;}
    .phms-modern-billing .phms-save-top-inline .btn{width:100% !important;}
}


/* PHMS v16 - Match top save button with add row buttons */
.phms-modern-billing button.btn.btn-primary.phms-top-save-btn,
.phms-modern-billing button.button.phms-add-row{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:6px !important;
    min-height:36px !important;
    height:36px !important;
    padding:7px 16px !important;
    border-radius:10px !important;
    border:1px solid #2271b1 !important;
    background:#2271b1 !important;
    color:#ffffff !important;
    font-size:14px !important;
    font-weight:600 !important;
    line-height:1.2 !important;
    text-decoration:none !important;
    box-shadow:none !important;
    cursor:pointer !important;
}
.phms-modern-billing button.btn.btn-primary.phms-top-save-btn:hover,
.phms-modern-billing button.button.phms-add-row:hover,
.phms-modern-billing button.btn.btn-primary.phms-top-save-btn:focus,
.phms-modern-billing button.button.phms-add-row:focus{
    background:#135e96 !important;
    border-color:#135e96 !important;
    color:#ffffff !important;
    box-shadow:0 0 0 1px #ffffff,0 0 0 3px rgba(34,113,177,.25) !important;
    outline:none !important;
}
.phms-modern-billing .phms-save-top-inline{
    justify-content:flex-end !important;
    margin:0 0 14px !important;
}
@media(max-width:900px){
    .phms-modern-billing .phms-save-top-inline button.btn.btn-primary.phms-top-save-btn{
        width:auto !important;
    }
}

/* PHMS v1.3.1 - other dues + medicine stock availability */
.phms-other-dues-master-panel .phms-master-grid,
.phms-med-master-grid { align-items: end; }
.phms-stock-status[readonly] { background: #f8fafc; font-weight: 600; }
.phms-low-stock-tab-btn { border-color: #f59e0b !important; }
.phms-low-stock-card { border-left: 4px solid #f59e0b !important; }
.phms-low-stock-empty { padding: 16px; border: 1px dashed #d1d5db; border-radius: 10px; background: #f9fafb; color: #374151; }
.phms-med-filter-bar { gap: 10px; flex-wrap: wrap; }
.phms-med-filter-bar label { min-width: 150px; }


/* PHMS English text cleanup + single-row billing layout fix v1.3.2 */
.phms-modern-billing .phms-master-list,
.phms-modern-billing .phms-repeat-list.phms-master-list{
    display:flex !important;
    flex-direction:column !important;
    gap:12px !important;
}
.phms-modern-billing .phms-master-card.phms-no-icon-card{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto !important;
    align-items:end !important;
    gap:14px !important;
    width:100% !important;
}
.phms-modern-billing .phms-master-card.phms-no-icon-card .phms-master-grid{
    display:grid !important;
    grid-template-columns:minmax(280px,1fr) minmax(130px,180px) !important;
    align-items:end !important;
    gap:14px !important;
    width:100% !important;
}
.phms-modern-billing .phms-master-card.phms-no-icon-card .phms-remove-row{
    margin:0 !important;
    height:46px !important;
    min-height:46px !important;
    align-self:end !important;
    white-space:nowrap !important;
}
.phms-medicine-setup-panel .phms-med-master-card{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) 112px !important;
    align-items:end !important;
    gap:14px !important;
}
.phms-medicine-setup-panel .phms-med-master-grid{
    display:grid !important;
    grid-template-columns:minmax(260px,1.5fr) minmax(110px,.65fr) minmax(120px,.65fr) minmax(135px,.75fr) !important;
    align-items:end !important;
    gap:14px !important;
    width:100% !important;
}
.phms-modern-billing .phms-billing-filter-bar,
.phms-modern-billing .phms-billing-filter-bar.phms-med-filter-bar{
    display:flex !important;
    flex-wrap:nowrap !important;
    align-items:end !important;
    gap:12px !important;
    width:100% !important;
}
.phms-modern-billing .phms-billing-filter-bar label{
    flex:1 1 180px !important;
    min-width:0 !important;
}
.phms-modern-billing .phms-billing-filter-bar label:first-of-type{
    flex:1.4 1 240px !important;
}
.phms-modern-billing .phms-billing-filter-bar .phms-apply-billing-filter,
.phms-modern-billing .phms-billing-filter-bar .phms-clear-billing-filter{
    flex:0 0 auto !important;
    margin:0 !important;
    height:48px !important;
    min-height:48px !important;
}
.phms-modern-billing .phms-med-filter-bar label{
    flex:1 1 140px !important;
}
.phms-modern-billing .phms-med-filter-bar label:first-of-type{
    flex:1.5 1 220px !important;
}
.phms-modern-billing .phms-med-filter-bar .phms-apply-billing-filter,
.phms-modern-billing .phms-med-filter-bar .phms-clear-billing-filter{
    padding-left:16px !important;
    padding-right:16px !important;
}
@media(max-width:1180px){
    .phms-modern-billing .phms-billing-filter-bar,
    .phms-modern-billing .phms-billing-filter-bar.phms-med-filter-bar{
        flex-wrap:wrap !important;
    }
    .phms-modern-billing .phms-billing-filter-bar label{
        flex:1 1 calc(50% - 12px) !important;
    }
}
@media(max-width:900px){
    .phms-modern-billing .phms-master-card.phms-no-icon-card,
    .phms-medicine-setup-panel .phms-med-master-card{
        grid-template-columns:1fr !important;
    }
    .phms-medicine-setup-panel .phms-med-master-grid{
        grid-template-columns:1fr 1fr !important;
    }
}
@media(max-width:700px){
    .phms-modern-billing .phms-master-card.phms-no-icon-card .phms-master-grid,
    .phms-medicine-setup-panel .phms-med-master-grid{
        grid-template-columns:1fr !important;
    }
    .phms-modern-billing .phms-billing-filter-bar label,
    .phms-modern-billing .phms-billing-filter-bar label:first-of-type{
        flex:1 1 100% !important;
    }
    .phms-modern-billing .phms-billing-filter-bar .phms-apply-billing-filter,
    .phms-modern-billing .phms-billing-filter-bar .phms-clear-billing-filter{
        width:100% !important;
    }
}


/* PHMS medicine setup table-style rows v1.3.3 */
.phms-medicine-setup-panel .phms-med-master-header{
    display:grid !important;
    grid-template-columns:minmax(260px,1.5fr) minmax(110px,.65fr) minmax(120px,.65fr) minmax(135px,.75fr) 112px !important;
    align-items:center !important;
    gap:14px !important;
    width:100% !important;
    padding:0 0 6px 0 !important;
    margin:10px 0 0 0 !important;
    font-weight:700 !important;
    color:#111827 !important;
    font-size:13px !important;
}
.phms-medicine-setup-panel .phms-med-master-card .phms-field > span{
    display:none !important;
}
.phms-medicine-setup-panel .phms-med-master-card{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) 112px !important;
    align-items:center !important;
    gap:14px !important;
    padding-top:10px !important;
    padding-bottom:10px !important;
}
.phms-medicine-setup-panel .phms-med-master-grid{
    display:grid !important;
    grid-template-columns:minmax(260px,1.5fr) minmax(110px,.65fr) minmax(120px,.65fr) minmax(135px,.75fr) !important;
    align-items:center !important;
    gap:14px !important;
    width:100% !important;
}
.phms-medicine-setup-panel .phms-med-master-card .phms-remove-row{
    margin:0 !important;
    height:42px !important;
    min-height:42px !important;
    align-self:center !important;
    white-space:nowrap !important;
}
@media(max-width:900px){
    .phms-medicine-setup-panel .phms-med-master-header{
        display:none !important;
    }
    .phms-medicine-setup-panel .phms-med-master-card .phms-field > span{
        display:block !important;
    }
    .phms-medicine-setup-panel .phms-med-master-card{
        grid-template-columns:1fr !important;
    }
    .phms-medicine-setup-panel .phms-med-master-grid{
        grid-template-columns:1fr 1fr !important;
    }
}
@media(max-width:700px){
    .phms-medicine-setup-panel .phms-med-master-grid{
        grid-template-columns:1fr !important;
    }
}

/* Multi-medicine timers: keeps the existing countdown badge styling and only stacks multiple timers neatly. */
.phms-multi-timers{display:flex;flex-direction:column;gap:6px;min-width:150px;}
.phms-medicine-timer{line-height:1.25;}
.phms-medicine-timer small{font-weight:600;opacity:.85;}
