:root {
    --omnigent-surface: #ffffff;
    --omnigent-surface-muted: #f8fafc;
    --omnigent-border: #e5e7eb;
    --omnigent-border-strong: #d5d9e2;
    --omnigent-text: #1f2937;
    --omnigent-muted: #6b7280;
    --omnigent-primary: #484d75;
    --omnigent-primary-dark: #383d63;
    --omnigent-sidebar-start: #484d75;
    --omnigent-sidebar-end: #224abe;
    --omnigent-primary-soft: #eef0f8;
    --omnigent-focus: rgba(72, 77, 117, 0.20);
    --omnigent-radius: 0.85rem;
    --omnigent-shadow: 0 16px 40px rgba(31, 41, 55, 0.08);
}

body {
    color: var(--omnigent-text);
    background: linear-gradient(180deg, #f6f8fc 0%, #eef2f7 100%);
}

#wrapper {
    min-height: 100vh;
}

#accordionSidebar,
.sidebar.bg-gradient-primary,
.bg-gradient-primary.sidebar {
    background-color: var(--omnigent-sidebar-start) !important;
    background-image: linear-gradient(180deg, var(--omnigent-sidebar-start) 10%, var(--omnigent-sidebar-end) 100%) !important;
    background-size: cover;
}

@media (min-width: 768px) {
    #wrapper {
        height: 100vh;
        overflow: hidden;
    }

    #accordionSidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
        scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
        scrollbar-width: thin;
    }

    #accordionSidebar:not(.toggled) {
        width: 16rem !important;
        flex: 0 0 16rem;
    }

    #accordionSidebar:not(.toggled) .sidebar-brand,
    #accordionSidebar:not(.toggled) .nav-item .nav-link {
        width: 16rem !important;
    }

    #accordionSidebar:not(.toggled) .nav-item .nav-link {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        white-space: normal;
    }

    #accordionSidebar:not(.toggled) .nav-item .nav-link span {
        min-width: 0;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    #accordionSidebar.toggled {
        flex: 0 0 6.5rem;
    }

    #content-wrapper {
        min-width: 0;
        height: 100vh;
        overflow: hidden;
    }

    #content {
        flex: 1 1 auto;
        min-height: 0;
        height: 100vh;
        max-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    #content .topbar {
        position: sticky;
        top: 0;
        z-index: 1020;
    }
}

.container-fluid {
    padding-top: 1.25rem;
}

.h1, .h2, .h3, h1, h2, h3,
.text-gray-800 {
    color: var(--omnigent-text) !important;
    letter-spacing: -0.02em;
}

.card,
form.user {
    border: 1px solid rgba(229, 231, 235, 0.85) !important;
    border-radius: var(--omnigent-radius) !important;
    box-shadow: var(--omnigent-shadow) !important;
    background: var(--omnigent-surface);
}

form.user {
    padding: 1.35rem;
}

.card-header {
    border-bottom: 1px solid var(--omnigent-border) !important;
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%) !important;
    border-top-left-radius: var(--omnigent-radius) !important;
    border-top-right-radius: var(--omnigent-radius) !important;
}

.card-body {
    padding: 1.35rem;
}

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

