:root {
    /* Color Palette - Modern Light/SaaS Theme */
    --primary-color: #3b82f6;
    /* Blue 500 */
    --primary-hover: #2563eb;
    /* Blue 600 */
    --secondary-color: #64748b;
    /* Slate 500 */

    --background-start: #f8fafc;
    /* Slate 50 */
    --background-end: #f1f5f9;
    /* Slate 100 */

    --surface-color: #ffffff;
    --surface-border: #e2e8f0;
    /* Slate 200 */

    --text-main: #0f172a;
    /* Slate 900 */
    --text-muted: #64748b;
    /* Slate 500 */

    --danger-color: #ef4444;
    /* Red 500 */
    --success-color: #10b981;
    /* Emerald 500 */

    /* Spacing & Radius */
    --radius-lg: 12px;
    --radius-md: 8px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Transitions */
    --transition-fast: 0.2s ease;

    /* Extended Color Palette */
    --info-color: #0ea5e9;
    /* Sky 500 */
    --warning-color: #f59e0b;
    /* Amber 500 */
    --indigo-color: #6366f1;
    /* Indigo 500 */
    --teal-color: #14b8a6;
    /* Teal 500 */
}

/* Bootstrap Color Overrides */
.bg-info {
    background-color: var(--info-color) !important;
    color: white !important;
}

.text-info {
    color: var(--info-color) !important;
}

.btn-info {
    background-color: var(--info-color) !important;
    border-color: var(--info-color) !important;
    color: white !important;
}

.btn-info:hover {
    background-color: #0284c7 !important;
    border-color: #0284c7 !important;
}

/* Sky 600 */

.bg-warning {
    background-color: var(--warning-color) !important;
    color: white !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.btn-warning {
    background-color: var(--warning-color) !important;
    border-color: var(--warning-color) !important;
    color: white !important;
}

.btn-warning:hover {
    background-color: #d97706 !important;
    border-color: #d97706 !important;
}

/* Amber 600 */

.bg-indigo {
    background-color: var(--indigo-color) !important;
    color: white !important;
}

.bg-teal {
    background-color: var(--teal-color) !important;
    color: white !important;
}

/* Custom Buttons (Indigo & Teal) */
.btn-indigo {
    background-color: var(--indigo-color) !important;
    border-color: var(--indigo-color) !important;
    color: white !important;
}

.btn-indigo:hover {
    background-color: #4f46e5 !important;
    border-color: #4f46e5 !important;
}

.btn-outline-indigo {
    color: var(--indigo-color) !important;
    border-color: var(--indigo-color) !important;
    background-color: transparent !important;
}

.btn-outline-indigo:hover,
.btn-outline-indigo.active {
    background-color: var(--indigo-color) !important;
    color: white !important;
}

.btn-teal {
    background-color: var(--teal-color) !important;
    border-color: var(--teal-color) !important;
    color: white !important;
}

.btn-teal:hover {
    background-color: #0d9488 !important;
    border-color: #0d9488 !important;
}

.btn-outline-teal {
    color: var(--teal-color) !important;
    border-color: var(--teal-color) !important;
    background-color: transparent !important;
}

.btn-outline-teal:hover,
.btn-outline-teal.active {
    background-color: var(--teal-color) !important;
    color: white !important;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--background-start);
    color: var(--text-main);
    min-height: 100vh;
}

/* Glass/Card Utilities (Redefined for Light Theme) */
.glass-panel {
    background: var(--surface-color);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

/* Typography */
h1,
h2,
h3 {
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: #ffffff;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.95rem;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Custom Form Switch Size */
.form-switch-custom .form-check-input {
    width: 32px;
    height: 18px;
}

/* Filter Specific */
.filter-wrapper {
    position: relative;
    display: inline-block;
}

.filter-spinner {
    position: absolute;
    right: 35px;
    /* Offset for select2 arrow */
    top: 0;
    bottom: 0;
    margin: auto 0;
    height: 1rem;
    z-index: 10;
    pointer-events: none;
    display: none;
}

.filter-wrapper.loading .filter-spinner {
    display: block;
}

.filter-wrapper.loading .select2-container {
    opacity: 0.6;
    pointer-events: none;
}

/* Modal Loading Overlay */
.modal-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1056;
    /* Above modal-header/body but below potential tooltips */
    display: none !important;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
}

.modal-loading-overlay.active {
    display: flex !important;
}

/* QR Scanner Preview */
.scanner-preview {
    width: 100%;
    min-height: 250px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

#readerContainer.d-flex {
    display: flex !important;
}

#readerContainer.d-none {
    display: none !important;
}

