/* assets/css/style.css - Corporate Modern UI + Document A4 Print Styles */

:root {
    --primary-red: #dc2626;
    --primary-red-hover: #b91c1c;
    --primary-red-light: #fef2f2;
    --primary-red-border: #fecaca;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
}

/* Base Document Styles (Times New Roman official format) */
.madi-document {
    font-family: 'Times New Roman', 'Liberation Serif', serif;
    font-size: 11pt;
    line-height: 1.25;
    color: #000000;
    text-align: justify;
    background: transparent;
    user-select: text;
}

.madi-document u {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.doc-header {
    text-align: center;
    margin-bottom: 12px;
}

.doc-title {
    font-size: 12pt;
    font-weight: bold;
    line-height: 1.3;
    margin: 0 0 4px 0;
    text-transform: none;
    text-align: center;
}

.doc-subtitle {
    font-size: 11pt;
    margin: 4px 0 10px 0;
    text-align: center;
}

.doc-meta-row {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    margin-bottom: 12px;
    font-size: 11pt;
}

.doc-meta-left {
    text-align: left;
}

.doc-meta-right {
    text-align: right;
}

.doc-p {
    font-size: 11pt;
    text-indent: 1.25cm;
    margin: 6px 0;
    line-height: 1.25;
}

.doc-caption-center {
    font-size: 8pt;
    text-align: center;
    margin-top: -4px;
    margin-bottom: 6px;
    color: #333333;
}

.doc-caption-sub {
    font-size: 8pt;
    display: block;
    text-align: right;
    margin-right: 25px;
    color: #333333;
}

.doc-caption-inline {
    font-size: 8.5pt;
    font-style: italic;
    color: #444444;
}

.doc-section-title {
    font-size: 11.5pt;
    font-weight: bold;
    text-align: center;
    margin: 14px 0 6px 0;
}

.doc-p-indent {
    font-size: 11pt;
    margin: 4px 0 4px 1.25cm;
}

.doc-p-subindent {
    font-size: 11pt;
    margin: 3px 0 3px 1.8cm;
}

.doc-funding-list {
    margin: 4px 0 6px 1.25cm;
    font-size: 11pt;
}

.doc-funding-item {
    margin: 2px 0;
}

.funding-active {
    font-weight: 500;
}

.doc-strikethrough {
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    color: #475569;
}

@media print {
    .doc-strikethrough {
        text-decoration: line-through !important;
        text-decoration-thickness: 1.5px !important;
        color: #000000 !important;
    }
    .doc-preview-page-break {
        display: none !important;
    }
    .doc-page-break {
        page-break-before: always !important;
        break-before: page !important;
        clear: both !important;
    }
}

.doc-page-break {
    page-break-before: always;
    break-before: page;
    clear: both;
}

.doc-preview-page-break {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 28px -15mm 24px -20mm;
    padding: 8px 0;
    background: #f1f5f9;
    border-top: 1px dashed #cbd5e1;
    border-bottom: 1px dashed #cbd5e1;
    user-select: none;
}

.doc-preview-page-break .break-line {
    flex: 1;
    height: 1px;
    background: #cbd5e1;
}

.doc-preview-page-break .break-badge {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    background: #e2e8f0;
    padding: 3px 12px;
    border-radius: 9999px;
    letter-spacing: 0.04em;
}

.sign-employer-table {
    width: 100%;
    border-collapse: collapse;
}

.sign-employer-table td {
    padding: 0;
    line-height: 1.15;
}

.doc-signatures-wrap {
    margin-top: 18px;
    page-break-inside: avoid;
}

.doc-signatures-table {
    width: 100%;
    border-collapse: collapse;
}

.doc-signatures-table td {
    vertical-align: top;
    font-size: 10.5pt;
    line-height: 1.25;
}

.doc-signatures-table table td {
    padding: 0;
    line-height: 1.15;
}

.sign-col-left {
    width: 48%;
    padding-right: 15px;
}

.sign-col-right {
    width: 52%;
    padding-left: 15px;
}

.sign-party-title {
    font-weight: bold;
    margin: 0 0 4px 0;
}

.sign-party-desc {
    margin: 0 0 10px 0;
    text-align: justify;
    font-size: 10pt;
}

.sign-employee-name {
    margin: 0 0 6px 0;
}

.sign-field-row {
    font-size: 10.5pt;
}

.sign-field-sub {
    font-size: 8pt;
    color: #333;
    padding-top: 2px;
}

.sign-org-requisites {
    margin-top: 14px;
    font-size: 9.5pt;
    line-height: 1.25;
    color: #111;
}

.sign-employee-details {
    margin-top: 10px;
    font-size: 9.5pt;
    line-height: 1.25;
}

.det-line {
    margin: 2px 0;
}

.doc-receipt-box {
    margin-top: 16px;
    padding-top: 10px;
    page-break-inside: avoid;
    font-size: 10.5pt;
}

.doc-clause-sign-table {
    margin-left: 1.25cm;
    margin-top: 4px;
    margin-bottom: 8px;
    border-collapse: collapse;
}

.doc-clause-sign-table td {
    font-size: 11pt;
}

.receipt-header {
    margin: 0 0 4px 0;
    font-weight: 500;
}

.receipt-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.receipt-table td {
    font-size: 10.5pt;
    line-height: 1.25;
}

.receipt-sign-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 4px;
}

.receipt-captions {
    display: flex;
    justify-content: space-between;
    font-size: 8pt;
    color: #444;
}

.doc-approvals-box {
    margin-top: 18px;
    font-size: 10.5pt;
    page-break-inside: avoid;
}

.approval-title {
    margin: 0 0 8px 0;
}

.approval-row {
    margin: 5px 0;
}

/* Live Preview Sheet Styling */
.sheet-container {
    background: #525659;
    padding: 24px 16px;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
    display: flex;
    justify-content: center;
    border-radius: 8px;
}

.sheet-page {
    background: #ffffff;
    width: 210mm;
    min-height: 297mm;
    padding: 20mm 15mm 20mm 20mm;
    box-sizing: border-box;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    transform-origin: top center;
    transition: transform 0.2s ease;
}

/* Custom UI Elements */
.badge-rate {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 11px;
}

.custom-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    background-color: #ffffff;
    color: #0f172a;
    transition: all 0.15s ease;
}

.custom-input:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.custom-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}

.card-header-accent {
    border-left: 4px solid #dc2626;
}

/* Toast Notification */
.toast-msg {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0f172a;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-msg.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    border-left: 4px solid #22c55e;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

/* Custom Scrollbar for cleaner look */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
