:root {
    --primary: #0f4c81;
    --border: #d8e0e8;
    --bg: #f5f7fa;
    --text: #1f2937;
    --muted: #64748b;
    --danger: #b91c1c;
    --warning: #92400e;
    --success: #166534;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}
.container {
    width: min(1400px, 96vw);
    margin: 24px auto;
}
.header {
    background: linear-gradient(135deg, #0f4c81, #123a5e);
    color: #fff;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 10px 24px rgba(15, 76, 129, .18);
}
.header h1 { margin: 0 0 8px; font-size: 28px; }
.header p { margin: 0; opacity: .92; }
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    margin-top: 18px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
}
.grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(140px, 1fr));
    gap: 12px;
}
label { display: block; font-weight: 700; font-size: 12px; color: #334155; margin-bottom: 6px; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 10px 11px;
    font-size: 14px;
    background: #fff;
    font-family: inherit;
}
.btn {
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    background: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn.secondary { background: #475569; }
.btn.light { background: #e2e8f0; color: #0f172a; }
.btn.danger { background: #b91c1c; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}
th, td {
    border: 1px solid var(--border);
    padding: 9px;
    text-align: left;
    font-size: 13px;
}
th { background: #e8f1f8; color: #0f3d63; }
td.number, th.number { text-align: right; }
.note {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.badge.ok { background: #dcfce7; color: var(--success); }
.badge.warn { background: #fef3c7; color: var(--warning); }
.badge.err { background: #fee2e2; color: var(--danger); }
.messages { margin: 0; padding-left: 18px; }
.result-total {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 12px;
}
.stat {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
}
.stat .label { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.stat .value { margin-top: 6px; font-size: 22px; font-weight: 800; color: var(--primary); }
.small { font-size: 12px; color: var(--muted); }
@media print {
    .no-print, .header p, .input-card { display: none !important; }
    body { background: #fff; }
    .container { width: 100%; margin: 0; }
    .card, .header { box-shadow: none; border-radius: 0; }
}
@media (max-width: 900px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
    .result-total { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
    .grid, .result-total { grid-template-columns: 1fr; }
    .header h1 { font-size: 22px; }
}
/* SEO / website additions */
.topnav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 800;
}
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    letter-spacing: .5px;
}
.navlinks { display: flex; gap: 10px; flex-wrap: wrap; }
.navlinks a, .site-footer a, .seo-content a, .article a, .post-card a { color: var(--primary); }
.navlinks a {
    text-decoration: none;
    font-weight: 700;
    padding: 8px 10px;
    border-radius: 8px;
}
.navlinks a:hover { background: #e8f1f8; }
.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}
.small-hero { display: block; }
.eyebrow {
    margin: 0 0 8px;
    color: #9bd1ff;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 800;
}
.card .eyebrow, .article .eyebrow, .post-card .eyebrow { color: var(--primary); }
.hero-box {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 14px;
    padding: 14px;
    min-width: 220px;
    display: grid;
    gap: 8px;
}
.hero-box strong { font-size: 14px; }
.hero-box span {
    background: rgba(255,255,255,.14);
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 13px;
}
.input-card h2 { margin-top: 0; }
.faq details, .article details {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    margin-top: 10px;
    background: #f8fafc;
}
.faq summary, .article summary { cursor: pointer; font-weight: 800; }
.site-footer {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    margin: 24px 0;
    text-align: center;
}
.blog-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}
.post-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    background: #fbfdff;
}
.post-card h2 { margin-top: 0; }
.post-card h2 a { text-decoration: none; }
.article {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    font-size: 16px;
    line-height: 1.7;
}
.article h1 { font-size: 34px; line-height: 1.18; margin-bottom: 12px; color: #0f172a; }
.article h2 { margin-top: 28px; color: #0f3d63; }
.article h3 { color: #1f2937; }
.lead { font-size: 18px; color: #334155; }
.toc {
    display: grid;
    gap: 8px;
    background: #f1f7fb;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    margin: 18px 0;
}
.toc a { text-decoration: none; font-weight: 700; }
pre {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    overflow-x: auto;
}
code {
    background: #eef4f8;
    color: #0f3d63;
    padding: 2px 5px;
    border-radius: 5px;
}
pre code { background: transparent; color: inherit; padding: 0; }
@media (max-width: 760px) {
    .topnav, .hero { align-items: flex-start; flex-direction: column; }
    .hero-box { width: 100%; }
    .article h1 { font-size: 26px; }
}
@media print {
    .site-footer { display: none !important; }
    .article { max-width: none; }
}

/* User registration and saved record additions */
.btn.success { background: #166534; }
.nav-user {
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    background: #eef6ff;
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
}
.nav-cta { background: #e8f1f8; }
.flash {
    border-radius: 12px;
    padding: 12px 14px;
    margin-top: 12px;
    font-weight: 700;
}
.flash.ok { background: #dcfce7; color: var(--success); border-color: #86efac; }
.flash.warn { background: #fef3c7; color: var(--warning); border-color: #fbbf24; }
.flash.err { background: #fee2e2; color: var(--danger); border-color: #fca5a5; }
.auth-callout {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.auth-card {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}
.auth-card label { margin-top: 12px; }
.filter-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 12px;
    align-items: end;
}
.filter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    grid-column: span 2;
}
@media (max-width: 800px) {
    .filter-form { grid-template-columns: 1fr; }
    .filter-actions { grid-column: auto; }
    .auth-callout { align-items: stretch; }
    .auth-callout .btn { width: 100%; }
}

/* Company-wise monthly records and CRUD */
.wide-card { max-width: 780px; }
.record-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}
.record-form label { font-weight: 800; color: #123a56; }
.record-form input,
.record-form textarea,
.record-form select,
.filter-form input,
.filter-form select {
    width: 100%;
}
.form-actions { grid-column: 1 / -1; }
.preview-box {
    margin-top: 20px;
    border-top: 1px solid var(--border);
    padding-top: 18px;
}
.monthly-actions {
    grid-column: span 3;
    align-items: center;
}
.compact-table table { min-width: 520px; }
.action-cell {
    min-width: 175px;
    white-space: nowrap;
}
.action-cell form { display: inline-flex; margin: 0; }
.btn.small {
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    line-height: 1;
    min-height: 32px;
    min-width: 58px;
    white-space: nowrap;
    color: #fff !important;
}
.btn.light.small {
    color: #0f172a !important;
}
.btn.danger.small,
.btn.secondary.small,
.btn.success.small {
    color: #fff !important;
}

.action-cell .btn,
.action-cell button.btn {
    margin-right: 5px;
    margin-bottom: 4px;
}
.action-cell form:last-child .btn,
.action-cell .btn:last-child {
    margin-right: 0;
}

.help-text {
    font-size: 13px;
    color: #64748b;
    margin: 6px 0 0;
}
@media (max-width: 760px) {
    .record-form { grid-template-columns: 1fr; }
    .monthly-actions { grid-column: auto; }
    .monthly-actions .btn { width: 100%; }
}

/* Employee management additions */
.quick-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.stacked-input {
    margin-top: 7px;
}
.small-value {
    font-size: 16px !important;
    word-break: break-word;
}
.employee-select {
    min-width: 190px;
}
@media (max-width: 760px) {
    .quick-actions .btn { width: 100%; }
}

/* Company global settings management */
.settings-form h3 {
    margin-top: 22px;
    color: #0f3d63;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}
.settings-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
}
.settings-form .help-text {
    margin-bottom: 0;
}
.logo-preview-box {
    width: 220px;
    max-width: 100%;
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    padding: 8px;
    margin-bottom: 8px;
}
.logo-preview-box img {
    max-width: 100%;
    max-height: 110px;
    object-fit: contain;
}
@media (max-width: 900px) {
    .settings-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .settings-grid { grid-template-columns: 1fr; }
}

/* Print fixes for employee-wise and monthly reports */
.print-only { display: none !important; }
@media print {
    @page {
        size: A4 landscape;
        margin: 8mm;
    }
    html, body {
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .print-only { display: block !important; }
    .no-print,
    .topnav,
    .site-footer,
    .input-card,
    .filter-form,
    .filter-actions,
    .hero-box,
    .btn,
    form,
    .action-cell,
    .navlinks {
        display: none !important;
    }
    .container {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .header,
    .card {
        box-shadow: none !important;
        border-radius: 0 !important;
        border: 1px solid #cbd5e1 !important;
        background: #fff !important;
        color: #000 !important;
        margin: 0 0 5mm 0 !important;
        padding: 5mm !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    .header {
        display: block !important;
        padding: 4mm 5mm !important;
        border: 2px solid #0f4c81 !important;
    }
    .header h1 {
        color: #0f3d63 !important;
        font-size: 18pt !important;
        line-height: 1.15 !important;
        margin: 0 0 2mm 0 !important;
    }
    .header p,
    .eyebrow {
        color: #334155 !important;
        opacity: 1 !important;
        margin: 0 !important;
    }
    h2 {
        font-size: 12pt !important;
        margin: 0 0 3mm 0 !important;
        color: #0f3d63 !important;
    }
    .result-total {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 3mm !important;
    }
    .stat {
        border: 1px solid #cbd5e1 !important;
        border-radius: 4px !important;
        background: #fff !important;
        padding: 3mm !important;
    }
    .stat .label {
        color: #334155 !important;
        font-size: 7pt !important;
        margin: 0 !important;
    }
    .stat .value,
    .stat .value.small-value {
        color: #0f3d63 !important;
        font-size: 11pt !important;
        margin-top: 1mm !important;
        line-height: 1.15 !important;
        word-break: normal !important;
    }
    .table-wrap {
        overflow: visible !important;
        width: 100% !important;
    }
    table,
    .compact-table table {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        border-collapse: collapse !important;
        table-layout: fixed !important;
        page-break-inside: auto;
    }
    thead { display: table-header-group; }
    tfoot { display: table-footer-group; }
    tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    th,
    td {
        border: 1px solid #cbd5e1 !important;
        padding: 2mm 1.6mm !important;
        font-size: 7.4pt !important;
        line-height: 1.2 !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: anywhere !important;
    }
    th {
        background: #e8f1f8 !important;
        color: #0f3d63 !important;
        font-weight: 800 !important;
    }
    td.number,
    th.number { text-align: right !important; }
    a { color: #000 !important; text-decoration: none !important; }
    .employee-report-page .card:nth-of-type(3),
    .employee-report-page .card:nth-of-type(4) {
        margin-bottom: 4mm !important;
    }
    .employee-report-page section.card:last-of-type {
        page-break-inside: auto;
        break-inside: auto;
    }
}

@media print and (orientation: portrait) {
    body::before {
        content: "For best result, change print layout to Landscape.";
        display: block;
        margin-bottom: 4mm;
        padding: 3mm;
        border: 1px solid #f59e0b;
        background: #fffbeb;
        color: #92400e;
        font-weight: 700;
    }
}
@media print {
    .print-meta {
        font-size: 8pt !important;
        text-align: right !important;
        color: #475569 !important;
        margin: -3mm 0 3mm 0 !important;
    }
}


/* All reports print optimisation - monthly records, employee reports, employee master */
.report-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.report-table-card h2,
.report-summary-card h2 { break-after: avoid; }

@media print {
    @page {
        size: A4 landscape;
        margin: 7mm;
    }
    body.printable-report-page {
        background: #fff !important;
        color: #000 !important;
        font-size: 9pt !important;
    }
    body.printable-report-page .container {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    body.printable-report-page .topnav,
    body.printable-report-page .site-footer,
    body.printable-report-page .no-print,
    body.printable-report-page .filter-form,
    body.printable-report-page .filter-actions,
    body.printable-report-page .hero-box,
    body.printable-report-page .btn,
    body.printable-report-page .action-cell,
    body.printable-report-page form {
        display: none !important;
    }
    body.printable-report-page .print-only,
    body.printable-report-page .header p,
    body.printable-report-page .eyebrow {
        display: block !important;
    }
    body.printable-report-page .header {
        display: block !important;
        background: #fff !important;
        color: #000 !important;
        border: 2px solid #0f4c81 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 4mm 5mm !important;
        margin: 0 0 3mm 0 !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }
    body.printable-report-page .header h1 {
        color: #0f3d63 !important;
        font-size: 17pt !important;
        line-height: 1.15 !important;
        margin: 0 0 1.5mm 0 !important;
    }
    body.printable-report-page .header p,
    body.printable-report-page .eyebrow {
        color: #334155 !important;
        opacity: 1 !important;
        margin: 0 !important;
        font-size: 8pt !important;
    }
    body.printable-report-page .print-meta {
        display: block !important;
        font-size: 8pt !important;
        text-align: right !important;
        color: #475569 !important;
        margin: -1mm 0 2mm 0 !important;
    }
    body.printable-report-page .card {
        box-shadow: none !important;
        border-radius: 0 !important;
        border: 1px solid #cbd5e1 !important;
        background: #fff !important;
        color: #000 !important;
        margin: 0 0 3mm 0 !important;
        padding: 3.5mm !important;
    }
    body.printable-report-page .report-summary-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    body.printable-report-page .report-table-card {
        break-inside: auto !important;
        page-break-inside: auto !important;
    }
    body.printable-report-page h2 {
        color: #0f3d63 !important;
        font-size: 11pt !important;
        line-height: 1.15 !important;
        margin: 0 0 2.5mm 0 !important;
    }
    body.printable-report-page .result-total {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 2.5mm !important;
    }
    body.printable-report-page .stat {
        background: #fff !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 3px !important;
        padding: 2.4mm !important;
    }
    body.printable-report-page .stat .label {
        color: #334155 !important;
        font-size: 6.8pt !important;
        line-height: 1.1 !important;
        margin: 0 !important;
    }
    body.printable-report-page .stat .value,
    body.printable-report-page .stat .value.small-value {
        color: #0f3d63 !important;
        font-size: 10.5pt !important;
        line-height: 1.15 !important;
        margin-top: 1mm !important;
        word-break: normal !important;
    }
    body.printable-report-page .table-wrap {
        overflow: visible !important;
        width: 100% !important;
    }
    body.printable-report-page table,
    body.printable-report-page .report-table {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        border-collapse: collapse !important;
        table-layout: fixed !important;
        page-break-inside: auto !important;
        break-inside: auto !important;
    }
    body.printable-report-page thead { display: table-header-group !important; }
    body.printable-report-page tfoot { display: table-footer-group !important; }
    body.printable-report-page tr {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }
    body.printable-report-page th,
    body.printable-report-page td {
        border: 1px solid #cbd5e1 !important;
        padding: 1.6mm 1.1mm !important;
        font-size: 7pt !important;
        line-height: 1.15 !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: anywhere !important;
        color: #000 !important;
    }
    body.printable-report-page th {
        background: #e8f1f8 !important;
        color: #0f3d63 !important;
        font-weight: 800 !important;
    }
    body.printable-report-page th.number,
    body.printable-report-page td.number {
        text-align: right !important;
    }
    body.printable-report-page a {
        color: #000 !important;
        text-decoration: none !important;
    }

    /* More compact for wide monthly/detail tables */
    body.monthly-records-page .monthly-records-table th,
    body.monthly-records-page .monthly-records-table td,
    body.employee-report-page .employee-detail-table th,
    body.employee-report-page .employee-detail-table td {
        font-size: 6.15pt !important;
        padding: 1.15mm .75mm !important;
    }
    body.monthly-records-page .monthly-records-table th:nth-child(1),
    body.monthly-records-page .monthly-records-table td:nth-child(1),
    body.employee-report-page .employee-detail-table th:nth-child(1),
    body.employee-report-page .employee-detail-table td:nth-child(1) { width: 8%; }
    body.monthly-records-page .monthly-records-table th:nth-child(2),
    body.monthly-records-page .monthly-records-table td:nth-child(2) { width: 6%; }
    body.monthly-records-page .monthly-records-table th:nth-child(3),
    body.monthly-records-page .monthly-records-table td:nth-child(3) { width: 11%; }
    body.monthly-records-page .monthly-records-table th:nth-child(4),
    body.monthly-records-page .monthly-records-table td:nth-child(4),
    body.employee-report-page .employee-detail-table th:nth-child(2),
    body.employee-report-page .employee-detail-table td:nth-child(2) { width: 9%; }
    body.monthly-records-page .monthly-records-table th:nth-child(5),
    body.monthly-records-page .monthly-records-table td:nth-child(5),
    body.monthly-records-page .monthly-records-table th:nth-child(6),
    body.monthly-records-page .monthly-records-table td:nth-child(6),
    body.employee-report-page .employee-detail-table th:nth-child(3),
    body.employee-report-page .employee-detail-table td:nth-child(3),
    body.employee-report-page .employee-detail-table th:nth-child(4),
    body.employee-report-page .employee-detail-table td:nth-child(4) { width: 6%; }
    body.monthly-records-page .monthly-records-table th:nth-child(7),
    body.monthly-records-page .monthly-records-table td:nth-child(7),
    body.monthly-records-page .monthly-records-table th:nth-child(8),
    body.monthly-records-page .monthly-records-table td:nth-child(8),
    body.employee-report-page .employee-detail-table th:nth-child(5),
    body.employee-report-page .employee-detail-table td:nth-child(5),
    body.employee-report-page .employee-detail-table th:nth-child(6),
    body.employee-report-page .employee-detail-table td:nth-child(6) { width: 7%; }
    body.monthly-records-page .monthly-records-table th:nth-child(9),
    body.monthly-records-page .monthly-records-table td:nth-child(9),
    body.monthly-records-page .monthly-records-table th:nth-child(10),
    body.monthly-records-page .monthly-records-table td:nth-child(10),
    body.monthly-records-page .monthly-records-table th:nth-child(11),
    body.monthly-records-page .monthly-records-table td:nth-child(11),
    body.monthly-records-page .monthly-records-table th:nth-child(12),
    body.monthly-records-page .monthly-records-table td:nth-child(12),
    body.employee-report-page .employee-detail-table th:nth-child(7),
    body.employee-report-page .employee-detail-table td:nth-child(7),
    body.employee-report-page .employee-detail-table th:nth-child(8),
    body.employee-report-page .employee-detail-table td:nth-child(8),
    body.employee-report-page .employee-detail-table th:nth-child(9),
    body.employee-report-page .employee-detail-table td:nth-child(9),
    body.employee-report-page .employee-detail-table th:nth-child(10),
    body.employee-report-page .employee-detail-table td:nth-child(10) { width: 5.6%; }
    body.monthly-records-page .monthly-records-table th:nth-child(13),
    body.monthly-records-page .monthly-records-table td:nth-child(13),
    body.employee-report-page .employee-detail-table th:nth-child(11),
    body.employee-report-page .employee-detail-table td:nth-child(11) { width: 7.5%; }
    body.monthly-records-page .monthly-records-table th:nth-child(14),
    body.monthly-records-page .monthly-records-table td:nth-child(14),
    body.employee-report-page .employee-detail-table th:nth-child(12),
    body.employee-report-page .employee-detail-table td:nth-child(12) { width: 5.8%; }
    body.monthly-records-page .monthly-records-table th:nth-child(15),
    body.monthly-records-page .monthly-records-table td:nth-child(15) { width: 7%; }

    body.employees-page .employee-master-table th,
    body.employees-page .employee-master-table td,
    body.employee-report-page .all-employees-report-table th,
    body.employee-report-page .all-employees-report-table td,
    body.monthly-records-page .employee-summary-table th,
    body.monthly-records-page .employee-summary-table td {
        font-size: 6.8pt !important;
        padding: 1.35mm .9mm !important;
    }
    body.printable-report-page .badge {
        background: transparent !important;
        color: #000 !important;
        border: 1px solid #94a3b8 !important;
        padding: .7mm 1.5mm !important;
    }
}

/* Return-to-row support after add/edit */
.record-row { scroll-margin-top: 110px; }
.record-row:target td {
    background: #fff7cc !important;
    box-shadow: inset 0 1px 0 #facc15, inset 0 -1px 0 #facc15;
}
.record-row:target td:first-child {
    border-left: 4px solid #eab308;
}
@media print {
    .record-row:target td {
        background: transparent !important;
        box-shadow: none !important;
    }
    .record-row:target td:first-child { border-left: 1px solid #cbd5e1 !important; }
}

/* Latest calculator operation result row */
.operation-result-card {
    border: 2px solid #bfdbfe;
    box-shadow: 0 8px 22px rgba(15, 76, 129, .10);
    scroll-margin-top: 100px;
    outline: none;
}
.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.section-title-row h2 { margin: 0; }
.operation-result-table { min-width: 1040px; }
.operation-result-table th,
.operation-result-table td { vertical-align: middle; }
.latest-result-row td,
.calculation-result-row td {
    transition: background-color .45s ease, box-shadow .45s ease;
}
.latest-result-row.ok-row td {
    background: #f0fdf4;
}
.latest-result-row.error-row td {
    background: #fff1f2;
}
.operation-result-card:focus .latest-result-row:first-child td,
.operation-result-card.result-pulse .latest-result-row:first-child td {
    box-shadow: inset 0 1px 0 #22c55e, inset 0 -1px 0 #22c55e;
}
.small-link {
    display: inline-block;
    margin-top: 5px;
    font-size: 12px;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
}
.small-link:hover { text-decoration: underline; }
@media (max-width: 760px) {
    .section-title-row .btn { width: 100%; }
}
@media print {
    .operation-result-card {
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    .latest-result-row.ok-row td,
    .latest-result-row.error-row td {
        background: #fff !important;
    }
}


/* MTG sheet employee import */
.import-warning-card {
    border-left: 5px solid #b91c1c;
}
.import-warning-card p {
    color: #334155;
    margin: 8px 0;
}
.import-confirm-form {
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 14px;
}
.confirm-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 12px 0 0;
    font-size: 13px;
    color: #334155;
    flex: 1 1 420px;
}
.confirm-line input {
    width: auto;
}
.compact-import-table table {
    min-width: 850px;
}
@media (max-width: 760px) {
    .import-confirm-form .btn {
        width: 100%;
    }
}

/* Reset OT records page */
.danger-hero {
    background: linear-gradient(135deg, #7f1d1d, #b91c1c);
}
.reset-warning-card {
    border-left: 5px solid #b91c1c;
}
.reset-warning-card p {
    color: #334155;
    margin: 8px 0;
}
.danger-text {
    color: #b91c1c !important;
    font-weight: 800;
}
.reset-confirm-form {
    align-items: flex-end;
}
.reset-confirm-form .confirm-line {
    flex: 1 1 520px;
}
@media (max-width: 760px) {
    .reset-confirm-form .btn {
        width: 100%;
    }
}

/* Excel OT record import page */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; padding: 7px 12px; border-radius: 999px; background: #e8f2fb; color: #0b4f83; font-weight: 700; font-size: 13px; }
.check-row { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #0f2340; }
.compact-import-record-table th,
.compact-import-record-table td { white-space: nowrap; }
