/* ================================================================
   HIS MASTER UNIFIED STYLE SHEET
   ================================================================ */

:root {
    --hms-primary: #1a4d8a;       /* Unified Brand Blue */
    --hms-header-text: #ffffff;
    --hms-bg-main: #cbd5e0;       /* App background */
    --hms-border: #a0aec0;
    --hms-success: #198754;
    --hms-danger: #dc3545;
}

/* --- 1. GLOBAL LAYOUT --- */
html {
    overflow: hidden !important;
    height: 100% !important;
}

body {
    background: #f0f0f0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    margin: 0;
    overflow: hidden !important; /* Forces the main body viewport to never scroll */
    height: 100% !important;
}



/* --- 2. MULTI-WINDOW CORE (Do not change) --- */
.modal-backdrop { display: none !important; }
body.modal-open { overflow: hidden !important; padding-right: 0 !important; }

/* FIX: Forces Bootstrap's overlay container layer to hide outer vertical scrollbar tracks completely */
.modal {
    pointer-events: none !important;
    background: transparent !important;
    overflow-y: hidden !important; /* Prevents container background calculations from causing page jitter */
}

.modal-dialog {
    pointer-events: auto !important;
    max-width: 80% !important;
    width: 65% !important;
    margin: 1.5rem auto;
    transition: none !important;

    /* MODIFIED: Allows height to grow dynamically past default screen limitations */
    max-height: 95vh !important;
    display: flex !important;
    flex-direction: column !important;
}

.modal-content {
    resize: both;
    overflow: hidden !important;
    pointer-events: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3) !important;
    display: flex !important;
    flex-direction: column !important;

    /* REMOVED: height: 100% !important; (This was freezing vertical manual scaling) */
    /* ADDED: Baseline height to start clean before dragging */
    height: auto;
    max-height: 100% !important;
    background-color: #f0f0f0 !important;
}

.modal-body {
    overflow-x: auto !important;
    overflow-y: auto !important;
    /* padding: 15px !important;*/
}

.form-check-input{
    border:solid 1px;
}

/* 3. Ensure tables/grids inside the body also stretch */
.table-responsive, .table-container, .due-table-container {
    flex: 1 1 auto !important; /* Forces the table container to fill the modal height */
    height: auto !important;   /* Removes any fixed height restrictions */
    min-height: 200px;
}
.modal-body input, .modal-body select {
    position: relative; z-index: 10001 !important; pointer-events: auto !important;

}
/* 1. Global Rule for big windows */


/* 2. THE FIX: Exception for small popups like Discount/Alerts */
.modal-sm {
    max-width: 400px !important; /* Force small modals to be 400px maximum */
    width: 400px !important;
}

/* 3. Ensure the content doesn't stretch small modals */
.modal-sm .modal-content {
    min-width: auto !important;
}
/* --- 3. THE UNIFIED DESIGN (This fixes your screenshot) --- */

/* Force ALL Modal Headers to be the SAME color */
.modal-header {
    background-color: var(--hms-primary) !important; /* Force Navy Blue */
    color: var(--hms-header-text) !important;
    padding: 6px 15px !important;
    border-bottom: 1px solid rgba(0,0,0,0.2) !important;
}

/* Make close buttons white */
.btn-close { filter: invert(1) grayscale(100%) brightness(200%) !important; }

/* Unified Panel/Card Design (Adm, Lab, Fin, etc) */
.adm-panel, .lab-panel, .info-box, .fin-card, .bg-white.border.rounded {
    background: #ffffff !important;
    border: 1px solid var(--hms-border) !important;
    border-top: 1px solid black !important; /* Unified Blue top-accent */
    border-radius: 4px !important;
    /*padding: 4px !important;*/
    margin-bottom: 10px !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important;
}

/* Unified Tables */
.table, .due-table, .table-addendum, .table-reprint {
    font-size: 14.9px !important;
    border: 1px solid #ddd !important;
}
.table thead th, .due-table thead th {
    background-color: #4a5568 !important; /* Professional Dark Grey headers */
    color: white !important;
    font-weight: 600 !important;
    border: 1px solid #2d3748 !important;
    text-transform: uppercase;
    font-size: 15px;
}

/* Unified Inputs */
.form-control, .form-select, .lab-input, .adm-input {
    border-radius: 3px !important;
    border: 1px solid black !important;
    padding: 4px 8px !important;
    font-size: 14.9px !important;
    margin: 0 20px 0 0;
}

/* Universal Active & Hover Row Text Color Force */
.table tr.table-active > td,
.table tr.table-active > td *,
.table tr.table-active .text-dark,
.table tr.table-active .text-success,
.table tr.table-active .text-primary,
.table tr.table-active .text-secondary,
.table tr:hover > td,
.table tr:hover > td *,
.table tr:hover .text-dark,
.table tr:hover .text-success,
.table tr:hover .text-primary,
.table tr:hover .text-secondary {
    color: #ffffff !important;
}