/* Buttons - Removed duplicates (btn, btn-primary, etc) */

.btn-icon {
    padding: 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
    background: white;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
}

.btn-icon:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: #eff6ff;
}

.btn-icon.danger:hover {
    color: var(--danger-color);
    border-color: var(--danger-color);
    background: #fef2f2;
}

/* New Modern Login Page Specifics */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    background: var(--background-start);
}

.login-brand-side {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color), var(--indigo-color));
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.brand-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 400px;
}

.brand-logo-img {
    width: 120px;
    height: 120px;
    margin-bottom: 1.5rem;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
    background: white;
    border-radius: 20px;
    padding: 10px;
}

.brand-title {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.brand-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Decorative Circles */
.circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    backdrop-filter: blur(10px);
    z-index: 1;
}

.circle-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    left: -100px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.circle-2 {
    width: 300px;
    height: 300px;
    bottom: -50px;
    right: -50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--background-start);
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.85);
    /* Slightly transparent */
    padding: 3rem 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    /* Deep soft shadow */
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px);
    /* Glassmorphism */
}

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

.login-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.modern-form .form-input {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.modern-form .form-input:focus {
    background: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.modern-form .btn-primary {
    padding: 0.8rem;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    background: linear-gradient(to right, var(--primary-color), var(--indigo-color));
    border: none;
    transition: all 0.3s ease;
}

.modern-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(59, 130, 246, 0.3);
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: var(--indigo-color);
    text-decoration: underline;
}

/* Scoped Utility Classes for Login */
.modern-form .form-group {
    margin-bottom: 1.5rem;
}

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

.login-form-side .mb-4 {
    margin-bottom: 1.5rem;
}

.login-form-side .text-center {
    text-align: center;
}

.login-form-side .text-danger {
    color: var(--danger-color);
}

.login-form-side .text-success {
    color: var(--success-color);
}

.login-form-side .d-inline-block {
    display: inline-block;
}

.login-form-side .mt-2 {
    margin-top: 0.5rem;
}

.login-form-side .mt-4 {
    margin-top: 1.5rem;
}

/* Align Şifre and Unuttum on the same line */
.modern-form .form-label.d-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Responsive Breakpoints for Login */
@media (max-width: 992px) {
    .login-wrapper {
        flex-direction: column;
    }

    .login-brand-side {
        flex: none;
        padding: 3rem 1.5rem;
    }

    .brand-logo-img {
        width: 80px;
        height: 80px;
    }

    .brand-title {
        font-size: 2rem;
    }

    .login-form-side {
        padding: 2rem 1rem;
    }
}

/* Layout System */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid var(--surface-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-logo {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 0.5rem;
    flex-shrink: 0;
}

.sidebar nav {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-right: 0.5rem;
    /* Custom Scrollbar for Nav */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.sidebar nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar nav::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}


.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.nav-link:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.nav-link.active {
    background: #eff6ff;
    /* Blue 50 */
    color: var(--primary-color);
    font-weight: 600;
}

.nav-link ion-icon {
    font-size: 1.25rem;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    background: var(--background-start);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-sm);
}

.user-profile {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--surface-border);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.info .name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.logout-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.logout-btn:hover {
    background: #fee2e2;
    color: var(--danger-color);
}

/* Data Tables Styling Override */
.table-card {
    background: white;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
    color: var(--text-muted) !important;
    margin-bottom: 1rem;
}

/* Pagination Styling */
.dataTables_wrapper .dataTables_paginate {
    display: flex;
    justify-content: flex-end;
    gap: 0.25rem;
    margin-top: 1rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    box-sizing: border-box;
    display: inline-block;
    min-width: 1.5em;
    padding: 0.5em 1em !important;
    margin-left: 2px;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    color: var(--text-main) !important;
    border: 1px solid var(--surface-border) !important;
    border-radius: var(--radius-md) !important;
    background: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    color: white !important;
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active {
    cursor: default;
    color: #cbd5e1 !important;
    border: 1px solid var(--surface-border) !important;
    background: #f8fafc !important;
    box-shadow: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    color: var(--primary-color) !important;
    border: 1px solid var(--primary-color) !important;
    background-color: #eff6ff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:active {
    outline: none;
    background-color: #dbeafe !important;
    box-shadow: inset 0 0 3px #111;
}

.dataTables_wrapper .dataTables_paginate .ellipsis {
    padding: 0 1em;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--surface-border) !important;
    border-radius: var(--radius-md) !important;
    padding: 0.4rem 0.8rem !important;
    background-color: white !important;
    color: var(--text-main) !important;
}

table.dataTable {
    border-collapse: separate !important;
    border-spacing: 0;
    width: 100% !important;
    margin-top: 0 !important;
}

table.dataTable thead th {
    border-bottom: 1px solid var(--surface-border) !important;
    color: var(--text-muted) !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem !important;
}

table.dataTable tbody td {
    padding: 1rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
    color: var(--text-main) !important;
    font-size: 0.95rem;
    vertical-align: middle;
}

table.dataTable tbody tr:hover {
    background-color: #f8fafc !important;
}

/* CRITICAL DATATABLES BUTTON & DROPDOWN FIXES */
button.dt-button,
div.dt-button,
a.dt-button {
    background: white !important;
    border: 1px solid var(--surface-border) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-main) !important;
    padding: 0.5em 1em !important;
    box-shadow: var(--shadow-sm) !important;
}

