/* =====================================================================
   Medical Sales & Service ERP – theme on top of AdminLTE 3
   ===================================================================== */
:root{
	--navy:#0d1b36; --navy-2:#11234a; --navy-3:#1a2f5c;
	--primary:#2563eb; --primary-600:#1d4ed8; --primary-50:#eef4ff;
	--green:#16a34a; --green-50:#e8f8ee; --purple:#7c3aed; --purple-50:#f1ebff;
	--teal:#0d9488; --teal-50:#e2f6f4; --orange:#f59e0b; --orange-50:#fff4df;
	--red:#ef4444; --red-50:#fdecec; --violet:#a855f7; --violet-50:#f5ecff;
	--ink:#0f172a; --muted:#64748b; --line:#e7ecf4; --bg:#f4f6fb;
	--radius:12px;
}
body.erp, body.login-page{ font-family:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif; color:var(--ink); font-size:13.5px; }
body.erp .content-wrapper{ background:var(--bg); }
.font-weight-600{font-weight:600}.lh-1{line-height:1.15}
a{color:var(--primary)}
.text-primary{color:var(--primary)!important}
.btn-primary{background:var(--primary);border-color:var(--primary)}
.btn-primary:hover{background:var(--primary-600);border-color:var(--primary-600)}
.btn{border-radius:8px;font-weight:500;font-size:13px}
.btn-sm{border-radius:7px;font-size:12px}
.btn-xs{padding:.15rem .45rem;font-size:11.5px;border-radius:6px}
.form-control,.custom-select{border-radius:8px;border-color:#dbe2ee;font-size:13px;height:calc(2.1rem + 2px)}
textarea.form-control{height:auto}
.form-control:focus{border-color:#93b4f8;box-shadow:0 0 0 3px rgba(37,99,235,.12)}
label{font-weight:500!important;font-size:12.5px;color:#334155;margin-bottom:.3rem}
.form-group{margin-bottom:.85rem}

/* ---------------- Sidebar ---------------- */
.erp-sidebar{background:linear-gradient(180deg,var(--navy) 0%,#0a1730 100%)!important;width:260px}
.sidebar-mini .main-sidebar,.sidebar-mini .main-sidebar::before{width:260px}
@media (min-width:992px){
	.sidebar-mini .content-wrapper,.sidebar-mini .main-footer,.sidebar-mini .main-header{margin-left:260px}
	.sidebar-mini.sidebar-collapse .content-wrapper,.sidebar-mini.sidebar-collapse .main-footer,.sidebar-mini.sidebar-collapse .main-header{margin-left:4.6rem!important}
	.sidebar-mini.sidebar-collapse .main-sidebar,.sidebar-mini.sidebar-collapse .main-sidebar::before{width:4.6rem}
	.sidebar-mini.sidebar-collapse .main-sidebar:hover,.sidebar-mini.sidebar-collapse .main-sidebar.sidebar-focused{width:260px}
	.sidebar-collapse .erp-brand .brand-text{display:none}
	.sidebar-collapse .main-sidebar:hover .erp-brand .brand-text{display:block}
}
@media (max-width:991.98px){ .sidebar-mini .main-sidebar{margin-left:-260px} .sidebar-open .main-sidebar{margin-left:0} }
.erp-brand{display:flex!important;align-items:center;padding:16px 16px!important;border-bottom:1px solid rgba(255,255,255,.06)!important;height:auto!important;background:transparent!important}
.erp-brand .brand-logo{width:44px;height:44px;flex:0 0 44px;border-radius:12px;background:#fff;display:flex;align-items:center;justify-content:center;overflow:hidden;box-shadow:0 4px 14px rgba(0,0,0,.25)}
.erp-brand .brand-logo img{max-width:36px;max-height:36px}
.erp-brand .brand-text{color:#fff;font-weight:800;font-size:17px;line-height:1.15;margin-left:12px;letter-spacing:-.2px;white-space:normal}
.erp-sidebar .sidebar{padding:6px 12px 20px;height:calc(100% - 77px)}
.erp-sidebar .nav-sidebar .nav-link{color:#c3cde0;border-radius:9px;padding:.55rem .8rem;margin-bottom:2px;font-size:13.5px;font-weight:500;display:flex;align-items:center}
.erp-sidebar .nav-sidebar .nav-link p{white-space:nowrap;flex:1;margin:0}
.erp-sidebar .nav-sidebar .nav-link .nav-icon{font-size:.95rem;width:1.6rem;color:#9fb0cf;margin-right:.35rem}
.erp-sidebar .nav-sidebar .nav-link:hover{background:rgba(255,255,255,.06);color:#fff}
.erp-sidebar .nav-sidebar>.nav-item>.nav-link.active{background:var(--primary)!important;color:#fff!important;box-shadow:0 6px 16px rgba(37,99,235,.35)}
.erp-sidebar .nav-sidebar>.nav-item>.nav-link.active .nav-icon{color:#fff}
.erp-sidebar .nav-sidebar .nav-link.parent-active{color:#fff}
.erp-sidebar .nav-sidebar .nav-link .right{position:absolute;right:12px;top:12px;font-size:12px;transition:transform .2s}
.erp-sidebar .nav-sidebar .menu-open>.nav-link .right{transform:rotate(180deg)}
.erp-sidebar .nav-treeview{padding-left:22px;margin-bottom:4px}
.erp-sidebar .nav-treeview .sub-link{padding:.36rem .7rem!important;font-size:13px!important;color:#aebbd4!important}
.erp-sidebar .nav-treeview .sub-link .sub-dot{width:5px;height:5px;border-radius:50%;background:#7e8db0;display:inline-block;margin-right:12px;flex:0 0 5px}
.erp-sidebar .nav-treeview .sub-link.active{background:rgba(37,99,235,.18)!important;color:#fff!important}
.erp-sidebar .nav-treeview .sub-link.active .sub-dot{background:#60a5fa;box-shadow:0 0 0 3px rgba(96,165,250,.25)}
.erp-sidebar .nav-item>.nav-link{position:relative}
.erp-sidebar .nav-sidebar>.nav-item{border-bottom:1px solid rgba(255,255,255,.03)}
.sidebar-collapse .erp-sidebar .nav-treeview{padding-left:0}

/* ---------------- Top bar ---------------- */
.erp-topbar{border-bottom:1px solid var(--line)!important;min-height:64px;padding:.4rem 1rem;box-shadow:none}
.erp-topbar .nav-link{color:#475569}
.btn-branch{border:1px solid var(--line);background:#fff;font-weight:500;padding:.42rem .9rem;color:#1e293b}
.app-links .btn-app-link{margin:0 6px;padding:.45rem .95rem;border-radius:9px;font-weight:600;font-size:12.5px;border:1px solid}
.app-links .btn-app-link i{margin-right:6px}
.btn-app-blue{background:var(--primary-50);color:var(--primary);border-color:#cfe0ff}
.btn-app-blue:hover{background:#dfeaff;color:var(--primary-600)}
.btn-app-green{background:var(--green-50);color:var(--green);border-color:#c5ecd3}
.btn-app-green:hover{background:#d6f3e0;color:#15803d}
.nav-icon-btn{font-size:18px;padding:.4rem .7rem!important}
.navbar-badge{font-size:.6rem;top:4px;right:4px}
.avatar-circle{width:36px;height:36px;border-radius:50%;background:#e2e8f5;color:#64748b;display:inline-flex;align-items:center;justify-content:center;overflow:hidden}
.avatar-circle img{width:100%;height:100%;object-fit:cover}
.user-menu .dropdown-toggle::after{margin-left:8px;color:#94a3b8}
.notif-menu .dropdown-item{white-space:normal;font-size:13px}

/* ---------------- Page header ---------------- */
.content-header{padding:18px 1.25rem 4px}
.content{padding:0 .5rem 1rem}
.page-title{font-size:21px;font-weight:700;margin:0;color:var(--ink);letter-spacing:-.3px}
.page-subtitle{color:var(--muted);font-size:13px;margin-top:2px}
.content-header .breadcrumb{background:transparent;padding:0;margin:2px 0 0;font-size:12.5px}
.content-header .breadcrumb a{color:var(--muted)}
.main-footer{font-size:12px;border-top:1px solid var(--line);padding:.7rem 1.25rem;color:var(--muted)}

/* ---------------- Cards ---------------- */
.card{border-radius:var(--radius);border:1px solid var(--line);box-shadow:0 1px 2px rgba(16,24,40,.04)}
.card-header{background:transparent;border-bottom:1px solid var(--line);padding:.85rem 1.1rem}
.card-header .card-title{font-weight:700;font-size:15px;color:var(--ink)}
.card-header .card-title i{color:var(--primary);margin-right:6px}
.card-body{padding:1.1rem}
.section-title{font-size:13px;font-weight:700;color:var(--primary);text-transform:uppercase;letter-spacing:.4px;margin:4px 0 12px;display:flex;align-items:center}
.section-title:after{content:'';flex:1;height:1px;background:var(--line);margin-left:10px}

/* KPI cards */
.kpi-card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:16px;display:flex;align-items:flex-start;height:100%;box-shadow:0 1px 2px rgba(16,24,40,.04);transition:.15s}
.kpi-card:hover{transform:translateY(-2px);box-shadow:0 8px 22px rgba(16,24,40,.07)}
.kpi-icon{width:50px;height:50px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:20px;flex:0 0 50px;margin-right:12px}
.kpi-label{white-space:nowrap;font-size:13px;color:#334155;font-weight:500;margin-bottom:2px}
.kpi-value{white-space:nowrap;font-size:20px;font-weight:700;color:var(--ink);letter-spacing:-.4px;line-height:1.2}
.kpi-sub{font-size:12px;color:var(--muted);margin-top:3px}
.kpi-sub .up{color:var(--green);font-weight:600}.kpi-sub .down{color:var(--red);font-weight:600}
.bg-soft-green{background:var(--green-50);color:var(--green)}
.bg-soft-purple{background:var(--purple-50);color:var(--purple)}
.bg-soft-blue{background:var(--primary-50);color:var(--primary)}
.bg-soft-teal{background:var(--teal-50);color:var(--teal)}
.bg-soft-violet{background:var(--violet-50);color:var(--violet)}
.bg-soft-orange{background:var(--orange-50);color:var(--orange)}
.bg-soft-red{background:var(--red-50);color:var(--red)}

/* Pipeline */
.pipeline{display:flex;align-items:center;background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:14px 10px;overflow-x:auto}
.pipe-step{display:flex;align-items:center;flex:1;min-width:150px;padding:0 8px;color:inherit}
.pipe-step:hover{text-decoration:none;color:inherit}
.pipe-step .kpi-icon{width:44px;height:44px;flex-basis:44px;font-size:17px}
.pipe-step .pl{font-size:12.5px;color:#334155;font-weight:500}
.pipe-step .pv{font-size:19px;font-weight:700}
.pipe-arrow{color:#94a3b8;font-size:14px;padding:0 4px}

/* AMC overview list */
.ov-row{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-radius:9px;margin-bottom:8px;font-weight:500}
.ov-row i{width:22px}
.ov-row b{font-size:16px}
.ov-green{background:var(--green-50)} .ov-green i{color:var(--green)}
.ov-orange{background:var(--orange-50)} .ov-orange i,.ov-orange b{color:#d97706}
.ov-red{background:var(--red-50)} .ov-red i,.ov-red b{color:var(--red)}
.ov-blue{background:var(--primary-50)} .ov-blue i{color:var(--primary)}

/* donut legend */
.legend-list{list-style:none;padding:0;margin:0}
.legend-list li{display:flex;align-items:center;margin:9px 0;font-size:13px}
.legend-list .dot{width:11px;height:11px;border-radius:50%;margin-right:10px}
.legend-list .lv{margin-left:auto;font-weight:600}
.donut-wrap{position:relative}
.donut-center{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;pointer-events:none}
.donut-center b{font-size:26px;line-height:1}
.donut-center small{color:var(--muted)}

/* Tables */
.table{color:#1e293b;font-size:13px}
.table thead th{background:#f7f9fc;color:#475569;font-weight:600;font-size:12px;text-transform:none;border-bottom:1px solid var(--line)!important;border-top:0!important;white-space:nowrap;padding:.6rem .75rem}
.table td{vertical-align:middle;border-top:1px solid #eef2f7;padding:.55rem .75rem}
.table-mini td,.table-mini th{padding:.5rem .6rem;font-size:12.5px}
.table-hover tbody tr:hover{background:#f8fafd}
.dataTables_wrapper .dt-buttons .btn{background:#fff;border:1px solid var(--line);color:#334155;font-size:12px;padding:.3rem .7rem}
.dataTables_wrapper .dataTables_filter input{border-radius:8px;border:1px solid #dbe2ee;padding:.25rem .6rem}
.dataTables_wrapper .dataTables_length select{border-radius:8px}
.dataTables_info,.dataTables_paginate{font-size:12.5px}
.page-item.active .page-link{background:var(--primary);border-color:var(--primary)}
.card .card-header .view-all{font-size:12.5px;font-weight:600}

/* Badges */
.badge-soft{display:inline-block;padding:.22rem .6rem;border-radius:6px;font-size:11.5px;font-weight:600;white-space:nowrap}
.badge-soft-success{background:#e3f6ea;color:#15803d}
.badge-soft-info{background:#e3edff;color:#1d4ed8}
.badge-soft-warning{background:#fff1d6;color:#b45309}
.badge-soft-danger{background:#fde4e4;color:#dc2626}
.badge-soft-secondary{background:#eef1f6;color:#475569}
.badge-soft-purple{background:#efe7ff;color:#6d28d9}

/* Action buttons in tables */
.act-btn{width:28px;height:28px;border-radius:7px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--line);background:#fff;color:#475569;font-size:12px;margin:0 1px}
.act-btn:hover{background:var(--primary-50);color:var(--primary);border-color:#cfe0ff;text-decoration:none}
.act-btn.danger:hover{background:var(--red-50);color:var(--red);border-color:#f8caca}
.act-btn.success:hover{background:var(--green-50);color:var(--green)}

/* Modal */
.modal-content{border-radius:14px;border:0;box-shadow:0 20px 50px rgba(15,23,42,.25)}
.modal-header{background:linear-gradient(90deg,var(--primary),#3b82f6);color:#fff;border-radius:14px 14px 0 0;padding:.85rem 1.2rem}
.modal-header .close{color:#fff;opacity:.85;text-shadow:none}
.modal-title{font-weight:600;font-size:16px}

/* Select2 */
.select2-container--bootstrap4 .select2-selection{border-radius:8px;border-color:#dbe2ee;min-height:calc(2.1rem + 2px)}
.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered{line-height:2.1rem;font-size:13px}
.select2-container--bootstrap4 .select2-selection--single{height:calc(2.1rem + 2px)!important}
.select2-container--bootstrap4 .select2-results__option--highlighted{background:var(--primary)}
.select2-container{width:100%!important}

/* Document line items */
.items-table th{background:var(--primary);color:#fff;font-weight:600;font-size:12px;white-space:nowrap}
.items-table td{padding:.35rem .35rem;vertical-align:top}
.items-table .form-control{height:32px;font-size:12.5px;padding:.25rem .45rem}
.items-table .select2-container--bootstrap4 .select2-selection--single{height:32px!important}
.items-table .select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered{line-height:30px;font-size:12.5px}
.totals-box{background:#f8fafd;border:1px solid var(--line);border-radius:10px;padding:12px 14px}
.totals-box .row{align-items:center;margin-bottom:6px}
.totals-box .grand{font-size:18px;font-weight:700;color:var(--primary)}

/* Filters bar */
.filter-bar{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:12px 14px 2px;margin-bottom:14px}
.filter-bar .form-group{margin-bottom:10px}
.status-tabs .nav-link{border-radius:8px;font-size:12.5px;font-weight:600;color:#475569;padding:.4rem .8rem;margin-right:4px}
.status-tabs .nav-link.active{background:var(--primary);color:#fff}
.status-tabs .nav-link .badge{background:rgba(0,0,0,.08);color:inherit;margin-left:4px}

/* timeline */
.tl{list-style:none;padding:0;margin:0;position:relative}
.tl:before{content:'';position:absolute;left:11px;top:4px;bottom:4px;width:2px;background:var(--line)}
.tl li{position:relative;padding-left:34px;margin-bottom:14px}
.tl li .tl-dot{position:absolute;left:4px;top:3px;width:16px;height:16px;border-radius:50%;background:#fff;border:3px solid var(--primary)}
.tl li small{color:var(--muted)}

.info-list dt{font-weight:500;color:var(--muted);font-size:12px}
.info-list dd{font-weight:600;margin-bottom:.6rem}
.stat-mini{border:1px solid var(--line);border-radius:10px;padding:10px 12px;background:#fff}
.stat-mini .v{font-size:18px;font-weight:700}
.stat-mini .l{font-size:12px;color:var(--muted)}
.empty-state{text-align:center;color:var(--muted);padding:30px}
.empty-state i{font-size:34px;opacity:.4;display:block;margin-bottom:8px}

/* ---------------- Login ---------------- */
.login-split{min-height:100vh;display:flex;background:#fff}
.login-left{flex:1.1;background:radial-gradient(circle at 20% 20%,#1d4ed8 0%,#0d1b36 60%);color:#fff;padding:50px 60px;display:flex;flex-direction:column;justify-content:space-between;position:relative;overflow:hidden}
.login-left:after{content:'';position:absolute;width:420px;height:420px;border-radius:50%;border:60px solid rgba(255,255,255,.04);right:-120px;bottom:-120px}
.login-left h1{font-weight:800;font-size:34px;line-height:1.15;letter-spacing:-.6px}
.login-left .feat{display:flex;align-items:center;margin:14px 0;font-size:15px;color:#dbe6ff}
.login-left .feat i{width:38px;height:38px;border-radius:10px;background:rgba(255,255,255,.1);display:inline-flex;align-items:center;justify-content:center;margin-right:14px}
.login-right{flex:1;display:flex;align-items:center;justify-content:center;padding:40px}
.login-card{width:100%;max-width:400px}
.login-card h2{font-weight:800;font-size:26px}
.login-card .form-control{height:46px;border-radius:10px;padding-left:42px}
.login-card .input-icon{position:relative}
.login-card .input-icon i{position:absolute;left:15px;top:16px;color:#94a3b8}
.login-card .btn{height:46px;border-radius:10px;font-weight:600}
@media (max-width:900px){.login-left{display:none}}

/* ---------------- Print ---------------- */
.doc-paper{background:#fff;max-width:900px;margin:0 auto;padding:28px;border:1px solid var(--line);border-radius:12px;color:#111}
@media print{
	.main-sidebar,.main-header,.main-footer,.content-header,.no-print,.page-actions{display:none!important}
	.content-wrapper{margin:0!important;background:#fff!important}
	.doc-paper{border:0;padding:0;max-width:100%}
	body{background:#fff}
}
.hidden{display:none}
.items-table{min-width:1180px}.items-table .rate,.items-table .amt,.items-table .tax{min-width:100px}
.card-body{overflow-x:auto}.table td[data-order]{white-space:nowrap}
/* brand logo (wide wordmark) */
.erp-brand{justify-content:center;padding:12px 14px!important}
.erp-brand .brand-full{display:flex;align-items:center;justify-content:center;background:#fff;border-radius:12px;padding:6px 10px;width:100%;height:58px;box-shadow:0 4px 14px rgba(0,0,0,.25)}
.erp-brand .brand-full img{max-width:100%;max-height:46px;object-fit:contain}
.erp-brand .brand-icon{display:none;width:40px;height:40px;border-radius:50%;background:#fff;align-items:center;justify-content:center;overflow:hidden}
.erp-brand .brand-icon img{width:36px;height:36px}
.erp-sidebar .sidebar{height:calc(100% - 83px)}
@media (min-width:992px){
	.sidebar-collapse .erp-brand .brand-full{display:none}
	.sidebar-collapse .erp-brand .brand-icon{display:inline-flex}
	.sidebar-collapse .main-sidebar:hover .erp-brand .brand-full{display:flex}
	.sidebar-collapse .main-sidebar:hover .erp-brand .brand-icon{display:none}
}