/* Maintain Action Button Styling on Active Row */
.table tr.table-active td button,
.table tr:hover td button {
    color: #000000 !important;
    background-color: #ffffff !important;
}
.table tr.table-active td button:hover,
.table tr:hover td button:hover {
    color: #ffffff !important;
    background-color: #0f766e !important;
}





.form-control:focus {
    border-color: var(--hms-primary) !important;
    box-shadow: 0 0 0 2px rgba(26, 77, 138, 0.2) !important;
}

/* Unified Buttons */
.btn-primary { background-color: var(--hms-primary) !important; border-color: var(--hms-primary) !important; }
.btn-success { background-color: var(--hms-success) !important; border-color: var(--hms-success) !important; }
.btn-danger  { background-color: var(--hms-danger) !important; border-color: var(--hms-danger) !important; }

/* BIG SAVE BUTTON STYLING */
.btn-big-save { background: #fff; border: 1px solid #ccc; box-shadow: 0 4px 8px rgba(0,0,0,0.1); font-size: 32px; font-weight: bold; padding: 15px 60px; border-radius: 8px; cursor: pointer; }
.btn-big-save:hover { background-color: #f8f9fa; border-color: #0d6efd; }
.btn-big-save:focus { background-color: #eef4ff; border-color: #0d6efd; outline: 3px solid rgba(13, 110, 253, 0.2); }

.btn-clear-all { background: #ffc107; color: white; font-weight: bold; border-radius: 8px; padding: 10px 20px; border: none; }


/* Add this back to your style.css */
.five-column-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 10px;
    align-items: end; /* Aligns labels and inputs perfectly */
}

/* Ensure inputs aren't too tall */
.form-control-sm,
.form-select-sm,
input[type="date"].form-control-sm {
    /* 1. Eliminate vertical padding completely so large text has room */
    padding-top: 0 !important;
    padding-bottom: 0 !important;

    height: 28px !important;
    min-height: 28px !important;

    /* 2. Your preferred large font size */
    font-size: 14.9px !important;

    /* 3. Force line-height to match the total box height exactly */
    line-height: 28px !important;
}

/* Extra alignment check for select dropdowns */
.form-select-sm {
    padding-left: 6px !important;
    padding-right: 24px !important;
}

/* ================================================================
   HIS MASTER UNIFIED STYLE SHEET - CUSTOM MODAL OVERRIDES
   ================================================================ */

/*my style start*/
.adm-panel, .lab-panel, .info-box, .fin-card, .bg-white.border.rounded {
    background: #f0f0f0 !important;
}
.bg-light {
    background-color: rgb(240 240 240) !important;
}
.row-label {
    font-weight: bold;
    color: black;
    margin-bottom: 2px;
    display: block;
    font-size: 14.9px;
}
.bg-white {
    background-color: rgb(221 221 221) !important;
}

/* --- SAFE NATIVE TABLE CONTROLS --- */
table.table {
    width: 100% !important;
    table-layout: auto !important; /* Forces rigid, developer-assigned column tracking */
    border-collapse: collapse !important;
}

/* Base cell scaling configurations */
table.table th,
table.table td {
    padding: 0px 8px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
}

/* Table Header Specific Theming */
table.table thead tr {
    background-color: #1a252f !important; /* Elegant slate background */
}
table.table thead th {
    background-color: transparent !important;
    color: #ffffff !important;
}

/* Expand the Report Column Action Components */
table.table tbody td:last-child {
    padding-left: 6px !important;
    padding-right: 6px !important;
    text-align: center;
}
table.table tbody td:last-child button,
table.table tbody td:last-child a,
table.table tbody td:last-child .btn {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
   /* padding: 4px 2px !important;*/
}

/* Standard Hover Background Controls */
.table {
    --bs-table-active-bg: #1f4e87;
    --bs-table-active-color: white;
    --bs-table-hover-bg: #1f4e87;
    --bs-table-hover-color: white;
}
.text-primary {
    color: black !important;
}
.table .table-active .text-primary,
.table tr.active .text-primary {
    color: white !important;
}
.table tr:hover .text-primary {
    color: white !important;
}

/* --- INTERACTIVE RESIZER HANDLES --- */
th.resizable-th {
    position: relative !important;
    user-select: none;
}
.table-col-resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    z-index: 10;
    user-select: none;
    transition: background-color 0.2s;
}
.table-col-resizer:hover,
.table-col-resizer.is-resizing {
    background-color: #0d6efd !important;
}

/* Sorting Structural Indicators */
th.sortable-th {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-top: 1px !important;
    padding-bottom: 1px !important;
    padding-right: 34px !important;
    vertical-align: middle !important;
}
.table-sort-indicator {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 14px;
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}
th.sortable-th:hover .table-sort-indicator {
    opacity: 0.85;
}
th.sortable-th.sort-asc .table-sort-indicator,
th.sortable-th.sort-desc .table-sort-indicator {
    opacity: 1 !important;
}
.sort-arrow-up {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 5px solid rgba(255, 255, 255, 0.6);
    transition: border-bottom-color 0.2s ease;
}
.sort-arrow-down {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(255, 255, 255, 0.6);
    transition: border-top-color 0.2s ease;
}
th.sortable-th.sort-asc .sort-arrow-up {
    border-bottom-color: #0dcaf0;
}
th.sortable-th.sort-desc .sort-arrow-down {
    border-top-color: #0dcaf0;
}
/*finish table style*/

/*zebra table color*/
/* Custom Zebra Colors for your table-striped class */
.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #ffffff !important; /* Color for odd rows (e.g., Pure White) */
    --bs-table-accent-bg: #ffffff !important; /* Fix for newer Bootstrap versions */
    border-bottom: 1px solid black;
}

.table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: #e0e9f6 !important; /* Color for even rows (e.g., Light Gray) */
    --bs-table-accent-bg: #e0e9f6 !important; /* Fix for newer Bootstrap versions */
    border-bottom: 1px solid black;
}

