:root {
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 70px;
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --success-color: #16a34a;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --info-color: #0ea5e9;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

body {
    font-family: Vazirmatn,'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

#blazor-waiting-ui {
    background-color: #fff;
}

    #blazor-waiting-ui .spinner-border {
        border-width: 0px;
        width: auto;
        height: auto;
        animation: 2s linear infinite spinner-border;
    }

.form-control, .form-select {
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    background-color: white;
}

    .form-control:focus, .form-select:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.1);
    }

    .form-control.is-valid,
    .form-select.is-valid {
        border-color: var(--success-color);
        background-color: rgba(5, 150, 105, 0.05);
    }

    .form-control.is-invalid,
    .form-select.is-invalid {
        border-color: var(--danger-color);
        background-color: rgba(220, 38, 38, 0.05);
    }

    .form-control:focus,
    .form-select:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }

    .form-control.required-empty,
    .form-select.required-empty {
        border-color: var(--warning-color);
        background-color: rgba(217, 119, 6, 0.05);
    }

.form-floating label {
    left: auto;
    right: 0;
}

legend {
    float: none;
}


.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    height: calc(100vh - 70px);
    width: calc(100vw - var(--sidebar-width));
    overflow-x: auto;
    overflow-y: auto;
    top: 70px;
    right: var(--sidebar-width);
    position: fixed;
    overflow: scroll;
    scrollbar-width: none;
}

.main-content-background {
    transition: margin-right 0.3s ease;
    background-image: url('../../images/download.jpg');
}

.main-content.expanded {
    margin-right: var(--sidebar-collapsed-width);
}

[dir="ltr"] .main-content {
    margin-left: var(--sidebar-width);
    margin-right: 0;
    padding-top: 70px;
}

    [dir="ltr"] .main-content.expanded {
        margin-left: var(--sidebar-collapsed-width);
        margin-right: 0;
    }

.content-area {
    padding: 2rem;
    background-image: src(../../images/download.jpg);
    overflow-x: hidden;
    overflow-y: auto;
    height: 100%;
    min-height: 100vh;
}


.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 999;
    height: 70px;
}

.navbar-start {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-end {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toggle-btn {
    background: none;
    border: none;
    color: #374151;
    font-size: 1.3rem;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

    .toggle-btn:hover {
        background: #f3f4f6;
        color: #374151;
    }

.logo {
    width: 45px;
    height: 45px;
    /*background: var(--primary-color);*/
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.3rem;
}

.company-name {
    color: #374151;
    font-weight: 600;
    font-size: 1.2rem;
    white-space: nowrap;
}

.desktop-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

user-name {
    font-weight: 600;
    color: #374151;
}

.user-role {
    font-size: 0.875rem;
    color: #6b7280;
}

.sidebar {
    position: fixed;
    top: 70px;
    right: 0;
    height: calc(100vh - 70px);
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow-x: hidden;
    overflow-y: auto;
}

    .sidebar.collapsed {
        width: var(--sidebar-collapsed-width);
    }

        .sidebar.collapsed .nav-item:hover .tooltip-custom {
            opacity: 1;
            visibility: visible;
        }

.sidebar-content {
    padding: 1rem 0;
}

.sidebar-content {
    padding: 1rem 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: #cbd5e1;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    background: none;
    width: 100%;
    font-size: 0.95rem;
    cursor: pointer;
}

    .nav-link:hover {
        background: var(--sidebar-hover);
        color: white;
        text-decoration: none;
    }

    .nav-link.active {
        background: var(--primary-color);
        color: white;
    }

.nav-text {
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .nav-text {
    opacity: 0;
}

.tooltip-custom {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #1f2937;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-right: 15px;
    z-index: 1001;
}

    .tooltip-custom::after {
        content: '';
        position: absolute;
        left: 100%;
        top: 50%;
        transform: translateY(-50%);
        border: 6px solid transparent;
        border-right-color: #1f2937;
    }

.sidebar.collapsed .nav-item:hover .tooltip-custom {
    opacity: 1;
    visibility: visible;
}

.submenu {
    background: #0f172a;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

    .submenu.show {
        max-height: 300px;
        overflow-x: hidden;
        overflow-y: auto;
        --border-color
    }

    .submenu .nav-link {
        padding-right: 3rem;
        font-size: 0.875rem;
    }

.sidebar.collapsed .nav-item:hover .tooltip-custom {
    opacity: 1;
    visibility: visible;
}

.btn:focus-visible,
.nav-link:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.ellipsis {
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: default;
}

    .ellipsis:hover {
        background: transparent;
        color: #6c757d;
        transform: none;
        box-shadow: none;
    }

@media (max-width: 768px) {
    .main-content {
        margin-right: 0 !important;
        margin-left: 0 !important;
        width: 100%;
    }

        .main-content.expanded {
            margin-right: 0 !important;
            margin-left: 0 !important;
            width: 100%;
        }

    [dir="ltr"] .main-content,
    [dir="rtl"] .main-content {
        margin-right: 0 !important;
        margin-left: 0 !important;
        width: 100%;
    }

    .top-navbar {
        padding: 1rem;
    }

    .desktop-controls {
        display: none;
    }

    .sidebar {
        width: 100%;
        transform: translateX(100%);
        top: 70px;
        height: calc(100vh - 70px);
    }

        .sidebar.show {
            transform: translateX(0);
        }

        .sidebar.collapsed {
            width: 100%;
            transform: translateX(100%);
        }

            .sidebar.collapsed.show {
                transform: translateX(0);
            }
}

.table-responsive {
    overflow-x: overlay !important;
}
