/* UI Kit Overrides & Bridge to Modern Theme */

/* --- Sidebar Navigation --- */
.sidebar-nav-wrapper {
    background: var(--bg-surface);
    width: 260px;
    height: 100vh;
    position: fixed;
    top: 0;
    overflow-y: auto;
    z-index: 999;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease-in-out;
    border-inline-end: 1px solid var(--border-color);
    padding-bottom: 2rem;
}

/* LTR Default */
.sidebar-nav-wrapper {
    left: 0;
    transform: translateX(0);
}

/* RTL Support */
[dir="rtl"] .sidebar-nav-wrapper {
    left: auto;
    right: 0;
    transform: translateX(0);
    border-inline-end: none;
    border-inline-start: 1px solid var(--border-color);
}

/* Mobile: Hidden by default (handled by media queries in kit, but we override here) */
@media (max-width: 991.98px) {
    .sidebar-nav-wrapper {
        transform: translateX(-100%);
    }
    [dir="rtl"] .sidebar-nav-wrapper {
        transform: translateX(100%);
    }

    .sidebar-nav-wrapper.active {
        transform: translateX(0) !important;
    }
}

.sidebar-nav-wrapper .navbar-logo {
    padding: 1.5rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
}

.sidebar-nav-wrapper .sidebar-nav ul .nav-item a {
    color: var(--text-muted);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
}

.sidebar-nav-wrapper .sidebar-nav ul .nav-item a:hover,
.sidebar-nav-wrapper .sidebar-nav ul .nav-item.active > a {
    color: var(--primary);
    background-color: var(--primary-subtle);
}

.sidebar-nav-wrapper .sidebar-nav ul .nav-item a .icon {
    width: 24px;
    margin-inline-end: 10px;
    display: inline-flex;
    justify-content: center;
    color: inherit;
}

/* --- Header --- */
.header {
    background: var(--bg-surface);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 99;
    border-bottom: 1px solid var(--border-color);
    transition: margin-inline-start 0.3s ease-in-out;
}

/* RTL Header Layout */
[dir="rtl"] .header {
    /* Ensure content flows correctly */
}

/* --- Main Content Wrapper --- */
.main-wrapper {
    transition: margin-inline-start 0.3s ease-in-out;
    min-height: 100vh;
    padding-top: 0;
    background: var(--bg-body);
}

@media (min-width: 992px) {
    .main-wrapper {
        margin-inline-start: 260px;
    }
}

/* --- Cards --- */
.card-style {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

/* --- Buttons --- */
.main-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn {
    background: var(--primary);
    color: #fff;
}
.primary-btn:hover {
    background: var(--primary-hover);
    color: #fff;
    box-shadow: 0 4px 12px rgba(54, 92, 245, 0.2);
}

/* --- Tables --- */
.table-wrapper {
    overflow-x: auto;
}
.table > :not(caption) > * > * {
    background-color: transparent;
    padding: 1rem;
    border-bottom-color: var(--border-color);
    color: var(--text-main);
}
.table th {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

/* --- Inputs --- */
.input-style-1 input,
.input-style-1 textarea,
.select-style-1 select {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    width: 100%;
    transition: all 0.3s;
}

.input-style-1 input:focus,
.select-style-1 select:focus {
    border-color: var(--primary);
    background: var(--bg-surface);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

.input-style-1 label {
    color: var(--text-main);
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

/* --- Overlay --- */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-out;
}
.overlay.active {
    opacity: 1;
    visibility: visible;
}
