:root{
	--ruby-500:#174275;
	--ruby-600:#174275;
	--ruby-50:#fdebed;
	--slate-900:#7f0e19;
	--slate-600:#64748b;
	--slate-100:#f8fafc;
}

body{font-family:Inter,system-ui,-apple-system,'Segoe UI',Roboto,Arial;background:#f3f4f6;color:#1f2933}
.auth-body{background:linear-gradient(135deg,#fdebed,#f3f4f6)}
.app-body{background:#f3f4f6}

/* Utility classes to replace inline styles (CSP safe) */
.mw-280{max-width:280px}
.mw-720{max-width:720px}
.mw-820{max-width:820px}
.mw-840{max-width:840px}
.inline-form{display:inline-block;margin:0}
.mb-12{margin-bottom:12px}

/* Payslip preview layout (kept external because the app CSP blocks inline styles) */
.payroll-payslip-preview{width:100%;max-width:100%;min-width:0;overflow:hidden}
.payroll-payslip-preview .sheet{width:100%;max-width:900px;margin:0 auto;background:#fff;border:1px solid #d8d2c8;border-radius:18px;overflow:hidden;box-shadow:0 16px 40px rgba(31,41,55,.08);box-sizing:border-box}
.payroll-payslip-preview .head{padding:24px 28px;border-bottom:1px solid #ebe6df;box-sizing:border-box}
.payroll-payslip-preview .head img{width:100%;max-width:100%;height:auto;display:block;object-fit:contain;margin:0 0 20px}
.payroll-payslip-preview .head>div{min-width:0}
.payroll-payslip-preview .title{font-size:22px;font-weight:700;line-height:1.2;margin:0;color:#17324d;overflow-wrap:anywhere}
.payroll-payslip-preview .muted{color:#6b7280;font-size:12px;overflow-wrap:anywhere}
.payroll-payslip-preview .body{padding:28px;min-width:0}
.payroll-payslip-preview .grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:20px}
.payroll-payslip-preview .card{border:1px solid #ebe6df;border-radius:14px;padding:14px 16px;background:#faf8f5;min-width:0}
.payroll-payslip-preview .label{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#6b7280;margin-bottom:6px}
.payroll-payslip-preview .value{font-size:18px;font-weight:700;overflow-wrap:anywhere}
.payroll-payslip-preview table{width:100%;border-collapse:collapse;margin-top:8px;table-layout:fixed}
.payroll-payslip-preview th,.payroll-payslip-preview td{padding:10px 8px;border-bottom:1px solid #ebe6df;text-align:left;overflow-wrap:anywhere;word-break:break-word}
.payroll-payslip-preview th{text-transform:uppercase;font-size:11px;letter-spacing:.08em;color:#6b7280}
.payroll-payslip-preview .summary{margin-top:18px;border-top:2px solid #17324d;padding-top:14px}
.payroll-payslip-preview .summary .row{display:flex;justify-content:space-between;gap:12px;padding:6px 0;overflow-wrap:anywhere}
.payroll-payslip-preview .summary .row.total{font-size:18px;font-weight:700}
.payroll-payslip-preview .footer{padding:14px 28px 24px;color:#6b7280;font-size:12px;overflow-wrap:anywhere}

@media (max-width:575.98px){
	.payroll-payslip-preview .head,.payroll-payslip-preview .body,.payroll-payslip-preview .footer{padding-left:16px;padding-right:16px}
	.payroll-payslip-preview .head img{margin-bottom:16px}
	.payroll-payslip-preview .grid{grid-template-columns:1fr}
	.payroll-payslip-preview table{font-size:13px}
	.payroll-payslip-preview th,.payroll-payslip-preview td{padding:8px 4px}
	.payroll-payslip-preview .summary .row{flex-wrap:wrap}
}

@media print{
	.no-print,.app-sidebar,.app-topbar,.alert,footer{display:none!important}
	.app-main{padding:0!important}
	body{background:#fff}
}

.card{border-radius:12px;border:1px solid rgba(18,22,28,.05);box-shadow:0 10px 30px rgba(18,22,28,.05)}
.invoice-automation-card{background-color:#174275!important}
.invoice-automation-label{color:rgba(255,255,255,.8)}

.btn-primary{background:var(--ruby-500);border-color:var(--ruby-500)}
.btn-primary:hover,.btn-primary:focus{background:var(--ruby-600);border-color:var(--ruby-600)}
.btn-outline-primary{color:var(--ruby-500);border-color:var(--ruby-500)}
.btn-outline-primary:hover,.btn-outline-primary:focus{background:var(--ruby-500);border-color:var(--ruby-500);color:#fff}
.text-primary{color:var(--ruby-500)!important}
.link-primary{color:var(--ruby-500)!important}
.link-primary:hover{color:var(--ruby-600)!important}
.bg-primary{background:var(--ruby-500)!important}
.border-primary{border-color:var(--ruby-500)!important}

.app-shell{min-height:100vh}
.app-sidebar{width:260px;min-width:260px;height:100vh;position:fixed;top:0;left:0;z-index:1020;background:var(--ruby-500);background:linear-gradient(180deg,var(--ruby-500),#174275);display:flex;flex-direction:column;overflow-y:hidden;overflow-x:hidden;overscroll-behavior:contain;scroll-behavior:smooth;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.28) transparent}
.app-sidebar.financial-sidebar{background:#28282B}
.app-sidebar:hover{overflow-y:auto}
.app-sidebar::-webkit-scrollbar{width:8px}
.app-sidebar::-webkit-scrollbar-track{background:transparent}
.app-sidebar::-webkit-scrollbar-thumb{background:rgba(255,255,255,.22);border-radius:999px}
.app-sidebar::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.34)}
.app-sidebar .brand-link{color:#fff;font-weight:700;font-size:1.25rem;text-decoration:none}
.app-sidebar .brand-logo{width:32px;height:32px;border-radius:50%;display:inline-block}
.app-sidebar .nav-link{display:flex;align-items:center;padding:.65rem 1rem;border-radius:.75rem;color:rgba(255,255,255,.8);font-weight:500;transition:background .2s ease,color .2s ease}
.app-sidebar .nav-link:hover{background:rgba(255,255,255,.12);color:#fff}
.app-sidebar .nav-link.active{background:#fff;color:var(--ruby-500);box-shadow:0 8px 16px rgba(0,0,0,.15)}
.app-sidebar .nav-link span{flex-grow:1}
.app-content{margin-left:260px;width:calc(100% - 260px)}
.app-topbar{background:#fff;padding:1.25rem 2rem;border-bottom:1px solid rgba(18,22,28,.08)}
.app-main{padding:2rem;}
.app-main>.alert{margin:0 0 1.5rem}
.app-main .card{margin-bottom:1.5rem}

/* Chart containers */
.chart-box{position:relative;height:220px}
.chart-box canvas{width:100%!important;height:100%!important}

.text-ruby{color:var(--ruby-500)!important}
.bg-ruby{background:var(--ruby-500)!important}
.bg-ruby-soft{background:var(--ruby-50)!important}

.navbar-brand{font-weight:700}

.table thead th{text-transform:uppercase;font-size:.75rem;color:var(--slate-600);letter-spacing:.08em}

@media (max-width:992px){
	.app-shell{flex-direction:column}
	/* Sidebar behaves like a drawer on mobile */
	.app-topbar{position:sticky;top:0;z-index:1030}
	.app-sidebar{display:none;width:100%;min-width:100%;height:calc(100vh - 72px);position:static;top:auto;left:auto;z-index:auto;flex-direction:column;padding:.75rem 1rem;overflow-y:auto;overflow-x:hidden}
	.sidebar-open .app-sidebar{display:flex}
	.app-sidebar nav{flex-direction:column!important;gap:.5rem;overflow-y:visible;white-space:normal;-webkit-overflow-scrolling:touch}
	.app-sidebar .nav-link{border-radius:12px;padding:.75rem 1rem;white-space:normal;flex:0 0 auto}
	.app-content{min-height:auto;margin-left:0;width:100%}
	.app-main{padding:1rem}
}