.form-group label,
label h6,
label p,
.custom-control-label {
    color: #374151;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.form-group label h6,
.form-group label p {
    margin-bottom: 0.35rem;
}

.form-control,
.custom-select,
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select,
input[type="file"].form-control,
textarea.form-control,
select.form-control {
    min-height: 2.85rem;
    border: 1px solid var(--omnigent-border-strong);
    border-radius: 0.7rem;
    background-color: #fff;
    color: var(--omnigent-text);
    box-shadow: 0 1px 2px rgba(31, 41, 55, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

textarea.form-control {
    min-height: 7.5rem;
}

.omnigent-auto-help {
    margin-top: 0.35rem;
    color: var(--omnigent-muted) !important;
    font-size: 0.82rem;
    line-height: 1.35;
}

.form-control::placeholder,
textarea.form-control::placeholder {
    color: #9aa3b2;
    opacity: 1;
}

.form-control:focus,
.custom-select:focus,
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus,
textarea.form-control:focus,
select.form-control:focus {
    border-color: var(--omnigent-primary);
    box-shadow: 0 0 0 0.2rem var(--omnigent-focus);
}

.form-control:disabled,
.form-control[readonly] {
    background-color: var(--omnigent-surface-muted);
    color: var(--omnigent-muted);
}

.custom-control {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.custom-control-input:checked ~ .custom-control-label::before {
    border-color: var(--omnigent-primary);
    background-color: var(--omnigent-primary);
}

.btn,
.generateButton,
.dataTables_wrapper .dataTables_paginate .paginate_button .page-link,
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.5rem;
    border-radius: 0.72rem !important;
    padding: 0.58rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.005em;
    white-space: nowrap;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn-primary,
.generateButton {
    color: #fff !important;
    border-color: var(--omnigent-primary) !important;
    background: linear-gradient(135deg, var(--omnigent-primary) 0%, var(--omnigent-primary-dark) 100%) !important;
    box-shadow: 0 8px 18px rgba(72, 77, 117, 0.22) !important;
    text-shadow: none !important;
}

.btn:hover,
.generateButton:hover,
.page-link:hover {
    transform: translateY(-1px);
}

.btn-primary:hover,
.btn-primary:focus,
.generateButton:hover,
.generateButton:focus {
    color: #fff !important;
    border-color: var(--omnigent-primary-dark) !important;
    background: linear-gradient(135deg, #535982 0%, var(--omnigent-primary-dark) 100%) !important;
    box-shadow: 0 10px 22px rgba(72, 77, 117, 0.28) !important;
}

.btn-secondary {
    color: #fff !important;
    border-color: #6b7280 !important;
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%) !important;
}

.btn-light,
.btn-outline-secondary {
    color: var(--omnigent-primary) !important;
    border-color: var(--omnigent-border-strong) !important;
    background: #fff !important;
}

.btn-light:hover,
.btn-outline-secondary:hover,
.btn-light:focus,
.btn-outline-secondary:focus {
    color: var(--omnigent-primary-dark) !important;
    border-color: var(--omnigent-primary) !important;
    background: var(--omnigent-primary-soft) !important;
}

.btn-user.btn-block {
    padding: 0.8rem 1rem;
}

.alert {
    border: 0;
    border-radius: 0.85rem;
    box-shadow: 0 10px 22px rgba(31, 41, 55, 0.08);
}

.table-responsive {
    border: 1px solid var(--omnigent-border);
    border-radius: var(--omnigent-radius);
    background: #fff;
    box-shadow: 0 8px 24px rgba(31, 41, 55, 0.05);
}

.table {
    margin-bottom: 0 !important;
    color: var(--omnigent-text);
    border-collapse: separate !important;
    border-spacing: 0;
}

.table-bordered,
.table-bordered th,
.table-bordered td {
    border-color: var(--omnigent-border) !important;
}

.table thead th {
    border-top: 0 !important;
    border-bottom: 1px solid var(--omnigent-border) !important;
    background: #f8fafc;
    color: #4b5563;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody td {
    vertical-align: middle;
    background: #fff;
}

.table tbody tr {
    transition: background-color 0.12s ease, box-shadow 0.12s ease;
}

.table-hover tbody tr:hover,
.table tbody tr:hover td {
    background-color: #f8faff;
}

.dataTables_wrapper .row:first-child,
.dataTables_wrapper .row:last-child {
    align-items: center;
    padding: 0.85rem 0.25rem;
}

.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_info {
    color: var(--omnigent-muted) !important;
    font-weight: 600;
}

.dataTables_wrapper .dataTables_filter input {
    margin-left: 0.5rem;
    min-height: 2.45rem;
}

.dataTables_wrapper .dataTables_length select {
    min-height: 2.45rem;
    padding-left: 0.7rem;
    padding-right: 1.65rem;
}

.page-item.active .page-link {
    border-color: var(--omnigent-primary);
    background-color: var(--omnigent-primary);
}

.omnigent-password-toggle {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.omnigent-password-toggle > input.form-control {
    height: auto;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.omnigent-password-toggle-button,
.omnigent-password-toggle-button.btn,
.omnigent-password-toggle > input.form-control + .omnigent-password-toggle-button {
    min-height: 2.85rem;
    min-width: 3.25rem;
    padding: 0 0.9rem !important;
    border: 1px solid var(--omnigent-border-strong) !important;
    border-left: 0 !important;
    border-radius: 0 0.7rem 0.7rem 0 !important;
    background: #fff !important;
    color: var(--omnigent-primary) !important;
    box-shadow: 0 1px 2px rgba(31, 41, 55, 0.04) !important;
    transform: none !important;
}

.omnigent-password-toggle-button:hover,
.omnigent-password-toggle-button:focus {
    background: var(--omnigent-primary-soft) !important;
    color: var(--omnigent-primary-dark) !important;
    outline: none;
}

.omnigent-password-toggle-button svg {
    width: 1.15rem;
    height: 1.15rem;
}

#agentAvatar {
    border-radius: 1rem;
    border: 1px solid var(--omnigent-border);
    box-shadow: 0 12px 28px rgba(31, 41, 55, 0.10);
    object-fit: cover;
}

#avatarImages {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

#avatarImages img {
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    border: 2px solid transparent;
    padding: 0.15rem;
    background: #fff;
    box-shadow: 0 6px 14px rgba(31, 41, 55, 0.10);
    transition: transform 0.12s ease, border-color 0.12s ease;
}

#avatarImages img:hover {
    border-color: var(--omnigent-primary);
    transform: translateY(-2px);
}

#deleteAvatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    margin-left: 0.65rem;
    border-radius: 999px;
    color: #dc2626;
    background: #fff1f2;
    text-decoration: none;
}

.modal-content {
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.20);
}

.modal-header,
.modal-footer {
    border-color: var(--omnigent-border);
}




.omnigent-header-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 2.35rem;
}

