/* /css/styles.css */
/* This is the fully integrated and corrected stylesheet. */

/* --- General Layout & Components --- */
.table-horizontal table, .table table { width: 100%; border-collapse: collapse; }
.table-horizontal th, .table-horizontal td, .table th, .table td { border: 1px solid #e5e7eb; padding: 8px; }
.table-horizontal th { background: #f8fafc; text-align: left; }
.num { text-align: right; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.toolbar .spacer { flex: 1; }
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; align-items: end; }
.row-end { display: flex; justify-content: flex-end; }
button, .topnav button, .actions button { padding: 8px 12px; border-radius: 8px; border: 1px solid #e5e7eb; background: #f3f4f6; cursor: pointer; }
button.secondary { background: #fff; }
.topnav { display: flex; gap: 8px; margin-bottom: 16px; }
.container { display: grid; gap: 16px; }
.muted { color: #6b7280; font-size: 0.9em; }

.shift-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cal-buttons { display: flex; gap: 8px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display:flex; align-items:center; justify-content:center; }
.modal { background: #fff; border-radius: 12px; width: min(900px, 90vw); padding: 16px; }
.modal__actions { display:flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

.payslip { font-family: system-ui, sans-serif; }
.payslip__header { display:flex; gap: 16px; align-items:center; border-bottom: 2px solid #e5e7eb; padding-bottom: 8px; margin-bottom: 12px; }
.payslip__logo { width: 64px; height: 64px; object-fit: contain; }
.payslip__title { margin: 0; }
.payslip__address, .payslip__contact { color:#374151; font-size: 0.9em; }
.payslip__meta { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-bottom: 12px; }
.payslip__tables { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.payslip__table table { width: 100%; border-collapse: collapse; }
.payslip__table th, .payslip__table td { border: 1px solid #e5e7eb; padding: 6px; }
.payslip__net .net-card { margin-top: 12px; padding: 12px; border: 2px solid #16a34a; border-radius: 10px; display:flex; justify-content: space-between; font-size: 1.1em; }
.net-amt { font-weight: 700; }


/* --- Specific Components --- */
.marquee {
    white-space: nowrap;
    overflow: hidden;
    box-sizing: border-box;
}
.marquee-content {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 25s linear infinite;
}
.marquee-content:hover {
    animation-play-state: paused;
}
@keyframes marquee {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

/* Toggle Switch Styles */
.toggle-bg:after {
    content: '';
    position: absolute;
    top: 0.125rem;
    left: 0.125rem;
    background-color: #fff;
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    height: 1.25rem;
    width: 1.25rem;
    transition-property: transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}
input:checked + .toggle-bg:after {
    transform: translateX(100%);
    border-color: #fff;
}
input:checked + .toggle-bg {
    background-color: #2563eb; /* bg-blue-600 */
}
input:checked + .toggle-bg.toggle-green {
    background-color: #16a34a; /* bg-green-500 */
}


/* --- Utilities --- */
.scrollbar-thin::-webkit-scrollbar { width: 8px; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
.scrollbar-thin:hover::-webkit-scrollbar-thumb { background: #94a3b8; }


/* --- UPDATED & ENHANCED PRINT STYLES --- */
#notepad-print-section {
    display: none; /* Hidden by default */
}

@media print {
    /* Define the page layout */
    @page {
        size: letter;
        margin: 1in;
    
  .pdf-page { page-break-after: always; }
}

    body, html {
        background: #fff !important;
        color: #000 !important;
    }

    /* Hide everything on the page by default */
    body * {
        visibility: hidden;
    }
    
    /* Make ONLY the specified print section and its children visible */
    #print-section, #print-section *,
    #notepad-print-section, #notepad-print-section * {
        visibility: visible;
    }
    
    /* Position the print section to fill the page */
    #print-section,
    #notepad-print-section {
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* Professional typography for printed notes */
    #notepad-print-section h1, #notepad-print-section h2 {
        font-family: Georgia, 'Times New Roman', Times, serif;
        color: #000;
        border-bottom: 2px solid #ccc;
        padding-bottom: 8px;
        margin-bottom: 24px;
        page-break-after: avoid;
    }
    #notepad-print-section .note-print-item {
        font-family: Georgia, 'Times New Roman', Times, serif;
        page-break-inside: avoid;
        border-bottom: 1px solid #eee;
        padding-bottom: 16px;
        margin-bottom: 16px;
    }
    #notepad-print-section .note-print-meta {
        font-size: 0.8rem;
        color: #666;
        font-style: italic;
    }
     #notepad-print-section .note-print-content {
        font-size: 1rem;
        line-height: 1.5;
        white-space: pre-wrap; /* Preserves line breaks */
    }

    /* Utility to hide elements from print (buttons, etc.) */
    .no-print {
        display: none !important;
    }
}