button.dt-button:hover:not(.disabled) {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

/* The dropdown collection specifically */
div.dt-button-collection {
    background-color: white !important;
    border: 1px solid var(--surface-border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 0.5rem !important;
    width: 200px;
}

div.dt-button-collection button.dt-button {
    display: block !important;
    width: 100% !important;
    margin: 0.2rem 0 !important;
    text-align: left !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--text-main) !important;
}

div.dt-button-collection button.dt-button.active {
    background: #eff6ff !important;
    color: var(--primary-color) !important;
    font-weight: 600 !important;
}

div.dt-button-background {
    background: rgba(0, 0, 0, 0.5) !important;
    /* Dimmed background */
}

/* Custom DataTable Header Alignment */
.dt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dt-header .dt-buttons {
    display: flex;
    gap: 0.5rem;
}

.dataTables_length {
    margin: 0 !important;
}

.dataTables_length select {
    border: 1px solid var(--surface-border) !important;
    border-radius: var(--radius-md) !important;
    padding: 0.4rem 2rem 0.4rem 0.8rem !important;
    background-color: white !important;
    color: var(--text-main) !important;
    cursor: pointer;
}

/* Badge Utilities - Removed duplicates */



/* Scan Panel Styling - Subtle & Integrated */
.scan-panel {
    background: rgba(59, 130, 246, 0.05);
    /* Very subtle primary tint */
    border: 1px dashed var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition-fast);
}

.scan-panel:focus-within {
    background: rgba(59, 130, 246, 0.1);
    border-style: solid;
}

.scan-panel label {
    color: var(--primary-color) !important;
    font-weight: 600 !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 0 !important;
}

/* Accordion Image Upload */
details.accordion-group {
    background: var(--background-start);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: 1rem;
}

details.accordion-group summary {
    padding: 0.8rem 1rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    /* Hide default triangle */
}

details.accordion-group summary::-webkit-details-marker {
    display: none;
}

details.accordion-group summary::after {
    content: '+';
    margin-left: auto;
    font-weight: bold;
    font-size: 1.2rem;
}

details.accordion-group[open] summary::after {
    content: '-';
}

details.accordion-group[open] summary {
    border-bottom: 1px solid var(--surface-border);
    background: white;
    color: var(--primary-color);
}

.accordion-content {
    padding: 1rem;
    background: white;
}

.info-card {
    background: var(--surface-color);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-sm);
}

.image-upload-area {
    width: 100%;
    /* border: 2px dashed var(--surface-border); Removed duplicate definition if any, ensuring clean style */
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
}

