@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&family=Playfair+Display:wght@500&display=swap');

:root {
  --primary:        #1a3c5e;
  --primary-light:  #3b82c4;
  --primary-xlight: #dbeafe;
  --accent:         #0f766e;
  --accent-light:   #ccfbf1;
  --danger:         #c0392b;
  --danger-light:   #fadbd8;
  --warning:        #d68910;
  --warning-light:  #fcf3cf;
  --info:           #1a6b8a;
  --info-light:     #d6eef8;
  --success:        #1e8449;
  --success-light:  #d5f5e3;
  --purple:         #7c3aed;
  --purple-light:   #ede9fe;
  --text:           #1a1a2e;
  --text-muted:     #6b7280;
  --text-light:     #9ca3af;
  --bg:             #f4f6f9;
  --bg-white:       #ffffff;
  --border:         #e5e7eb;
  --border-dark:    #d1d5db;
  --sidebar-w:      248px;
  --header-h:       60px;
  --radius:         10px;
  --radius-lg:      16px;
  --shadow:         0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:      0 4px 12px rgba(0,0,0,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; }

/* ── Layout ── */
.layout { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w); background: var(--text); color: #fff;
  position: fixed; top: 0; left: 0; height: 100vh;
  display: flex; flex-direction: column; z-index: 100; overflow-y: auto;
}
.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 18px; color: #fff; display: block; line-height: 1.2;
}
.sidebar-brand .brand-sub { font-size: 11px; color: rgba(255,255,255,0.45); letter-spacing: .04em; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-section { padding: 16px 16px 4px; font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.3); letter-spacing: .1em; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 18px; color: rgba(255,255,255,0.65); text-decoration: none; font-size: 13.5px; border-left: 3px solid transparent; transition: all .15s; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.06); }
.nav-item.active { color: #fff; background: rgba(59,130,196,0.2); border-left-color: var(--primary-light); }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .8; }
.sidebar-footer { padding: 16px 18px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 13px; color: rgba(255,255,255,0.5); }
.sidebar-footer a { color: rgba(255,255,255,0.5); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.sidebar-footer a:hover { color: #fff; }

/* ── Main ── */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--header-h); background: var(--bg-white);
  border-bottom: 1px solid var(--border); display: flex;
  align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 17px; font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-xlight); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }

.content { flex: 1; padding: 28px; }

/* ── Cards ── */
.card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-title { font-size: 15px; font-weight: 600; }

/* ── Stat cards ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--primary-light); }
.stat-card.accent::before  { background: var(--accent); }
.stat-card.info::before    { background: var(--info); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before  { background: var(--danger); }
.stat-card.purple::before  { background: var(--purple); }
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 600; color: var(--text); line-height: 1; margin-bottom: 4px; }
.stat-sub { font-size: 12px; color: var(--text-muted); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: var(--radius); font-size: 14px; font-weight: 500; cursor: pointer; border: 1px solid transparent; text-decoration: none; transition: all .15s; white-space: nowrap; }
.btn-primary   { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover   { background: #12304f; }
.btn-accent    { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover    { background: #0c5e57; }
.btn-secondary { background: var(--bg-white); color: var(--text); border-color: var(--border-dark); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger    { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover    { background: #a93226; }
.btn-warning   { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-success   { background: var(--success); color: #fff; border-color: var(--success); }
.btn-sm  { padding: 5px 12px; font-size: 13px; }
.btn-xs  { padding: 3px 9px; font-size: 12px; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); background: var(--bg); }
tbody td { padding: 13px 14px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg); }
tfoot td { padding: 10px 14px; font-weight: 600; border-top: 2px solid var(--border); background: var(--bg); font-size: 13px; }

/* ── Forms ── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
.form-group.span2 { grid-column: span 2; }
label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
label .req { color: var(--danger); }
input[type=text], input[type=email], input[type=date], input[type=time],
input[type=number], input[type=tel], input[type=password], input[type=month],
select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border-dark);
  border-radius: var(--radius); font-size: 14px; font-family: inherit;
  background: var(--bg-white); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59,130,196,0.15);
}
textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.input-group { display: flex; }
.input-group-text { display: flex; align-items: center; padding: 0 12px; background: var(--bg); border: 1px solid var(--border-dark); border-right: none; border-radius: var(--radius) 0 0 var(--radius); font-size: 14px; color: var(--text-muted); white-space: nowrap; }
.input-group input { border-radius: 0 var(--radius) var(--radius) 0; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger  { background: var(--danger-light); color: var(--danger); }
.badge-info    { background: var(--info-light); color: var(--info); }
.badge-neutral { background: #f3f4f6; color: var(--text-muted); }
.badge-primary { background: var(--primary-xlight); color: var(--primary); }
.badge-accent  { background: var(--accent-light); color: var(--accent); }
.badge-purple  { background: var(--purple-light); color: var(--purple); }

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; margin-bottom: 16px; border: 1px solid; }
.alert-success { background: var(--success-light); border-color: #a9dfbf; color: var(--success); }
.alert-error, .alert-danger { background: var(--danger-light); border-color: #f1948a; color: var(--danger); }
.alert-warning { background: var(--warning-light); border-color: #f9ca6b; color: var(--warning); }
.alert-info    { background: var(--info-light); border-color: #aad4e8; color: var(--info); }

/* ── Page header ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 22px; font-weight: 600; }
.page-header p  { font-size: 14px; color: var(--text-muted); margin-top: 2px; }
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Login page ── */
.login-page { min-height: 100vh; background: var(--text); display: flex; align-items: center; justify-content: center; }
.login-box { background: var(--bg-white); border-radius: var(--radius-lg); padding: 44px; width: 100%; max-width: 420px; box-shadow: var(--shadow-md); }
.login-brand { text-align: center; margin-bottom: 32px; }
.login-brand h1 { font-family: 'Playfair Display', serif; font-size: 26px; color: var(--primary); }
.login-brand p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── Search & Filter bar ── */
.filter-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar input, .filter-bar select { min-width: 160px; flex: 1; }
.filter-bar .btn { flex-shrink: 0; }

