:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --secondary-color: #64748b;
    --background-color: #f1f5f9;
    --surface-color: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.8);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --sidebar-width: 280px;
    --header-height: 70px;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --glass-backdrop: blur(12px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--surface-glass);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
}

.logo-container {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--primary-color);
}

.logo-container i {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

.logo-container h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.main-nav {
    padding: 1.5rem 1rem;
    flex: 1;
}

.main-nav ul {
    list-style: none;
}

.main-nav li {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.main-nav li i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.main-nav li:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
    transform: translateX(4px);
}

.main-nav li.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.main-nav li.active i {
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    height: var(--header-height);
    background-color: var(--surface-glass);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

.top-bar h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 36px;
    height: 36px;
    background-color: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

#content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
}

.stat-card h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Forms & Tables (Generic) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: var(--text-primary);
}

.table-container {
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #f8fafc;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tbody tr {
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: #f8fafc;
}

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

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.status-active,
.status-granted,
.status-approved,
.status-completed {
    background-color: #ecfdf5;
    color: #059669;
}

.status-suspended,
.status-draft,
.status-pending {
    background-color: #fef3c7;
    color: #d97706;
}

.status-withdrawn,
.status-rejected {
    background-color: #fef2f2;
    color: #dc2626;
}

.status-scheduled {
    background-color: #eff6ff;
    color: #2563eb;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-family: inherit;
    font-size: 0.95rem;
}

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

label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Tab Styles */
.tab-container {
    display: flex;
    gap: 0.5rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 220px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card h3 {
        font-size: 0.875rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
    }

    .sidebar {
        position: fixed;
        left: -260px;
        width: 260px;
        height: 100vh;
        z-index: 1000;
        box-shadow: var(--shadow-lg);
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
    }

    .top-bar {
        padding: 0 1rem;
    }

    .top-bar h2 {
        font-size: 1.25rem;
    }

    .user-profile span {
        display: none;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

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

    table {
        min-width: 600px;
    }

    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 1rem;
    }

    .card {
        padding: 1rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .top-bar h2 {
        font-size: 1.125rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {

    /* Hide non-essential elements */
    .sidebar,
    .top-bar,
    .btn,
    .modal-overlay,
    button {
        display: none !important;
    }

    /* Reset layout for print */
    body {
        overflow: visible;
        background: white;
    }

    .app-container {
        display: block;
        height: auto;
    }

    .main-content {
        width: 100%;
        margin: 0;
        padding: 0;
        overflow: visible;
    }

    #content-area {
        padding: 0;
        overflow: visible;
    }

    /* Optimize tables for print */
    .table-container {
        overflow: visible;
    }

    table {
        page-break-inside: auto;
        border-collapse: collapse;
        width: 100%;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    thead {
        display: table-header-group;
    }

    /* Card styles for print */
    .card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
        margin-bottom: 1rem;
    }

    /* Ensure charts are visible */
    canvas {
        max-width: 100%;
        height: auto !important;
    }

    /* Print-friendly colors */
    .status-badge {
        border: 1px solid #333;
        color: #000 !important;
        background: #fff !important;
    }

    /* Add page header */
    @page {
        margin: 2cm;
    }

    /* Print URLs after links */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 100;
}

.skip-to-main:focus {
    top: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
        --text-secondary: #000;
    }

    .card {
        border: 2px solid #000;
    }
}

/* 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;
    }

    .fade-in {
        animation: none;
    }
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Improved button accessibility */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Better link visibility */
a {
    color: var(--primary-color);
    text-decoration: underline;
}

a:hover {
    color: var(--primary-hover);
}

/* Form accessibility */
input:invalid,
select:invalid,
textarea:invalid {
    border-color: var(--danger-color);
}

input:focus:invalid,
select:focus:invalid,
textarea:focus:invalid {
    outline-color: var(--danger-color);
}

/* Loading state */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
}

/* Overlay for mobile menu */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.mobile-overlay.active {
    display: block;
}

/* MODAL Z-INDEX FIX - PREVENT SIDEBAR OVERLAP */
/* ============================================
   PREMIUM MODAL STYLES
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.7) 0%, rgba(30, 41, 59, 0.8) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999 !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 24px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
    z-index: 10000 !important;
    position: relative !important;
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-40px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* ============================================
   MODAL HEADER - PREMIUM DESIGN
   ============================================ */

.modal-header {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 1.75rem 2rem;
    border-bottom: 2px solid #e2e8f0;
    border-radius: 24px 24px 0 0;
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.modal-header h3 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-header h3::before {
    content: '';
    width: 6px;
    height: 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 3px;
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(100, 116, 139, 0.1);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.close-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    transform: rotate(90deg) scale(1.1);
}

/* ============================================
   MODAL BODY - ENHANCED SCROLLING
   ============================================ */

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    max-height: 65vh;
    background: #ffffff;
}

