/* ======= CSS Variables - Green Vintage Theme ======= */
:root {
    /* Primary Green Colors */
    --vintage-green-dark: #2d5016;
    --vintage-green: #4a7c59;
    --vintage-green-light: #7cb342;
    --vintage-green-pale: #aed581;
    --vintage-green-mint: #c8e6c9;
    
    /* Accent Colors */
    --vintage-cream: #f8f6f0;
    --vintage-gold: #d4af37;
    --vintage-amber: #ff8f00;
    --vintage-brown: #5d4037;
    
    /* Text Colors */
    --text-dark: #263238;
    --text-light: #37474f;
    --text-white: #ffffff;
    --text-muted: #78909c;
    
    /* Status Colors */
    --success-green: #4caf50;
    --error-red: #f44336;
    --warning-orange: #ff9800;
    --info-blue: #2196f3;
    
    /* Shadows & Effects */
    --shadow-light: 0 2px 8px rgba(45, 80, 22, 0.1);
    --shadow-medium: 0 4px 16px rgba(45, 80, 22, 0.15);
    --shadow-heavy: 0 8px 24px rgba(45, 80, 22, 0.2);
    --vintage-gradient: linear-gradient(135deg, var(--vintage-green) 0%, var(--vintage-green-light) 100%);
    
    /* Borders */
    --border-radius: 12px;
    --border-radius-small: 8px;
    --border-radius-large: 16px;
}

/* ======= Base Styles ======= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--vintage-cream) 0%, #f1f8e9 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, var(--vintage-green-mint) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, var(--vintage-green-pale) 0%, transparent 50%);
    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
}

/* ======= Loading Spinner ======= */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(248, 246, 240, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--vintage-green-mint);
    border-top: 4px solid var(--vintage-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading p {
    color: var(--vintage-green);
    font-size: 16px;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ======= Page System ======= */
.page {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.page.active {
    display: block;
}

/* ======= Login Page Styles ======= */
.login-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 40px 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: var(--vintage-gradient);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: hidden;
}

.header-icon {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.login-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.05) 10px,
        rgba(255, 255, 255, 0.05) 20px
    );
    animation: shimmer 4s linear infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%); }
    100% { transform: translateX(100%) translateY(100%); }
}

.login-header h1 {
    color: var(--text-white);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.login-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

.login-form {
    background: var(--text-white);
    padding: 40px 30px;
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--vintage-green-mint);
    position: relative;
}

.login-form h2 {
    color: var(--vintage-green-dark);
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.login-form h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--vintage-gradient);
    border-radius: 2px;
}

/* ======= Form Styles ======= */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    color: var(--vintage-green-dark);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    position: relative;
}

.form-group label i {
    margin-right: 8px;
    color: var(--vintage-green);
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    color: var(--vintage-green);
    z-index: 2;
    font-size: 16px;
}

.form-group input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    border: 2px solid var(--vintage-green-mint);
    border-radius: var(--border-radius);
    font-size: 16px;
    font-family: 'Sarabun', sans-serif;
    background: var(--vintage-cream);
    color: var(--text-dark);
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus {
    border-color: var(--vintage-green);
    background: var(--text-white);
    box-shadow: 0 0 0 4px rgba(74, 124, 89, 0.1);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

/* ======= Button Styles ======= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 30px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    font-family: 'Sarabun', sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 50px;
    white-space: nowrap;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--vintage-gradient);
    color: var(--text-white);
    box-shadow: var(--shadow-light);
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-thaid {
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    color: var(--text-white);
    box-shadow: var(--shadow-light);
    width: 100%;
    gap: 10px;
}

.btn-thaid:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    filter: brightness(1.1);
}

.btn-thaid img {
    filter: brightness(1.2);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--text-light) 0%, var(--text-muted) 100%);
    color: var(--text-white);
    box-shadow: var(--shadow-light);
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn-outline {
    background: turquoise;/*transparent;*/
    color: var(--vintage-green);
    border: 2px solid var(--vintage-green);
    box-shadow: var(--vintage-green);
}

.btn-outline:hover {
    background: var(--vintage-green);
    color: var(--text-white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-light);
}

.btn-sm {
    padding: 10px 20px;
    font-size: 14px;
    min-height: 40px;
}

