@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap');

/* Global Font */
html, body {
    font-family: "DM Sans", sans-serif !important;
}

body *:not(i):not(.fa):not(.fas):not(.far):not(.fal):not(.fab):not(.glyphicon):not([class^="fa-"]):not([class*=" fa-"]) {
    font-family: "DM Sans", sans-serif !important;
}

/* Keep icon fonts intact */
.fa, .fas, .far, .fal, .fab, [class^="fa-"], [class*=" fa-"] {
    font-family: "Font Awesome 5 Free", "Font Awesome 5 Brands", "FontAwesome" !important;
}

.glyphicon {
    font-family: "Glyphicons Halflings" !important;
}

/* Login Background (Scoped) */
body.pg-auth {
    background: radial-gradient(1200px 500px at 10% 5%, rgba(52, 144, 220, 0.22), transparent 60%),
                radial-gradient(900px 500px at 85% 90%, rgba(27, 176, 255, 0.18), transparent 65%),
                linear-gradient(145deg, #0b1d30 0%, #123a5d 45%, #1e5f8f 100%) !important;
    background-attachment: fixed !important;
    min-height: 100vh;
}

/* Cards / Boxes */
.box, .card {
    border-radius: 16px !important;
    background: #fff !important;
    border: 1px solid rgba(12, 34, 53, 0.08) !important;
    box-shadow: 0 12px 34px rgba(8, 16, 28, 0.25) !important;
    padding: 20px !important;
    border-top: none !important; /* Remove AdminLTE default top border */
}

/* Cards / Boxes */
.loginbg {
    border-radius: 16px !important;
    background: #337ab7 !important;
    border: 1px solid rgba(12, 34, 53, 0.08) !important;
    box-shadow: 0 12px 34px rgba(8, 16, 28, 0.25) !important;
    padding: 20px !important;
    border-top: none !important; /* Remove AdminLTE default top border */
}

/* Buttons */
button.btn, .btn, .btn-primary {
    border-radius: 10px !important;
    padding: 0.6rem 1.5rem !important;
    font-size: 14px !important;
    background: linear-gradient(90deg, #1672e0 0%, #1e9fe9 100%) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(23, 114, 224, 0.2) !important;
    transition: all .2s ease !important;
    font-weight: 500 !important;
}

button.btn:hover, .btn:hover, .btn-primary:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 8px 20px rgba(23, 114, 224, 0.28) !important;
    opacity: 1 !important;
    background: linear-gradient(90deg, #1e9fe9 0%, #1672e0 100%) !important;
    color: #fff !important;
}

/* Specific for small buttons like in tables */
.btn-xs, .btn-group-xs > .btn {
    padding: 4px 10px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
}

.btn-sm, .btn-group-sm > .btn {
    font-size: 13px !important;
}

.btn-lg, .btn-group-lg > .btn {
    font-size: 15px !important;
}

/* Form Controls */
.form-control {
    border-radius: 8px !important;
    padding: 0.6rem 0.8rem !important;
    border: 1px solid #d9e4f1 !important;
    transition: all .15s ease !important;
    height: auto !important;
}

.form-control:focus {
    outline: none !important;
    border-color: rgba(16, 122, 255, 0.85) !important;
    box-shadow: 0 4px 12px rgba(16, 122, 255, 0.1) !important;
}

/* Login Specific Adjustments */
.loginbg {
    padding: 30px !important;
}

.loginbg h3 {
    color: #1e293b !important;
    font-weight: 700 !important;
    margin-bottom: 25px !important;
}

.form-top {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 0 20px 0 !important;
    border-bottom: none !important;
}

.form-bottom {
    background: transparent !important;
    padding: 0 !important;
}

.form-top-right {
    display: none !important;
}

a.forgot {
    color: #1672e0 !important;
    font-weight: 500;
}

/* Sidebar Modernization */
body .main-sidebar {
    background: linear-gradient(180deg, #0f2b45 0%, #133a5d 55%, #0f2f4b 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 8px 0 26px rgba(5, 16, 31, 0.28) !important;
}

body .sidebar {
    padding-top: 8px;
    scrollbar-width: thin;
    scrollbar-color: #fff rgba(5, 25, 44, 0.25);
}

body .sidebar::-webkit-scrollbar {
    width: 8px;
}

body .sidebar::-webkit-scrollbar-track {
    background: rgba(5, 25, 44, 0.25);
    border-radius: 8px;
    cursor: default;
}

body .sidebar::-webkit-scrollbar-thumb {
    background: #fff;
    border-radius: 8px;
    cursor: default;
}

body .sidebar::-webkit-scrollbar-thumb:hover {
    background: #fff;
    cursor: default;
}

body .sidebar-menu > li > a,
body .sidebar-menu .treeview-menu > li > a {
    font-family: "DM Sans", sans-serif !important;
    font-weight: 500 !important;
    letter-spacing: 0.2px;
}

body .sidebar-menu > li {
    margin: 2px 8px;
}

body .sidebar-menu > li > a {
    border-left: 0 !important;
    border-radius: 10px !important;
    color: #e6f0ff !important;
    padding: 11px 12px 11px 14px !important;
    transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

body .sidebar-menu > li > a > i:first-child {
    width: 20px;
    text-align: center;
    color: #99d5ff;
    margin-right: 8px;
}

body .sidebar-menu > li:hover > a,
body .sidebar-menu > li.active > a {
    background: linear-gradient(90deg, rgba(80, 168, 245, 0.25), rgba(38, 132, 214, 0.12)) !important;
    color: #ffffff !important;
    transform: translateX(2px);
}

body .sidebar-menu > li.active > a > i:first-child,
body .sidebar-menu > li:hover > a > i:first-child {
    color: #d8f1ff;
}

body .sidebar-menu > li > .treeview-menu {
    background: rgba(3, 14, 29, 0.26) !important;
    margin: 4px 8px 8px 8px !important;
    border-radius: 8px !important;
    padding: 6px 6px 8px 6px !important;
}

body .sidebar-menu .treeview-menu > li > a {
    border-radius: 8px;
    color: #d3e4f8 !important;
    font-size: 12.5px !important;
    padding: 7px 8px 7px 12px !important;
}

body .sidebar-menu .treeview-menu > li.active > a,
body .sidebar-menu .treeview-menu > li > a:hover {
    background: rgba(118, 204, 255, 0.16) !important;
    color: #ffffff !important;
}

body .sidebar-menu li > a > .pull-right-container,
body .sidebar-menu li > a > .pull-right {
    color: #b8dbff !important;
}

body .sidebar-form .input-group .form-control.search-form {
    background: rgba(255, 255, 255, 0.96) !important;
    border-radius: 24px 0 0 24px !important;
    border: none !important;
}

/* Admin sidebar menu priority ordering */
body .sidebar-menu.verttop {
    display: flex;
    flex-direction: column;
}

body .sidebar-menu.verttop > li {
    order: 40;
}

body .sidebar-menu.verttop > li.menu-priority-dashboard {
    order: 1;
}

body .sidebar-menu.verttop > li.menu-priority-admission {
    order: 10;
}

body .sidebar-menu.verttop > li.menu-priority-diagnosis {
    order: 20;
}

body .sidebar-menu.verttop > li.menu-priority-medicine {
    order: 30;
}

body .sidebar-menu.verttop > li.menu-priority-billing {
    order: 35;
}

body .sidebar-menu.verttop > li.menu-priority-settings {
    order: 999;
}

/* Global page polish */
body {
    font-size: 14px;
    line-height: 1.55;
    color: #1f2f45;
    background: linear-gradient(180deg, #f3f7fb 0%, #edf3f9 100%) !important;
}

.content-wrapper,
.right-side {
    background: linear-gradient(180deg, #f3f7fb 0%, #edf3f9 100%) !important;
}

.content {
    padding-top: 18px;
}

.box-header.with-border {
    border-bottom: 1px solid #e6edf5 !important;
}

.box-title,
.modal-title,
label,
th {
    font-weight: 600 !important;
    letter-spacing: 0.1px;
    color: #1f2f45;
}

.table > thead > tr > th {
    background: #f5f9ff;
    border-bottom: 1px solid #dfe8f3 !important;
    font-size: 13px;
}

.table > tbody > tr > td {
    border-top: 1px solid #ecf1f7 !important;
}

.badge,
.label {
    font-weight: 600 !important;
}

/* DataTables export button colors */
.dt-button.buttons-copy,
.buttons-copy.buttons-html5 {
    background: #3b82f6 !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25) !important;
}

.dt-button.buttons-excel,
.buttons-excel.buttons-html5 {
    background: #16a34a !important;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25) !important;
}

.dt-button.buttons-csv,
.buttons-csv.buttons-html5 {
    background: #0d9488 !important;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25) !important;
}

.dt-button.buttons-pdf,
.buttons-pdf.buttons-html5 {
    background: #dc2626 !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25) !important;
}

.dt-button.buttons-print,
.buttons-print {
    background: #7c3aed !important;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25) !important;
}

.dt-button.buttons-copy:hover,
.dt-button.buttons-excel:hover,
.dt-button.buttons-csv:hover,
.dt-button.buttons-pdf:hover,
.dt-button.buttons-print:hover {
    color: #fff !important;
    opacity: 0.95 !important;
}

/* Center DataTables export buttons on all pages */
.dataTables_wrapper .dt-buttons {
    float: none !important;
    width: 100%;
    display: flex !important;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

/* Header search + header icon polish */
.main-header .navbar {
    backdrop-filter: blur(6px);
}

.main-header .navbar-custom-menu {
    margin-right: 8px;
}

.main-header .search-form .input-group {
    background: #ffffff;
    border: 1px solid #dce8f5;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(15, 41, 70, 0.08);
    overflow: hidden;
    width: 360px;
    max-width: 100%;
}

.main-header .search-form .form-control.search-form3 {
    border: 0 !important;
    border-radius: 999px 0 0 999px !important;
    height: 36px !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
    box-shadow: none !important;
}

.main-header .search-form .btn.btn-flat {
    border-radius: 0 999px 999px 0 !important;
    height: 36px !important;
    min-width: 44px;
    padding: 0 12px !important;
    background: transparent !important;
    color: #3c4e65 !important;
    box-shadow: none !important;
    border-left: 1px solid #e3edf8 !important;
}

.main-header .search-form .btn.btn-flat i {
    font-size: 14px;
    color: inherit !important;
}

@media (max-width: 991px) {
    .main-header .search-form .input-group {
        width: 300px;
    }
}

.headertopmenu {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.headertopmenu > li {
    margin: 0 !important;
}

.headertopmenu > li > a {
    width: 38px;
    height: 38px;
    margin: 6px 0 !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #ffffff !important;
    transition: all .2s ease;
}

.headertopmenu > li > a:hover,
.headertopmenu > li.open > a {
    background: rgba(255, 255, 255, 0.28) !important;
    transform: translateY(-1px);
}

.headertopmenu > li > a i {
    font-size: 15px;
}

.headertopmenu .label.label-warning,
.headertopmenu .todo-indicator {
    border-radius: 999px;
    font-size: 10px !important;
    font-weight: 700 !important;
}

/* DataTables empty-state icon */
table.dataTable td.dataTables_empty {
    text-align: center !important;
    color: #5b6f86;
    font-weight: 500;
    padding: 18px !important;
}

table.dataTable td.dataTables_empty::before {
    content: "\f0ce";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    display: block;
    font-size: 20px;
    color: #7fa2c7;
    margin-bottom: 8px;
}

/* Replace upstream empty-state SVG with local empty-bin icon */
img[src*="smart-hospital.in/shappresource/images/addnewitem.svg"],
img[src*="/addnewitem.svg"] {
    content: url("../images/empty-bin.svg") !important;
}
