/* =================================================================== */
/* ===         UI/UX IMPROVEMENT STYLES (ui-ux-updates.css)        === */
/* =================================================================== */

/* --- 1. Modern Button & Form Styles --- */
:root {
    --primary-color: #4f46e5;
    --secondary-color: #4b5563;
    --danger-color: #dc2626;
    --success-color: #16a34a;
    --border-radius: 6px;
}

/* Base button styles */
.btn-primary, .btn-secondary {
    padding: 10px 18px;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-primary {
    background-color: var(--primary-color);
    color: white;
}
.btn-primary:hover {
    background-color: #4338ca;
}
.btn-secondary {
    background-color: #e5e7eb;
    color: #374151;
    border: 1px solid #d1d5db;
}
.btn-secondary:hover {
    background-color: #d1d5db;
}

/* Disabled field UX */
input:disabled, select:disabled, input:read-only, textarea:read-only {
    cursor: not-allowed !important;
    background-color: #f3f4f6 !important;
    opacity: 0.7;
}

/* --- 2. Salary Slips Dashboard Header (`salary-slips.html`) --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}
.search-bar {
    position: relative;
}
.search-bar .fa-search {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}
.search-bar input {
    padding-left: 35px;
    border-radius: var(--border-radius);
    min-width: 280px;
}
.header-actions {
    display: flex;
    gap: 12px;
}

/* --- 3. Dashboard Table Action Buttons (`salary-slips.html`) --- */
.data-table .actions-cell .action-btn {
    background-color: #f3f4f6;
    color: var(--secondary-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
}
.data-table .actions-cell .action-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

/* --- 4. Salary Form Action Buttons (`salary-form.html`) --- */
.form-actions-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end; /* Aligns buttons to the right */
}

/* --- 5. Professional Signature Modal --- */
#signature-modal-content {
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    padding: 30px;
}
#signature-modal-content p {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 20px;
    color: #111827;
}
.modal-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
}
.modal-buttons .btn-clear {
    color: var(--secondary-color);
    background: none;
    border: none;
    font-weight: 600;
    cursor: pointer;
}
.modal-buttons .btn-cancel {
    background-color: #e5e7eb;
    color: #374151;
}
.modal-buttons .btn-save {
    background-color: var(--success-color);
    color: white;
}
.modal-buttons button {
    padding: 10px 20px;
    border-radius: var(--border-radius);
    border: none;
    font-weight: 600;
    cursor: pointer;
}

/* =================================================================== */
/* ===         MOBILE RESPONSIVE STYLES (Add to end of file)       === */
/* =================================================================== */

@media (max-width: 768px) {

    /* --- General Mobile Adjustments --- */
    .page-content {
        padding: 15px;
    }

    /* --- Responsive Dashboard (`salary-slips.html`) --- */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    .page-header .header-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .search-bar input {
        min-width: 100%;
        width: 100%;
    }
    .btn-primary, .btn-secondary {
        justify-content: center; /* Center button text/icons */
    }

    /* Converts the dashboard table to a card-based layout on mobile */
    .data-table thead {
        display: none; /* Hide table headers */
    }
    .data-table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #e5e7eb;
        border-radius: var(--border-radius);
        padding: 10px;
    }
    .data-table td {
        display: block;
        text-align: right; /* Aligns cell content to the right */
        padding: 8px 5px;
        border-bottom: 1px dashed #f3f4f6;
    }
    .data-table td:last-child {
        border-bottom: none;
    }
    .data-table td::before {
        content: attr(data-label); /* Displays the data-label as the title */
        float: left;
        font-weight: 600;
        color: #374151;
    }
    .data-table .actions-cell {
        text-align: center;
    }

    /* --- Responsive Form (`salary-form.html`) --- */
    .salary-form-layout {
        flex-direction: column;
        gap: 20px;
    }
    .form-summary-sidebar {
        width: 100%;
        position: static;
        order: -1; /* Moves summary to the top on mobile */
    }
    .form-grid {
        grid-template-columns: 1fr; /* Stacks form fields vertically */
    }

    /* --- Responsive Slip View (`view-salary.html`) --- */
    .print-header {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    .header-col {
        flex: 1;
        width: 100%;
    }
    .header-logo, .header-center, .header-contact {
        text-align: center !important;
    }
    .employee-info-table td {
        display: block;
        width: 100%;
    }
    .main-salary-table {
        display: block;
    }
    .main-salary-table thead, .main-salary-table tbody, .main-salary-table tfoot, .main-salary-table tr {
        display: block;
    }
    .main-salary-table thead {
        display: none;
    }
    .main-salary-table tr {
        padding: 10px 0;
        border-bottom: 1px solid #eee;
    }
    .main-salary-table td {
        display: flex;
        justify-content: space-between;
        padding: 5px 0;
    }
    .main-salary-table td::before {
        content: attr(data-label);
        font-weight: 500;
        padding-right: 15px;
    }
    .main-salary-table tfoot th {
        display: flex;
        justify-content: space-between;
        font-size: 1.1em;
    }

    /* --- Responsive Modal --- */
    .modal-buttons {
        flex-direction: column;
        gap: 10px;
        align-items: stretch; /* Makes buttons full-width */
    }
}