.omnigent-header-avatar .img-profile,
.omnigent-header-avatar-initials {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    border: 2px solid #fff;
    box-shadow: 0 6px 16px rgba(31, 41, 55, 0.12);
}

.omnigent-header-avatar .img-profile {
    object-fit: cover;
}

.omnigent-header-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--omnigent-primary) 0%, var(--omnigent-primary-dark) 100%);
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.config-form,
.locale-form {
    display: flex;
    flex-direction: column;
}

.config-scroll-area,
.locale-scroll-area {
    overflow: visible;
    padding-right: 0;
    margin-right: 0;
}

.config-scroll-area .form-group:last-child,
.config-scroll-area .custom-control:last-child,
.locale-scroll-area .form-group:last-child {
    margin-bottom: 0.25rem;
}

.config-form #saveConfig,
.locale-form #saveLocale {
    flex: 0 0 auto;
    margin-top: 1rem;
}

.omnigent-builder-page {
    row-gap: 1.25rem;
}

.omnigent-design-panel {
    height: 100%;
    padding: 1.35rem !important;
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: var(--omnigent-radius);
    background: var(--omnigent-surface);
    box-shadow: var(--omnigent-shadow);
}

.omnigent-settings-panel {
    position: relative;
}

.omnigent-design-panel > h4,
.omnigent-design-panel > h6:first-child,
.omnigent-design-panel > .omnigent-preview-title {
    margin-bottom: 0.65rem;
    color: var(--omnigent-text);
    font-weight: 800;
    letter-spacing: -0.015em;
}

.omnigent-design-panel > h6,
.omnigent-design-panel > p {
    color: var(--omnigent-muted);
}

.omnigent-fieldset {
    margin: 0.75rem 0 1rem;
    padding: 1rem !important;
    border: 1px solid var(--omnigent-border);
    border-radius: 0.9rem;
    background: linear-gradient(180deg, #fff 0%, #fbfcff 100%);
}

.omnigent-design-panel hr {
    margin: 1.15rem 0;
    border-top: 1px solid var(--omnigent-border);
}

.omnigent-image-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(4.25rem, 1fr));
    gap: 0.55rem;
    max-height: 14rem;
    overflow-y: auto;
    padding: 0.55rem;
    border: 1px dashed var(--omnigent-border-strong);
    border-radius: 0.85rem;
    background: var(--omnigent-surface-muted);
    scrollbar-color: var(--omnigent-primary) #eef0f8;
    scrollbar-width: thin;
}

.omnigent-image-picker img {
    width: 100% !important;
    height: 3.75rem;
    object-fit: cover;
    border: 2px solid #fff;
    border-radius: 0.75rem;
    box-shadow: 0 6px 16px rgba(31, 41, 55, 0.10);
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.omnigent-image-picker img:hover {
    border-color: var(--omnigent-primary);
    box-shadow: 0 10px 22px rgba(72, 77, 117, 0.18);
    transform: translateY(-2px);
}

.omnigent-style-preview {
    max-width: 100%;
    min-height: 6rem;
    object-fit: cover;
    border: 1px solid var(--omnigent-border);
    border-radius: 0.9rem;
    background: #fff;
    box-shadow: 0 10px 24px rgba(31, 41, 55, 0.09);
}

#body-bg-delete,
#video-element-back-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    margin-left: 0.65rem;
    border-radius: 999px;
    color: #dc2626;
    background: #fff1f2;
    text-decoration: none;
}

