:root {
    --bg: #f5f7fb;
    --sidebar-bg: #1f2937;
    --sidebar-text: #e5e7eb;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --card-bg: #ffffff;
    --border: #e5e7eb;
    --text: #111827;
    --muted: #6b7280;
    --danger: #dc2626;
    --success: #16a34a;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.app-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 24px;
    gap: 24px;
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand-title {
    font-size: 1.4rem;
    font-weight: 600;
}

.brand-sub {
    font-size: 0.9rem;
    color: rgba(229, 231, 235, 0.7);
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav a {
    color: var(--sidebar-text);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
}

.nav a:hover {
    background: rgba(37, 99, 235, 0.15);
    transform: translateX(4px);
}

.nav a.active {
    background: rgba(37, 99, 235, 0.3);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.nav-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.logout-form button {
    margin-top: auto;
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(229, 231, 235, 0.4);
    background: transparent;
    color: var(--sidebar-text);
    border-radius: 8px;
    cursor: pointer;
}

.logout-form button:hover {
    background: rgba(229, 231, 235, 0.1);
}

.main {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.page-heading h1 {
    margin: 0;
}

.page-heading .breadcrumb {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.alerts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.alert.success {
    background: rgba(22, 163, 74, 0.12);
    color: var(--success);
}

.alert.error {
    background: rgba(220, 38, 38, 0.12);
    color: var(--danger);
}

.page-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.grid.two-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.grid.three-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.08), 0 15px 25px rgba(0, 0, 0, 0.15);
}

.card.full-span {
    grid-column: 1 / -1;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.field input,
.field select,
.field textarea {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input, select, textarea {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
}

textarea {
    resize: vertical;
}

.actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

button, .button, .button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--primary);
    color: #fff;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
}

button:hover, .button:hover, .button-link:hover {
    background: var(--primary-dark);
}

.button.secondary {
    background: #e5e7eb;
    color: var(--text);
}

.button.secondary:hover {
    background: #d1d5db;
}

.link {
    background: none;
    border: none;
    color: var(--primary);
    padding: 0;
}

.link.danger {
    color: var(--danger);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0;
    margin: 0;
    line-height: 1.5;
    display: inline-block;
}

.link.danger:hover {
    text-decoration: underline;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table thead {
    background: #f3f4f6;
}

.data-table th, .data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

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

.data-table.condensed th, .data-table.condensed td {
    padding: 8px 12px;
}

.actions-cell {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    white-space: nowrap;
    text-align: left;
}

.actions-cell button,
.actions-cell .button-link {
    margin: 0;
    padding: 6px 12px;
    font-size: 0.875rem;
    line-height: 1.5;
    vertical-align: middle;
}

.actions-cell .link {
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    vertical-align: middle;
}
/*.actions-cell {*/
/*    white-space: nowrap;*/
/*}*/

/*.actions-cell form {*/
/*    display: inline-flex;*/
/*    gap: 8px;*/
/*    align-items: center;*/
/*    margin-right: 8px;*/
/*}*/
.empty {
    text-align: center;
    color: var(--muted);
    padding: 24px;
}

.error-text {
    color: var(--danger);
    font-size: 0.8rem;
}

.help-text {
    color: var(--muted);
    font-size: 0.8rem;
    font-style: italic;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
}

.form-section {
    margin-bottom: 24px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.filters {
    display: flex;
    gap: 12px;
    align-items: center;
}

.highlight {
    font-weight: 600;
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
}

.login-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
}

.login-logo {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.login-card h1 {
    margin: 0 0 8px 0;
    background: linear-gradient(135deg, var(--primary) 0%, #0ea5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.75rem;
}

.subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
}

.login-footer {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.login-footer .help-text {
    margin: 0;
    font-size: 0.85rem;
}

@media (max-width: 960px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
    }

    .nav {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.table-wrapper {
    overflow-x: auto;
}

.table-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.table-summary {
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.85rem;
}

.pagination {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.page-link {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    font-size: 0.9rem;
}

.page-link.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.page-link.disabled {
    pointer-events: none;
    opacity: 0.4;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1000;
    padding: 24px;
}

.modal-backdrop.show {
    display: flex;
}

.modal-open {
    overflow: hidden;
}

.modal {
    background: #ffffff;
    width: 100%;
    max-width: 900px;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
    display: flex;
    flex-direction: column;
    max-height: 95vh;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
    gap: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px 24px 24px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.icon-button {
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--muted);
}

.icon-button:hover {
    color: var(--danger);
}

.table-actions .button {
    white-space: nowrap;
}

.card .data-table td {
    vertical-align: middle;
}

@media (max-width: 768px) {
    .modal {
        max-width: 100%;
        border-radius: 12px;
        margin: 16px;
        max-height: calc(100vh - 32px);
    }

    .modal-body {
        grid-template-columns: 1fr !important;
        padding: 16px;
        gap: 16px;
    }

    .modal-header {
        padding: 16px 16px 0 16px;
    }

    .modal-footer {
        padding: 12px 16px 16px 16px;
    }
}

@media (max-width: 480px) {
    .modal {
        margin: 8px;
        max-height: calc(100vh - 16px);
    }
}
.alert.error {
    color: #fff;
    background-color: #e74c3c;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.error-text {
    color: #e74c3c;
    font-size: 0.9em;
}
.alert.success {
    color: #fff;
    background-color: #2ecc71;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}
.modal {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-body {
    overflow-y: auto;
    max-height: calc(90vh - 120px);
}

/* Equipment Management Page Styles */
.filter-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.filter-card .field label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.filter-card input,
.filter-card select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: white;
}

.filter-card input:focus,
.filter-card select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.status-available {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.status-assigned {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #60a5fa;
}

.status-maintenance {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
}

.status-broken {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
}

.status-retired {
    background: #e5e7eb;
    color: #374151;
    border: 1px solid #9ca3af;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.action-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.action-edit {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.action-edit:hover {
    background: #dbeafe;
    transform: translateX(2px);
}

.action-assign {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #86efac;
}

.action-assign:hover {
    background: #dcfce7;
}

.action-unassign {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.action-unassign:hover {
    background: #fde68a;
}

.action-delete {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.action-delete:hover {
    background: #fee2e2;
    transform: translateX(2px);
}

.assign-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.employee-select {
    flex: 1;
    min-width: 150px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85rem;
    background: white;
}

.inline-form {
    display: inline;
}

/* Table Improvements for Equipment */
.data-table th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 14px 12px;
}

.data-table td {
    padding: 14px 12px;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
}

.data-table tbody tr:hover {
    background: #f8fafc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

/* Price formatting - only for equipment table price column */
.data-table td:nth-child(7):not(.actions-cell) {
    font-weight: 600;
    color: var(--primary);
    font-family: 'Courier New', monospace;
}

.data-table td:nth-child(7):not(.actions-cell)::before {
    content: "₫";
    margin-right: 4px;
    color: var(--muted);
}

/* Remove price formatting from actions column */
.actions-cell::before {
    content: none !important;
    margin: 0 !important;
}

/* Responsive for Equipment Page */
@media (max-width: 1024px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        min-width: auto;
    }
    
    .assign-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .employee-select {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
    
    .action-buttons {
        gap: 6px;
    }
    
    .action-btn {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}

/* Equipment Code styling */
.data-table td:first-child {
    font-weight: 700;
    color: var(--primary);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

/* Equipment Name styling */
.data-table td:nth-child(2) {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

/* Serial number styling - only for equipment table */
.equipment-table .data-table td:nth-child(4) {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--muted);
}

/* Position column styling - should not be muted */
.data-table td:nth-child(4) {
    color: var(--text);
    font-size: 0.95rem;
}

/* Assigned employee styling */
.data-table td:nth-child(8) {
    font-style: italic;
    color: var(--muted);
}

/* Empty state improvement */
.empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--muted);
    font-size: 1rem;
}

.empty::before {
    content: "📋";
    display: block;
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.4;
    animation: float 3s ease-in-out infinite;
}

/* Leave page specific empty state */
.pending-leaves-card .empty::before {
    content: "⏳";
}

.all-leaves-card .empty::before {
    content: "📝";
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Table wrapper improvements */
.table-wrapper {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: white;
}

/* Card header improvements */
.table-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
}

.table-actions .table-summary {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0;
}

.table-actions .table-summary strong {
    color: var(--primary);
    font-weight: 700;
}

/* Leave Management Page Styles */
.leave-form-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #bae6fd;
}

.form-title {
    margin: 0 0 20px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 2px solid #bae6fd;
}

.leave-request-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.leave-request-form .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.leave-request-form .field.full-width {
    grid-column: 1 / -1;
}

.leave-request-form label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

/* Card Header with Badge */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
}

.card-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge-count {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Leave Type Badge */
.leave-type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #f1f5f9;
    color: var(--text);
    border: 1px solid #e2e8f0;
}

/* Leave Status Badges */
.leave-status-pending {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
}

.leave-status-approved {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.leave-status-rejected {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
}

.leave-status-cancelled {
    background: #e5e7eb;
    color: #374151;
    border: 1px solid #9ca3af;
}

/* Date Range Styling */
.date-range {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.date-separator {
    color: var(--muted);
    font-weight: 600;
}

.days-count {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    margin-left: 4px;
}

.employee-name {
    font-weight: 600;
    color: var(--text);
}

.approver-name {
    font-weight: 500;
    color: var(--text);
    font-style: italic;
}

/* Decision Form */
.decision-form {
    margin-bottom: 8px;
}

.decision-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.status-select,
.approver-select {
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85rem;
    background: white;
    min-width: 120px;
}

.status-select {
    min-width: 140px;
}

.approver-select {
    min-width: 160px;
}

.action-update {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    padding: 6px 12px;
    font-size: 0.85rem;
}

.action-update:hover {
    background: #dbeafe;
}

/* Pending Leaves Card */
.pending-leaves-card {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 2px solid #fed7aa;
}

/* All Leaves Card */
.all-leaves-card {
    margin-top: 24px;
}

/* Responsive for Leave Page */
@media (max-width: 1024px) {
    .leave-request-form .form-grid {
        grid-template-columns: 1fr;
    }
    
    .decision-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .status-select,
    .approver-select {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .date-range {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .date-separator {
        display: none;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* Additional Leave Page Improvements */
.leave-form-card input,
.leave-form-card select,
.leave-form-card textarea {
    transition: all 0.2s ease;
}

.leave-form-card input:focus,
.leave-form-card select:focus,
.leave-form-card textarea:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.15);
}

.pending-leaves-card .data-table tbody tr:hover {
    background: #fff7ed;
}

.all-leaves-card .data-table tbody tr:hover {
    background: #f8fafc;
}

/* Decision form improvements */
.decision-controls select {
    transition: all 0.2s ease;
}

.decision-controls select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Leave type badge colors */
.leave-type-badge {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Status badge improvements for leave */
.status-badge {
    min-width: 100px;
    text-align: center;
}

/* Actions cell improvements */
.actions-cell .decision-form {
    margin-bottom: 8px;
}

.actions-cell .inline-form {
    display: inline-block;
    margin: 0;
    padding: 0;
}

.actions-cell .inline-form button {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    font-size: inherit;
    line-height: inherit;
}

/* Card improvements */
.pending-leaves-card,
.all-leaves-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pending-leaves-card:hover,
.all-leaves-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Statistics Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    transition: width 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.08), 0 15px 25px rgba(0, 0, 0, 0.15);
}

.stat-card:hover::before {
    width: 100%;
    opacity: 0.1;
}

.stat-card-primary::before {
    background: var(--primary);
}

.stat-card-success::before {
    background: var(--success);
}

.stat-card-warning::before {
    background: #f59e0b;
}

.stat-card-info::before {
    background: #0ea5e9;
}

.stat-icon {
    font-size: 3rem;
    line-height: 1;
    opacity: 0.9;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 500;
}

/* Welcome Card */
.welcome-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.welcome-card h2,
.welcome-card p {
    color: white;
}

.welcome-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.welcome-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.welcome-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.quick-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.quick-action-btn span {
    font-size: 1.2rem;
}

/* Process Card */
.process-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.process-card h3,
.process-card li {
    color: white;
}

.card-title-with-icon {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px 0;
    font-size: 1.25rem;
}

.card-title-with-icon span:first-child {
    font-size: 1.5rem;
}

.process-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.process-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.process-list li:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

.process-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    font-weight: bold;
    flex-shrink: 0;
    font-size: 0.9rem;
}

/* Brand improvements */
.brand {
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(229, 231, 235, 0.1);
    margin-bottom: 8px;
}

.brand-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Page heading improvements */
.page-heading {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(14, 165, 233, 0.05) 100%);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.page-heading h1 {
    background: linear-gradient(135deg, var(--primary) 0%, #0ea5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Button improvements */
button, .button, .button-link {
    transition: all 0.2s ease;
    font-weight: 500;
}

button:hover, .button:hover, .button-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
}

/* Table improvements */
.data-table {
    border-radius: 8px;
    overflow: hidden;
}

.data-table thead {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.05);
}

/* Responsive improvements */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        font-size: 2.5rem;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
}
