/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.navbar {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    flex-wrap: wrap;
}

.navbar-brand h2 {
    color: #3b82f6;
    font-weight: 700;
    font-size: 1.5rem;
}

/* Hamburger Toggle Button */
.navbar-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 2.5rem;
    height: 2.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.navbar-toggle:hover {
    background: #f1f5f9;
    border-radius: 0.5rem;
}

.hamburger-icon {
    width: 100%;
    height: 3px;
    background: #3b82f6;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.navbar-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: #3b82f6;
    background-color: #f1f5f9;
}

.nav-link.active {
    color: #3b82f6;
    background-color: #eff6ff;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    color: #475569;
    font-weight: 500;
}

.btn-logout {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

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

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    margin: 0 auto;
    width: 100%;
}

.main-content:has(.create-form-container-compact) {
    padding: 0.75rem 1rem;
    overflow: visible;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
}

.login-card {
    background: white;
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: #1e293b;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #64748b;
    font-size: 0.9rem;
}

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

.create-form-container-compact .form-group {
    margin-bottom: 0.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    color: #374151;
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
}

.create-form-container-compact .form-group label {
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.625rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

.create-form-container-compact .form-control {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
}

.form-control:hover {
    border-color: #cbd5e1;
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background-color: #ffffff;
}

/* Common style for all readonly fields */
.readonly-field {
    background-color: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    box-shadow: none;
}

.readonly-field:focus{
    border-color: #d1d5db;
    box-shadow: none;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

select.form-control[multiple] {
    background-image: none;
    min-height: 120px;
    padding: 0.75rem;
}

.create-form-container-compact select.form-control[multiple] {
    min-height: 80px;
    padding: 0.5rem;
    font-size: 0.8125rem;
}


.error-message {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #dc2626;
    padding: 1rem 1.25rem;
    border-radius: 0.625rem;
    margin-bottom: 1.5rem;
    border: 2px solid #fecaca;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.1);
}

.create-form-container-compact .error-message {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    border-radius: 0.5rem;
}


/* Page Headers */
.page-header {
    margin-bottom: 2.5rem;
    text-align: center;
    padding-bottom: 1.5rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.header-content h1 {
    color: #1e293b;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.header-content p {
    color: #64748b;
    font-size: 1rem;
}

.page-header h1 {
    color: #1e293b;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    color: #64748b;
    font-size: 1.125rem;
    font-weight: 400;
}

/* Loading States */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-right: 0.5rem;
}

.validation-message {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
    font-weight: 500;
}

/* Blazor ValidationMessage styling */
.validation-message,
.field-validation-error,
.text-danger {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
    font-weight: 500;
    padding-left: 0.25rem;
}

.validation-message::before {
    content: "⚠ ";
    font-weight: bold;
    margin-right: 0.25rem;
}

.create-form-container-compact .validation-message {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}



/* Compact Form Styles - No Scrolling */
.page-header-compact {
    margin-bottom: 1rem;
    text-align: center;
    padding-bottom: 0.5rem;
}

.page-header-compact h1 {
    color: #1e293b;
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.create-form-container-compact {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    overflow-y: auto;
    max-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
}

.create-form-container-compact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
}

.create-form-container-compact form {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
}

.form-section {
    margin-bottom: 1rem;
    padding: 1rem;
    background: linear-gradient(to bottom, #ffffff, #f9fafb);
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.form-section:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.form-section:last-of-type {
    margin-bottom: 0.5rem;
}

.form-section h3 {
    color: #1e293b;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section h3::before {
    content: '';
    width: 3px;
    height: 1rem;
    background: linear-gradient(180deg, #3b82f6, #8b5cf6);
    border-radius: 2px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}


.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f1f5f9;
}

.create-form-container-compact .form-actions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
    justify-content: center !important;
}

.create-form-container-compact .form-actions .btn-primary,
.create-form-container-compact .form-actions .btn-secondary {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    min-width: auto;
    width: auto;
}

/* Services Section */
.services-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.create-form-container-compact .services-header {
    margin-bottom: 0.5rem;
}

.services-header h3,
.services-header label {
    margin: 0;
    padding: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.services-header .btn-primary {
    margin-left: 0;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
}

.create-form-container-compact .services-header {
    gap: 0.5rem;
}

.create-form-container-compact .services-header .btn-primary {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    min-height: auto;
    width: auto;
    max-width: none;
    flex-shrink: 0;
    margin-left: 0;
}

.btn-remove-compact {
    background: #ef4444;
    color: white;
    width: 1.5rem;
    height: 1.5rem;
    min-width: 1.5rem;
    border-radius: 50%;
    font-size: 0.875rem;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-compact:hover {
    background: #dc2626;
}

.empty-services-compact {
    text-align: center;
    padding: 1rem;
    color: #64748b;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 0.5rem;
    border: 1px dashed #cbd5e1;
    font-size: 0.8125rem;
}

.empty-services-compact p {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .navbar-menu {
        gap: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .login-card {
        padding: 2rem;
    }

    .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .create-form-container-compact {
        padding: 1rem;
        max-height: calc(100vh - 150px);
    }

    .form-section {
        padding: 1rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-header-compact h1 {
        font-size: 1.5rem;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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

/* Blazor Error UI */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

/* Dialog Styles */
.service-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.service-dialog.visible {
    opacity: 1;
    visibility: visible;
}

.dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.dialog-content {
    position: relative;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.service-dialog.visible .dialog-content {
    transform: scale(1);
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.dialog-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
}

.btn-close {
    background: transparent;
    color: #64748b;
    padding: 0;
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    border-radius: 0.375rem;
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.dialog-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.search-input {
    margin-bottom: 0.75rem;
}

/* Checkbox List Styles */
.checkbox-list-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem;
    background-color: #f9fafb;
    margin-bottom: 1rem;
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
    flex: 1;
    user-select: none;
}

.checkbox-label:hover {
    background-color: #f1f5f9;
}

.checkbox-label input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: #3b82f6;
    flex-shrink: 0;
}

.checkbox-label span {
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
}

.empty-list-message {
    padding: 1rem;
    text-align: center;
    color: #64748b;
    font-size: 0.875rem;
    font-style: italic;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1.5rem;
    margin-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

/* Unified Modern Button System */
button {
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    line-height: 1.5;
    user-select: none;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
}

.btn-primary:active:not(:disabled) {
    background: #1d4ed8;
}

.btn-primary:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background: white;
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
}

.btn-secondary:active {
    background: #f1f5f9;
}

.btn-danger {
    background: #ef4444;
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

.btn-danger:active:not(:disabled) {
    background: #b91c1c;
    transform: translateY(0);
}

.btn-danger:disabled {
    background: #fca5a5;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-icon {
    padding: 0.5rem;
    min-width: 2rem;
    min-height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}


/* Selection Container Styles */
.selection-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.selected-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.selected-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #eff6ff;
    color: #1e40af;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #bfdbfe;
}

.btn-remove-item {
    background: transparent;
    color: #64748b;
    padding: 0;
    width: 1.25rem;
    height: 1.25rem;
    min-width: 1.25rem;
    border-radius: 0.25rem;
    font-size: 1.125rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-item:hover {
    background: #f1f5f9;
    color: #475569;
}

.empty-selection {
    color: #64748b;
    font-size: 0.875rem;
    font-style: italic;
    padding: 0.5rem 0;
}

/* Scrollbar styling for checkbox lists */
.checkbox-list-container::-webkit-scrollbar {
    width: 8px;
}

.checkbox-list-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.checkbox-list-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.checkbox-list-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Services Table Styles */
.services-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.services-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.services-table thead {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
}

.services-table th {
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.services-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s;
}

.services-table tbody tr:hover {
    background-color: #f9fafb;
}

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

.services-table td {
    padding: 0.75rem;
    vertical-align: middle;
}

.services-table .table-input {
    width: 100%;
    min-width: 80px;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.services-table .table-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.services-table .table-input[readonly] {
    background-color: #f3f4f6;
    cursor: not-allowed;
    color: #6b7280;
}

/* Ensure table doesn't squish on small screens; enable horizontal scroll in wrapper */
.services-table {
    min-width: 900px;
}

@media (max-width: 768px) {
    .services-table th,
    .services-table td {
        padding: 0.5rem;
        font-size: 0.8125rem;
    }

    .services-table .table-input {
        min-width: 100px;
        padding: 0.4rem;
        font-size: 0.8125rem;
    }
}

/* ========== Responsive Navigation Styles ========== */

/* Tablets and Large Phones (769px - 1024px) */
@media (max-width: 1024px) {
    .navbar {
        padding: 0.875rem 1.5rem;
    }

    .navbar-menu {
        gap: 1.25rem;
    }

    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .navbar-brand h2 {
        font-size: 1.375rem;
    }

    .user-info {
        font-size: 0.875rem;
    }

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

    .main-content {
        padding: 1.5rem;
    }
}

/* Mobile Devices (max-width: 768px) */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem 1rem;
        flex-wrap: nowrap;
    }

    .navbar-brand h2 {
        font-size: 1.25rem;
    }

    /* Show hamburger menu */
    .navbar-toggle {
        display: flex;
    }

    /* Hide desktop menu by default on mobile */
    .navbar-menu {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 280px;
        max-width: 80vw;
        background: white;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 5rem 0 2rem 0;
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
    }

    /* Show mobile menu when active */
    .navbar-menu.active {
        right: 0;
    }

    .nav-link {
        padding: 1rem 1.5rem;
        border-radius: 0;
        border-bottom: 1px solid #e2e8f0;
        font-size: 0.9375rem;
    }

    .nav-link:hover {
        background-color: #f8fafc;
    }

    .nav-link.active {
        background-color: #eff6ff;
        border-left: 3px solid #3b82f6;
    }

    /* Show overlay when menu is open */
    .mobile-menu-overlay {
        display: block;
    }

    /* Adjust user section for mobile */
    .navbar-user {
        gap: 0.5rem;
    }

    .user-info {
        display: none;
    }

    .btn-logout {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

    .main-content {
        padding: 1rem;
    }
}

/* Small Mobile Devices (max-width: 480px) */
@media (max-width: 480px) {
    .navbar {
        padding: 0.875rem 0.75rem;
    }

    .navbar-brand h2 {
        font-size: 1.125rem;
    }

    .navbar-toggle {
        width: 2.25rem;
        height: 2.25rem;
    }

    .navbar-menu {
        width: 260px;
    }

    .nav-link {
        padding: 0.875rem 1.25rem;
        font-size: 0.875rem;
    }

    .btn-logout {
        padding: 0.5rem 0.625rem;
        font-size: 0.75rem;
    }

    .main-content {
        padding: 0.75rem;
    }
}

/* Landscape Mode для мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .navbar-menu {
        padding: 4rem 0 1.5rem 0;
    }

    .nav-link {
        padding: 0.75rem 1.5rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .nav-link {
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    .btn-logout {
        min-height: 44px;
        min-width: 44px;
    }

    .navbar-toggle {
        min-width: 44px;
        min-height: 44px;
    }
}


/* Report Buttons */
.filters-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn-report {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid;
    white-space: nowrap;
}

    .btn-report .btn-icon {
        font-size: 1rem;
        line-height: 1;
    }

    .btn-report .btn-text {
        font-size: 0.875rem;
    }

    .btn-report:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.btn-download {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: #059669;
}

    .btn-download:hover:not(:disabled) {
        background: linear-gradient(135deg, #059669 0%, #047857 100%);
        border-color: #047857;
        transform: translateY(-1px);
        box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.3);
    }

    .btn-download:active:not(:disabled) {
        transform: translateY(0);
    }

.btn-send {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border-color: #7c3aed;
}

    .btn-send:hover:not(:disabled) {
        background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
        border-color: #6d28d9;
        transform: translateY(-1px);
        box-shadow: 0 4px 6px -1px rgba(124, 58, 237, 0.3);
    }

    .btn-send:active:not(:disabled) {
        transform: translateY(0);
    }

/* Responsive Report Buttons */
@media (max-width: 768px) {
    .filters-header-actions {
        width: 100%;
        flex-direction: column;
    }

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

@media (max-width: 480px) {
    .btn-report .btn-text {
        font-size: 0.8125rem;
    }

    .btn-report {
        padding: 0.5rem 0.875rem;
    }
}