.omnigent-action-row {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem 0 0.25rem;
    margin-top: 1rem;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, var(--omnigent-surface) 35%);
}

.omnigent-code-panel textarea,
#css_content {
    min-height: 28rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.88rem;
    line-height: 1.55;
}

.omnigent-preview-panel {
    position: sticky;
    top: 1rem;
}

.omnigent-preview-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.omnigent-preview-title::before {
    display: inline-block;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    background: var(--omnigent-primary);
    content: '';
}

#videoPreview {
    display: block;
    width: 100%;
    min-height: 18rem;
    border: 1px solid var(--omnigent-border);
    border-radius: 1rem;
    background: #111827;
    box-shadow: 0 18px 44px rgba(17, 24, 39, 0.16);
}

.omnigent-tool-card {
    position: relative;
    margin-bottom: 0.85rem;
}

.wrapper .text-right {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    margin: 0.75rem 0 1rem;
}

.wrapper .clone,
.wrapper .remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.45rem;
    height: 2.45rem;
    border-radius: 999px;
    font-size: 1rem !important;
    color: #fff !important;
    background: var(--omnigent-primary);
    box-shadow: 0 8px 18px rgba(72, 77, 117, 0.20);
}

.wrapper .remove {
    background: #6b7280;
}

.clr-field,
.clr-field input {
    width: 100%;
}


#avatar_container_free,
#avatar_container_paid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

#avatar_container_free > div,
#avatar_container_paid > div {
    float: none !important;
    width: 9rem !important;
    height: auto !important;
    min-height: 12.5rem;
    padding: 0.55rem !important;
    border: 1px solid var(--omnigent-border);
    border-radius: 0.9rem;
    background: #fff;
    box-shadow: 0 8px 18px rgba(31, 41, 55, 0.08);
}

#avatar_container_free img,
#avatar_container_paid img {
    height: 8.25rem !important;
    border-radius: 0.75rem;
    background: var(--omnigent-surface-muted);
}

#avatar_container_free label,
#avatar_container_paid label {
    display: flex;
    gap: 0.35rem;
    align-items: flex-start;
    margin: 0;
    color: var(--omnigent-text);
    font-weight: 700;
    line-height: 1.25;
}

@media (max-width: 991.98px) {
    .omnigent-preview-panel {
        position: static;
    }

    .omnigent-action-row {
        position: static;
    }
}

@media (max-width: 767.98px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .card-body,
    form.user {
        padding: 1rem;
    }

    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length {
        text-align: left !important;
    }
}

/* Mobile-first dashboard refinements */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

.card,
.table-responsive,
.omnigent-design-panel,
form.user {
    min-width: 0;
}

.table-responsive,
.dataTables_wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.btn,
.generateButton {
    white-space: normal;
}

@media (max-width: 991.98px) {
    #content .topbar,
    .topbar {
        height: auto !important;
        min-height: 4.375rem;
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0.85rem 1rem;
    }

    #headerTitle {
        flex: 1 1 100%;
        margin: 0;
        font-size: clamp(1.45rem, 4vw, 2rem);
        line-height: 1.15;
    }

    .topbar .navbar-nav.ml-auto {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.5rem;
        margin-left: 0 !important;
    }

    .topbar .navbar-nav .nav-item {
        display: flex;
        align-items: center;
    }

    .topbar .btn {
        margin-top: 0 !important;
        margin-left: 0 !important;
    }

    .card-header,
    .omnigent-action-row,
    .dataTables_wrapper .row:first-child,
    .dataTables_wrapper .row:last-child {
        gap: 0.75rem;
    }

    .card-header,
    .dataTables_wrapper .row:first-child,
    .dataTables_wrapper .row:last-child {
        flex-wrap: wrap;
    }
}

