/* ===============================
   شرکت سوپیتا
   سیستم دریافت اطلاعات فیش حقوق پرسنل
================================ */

:root{
    --brand:#0d6efd;
    --brand-dark:#1c2951;
    --ink:#1f2430;
    --muted:#6b7280;
    --border:#d8dee9;
    --bg:#f4f6f9;
    --earn:#0f9d58;
    --deduct:#d93025;
}

*{ box-sizing:border-box; }

body{
    direction:rtl;
    font-family:"Vazirmatn","Sahel",Tahoma,Arial,sans-serif;
    background:var(--bg);
    color:var(--ink);
    margin:0;
    padding:0;
}

.container{ max-width:1100px; }

/* Header */

.header{
    background:linear-gradient(90deg,#0d6efd,#0b0000);
    color:#ff0;
    text-align:center;
    padding:20px;
    border-radius:0 0 15px 15px;
    box-shadow:0 4px 10px rgba(0,0,0,.15);
}

.logo{
    width:90px;
    height:90px;
    object-fit:contain;
    margin-bottom:10px;
}

.header h2{ margin:5px 0; font-weight:bold; }
.header h5{ margin:0; color:#f8f000; }

/* Card */

.card{
    margin-top:30px;
    border:none;
    border-radius:16px;
    box-shadow:0 10px 30px rgba(32,32,64,.1);
}

.card-header{
    font-weight:bold;
    text-align:center;
    border-radius:16px 16px 0 0 !important;
}

.footer{
    text-align:center;
    color:#4d5000;
    margin:30px 0 20px;
    font-size:.9rem;
}

.btn-search{
    width:100%;
    font-size:1.15rem;
}

/* Search box: capped width so it stays a tidy, centered card on wide screens */
.search-shell{
    max-width:480px;
    margin:0 auto;
}

.search-shell .card-body{ padding:28px 26px; }

/* Form polish */

.form-label{
    font-size:.82rem;
    font-weight:600;
    color:var(--muted);
    margin-bottom:6px;
}

.form-control{
    border:1px solid var(--border);
    border-radius:10px;
    padding:10px 14px;
    font-family:inherit;
    background:#fff;
    transition:border-color .15s ease, box-shadow .15s ease;
}

.form-control:focus{
    border-color:var(--brand);
    box-shadow:0 0 0 3px rgba(13,110,253,.15);
    outline:none;
}

.form-control::placeholder{ color:#adb5bd; }

/* ============ Payslip ============ */

.page{ max-width:1000px; margin:30px auto; padding:0 16px 40px; }

.payslip{
    background:#fff;
    border:1px solid var(--border);
    border-radius:16px;
    box-shadow:0 8px 30px rgba(0,0,0,.08);
    overflow:hidden;
}

.payslip-header{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:16px;
    background:var(--brand-dark);
    color:#fff;
    padding:20px 24px;
}

.payslip-logo{
    width:64px;
    height:64px;
    object-fit:contain;
    border-radius:8px;
    background:#fff;
    padding:4px;
}

.payslip-title{ flex:1; min-width:200px; }
.payslip-title h1{ margin:0; font-size:1.4rem; }
.payslip-title h2{ margin:2px 0 0; font-size:1rem; font-weight:400; opacity:.85; }

.payslip-period{ display:flex; gap:12px; }
.payslip-period div{
    background:rgba(255,255,255,.12);
    padding:8px 14px;
    border-radius:10px;
    text-align:center;
}
.payslip-period span{ display:block; font-size:.75rem; opacity:.8; }
.payslip-period strong{ font-size:1.1rem; }

.payslip-employee{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    padding:16px 24px;
    background:#f8f9fc;
    border-bottom:1px solid var(--border);
}

.payslip-employee div{ flex:1 1 200px; }
.payslip-employee span{ display:block; font-size:.75rem; color:var(--muted); margin-bottom:2px; }
.payslip-employee strong{ font-size:1.05rem; }

.payslip-matrix{
    display:grid;
    grid-template-columns:repeat(3, 1fr);
}

.pay-col{
    display:flex;
    flex-direction:column;
    padding:16px 18px;
    border-inline-start:1px solid var(--border);
}
.pay-col:first-child{ border-inline-start:none; }

.pay-col h3{
    margin:0 0 10px;
    font-size:.95rem;
    text-align:center;
    padding-bottom:8px;
    border-bottom:2px solid var(--border);
}

.pay-col.earnings h3{ color:var(--earn); border-color:var(--earn); }
.pay-col.deductions h3{ color:var(--deduct); border-color:var(--deduct); }
.pay-col.summary h3{ color:var(--brand); border-color:var(--brand); }

.pay-col .row{
    display:flex;
    justify-content:space-between;
    gap:8px;
    padding:5px 0;
    border-bottom:1px dashed var(--border);
    font-size:.82rem;
}
.pay-col .row span{ color:var(--muted); }
.pay-col .row strong{ font-variant-numeric:tabular-nums; }

.pay-col .row.total{
    border-bottom:none;
    border-top:2px solid var(--border);
    margin-top:auto;
    padding-top:10px;
    font-weight:bold;
    font-size:.88rem;
}

.pay-col .row.net{
    border:none;
    margin-top:auto;
    padding:12px;
    background:var(--brand);
    color:#fff;
    border-radius:10px;
    font-weight:bold;
    font-size:1rem;
}

.payslip-actions{
    display:flex;
    justify-content:center;
    gap:12px;
    padding:20px;
}

.notice-card{ max-width:600px; margin:60px auto; text-align:center; }
.alert-box{
    background:#fdecea;
    color:#b3261e;
    border:1px solid #f5c2c0;
    border-radius:12px;
    padding:16px;
    margin-bottom:16px;
}

.btn{
    display:inline-block;
    padding:10px 22px;
    border-radius:10px;
    border:none;
    cursor:pointer;
    font-family:inherit;
    font-size:.95rem;
    text-decoration:none;
    transition:background-color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.btn:active{ transform:translateY(1px); }
.btn-primary{ background:var(--brand); color:#fff; box-shadow:0 4px 14px rgba(13,110,253,.25); }
.btn-primary:hover{ background:#0b5ed7; box-shadow:0 6px 18px rgba(13,110,253,.32); }
.btn-secondary{ background:#e9ecef; color:var(--ink); }
.btn-success{ background:#198754; color:#fff; }
.btn-success:hover{ background:#157347; }

/* ============ List page ============ */

.table-wrap{ overflow-x:auto; }

table{ width:100%; border-collapse:collapse; background:#fff; }
th, td{
    border:1px solid var(--border);
    padding:8px 10px;
    text-align:center;
    font-size:.85rem;
    white-space:nowrap;
}
thead th{ background:#eef2ff; }
tbody tr:nth-child(even){ background:#fafbff; }

/* ============ Print ============ */

@media print{
    body{ background:#fff; }
    .no-print, .header, .footer, form, nav{ display:none !important; }
    .page{ margin:0; padding:0; max-width:none; }
    .payslip{ box-shadow:none; border:1px solid #000; border-radius:0; }
    .payslip-header{
        background:#fff !important;
        color:#000 !important;
        -webkit-print-color-adjust:exact;
        print-color-adjust:exact;
        padding:10px 16px;
    }
    .payslip-period div{ background:#f0f0f0 !important; color:#000 !important; }
    .payslip-employee{ padding:10px 16px; }
    .pay-col{ padding:10px 12px; }
    .pay-col .row{ padding:3px 0; font-size:.72rem; }
    .pay-col .row.total{ font-size:.78rem; }
    .pay-col .row.net{ background:#f0f0f0 !important; color:#000 !important; font-size:.9rem; }
    .pay-col{ border-inline-start:1px solid #999; }
    @page{ size:A4; margin:10mm; }
}