/* ======= Divider ======= */
.divider {
    position: relative;
    text-align: center;
    margin: 30px 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--vintage-green-mint), transparent);
}

.divider span {
    background: var(--text-white);
    color: var(--text-muted);
    padding: 0 20px;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

/* ======= ThaiD Login Primary Style ======= */
.thaid-login-primary {
    text-align: center;
    padding: 20px 0;
}

.login-description {
    color: var(--text-light);
    font-size: 15px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-description i {
    color: var(--vintage-green);
    font-size: 18px;
}

.login-help {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1.5;
}

.login-help i {
    color: var(--info-blue);
    font-size: 14px;
    flex-shrink: 0;
}

/* ======= System Info ======= */
.system-info {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius);
    border: 1px solid var(--vintage-green-mint);
    backdrop-filter: blur(8px);
}

.info-header {
    font-size: 16px;
    font-weight: 600;
    color: var(--vintage-green-dark);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--vintage-green-mint);
    display: flex;
    align-items: center;
    gap: 8px;
}

.system-info p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.system-info p i {
    color: var(--vintage-green);
    width: 16px;
}

.system-info p:last-child {
    margin-bottom: 0;
}

.system-info span {
    font-weight: 600;
    color: var(--vintage-green);
}

/* ======= Dashboard Styles ======= */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-header {
    background: var(--text-white);
    padding: 30px;
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-medium);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    border: 1px solid var(--vintage-green-mint);
}

.dashboard-header h1 {
    color: var(--vintage-green-dark);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.dashboard-header p {
    color: var(--text-light);
    font-size: 16px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-id {
    color: var(--vintage-green);
    font-weight: 600;
    font-size: 14px;
    padding: 8px 16px;
    background: var(--vintage-green-mint);
    border-radius: var(--border-radius-small);
}

/* ======= Dashboard Sections ======= */
.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.dashboard-main section {
    background: var(--text-white);
    padding: 30px;
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--vintage-green-mint);
}

.dashboard-main h2 {
    color: var(--vintage-green-dark);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.dashboard-main h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--vintage-gradient);
    border-radius: 2px;
}

/* ======= Salary Card Styles ======= */
.salary-card {
    background: linear-gradient(135deg, var(--vintage-cream) 0%, var(--text-white) 100%);
    border: 2px solid var(--vintage-green-mint);
    border-radius: var(--border-radius-large);
    padding: 25px;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
}

.salary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.salary-period {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--vintage-green-mint);
}

.salary-period h3 {
    color: var(--vintage-green-dark);
    font-size: 18px;
    font-weight: 600;
}

.salary-status {
    padding: 6px 12px;
    border-radius: var(--border-radius-small);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.salary-status.paid {
    background: var(--success-green);
    color: var(--text-white);
}

.salary-status.unpaid {
    background: var(--warning-orange);
    color: var(--text-white);
}

/* ======= Salary Details ======= */
.salary-details {
    display: grid;
    gap: 20px;
}

.income-section,
.deduction-section {
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--vintage-green-mint);
}

.income-section h4 {
    color: var(--vintage-green);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.income-section h4 i {
    color: var(--success-green);
}

.deduction-section h4 {
    color: var(--error-red);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.deduction-section h4 i {
    color: var(--error-red);
}

.income-items,
.deduction-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.item span:first-child {
    color: var(--text-light);
}

.item span:last-child {
    color: var(--text-dark);
    font-weight: 600;
}

.total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid var(--vintage-green-mint);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
}

.net-salary {
    margin-top: 20px;
    padding: 20px;
    background: var(--vintage-gradient);
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-white);
    font-weight: 700;
    font-size: 18px;
}

.salary-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* ======= Salary Grid ======= */
.salary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.history-item {
    background: var(--text-white);
    border: 1px solid var(--vintage-green-mint);
    transition: all 0.3s ease;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--vintage-green-mint);
}

.card-header h4 {
    color: var(--vintage-green-dark);
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    margin-bottom: 15px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 14px;
}

.summary-row.net {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--vintage-green-mint);
    font-weight: 600;
    color: var(--vintage-green);
}

.card-actions {
    display: flex;
    gap: 10px;
}