@media (max-width: 767.98px) {
    #wrapper {
        display: block;
        min-height: 100vh;
        overflow: visible;
    }

    #accordionSidebar {
        position: sticky;
        top: 0;
        z-index: 1030;
        display: flex;
        flex-direction: row !important;
        align-items: center;
        width: 100% !important;
        min-height: auto;
        max-width: 100%;
        padding: 0.5rem;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    #accordionSidebar .sidebar-brand {
        flex: 0 0 auto;
        width: auto !important;
        min-width: 8.5rem;
        height: 3rem;
        margin: 0 0.5rem 0 0;
        padding: 0 0.65rem;
    }

    #accordionSidebar .sidebar-brand #responsivelogo,
    #accordionSidebar .sidebar-brand [style*="background-image"] {
        max-width: 8rem;
        height: 2.75rem !important;
        background-size: contain !important;
    }

    #accordionSidebar .sidebar-divider,
    #accordionSidebar .sidebar-heading,
    #accordionSidebar #sidebarToggle,
    #accordionSidebar .text-center.d-none.d-md-inline {
        display: none !important;
    }

    #accordionSidebar .nav-item {
        flex: 0 0 auto;
        margin: 0 0.25rem 0 0 !important;
    }

    #accordionSidebar .nav-item .nav-link,
    #accordionSidebar:not(.toggled) .nav-item .nav-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        width: auto !important;
        min-width: 5.75rem;
        min-height: 2.75rem;
        padding: 0.55rem 0.7rem;
        border-radius: 0.8rem;
        text-align: center;
        white-space: nowrap;
    }

    #accordionSidebar .nav-item .nav-link span {
        display: inline;
        font-size: 0.78rem;
        white-space: nowrap;
    }

    #accordionSidebar .nav-item .collapse,
    #accordionSidebar .nav-item .collapsing {
        position: fixed;
        right: 0.75rem;
        left: 0.75rem;
        top: 4.25rem;
        z-index: 1060;
        margin: 0 !important;
    }

    #accordionSidebar .nav-item .collapse .collapse-inner,
    #accordionSidebar .nav-item .collapsing .collapse-inner {
        max-height: calc(100vh - 5.5rem);
        overflow-y: auto;
        border-radius: 1rem;
        box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
    }

    #content-wrapper {
        width: 100%;
        min-width: 0;
        overflow: visible;
    }

    #content {
        min-height: auto;
        overflow: visible;
    }

    #content .topbar,
    .topbar {
        position: sticky;
        top: 0;
        z-index: 1020;
        margin-bottom: 1rem !important;
        border-radius: 0 0 1rem 1rem;
    }

    .container-fluid {
        padding-top: 0.75rem;
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .h1, .h2, .h3, h1, h2, h3 {
        font-size: clamp(1.55rem, 7vw, 2rem);
        line-height: 1.15;
    }

    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }

    .row > [class*="col-"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        margin-bottom: 1rem;
    }

    .card,
    form.user,
    .omnigent-design-panel {
        border-radius: 1rem !important;
    }

    .card-body,
    form.user,
    .omnigent-design-panel {
        padding: 1rem !important;
    }

    .form-control,
    .custom-select,
    input[type="file"].form-control,
    textarea.form-control,
    select.form-control {
        min-height: 3rem;
        font-size: 16px;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        width: 100%;
        text-align: left !important;
    }

    .dataTables_wrapper .dataTables_filter input,
    .dataTables_wrapper .dataTables_length select {
        width: 100%;
        margin: 0.35rem 0 0;
    }

    .dataTables_wrapper .dataTables_paginate .pagination {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.35rem;
    }

    .table {
        min-width: 42rem;
        font-size: 0.9rem;
    }

    .omnigent-action-row {
        flex-direction: column;
        align-items: stretch;
    }

    .omnigent-action-row .btn,
    .card-header .btn,
    .topbar .btn {
        width: 100%;
    }

    .omnigent-image-picker {
        grid-template-columns: repeat(auto-fill, minmax(4rem, 1fr));
    }

    #avatarImages,
    #avatar_container_free,
    #avatar_container_paid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
    }

    #avatar_container_free > div,
    #avatar_container_paid > div {
        width: 100% !important;
        min-height: 0;
    }

    #videoPreview {
        min-height: 12rem;
    }
}