.image-upload-area:hover {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.image-upload-area img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.image-upload-area.highlight {
    border-color: var(--primary-color);
    background: #e0f2fe;
    /* Light Blue */
    transform: scale(1.02);
}

/* Form Polish */
.input-glass {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(4px);
    border: 1px solid var(--surface-border) !important;
    box-shadow: none !important;
    transition: all 0.2s ease;
}

.input-glass:focus {
    background: white !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}


/* Glass Panel -> Card mapping preserved for easier migration if needed, 
   but ideally should be removed. Keeping it minimal for now or removing if fully replacing. 
   User said "replace all", so I should probably redefine .glass-panel to just inherit from .card 
   or remove it and update HTML. Plan says "Map them to Bootstrap .card". 
   Let's keep a shim for .glass-panel to avoid breaking everything immediately visually 
   before HTML refactor, but using Bootstrap vars. */

.glass-panel {
    background: var(--bs-card-bg, #fff);
    border: var(--bs-card-border-width, 1px) solid var(--bs-card-border-color, #dee2e6);
    border-radius: var(--bs-card-border-radius, 0.375rem);
    box-shadow: var(--bs-box-shadow-sm, 0 .125rem .25rem rgba(0, 0, 0, .075));
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Remove custom Modal & Grid - relying on Bootstrap */

/* Ensure inputs fill their columns and align vertically */

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.85rem;
}

.input-glass {
    width: 100%;
    height: 40px;
    /* Fixed height for perfect alignment */
    padding: 0.375rem 0.75rem;
}

textarea.input-glass {
    height: auto;
}


/* Cleaned up modal styles for Bootstrap migration */
/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked+.slider:before {
    -webkit-transform: translateX(18px);
    -ms-transform: translateX(18px);
    transform: translateX(18px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.toggle-label {
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s;
}

.toggle-label.active {
    color: var(--primary-color);
    font-weight: 700;
}

/* Table Utilities - Removed duplicates */

/* Modal Tabs */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--surface-border);
    margin-bottom: 1rem;
    gap: 1rem;
}

.modal-tab {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
}

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

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

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

.inventory-image {
    max-width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
    padding: 4px;
}

/* Sidebar Submenu */
.nav-item-dropdown {
    margin-bottom: 0.25rem;
}

.nav-link .icon-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dropdown-icon {
    font-size: 1rem;
    transition: transform 0.2s;
}

.nav-item-dropdown.active .dropdown-icon {
    transform: rotate(180deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-left: 0.5rem;
    /* Indent sub items */
}

.nav-item-dropdown.active .submenu {
    max-height: 500px;
    /* Arbitrary large height */
    transition: max-height 0.3s ease-in;
}

.submenu .nav-link {
    padding: 0.5rem 1rem 0.5rem 3rem;
    /* Extra left padding */
    font-size: 0.9rem;
    position: relative;
}

.submenu .nav-link::before {
    content: '';
    position: absolute;
    left: 1.75rem;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cbd5e1;
    transform: translateY(-50%);
}

.submenu .nav-link.active::before {
    background: var(--primary-color);
}

/* Print Styling */
@media print {

    .sidebar,
    .top-bar,
    .btn-group,
    .dt-header,
    .dataTables_filter,
    .dataTables_length,
    .dataTables_paginate,
    .dataTables_info,
    #toast-container {
        display: none !important;
    }

    .app-container {
        display: block !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        background: white !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .glass-panel {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
        margin-bottom: 1rem !important;
    }

    /* Ensure text is black */
    .form-label,
    #jobDates,
    #jobLocation,
    #jobWarehouse,
    #jobDescription,
    h3,
    h2 {
        color: black !important;
    }

    /* Table adjustments */
    table.dataTable thead th {
        color: black !important;
        background: #f8f9fa !important;
        border-bottom: 2px solid black !important;
    }

    table.dataTable tbody td {
        color: black !important;
        border-bottom: 1px solid #ddd !important;
    }

    /* Hide URLs in href */
    a[href]:after {
        content: none !important;
    }
}

@media print {
    #printTitle {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        text-align: center;
        font-size: 1.5rem;
        font-weight: bold;
        background: white;
        padding: 10px 0;
        border-bottom: 2px solid black;
        margin-bottom: 20px;
        z-index: 9999;
    }

    .main-content {
        padding-top: 60px !important;
    }
}

/* --- Admin Panel Compatibility Styles --- */

/* Grid Extensions */
/* Grid Extensions - Removed duplicates */

/* Card Components */
/* Card Components - Removed duplicates */

/* Forms */
/* Forms - Removed duplicates */

/* Utilities */
/* Utilities - Removed duplicates */

/* Modal specific */
.close-modal {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
    padding: 0.5rem;
    border-radius: 50%;
    line-height: 1;
}

.close-modal:hover {
    background: #f1f5f9;
    color: var(--danger-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Helper for Grid Settings Toggle */
.grid-rel {
    transition: all 0.2s ease;
}

/* Manager Badge - Star Icon */
.manager-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fbbf24;
    color: #92400e;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 6px;
    font-size: 0.9em;
    vertical-align: middle;
}

/* QR Code Scanner Size Constraints */
#jobReaderContainer {
    max-width: 500px !important;
    margin: 0 auto !important;
}

#jobReader {
    width: 100% !important;
}

#jobReader video {
    max-width: 100% !important;
    max-height: 350px !important;
    object-fit: contain;
}

#reader {
    max-width: 400px !important;
    margin: 0 auto;
}