/* ======= Stats Grid ======= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-item {
    background: var(--vintage-gradient);
    color: var(--text-white);
    padding: 25px 20px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.stat-item:hover::before {
    transform: translateX(100%);
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 15px;
    opacity: 0.8;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 500;
}

/* ======= Print Styles ======= */
.print-container {
    max-width: 800px;
    margin: 0 auto;
}

.print-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 2px solid var(--vintage-green-mint);
}

.salary-slip {
    background: var(--text-white);
    padding: 40px;
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--vintage-green-mint);
}

.slip-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--vintage-green);
}

.hospital-logo {
    font-size: 48px;
    color: var(--vintage-green);
    margin-bottom: 15px;
}

.slip-header h1 {
    color: var(--vintage-green-dark);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.slip-header h2 {
    color: var(--vintage-green);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.slip-header p {
    color: var(--text-light);
    font-size: 16px;
}

.slip-employee-info {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--vintage-cream);
    border-radius: var(--border-radius);
    border: 1px solid var(--vintage-green-mint);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.info-row span:first-child {
    color: var(--text-light);
    font-weight: 600;
}

.info-row span:last-child {
    color: var(--text-dark);
    font-weight: 700;
}

/* ======= Salary Table ======= */
.salary-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.salary-table th,
.salary-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--vintage-green-mint);
}

.salary-table th {
    background: var(--vintage-gradient);
    color: var(--text-white);
    font-weight: 600;
    font-size: 14px;
}

.salary-table .section-header td {
    background: var(--vintage-green-mint);
    color: var(--vintage-green-dark);
    font-weight: 600;
    border-top: 2px solid var(--vintage-green);
}

.salary-table .total-row td {
    border-top: 2px solid var(--vintage-green-light);
    font-weight: 600;
    color: var(--vintage-green);
}

.salary-table .net-row td {
    background: var(--vintage-green-pale);
    color: var(--vintage-green-dark);
    font-weight: 700;
    font-size: 16px;
    border-top: 3px solid var(--vintage-green);
}

.salary-table .amount {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.slip-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--vintage-green-mint);
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

/* ======= Modal Styles ======= */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(45, 80, 22, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--text-white);
    margin: 15% auto;
    padding: 0;
    border-radius: var(--border-radius-large);
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-heavy);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: var(--vintage-gradient);
    color: var(--text-white);
    padding: 20px 25px;
    border-radius: var(--border-radius-large) var(--border-radius-large) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    color: rgba(255, 255, 255, 0.8);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-white);
}

.modal-body {
    padding: 25px;
}

.modal-body p {
    margin: 0;
    color: var(--text-dark);
    line-height: 1.5;
}

/* ======= Loading Placeholder ======= */
.loading-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-style: italic;
    background: var(--vintage-cream);
    border-radius: var(--border-radius);
    border: 2px dashed var(--vintage-green-mint);
}

.loading-placeholder i.fa-spin {
    color: var(--vintage-green);
    margin-right: 8px;
}

/* ======= Utility Classes ======= */
.no-print {
    display: block !important;
}

.no-data,
.error {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-style: italic;
}

.error {
    color: var(--error-red);
}

/* ======= Utility Icon Colors ======= */
.text-success {
    color: var(--success-green) !important;
}

.text-danger {
    color: var(--error-red) !important;
}

.text-warning {
    color: var(--warning-orange) !important;
}

.text-info {
    color: var(--info-blue) !important;
}

/* ======= Print Media Query ======= */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .salary-slip {
        box-shadow: none !important;
        border: 2px solid #333 !important;
    }
    
    .modal {
        display: none !important;
    }
}