@media (max-width: 575.98px) {
    #headerTitle {
        font-size: 1.4rem;
    }

    .topbar .navbar-nav.ml-auto {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar .navbar-nav .nav-item,
    .topbar .navbar-nav .nav-link,
    .topbar .dropdown.no-arrow,
    .topbar .dropdown-toggle {
        width: 100%;
    }

    .topbar #userDropdown {
        justify-content: space-between;
        padding-left: 0;
        padding-right: 0;
    }

    .btn,
    .generateButton,
    .btn-user.btn-block {
        width: 100%;
    }

    .card-header {
        padding: 1rem;
    }

    .table {
        min-width: 38rem;
    }

    #accordionSidebar .nav-item .nav-link,
    #accordionSidebar:not(.toggled) .nav-item .nav-link {
        min-width: 5rem;
        padding-left: 0.6rem;
        padding-right: 0.6rem;
    }
}
/* Professional table polish: calm, compact, and readable across dashboards */
.card .table-responsive,
.omnigent-table-shell,
.dataTables_wrapper {
    border-color: rgba(78, 90, 133, 0.12) !important;
}

.card .table-responsive {
    overflow: hidden;
}

.table-responsive .dataTables_wrapper {
    border: 0 !important;
    box-shadow: none !important;
}

.dataTables_wrapper .row:first-child {
    background: #fff;
    border-bottom: 1px solid rgba(78, 90, 133, 0.1);
    margin-left: 0;
    margin-right: 0;
    padding: 1rem 1.1rem !important;
}