/*new header design*/
/* ================================================================
   PROFESSIONAL HEADER & NAVBAR OVERRIDES (SPECIFIC FOR OUTLOOK)
   ================================================================ */

/* 1. Main Navigation Row Container */
.navbar-main {
    background: var(--hms-primary) !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important; /* Forces menu left, user profile right */
    padding: 0 15px !important;
    margin-bottom: 0 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);

}
/* 2. Force the actual dropdown menus to render on top of the modals */
.navbar-main .dropdown-menu {
    z-index: 9999999 !important;
}

/* 3. Handle nesting layers for Laboratory/In-Patient submenus */
.navbar-main .dropdown-submenu .dropdown-menu {
    z-index: 10000000 !important;
}

/* Display nested side menus instantly when hovering over the parent tier item */
.dropdown-submenu:hover > .dropdown-menu {
    display: block !important;
    position: absolute;
    left: 100%;
    top: 0;
    margin-top: -6px; /* Clean alignment correction */
}
/* 2. Top-tier Dropdown Links (File, Setup, Transaction, etc.) */
.navbar-main .dropdown .nav-link-custom {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 15px !important; /* Clean corporate font sizing */
    font-weight: 500 !important;
    padding: 4px 12px !important;
    border-radius: 3px;
    display: inline-block;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

/* Hover style for top menu items */
.navbar-main .dropdown .nav-link-custom:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

/* 3. The Quick Toolbar Container Row */
.toolbar {
    background: #ffffff !important;
    border-bottom: 1px solid var(--hms-border) !important;
    padding: 6px 15px !important;
    display: flex;
    align-items: center;
    gap: 8px; /* Adds clean spacing between buttons so they aren't glued together */
    margin-bottom: 2px;
}

/* 4. Professional Makeover for Shortcut Buttons */
.toolbar .tool-btn {
    background: #f8fafc !important;
    border: 1px solid #cbd5e0 !important; /* Removes harsh double black borders */
    color: #334155 !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    padding: 0px 8px !important;
    border-radius: 4px !important;
    transition: all 0.15s ease;
    cursor: pointer;
}

/* Hover effects for shortcut buttons */
.toolbar .tool-btn:hover {
    background-color: #f1f5f9 !important;
    border-color: var(--hms-primary) !important;
    color: var(--hms-primary) !important;
}

/* Keep primary accent highlighted text styling clean */
.toolbar .tool-btn.text-primary {
    background-color: #e0f2fe !important;
    border-color: #bae6fd !important;
    color: #0369a1 !important;
}

/* Keep logout text styled properly */
.toolbar .tool-btn.text-danger:hover {
    background-color: #fee2e2 !important;
    border-color: #fca5a5 !important;
    color: var(--hms-danger) !important;
}
/* Dynamic highlight state for the currently loaded module shortcut */
.toolbar .tool-btn.active-module {
    background-color: #e0f2fe !important;
    border-color: #bae6fd !important;
    color: #0369a1 !important;
    font-weight: bold !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}
/* ================================================================
   DROPDOWN ITEM HOVER COLOR OVERRIDES
   ================================================================ */

/* Changes the hover state for all standard dropdown items */
.navbar-main .dropdown-menu .dropdown-item:hover {
    background-color: var(--hms-primary) !important; /* Elegant Navy Blue to match header */
    color: #ffffff !important;                       /* Sharp crisp white text for readability */
}

/* Fixes the arrow color for submenus (like Laboratory Management) on hover */
.navbar-main .dropdown-submenu:hover > .dropdown-item {
    background-color: var(--hms-primary) !important;
    color: #ffffff !important;
}
/*header design end*/
/* Disable default Bootstrap dialog shifting/sliding during close animations */
.modal.fade .modal-dialog {
    transform: none !important;
}