/* ======= Responsive Design ======= */
@media (max-width: 768px) {
    .page {
        padding: 15px;
    }
    
    .login-container {
        padding: 20px 0;
    }
    
    .login-header,
    .login-form {
        padding: 25px 20px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .login-form h2 {
        font-size: 20px;
    }
    
    .dashboard-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .header-right {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .btn-secondary,
    .btn-outline {
        width: 100%;
        margin: 5px 0;
    }
    
    .dashboard-main section {
        padding: 20px;
    }
    
    .salary-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .print-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .salary-slip {
        padding: 25px;
    }
    
    .salary-table {
        font-size: 12px;
    }
    
    .salary-table th,
    .salary-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .login-header h1 {
        font-size: 20px;
    }
    
    .login-form h2 {
        font-size: 18px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .form-group input {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .dashboard-main h2 {
        font-size: 18px;
    }
    
    .salary-card {
        padding: 20px;
    }
    
    .net-salary {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .stat-value {
        font-size: 24px;
    }
}

/* ======= Animation Classes ======= */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ======= Focus Styles for Accessibility ======= */
.btn:focus,
input:focus {
    outline: 2px solid var(--vintage-gold);
    outline-offset: 2px;
}

/* ======= ThaiD QR Code Modal Styles ======= */
.thaid-qr-content {
    max-width: 500px;
    margin: 0 auto;
}

.thaid-qr-body {
    text-align: center;
    padding: 30px 20px;
}

.qr-instruction {
    margin-bottom: 25px;
    color: var(--text-light);
}

.qr-instruction i {
    font-size: 48px;
    color: #1a237e;
    margin-bottom: 15px;
    display: block;
}

.qr-instruction p {
    font-size: 16px;
    margin: 8px 0;
    line-height: 1.6;
}

.qr-instruction strong {
    color: #1a237e;
    font-weight: 600;
}

.qrcode-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 280px;
    background: white;
    border: 3px solid #1a237e;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 20px rgba(26, 35, 126, 0.15);
}

.qrcode-container canvas,
.qrcode-container img {
    border-radius: 8px;
}

.qr-steps {
    display: flex;
    justify-content: space-around;
    margin: 25px 0;
    gap: 15px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a237e, #4a5fc1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(26, 35, 126, 0.3);
}

.step-text {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

.qr-status {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #e8ecff, #f0f2ff);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.qr-status i {
    color: #1a237e;
    font-size: 20px;
}

.qr-status span {
    color: var(--text-light);
    font-weight: 500;
}

@media (max-width: 480px) {
    .thaid-qr-content {
        max-width: 95%;
    }
    
    .qrcode-container {
        min-height: 240px;
        padding: 15px;
    }
    
    .qr-instruction i {
        font-size: 36px;
    }
    
    .step-number {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .step-text {
        font-size: 12px;
    }
}

/* ======= High Contrast Mode Support ======= */
@media (prefers-contrast: high) {
    :root {
        --vintage-green-dark: #1a3a0d;
        --vintage-green: #2d5016;
        --text-dark: #000000;
        --text-white: #ffffff;
    }
}

/* ======= Admin Menu Styles ======= */
.admin-menu {
    position: relative;
    display: inline-block;
}

.admin-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: var(--border-radius-small);
    box-shadow: var(--shadow-medium);
    min-width: 220px;
    z-index: 1000;
    margin-top: 5px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.admin-dropdown.show {
    opacity: 1;
    transform: translateY(0);
}

.admin-dropdown a {
    display: block;
    padding: 12px 16px;
    color: var(--text-dark);
    text-decoration: none;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.3s ease;
}

.admin-dropdown a:hover {
    background-color: var(--vintage-green-mint);
    color: var(--vintage-green-dark);
    transform: translateX(5px);
}

.admin-dropdown a:last-child {
    border-bottom: none;
}

.admin-dropdown hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 5px 0;
}

.admin-dropdown i {
    margin-right: 8px;
    width: 16px;
    color: var(--vintage-green);
}

/* ======= ThaiD QR Code Modal Styles ======= */
.thaid-qr-content {
    max-width: 400px;
}

.thaid-qr-body {
    text-align: center;
    padding: 30px 20px;
}

.qr-instruction {
    margin-bottom: 20px;
    color: var(--text-muted);
}

.qr-instruction p {
    margin: 5px 0;
    font-size: 0.95rem;
}

.qrcode-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.qrcode-container canvas,
.qrcode-container img {
    max-width: 100%;
    height: auto;
}

.qr-status {
    margin-top: 20px;
    padding: 15px;
    background: var(--vintage-cream);
    border-radius: 8px;
    color: var(--vintage-green-dark);
}

.qr-status i {
    margin-right: 8px;
    color: var(--vintage-green);
}

/* ======= Reduced Motion Support ======= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}