@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #f0f2f5;
    color: #1f2937;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* App Header */
.app-header {
    background-color: #111827;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 100;
    border-bottom: 1px solid #374151;
}

.logo-area {
    display: flex;
    align-items: center;
}

.logo-icon img {
    height: 40px;
    width: auto;
    display: block;
}

.company-info {
    margin-left: 15px;
}

.company-info h1 {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.025em;
}

.company-info p {
    font-size: 13px;
    color: #9ca3af;
    margin-top: 2px;
}

/* Controls */
.app-controls {
    display: flex;
    gap: 12px;
}

.btn-control {
    padding: 10px 20px;
    background-color: #304996;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-control:hover {
    background-color: #233a72;
    transform: translateY(-1px);
}

.btn-control i {
    margin-right: 8px;
}

.btn-pdf {
    background-color: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-pdf:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.btn-logout {
    background-color: #ef4444;
}

.btn-logout:hover {
    background-color: #dc2626;
}

/* Layout */
.app-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 400px;
    background-color: #ffffff;
    border-right: 1px solid #e5e7eb;
    padding: 30px;
    overflow-y: auto;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    color: #111827;
}

.sidebar-title i {
    margin-right: 12px;
    color: #304996;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background-color: #ffffff;
    color: #1f2937;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #304996;
    box-shadow: 0 0 0 3px rgba(48, 73, 150, 0.1);
}

.employee-id-options {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.id-option-btn {
    flex: 1;
    min-width: 80px;
    padding: 8px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    font-size: 13px;
    transition: all 0.2s;
    font-weight: 500;
}

.id-option-btn:hover {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #304996;
}

.id-option-btn.active {
    background-color: #eff6ff;
    color: #304996;
    border-color: #304996;
}

/* Preview Area */
.preview-container {
    flex: 1;
    padding: 40px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: auto;
    background-color: #f3f4f6;
}

.payslip-a4 {
    width: 210mm;
    min-height: 297mm;
    background-color: white;
    padding: 15mm 20mm;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    position: relative;
}

/* Payslip Specifics */
.payslip-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    border-bottom: 2px solid #304996;
    padding-bottom: 20px;
}

.payslip-logo img {
    height: 60px;
    width: auto;
    margin-bottom: 10px;
}

.company-address {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    margin-top: 4px;
}

.company-name {
    display: none;
    /* Hidden because we use logo now */
}

.payslip-title {
    text-align: right;
}

.payslip-title h1 {
    font-size: 32px;
    color: #304996;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.025em;
    margin: 0;
}

.payslip-period {
    font-size: 16px;
    color: #4b5563;
    font-weight: 500;
    margin-top: 5px;
}

.employee-info-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 35px;
}

.info-box {
    padding: 15px 20px;
    background-color: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #304996;
}

.info-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 6px;
}

.info-value {
    font-size: 16px;
    color: #111827;
    font-weight: 600;
}

.section-title {
    font-size: 18px;
    color: #111827;
    margin-bottom: 15px;
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.salary-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.salary-table th {
    background-color: #f8fafc;
    color: #4b5563;
    text-align: left;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    border-bottom: 1px solid #e5e7eb;
}

.salary-table td {
    padding: 12px 20px;
    border-bottom: 1px solid #f3f4f6;
    color: #1f2937;
    font-size: 14px;
}

.salary-table tr:last-child td {
    border-bottom: none;
}

.salary-table .amount-col {
    text-align: right;
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: 600;
}

.total-row {
    background-color: #f1f5f9 !important;
}

.total-row td {
    font-weight: 700;
    color: #111827;
    border-top: 2px solid #e5e7eb;
}

.net-salary-section {
    background-color: #304996;
    color: white;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.net-label {
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
}

.net-amount {
    font-size: 24px;
    font-weight: 800;
}

.amount-words {
    font-size: 14px;
    color: #6b7280;
    font-style: italic;
    margin-top: 15px;
    padding: 0 5px;
}

.payslip-footer {
    margin-top: 80px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.signature-box {
    text-align: center;
    width: 200px;
}

.signature-img {
    height: 100px;
    width: auto;
    margin-bottom: 10px;
    display: block;
    margin: 0 auto 10px auto;
}

.signature-line {
    border-top: 1px solid #d1d5db;
    margin-bottom: 8px;
}

.signature-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 24px;
    background-color: #10b981;
    color: white;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification i {
    margin-right: 12px;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px;
    border-radius: 50%;
}

@media print {
    body {
        background-color: white;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .app-header,
    .sidebar,
    .notification,
    .app-controls {
        display: none !important;
    }

    .app-container {
        display: block;
        margin: 0;
        padding: 0;
    }

    .preview-container {
        padding: 0;
        margin: 0;
        background-color: white;
        overflow: visible;
    }

    .payslip-a4 {
        width: 100%;
        max-width: none;
        box-shadow: none;
        margin: 0;
        padding: 0;
        border: none;
    }

    .net-salary-section {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 400px;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }

    .payslip-a4 {
        width: 100%;
        min-height: auto;
        margin: 20px 0;
    }
}

/* Login Page Styles */
.login-body {
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background-color: white;
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.login-logo {
    margin-bottom: 20px;
}

.login-logo img {
    height: 50px;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #111827;
}

.login-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 30px;
}

.login-btn {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
    padding: 12px;
}