/* Custom scrollbar for modal */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

/* ============================================
   PREMIUM FORM INPUTS
   ============================================ */

.modal-body .form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.modal-body label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    letter-spacing: 0.025em;
    text-transform: uppercase;
    opacity: 0.8;
}

.modal-body input[type="text"],
.modal-body input[type="email"],
.modal-body input[type="tel"],
.modal-body input[type="number"],
.modal-body input[type="date"],
.modal-body input[type="url"],
.modal-body input[type="password"],
.modal-body select,
.modal-body textarea {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: var(--text-primary);
    box-shadow:
        0 1px 2px 0 rgba(0, 0, 0, 0.05),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow:
        0 0 0 4px rgba(59, 130, 246, 0.1),
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 0 rgba(255, 255, 255, 1);
    transform: translateY(-1px);
}

.modal-body input:hover:not(:focus),
.modal-body select:hover:not(:focus),
.modal-body textarea:hover:not(:focus) {
    border-color: #cbd5e1;
}

.modal-body textarea {
    resize: vertical;
    min-height: 100px;
}

.modal-body select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

/* ============================================
   FORM SECTION DIVIDERS
   ============================================ */

.modal-body form>div[style*="border-top"],
.modal-body form>div[style*="border-bottom"] {
    margin: 2rem 0 1.5rem 0;
    padding-top: 1.5rem;
    border-top: 2px solid #e2e8f0 !important;
    position: relative;
}

.modal-body form>div[style*="border-top"]::before,
.modal-body form>div[style*="border-bottom"]::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
}

/* ============================================
   MODAL FOOTER - PREMIUM BUTTONS
   ============================================ */

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 2px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 0 0 24px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.modal-footer .btn {
    padding: 0.75rem 1.75rem;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.025em;
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    box-shadow:
        0 4px 6px -1px rgba(37, 99, 235, 0.3),
        0 2px 4px -1px rgba(37, 99, 235, 0.2);
}

.modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow:
        0 10px 15px -3px rgba(37, 99, 235, 0.4),
        0 4px 6px -2px rgba(37, 99, 235, 0.3);
    transform: translateY(-2px);
}

.modal-footer .btn-primary:active {
    transform: translateY(0);
    box-shadow:
        0 2px 4px rgba(37, 99, 235, 0.3);
}

.modal-footer .btn-secondary {
    background: #ffffff;
    color: var(--text-secondary);
    border: 2px solid #e2e8f0;
}

.modal-footer .btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* ============================================
   CHECKBOX & RADIO ENHANCEMENTS
   ============================================ */

.modal-body input[type="checkbox"],
.modal-body input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    cursor: pointer;
    accent-color: #3b82f6;
}

.modal-body input[type="checkbox"]:focus,
.modal-body input[type="radio"]:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ============================================
   HELPER TEXT & VALIDATION
   ============================================ */

.modal-body small {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-style: italic;
}

.modal-body .error-message {
    color: var(--danger-color);
    font-size: 0.8125rem;
    margin-top: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.modal-body .error-message::before {
    content: '⚠';
    font-size: 1rem;
}

.modal-body input.error,
.modal-body select.error,
.modal-body textarea.error {
    border-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.05);
}

/* ============================================
   RESPONSIVE MODAL ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 1rem;
        border-radius: 16px;
    }

    .modal-header {
        padding: 1.25rem 1.5rem;
        border-radius: 16px 16px 0 0;
    }

    .modal-header h3 {
        font-size: 1.125rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-footer {
        padding: 1.25rem 1.5rem;
        border-radius: 0 0 16px 16px;
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   LOADING STATE FOR MODAL
   ============================================ */

.modal-content.loading {
    pointer-events: none;
}

.modal-content.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    border-radius: 24px;
    z-index: 1;
}

.modal-content.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    z-index: 2;
}

font-style: italic;
}

/* Date input native picker styling */
.modal-body input[type="date"] {
    cursor: pointer;
}

/* Number input spinner removal for cleaner look */
.modal-body input[type="number"]::-webkit-outer-spin-button,
.modal-body input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.modal-body input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Required field indicator */
.modal-body label span[style*="danger-color"]::before {
    content: "";
}

/* Disabled input styling */
.modal-body input:disabled,
.modal-body select:disabled {
    background-color: #f1f5f9;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

/* Focus ring animation */
@keyframes focusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

.modal-body input:focus,
.modal-body select:focus {
    animation: focusPulse 0.4s ease;
}