#reader__scan_region {
    max-height: 300px !important;
}

#reader video {
    max-width: 100% !important;
    max-height: 300px !important;
    object-fit: contain;
}

/* Return Modal QR Scanner Size Constraints */
#returnReaderContainer {
    max-width: 500px !important;
    margin: 0 auto !important;
}

#returnReader {
    width: 100% !important;
}

#returnReader video {
    max-width: 100% !important;
    max-height: 350px !important;
    object-fit: contain;
}

/* Custom Bootstrap-like Switch Implementation */
/* Custom Bootstrap-like Switch Implementation - Removed in favor of B5 */

/* ========================
   Reservation Split View
   ======================== */
.reservation-split-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1rem;
}

.reservation-panel,
.equipment-panel {
    background: #ffffff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Color coding for equipment rows */
.equipment-reserved {
    background: #f3f4f6 !important;
}

.equipment-reserved td {
    text-decoration: line-through;
    color: #9ca3af !important;
}

.equipment-overridden {
    background: #fef3c7 !important;
    cursor: help;
}

/* Responsive adjustments for split view */
@media (max-width: 1024px) {
    .reservation-split-container {
        grid-template-columns: 1fr;
    }
}

/* Company General Page Modal Overrides */
.company-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    /* High z-index as requested */
    align-items: center;
    justify-content: center;
    display: none;
    /* Controlled by JS */
}