.dataTables_wrapper .row:last-child {
    background: #fbfcff;
    border-top: 1px solid rgba(78, 90, 133, 0.1);
    margin-left: 0;
    margin-right: 0;
    padding: 0.9rem 1.1rem !important;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_info {
    color: #6d7588;
    font-size: 0.92rem;
    font-weight: 700;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    background-color: #fff;
    border: 1px solid rgba(78, 90, 133, 0.18) !important;
    border-radius: 0.85rem !important;
    color: #2f3747;
    font-weight: 650;
    min-height: 2.75rem;
}

.dataTables_wrapper .dataTables_filter input {
    min-width: min(18rem, 100%);
    padding-left: 1rem;
}

.table,
table.dataTable {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    font-size: 0.94rem;
}

.table thead th,
table.dataTable thead th,
table.dataTable thead td {
    background: #f6f7fb !important;
    border-bottom: 1px solid rgba(78, 90, 133, 0.14) !important;
    color: #4e5a85 !important;
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.075em;
    padding: 1rem 1.05rem !important;
    text-transform: uppercase;
    vertical-align: middle;
}

.table tbody td,
table.dataTable tbody td {
    border-color: rgba(78, 90, 133, 0.1) !important;
    color: #2f3747;
    line-height: 1.45;
    padding: 1rem 1.05rem !important;
    vertical-align: middle;
}

.table tbody tr:nth-child(even) td,
table.dataTable tbody tr:nth-child(even) td {
    background-color: #fcfdff;
}

.table tbody tr:hover td,
table.dataTable.hover tbody tr:hover,
table.dataTable.display tbody tr:hover,
table.dataTable tbody tr:hover td {
    background-color: #f7f8fc !important;
}

.table-bordered,
.table-bordered th,
.table-bordered td,
table.dataTable.no-footer {
    border-color: rgba(78, 90, 133, 0.1) !important;
}

.table td a,
table.dataTable td a {
    color: #4e5a85;
    font-weight: 750;
    text-decoration: none;
}

.table td a:hover,
table.dataTable td a:hover {
    color: #333a5f;
    text-decoration: underline;
    text-underline-offset: 0.18rem;
}

.table td .btn,
table.dataTable td .btn {
    min-height: 2.2rem;
    padding: 0.42rem 0.75rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button:active {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0.15rem !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button .page-link,
.dataTables_wrapper .pagination .page-link {
    background: #fff !important;
    border: 1px solid rgba(78, 90, 133, 0.14) !important;
    box-shadow: none !important;
    color: #4e5a85 !important;
    min-height: 2.35rem;
    min-width: 2.35rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.active .page-link,
.dataTables_wrapper .pagination .page-item.active .page-link {
    background: #4e5a85 !important;
    border-color: #4e5a85 !important;
    color: #fff !important;
}

.dataTables_wrapper .dataTables_empty {
    background: #fbfcff !important;
    color: #7b8296 !important;
    font-weight: 750;
    padding: 2rem !important;
    text-align: center;
}

@media (max-width: 767.98px) {
    .card .table-responsive {
        border-radius: 0.95rem;
    }

    .dataTables_wrapper .row:first-child,
    .dataTables_wrapper .row:last-child {
        gap: 0.75rem;
        padding: 0.85rem !important;
    }

    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: left !important;
        width: 100%;
    }

    .dataTables_wrapper .dataTables_filter input,
    .dataTables_wrapper .dataTables_length select {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .table thead th,
    table.dataTable thead th,
    .table tbody td,
    table.dataTable tbody td {
        padding: 0.85rem !important;
    }
}

/* Executive dashboard layout */
.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.6rem;
    border-radius: 1.25rem;
    background: radial-gradient(circle at top right, rgba(78, 115, 223, 0.22), transparent 34%), linear-gradient(135deg, #ffffff 0%, #eef2ff 100%);
    border: 1px solid rgba(213, 217, 226, 0.9);
    box-shadow: var(--omnigent-shadow);
}

.dashboard-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--omnigent-primary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.dashboard-title {
    margin: 0.15rem 0 0.35rem;
    color: var(--omnigent-text);
    font-size: clamp(1.75rem, 3vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.dashboard-subtitle {
    max-width: 48rem;
    margin: 0;
    color: var(--omnigent-muted);
    font-size: 1rem;
}

.dashboard-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

.dashboard-stat-card,
.dashboard-action-card {
    position: relative;
    display: block;
    height: 100%;
    min-height: 9.6rem;
    padding: 1.35rem;
    overflow: hidden;
    color: var(--omnigent-text);
    background: #fff;
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 1rem;
    box-shadow: 0 14px 34px rgba(31, 41, 55, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dashboard-stat-card:hover,
.dashboard-action-card:hover {
    color: var(--omnigent-text);
    text-decoration: none;
    transform: translateY(-3px);
    border-color: rgba(72, 77, 117, 0.28);
    box-shadow: 0 20px 44px rgba(31, 41, 55, 0.12);
}

.dashboard-stat-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 0.35rem;
    background: var(--stat-accent, var(--omnigent-primary));
}

.dashboard-stat-card span,
.dashboard-metric-list span,
.dashboard-action-card span {
    display: block;
    color: var(--omnigent-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-stat-card strong {
    display: block;
    margin: 0.35rem 0;
    color: var(--omnigent-text);
    font-size: 2.2rem;
    line-height: 1;
}

.dashboard-stat-card small,
.dashboard-action-card small,
.dashboard-metric-list small {
    color: var(--omnigent-muted);
    font-weight: 600;
}

.dashboard-stat-card > i {
    position: absolute;
    right: 1.15rem;
    bottom: 1rem;
    color: rgba(72, 77, 117, 0.12);
    font-size: 3.15rem;
}

.accent-primary { --stat-accent: #4e73df; }
.accent-info { --stat-accent: #36b9cc; }
.accent-warning { --stat-accent: #f6c23e; }
.accent-success { --stat-accent: #1cc88a; }

.dashboard-panel .card-body {
    padding: 1.45rem;
}

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

.dashboard-panel-header h2 {
    margin: 0.15rem 0 0;
    color: var(--omnigent-text);
    font-size: 1.2rem;
    font-weight: 800;
}

.dashboard-panel-header a {
    font-size: 0.85rem;
    font-weight: 800;
}

.dashboard-metric-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-metric-list > div {
    padding: 1rem;
    border: 1px solid var(--omnigent-border);
    border-radius: 0.9rem;
    background: var(--omnigent-surface-muted);
}

.dashboard-metric-list strong {
    display: block;
    margin: 0.25rem 0;
    color: var(--omnigent-text);
    font-size: 1.7rem;
}

.dashboard-health-list {
    display: grid;
    gap: 0.8rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.dashboard-health-list li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--omnigent-border);
}

.dashboard-health-list li:last-child {
    border-bottom: 0;
}

.dashboard-health-list span {
    color: var(--omnigent-muted);
    font-weight: 700;
}

.dashboard-health-list strong {
    color: var(--omnigent-text);
    font-weight: 800;
    text-align: right;
}

.dashboard-action-card {
    min-height: 8.2rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.dashboard-action-card i {
    display: inline-flex;
    width: 2.65rem;
    height: 2.65rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.9rem;
    color: #fff;
    background: linear-gradient(135deg, var(--omnigent-primary), #4e73df);
    border-radius: 0.85rem;
}

.dashboard-action-card span {
    color: var(--omnigent-text);
    font-size: 0.98rem;
    letter-spacing: 0;
    text-transform: none;
}

@media (max-width: 991.98px) {
    .dashboard-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-hero-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 575.98px) {
    .dashboard-metric-list {
        grid-template-columns: 1fr;
    }
}