/* ── Tabs ── */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab-item { padding: 10px 20px; font-size: 14px; font-weight: 500; color: var(--text-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s; cursor: pointer; }
.tab-item:hover { color: var(--text); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Info box (view page) ── */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; }
.info-row { display: flex; flex-direction: column; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.info-row:nth-child(odd) { background: var(--bg); }
.info-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.info-value { font-size: 14px; color: var(--text); font-weight: 500; }

/* ── Summary panel ── */
.summary-panel { background: var(--primary); color: #fff; border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 20px; }
.summary-panel .s-label { font-size: 11px; opacity: .7; text-transform: uppercase; letter-spacing: .05em; }
.summary-panel .s-value { font-size: 24px; font-weight: 700; }

/* ── Payslip print styles ── */
.payslip-wrap { max-width: 760px; margin: 0 auto; }
.payslip-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 2px solid var(--border); }
.payslip-company { font-size: 20px; font-weight: 700; color: var(--primary); }
.payslip-title { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-top: 4px; }
.payslip-emp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; background: var(--bg); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; }
.payslip-emp-item .label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.payslip-emp-item .value { font-size: 13px; font-weight: 500; }
.payslip-earnings-deductions { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.payslip-section h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.payslip-section table { font-size: 13px; }
.payslip-section thead th { font-size: 11px; }
.payslip-net { background: var(--primary); color: #fff; border-radius: var(--radius); padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.payslip-net .label { font-size: 13px; opacity: .8; }
.payslip-net .value { font-size: 24px; font-weight: 700; }

/* ── Misc ── */
.text-muted  { color: var(--text-muted); }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-success{ color: var(--success); }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 6px; }
.gap-2 { gap: 10px; }
.actions { display: flex; gap: 6px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 12px; display: block; opacity: .3; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ── ITNS branding block ── */
.itns-block {
  padding: 0 4px 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.itns-block .powered { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.45); margin-bottom: 8px; }
.itns-block a { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.itns-block img { width: 26px; height: 26px; object-fit: contain; border-radius: 6px; }
.itns-block span { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.88); letter-spacing: .3px; }

.payslip-logo {
  padding: 0 4px 4px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.payslip-logo .powered { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.45); margin-bottom: 8px; }
.payslip-logo a { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.payslip-logo img { width: 26px; height: 26px; object-fit: contain; border-radius: 6px; }
.payslip-logo span { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.88); letter-spacing: .3px; }

/* ── Payroll status colors ── */
.status-draft    { background: #f3f4f6; color: var(--text-muted); }
.status-approved { background: var(--info-light); color: var(--info); }
.status-paid     { background: var(--success-light); color: var(--success); }
.status-locked   { background: var(--warning-light); color: var(--warning); }
.status-hold     { background: var(--danger-light); color: var(--danger); }

/* ── Progress bar ── */
.progress { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary-light); border-radius: 3px; }

@media print {
  .sidebar, .topbar, .page-header .btn, .no-print { display: none !important; }
  .main { margin-left: 0; }
  .content { padding: 0; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; }
  .content { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .payslip-earnings-deductions { grid-template-columns: 1fr; }
  .payslip-emp-grid { grid-template-columns: 1fr 1fr; }
}


/* =========================================
   PROFESSIONAL PAYSLIP DESIGN
========================================= */

.payslip-wrap{
    max-width:850px;
    margin:auto;
    background:#fff;
    padding:20px 25px;
    border:2px solid #17375e;
    border-radius:10px;
    box-shadow:0 3px 10px rgba(0,0,0,.06);
}


/* ---------- Header ---------- */

.payslip-header{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    padding-bottom:12px;
    border-bottom:1px dashed #d5dde7;
}

.payslip-company{
    font-size:20px;
    font-weight:700;
    color:#17375e;
}

.payslip-title{
    font-size:13px;
    text-transform:uppercase;
    letter-spacing:1px;
    color:#6b7280;
}


/* ---------- Employee Details ---------- */

.payslip-emp-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:0;
    margin:25px 0;
    border:1px dashed #cfd8e3;
    border-radius:12px;
    overflow:hidden;
}

.payslip-emp-item{
    padding:10px 12px;
    border-right:1px dashed #d8dee9;
    border-bottom:1px dashed #d8dee9;
}

.payslip-emp-item:nth-child(3n){
    border-right:none;
}

.payslip-emp-item .label{
    font-size:10px;
    text-transform:uppercase;
    color:#6b7280;
    margin-bottom:2px;
}

.payslip-emp-item .value{
    font-size:13px;
    font-weight:600;
    color:#111827;
}


/* ---------- Earnings & Deductions ---------- */

.payslip-earnings-deductions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:14px;
}

.payslip-section{
    border:1px dashed #d8dee9;
    border-radius:12px;
    overflow:hidden;
}

.payslip-section h4{
    background:#f8fafc;
    color:#17375e;
    padding:10px 14px;
    font-size:14px;
    margin:0;
    border-bottom:1px dashed #d8dee9;
}

.payslip-section table{
    width:100%;
    border-collapse:collapse;
}

.payslip-section td,
.payslip-section th{
    padding:8px 10px;
    font-size:13px;
}

.payslip-section tbody tr{
    border-bottom:1px dashed #e5e7eb;
}

.payslip-section tfoot{
    background:#fafafa;
}

.payslip-section tfoot td{
    font-size:15px;
}


/* ---------- Net Pay Banner ---------- */

.payslip-net{
    background:#17375e;
    color:white;
    border-radius:12px;
    padding:16px 20px;
    margin-top:28px;

    display:flex;
    justify-content:space-between;
    align-items:center;

    box-shadow:0 3px 10px rgba(0,0,0,.12);
}

.payslip-net .label{
    font-size:15px;
}

.payslip-net .value{
    font-size:32px;
    font-weight:700;
}


/* ---------- Employer Contributions ---------- */

.payslip-contribution{
    margin-top:22px;
    border:1px dashed #d8dee9;
    border-radius:12px;
    padding:14px 18px;
    font-size:12px;
}


/* ---------- Footer ---------- */

.payslip-footer{
    margin-top:15px;
    padding-top:18px;
    border-top:2px dashed #d8dee9;
    display:flex;
    justify-content:space-between;
    color:#6b7280;
    font-size:12px;
}

/* ==========================================
   PAYSLIP PRINT OPTIMIZATION
========================================== */

@media print {

    body{
        background:#fff !important;
        font-size:11px;
    }

    .payslip-wrap{
        width:100%;
        max-width:none;
        padding:10mm;
        margin:0;
        border:1px solid #17375e;
        box-shadow:none;
        border-radius:0;
    }

    .payslip-header{
        padding-bottom:6px;
    }

    .payslip-company{
        font-size:16px;
    }

    .payslip-title{
        font-size:10px;
    }

    .payslip-emp-grid{
        margin:8px 0;
        grid-template-columns:repeat(4,1fr);
    }

    .payslip-emp-item{
        padding:5px 7px;
    }

    .payslip-emp-item .label{
        font-size:8px;
    }

    .payslip-emp-item .value{
        font-size:10px;
    }

    .payslip-earnings-deductions{
        gap:8px;
    }

    .payslip-section h4{
        padding:5px 8px;
        font-size:10px;
    }

    .payslip-section th,
    .payslip-section td{
        padding:4px 6px;
        font-size:10px;
    }

    .payslip-net{
        margin-top:8px;
        padding:8px 12px;
    }

    .payslip-net .label{
        font-size:10px;
    }

    .payslip-net .value{
        font-size:20px;
    }

    .payslip-contribution{
        margin-top:6px;
        padding:8px 10px;
        font-size:9px;
    }

    .payslip-footer{
        margin-top:6px;
        padding-top:6px;
        font-size:8px;
    }

}