.company-modal-content {
    width: 100%;
    max-width: 600px;
    margin: 2rem;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

/* User Dropdown & Profile Header */
.user-dropdown {
    position: relative;
    cursor: pointer;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.user-profile:hover {
    background: #f8fafc;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    width: max-content;
    background: white;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.user-dropdown:hover .dropdown-menu,
.user-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-info {
    white-space: nowrap;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: #f1f5f9;
}

.dropdown-item.text-danger {
    color: var(--danger-color);
}

.dropdown-item.text-danger:hover {
    background: #fef2f2;
}

.dropdown-divider {
    height: 1px;
    background: var(--surface-border);
    margin: 0.5rem 0;
}

/* Profile Page */
.profile-image-container {
    position: relative;
    display: inline-block;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    cursor: pointer;
    border: 4px solid white;
    box-shadow: var(--shadow-md);
}

.profile-camera-btn {
    position: absolute;
    bottom: 0px;
    right: 0px;
    background: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid white;
    transition: var(--transition-fast);
}

.profile-camera-btn:hover {
    transform: scale(1.1);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid var(--surface-border);
    margin-bottom: 1.5rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 0;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
}

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

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

.tab-btn.text-danger.active {
    color: var(--danger-color);
}

.tab-btn.text-danger.active::after {
    background: var(--danger-color);
}

.tab-pane {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-pane.active {
    display: block;
    opacity: 1;
}

/* Modal Correct Implementation */
/* Modal Implementation - Removed duplicates */

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

/* Modal Content - Removed duplicates */

.close-modal {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover,
.close-modal:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Cropper Modal Specifics */
.modal-content.large {
    max-width: 800px;
    width: 90%;
}

.crop-image-preview {
    max-width: 100%;
    max-height: 500px;
    display: block;
}

.cropper-face-guide {
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    /* Adjust based on preference */
    height: 80%;
    pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

/* Grid System & Layouts */
.profile-grid {
    display: grid;
    grid-template-columns: minmax(250px, 300px) 1fr;
    gap: 1.5rem;
    align-items: start;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Card / Panel Standardization */
.glass-panel {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--surface-border);
    padding: 1.5rem;
}



/* Alerts - Removed duplicates */

/* Timeline Component */
ul.timeline {
    list-style-type: none;
    position: relative;
    padding-left: 1.5rem;
    margin: 0;
}

ul.timeline:before {
    content: ' ';
    background: #e2e8f0;
    display: inline-block;
    position: absolute;
    left: 6px;
    top: 0;
    width: 2px;
    height: 100%;
    z-index: 1;
}

li.timeline-item {
    margin: 1.5rem 0;
    padding-left: 1rem;
    position: relative;
}

.timeline-dot {
    position: absolute;
    left: -7px;
    top: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--primary-color);
    z-index: 2;
}

.tl-dot-success {
    border-color: var(--success-color);
}

.tl-dot-warning {
    border-color: #f59e0b;
}

.tl-dot-danger {
    border-color: var(--danger-color);
}

.tl-dot-info {
    border-color: var(--primary-color);
}

.timeline-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.timeline-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

/* Utility Classes for Ise Gonder */
.card-mw-800 {
    max-width: 800px;
}

.icon-circle-lg {
    width: 80px;
    height: 80px;
}

.text-xs {
    font-size: 0.75rem !important;
}

.scanner-container {
    min-height: 300px;
    max-height: 40vh;
}

.vh-50 {
    height: 50vh;
}

.transition-width {
    transition: width 0.3s ease;
}

/* Modal Refactor Utilities */
.icon-circle-32 {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-panel-collapsed {
    width: 0;
    min-width: 0;
    overflow: hidden;
}

.font-size-sm-09 {
    font-size: 0.9em !important;
}

.mw-400 {
    max-width: 400px;
}

.badge-flex {
    display: flex;
    align-items: center;
    gap: 4px;
}

.fw-600 {
    font-weight: 600;
}

/* Select2 Bootstrap Theme Fixes - Brand Visibility */
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
    border-color: var(--primary-color) !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove {
    filter: brightness(0) invert(1);
    /* Make the x icon white */
}

/* Ensure single select text is visible */
.select2-container--bootstrap-5 .select2-selection--single {
    color: var(--text-main) !important;
}

.transition-300 {
    transition: all 0.3s ease-in-out;
}

.table-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    backdrop-filter: blur(1px);
    border-radius: var(--radius-lg);
}

/* Utility Classes for Fault Detail */
.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    background: rgba(248, 250, 252, 0.7);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.btn-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Timeline Custom Styles */
.timeline-dot-custom {
    width: 12px;
    height: 12px;
    left: -1.75rem !important;
    margin-top: 0.5rem;
    z-index: 2;
}

.timeline-item-custom {
    border-left: 2px solid #e9ecef;
    margin-left: 1rem;
    padding-left: 1.5rem;
}

.extra-small {
    font-size: 0.75rem;
}

.api-token-form {
    max-width: 600px;
}

/* Profile Page Styles */
.profile-image-container {
    width: 150px;
    height: 150px;
}

.profile-image-container img {
    cursor: pointer;
}

.profile-camera-btn {
    width: 40px;
    height: 40px;
    cursor: pointer;
    border: 3px solid white;
}

.crop-modal-container {
    max-height: 500px;
}

.crop-modal-image {
    max-width: 100%;
}

.swal-delete-confirm-input {
    max-width: 200px;
    font-size: 1.2rem;
}

/* Profile Loading Spinner */
#profileLoadingSpinner .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Ticket Chat Styles */
.message-bubble {
    position: relative;
    max-width: 80%;
    transition: transform var(--transition-fast);
}

.message-bubble:hover {
    transform: scale(1.01);
}

#chatBody::-webkit-scrollbar {
    width: 6px;
}

#chatBody::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.extra-small {
    font-size: 0.65rem;
}