/* Velzon-style layout - matching themesbrand.com/velzon */
:root {
    --vz-sidebar-width: 250px;
    --vz-sidebar-width-sm: 70px;
    --vz-header-height: 70px;
    /* Official Velzon dark sidebar: primary #405189 */
    --vz-sidebar-bg: #405189;
    --vz-sidebar-border: #405189;
    --vz-sidebar-menu-item-color: #abb9e8;
    --vz-sidebar-menu-item-hover-bg: rgba(255, 255, 255, 0.08);
    --vz-sidebar-menu-item-active-bg: rgba(255, 255, 255, 0.12);
    --vz-sidebar-menu-item-active-color: #fff;
    --vz-sidebar-title-color: #838fb9;
    --vz-primary: #405189;
    --vz-primary-rgb: 64, 81, 137;
    --vz-body-bg: #f6f6f6;
    --vz-body-color: #495057;
    --vz-body-line-height: 1.6;
    --vz-heading-line-height: 1.4;
}

body {
    font-family: "Poppins", sans-serif;
    font-size: 0.9375rem;
    line-height: var(--vz-body-line-height);
    color: var(--vz-body-color);
    background-color: var(--vz-body-bg);
    min-height: 100vh;
}

#layout-wrapper {
    min-height: 100vh;
}

.layout-width {
    max-width: 100%;
    padding: 0 1.5rem;
}

#page-topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--vz-sidebar-width);
    z-index: 1002;
    background: #fff;
    box-shadow: 0 1px 2px rgba(56,65,74,.15);
    transition: left .3s ease;
    height: var(--vz-header-height);
}

.navbar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--vz-header-height);
    width: 100%;
}

.vertical-menu-btn {
    padding: 0 15px;
}

.app-search .form-control {
    padding-left: 40px;
    border-radius: 30px;
    background-color: var(--vz-body-bg);
    border: none;
}

.app-search .search-widget-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #878a99;
    font-size: 1.1rem;
}

#sidebar-menu {
    width: var(--vz-sidebar-width);
    z-index: 1001;
    background: var(--vz-sidebar-bg);
    border-right: 1px solid var(--vz-sidebar-border);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transition: all .3s ease;
    overflow-y: auto;
}

.app-menu .navbar-brand-box {
    padding: 0 1.5rem;
    height: var(--vz-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--vz-sidebar-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-menu .logo-lg {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.4;
}

.app-menu .logo-sm {
    display: none;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.app-menu .sidebar-brand-logo {
    display: block;
    height: auto;
    width: auto;
    object-fit: contain;
}

.app-menu .sidebar-brand-logo-lg {
    max-height: 2.25rem;
    max-width: 150px;
}

.app-menu .sidebar-brand-logo-sm {
    max-height: 2rem;
    max-width: 2.25rem;
}

.app-menu .navbar-nav {
    padding: 0.75rem 0;
    list-style: none;
    margin: 0;
}

.app-menu .navbar-nav .nav-item {
    margin: 0;
    list-style: none;
}

.app-menu .menu-link {
    display: flex;
    align-items: center;
    padding: 0.625rem 1.5rem;
    color: var(--vz-sidebar-menu-item-color);
    text-decoration: none;
    transition: color 0.15s ease, background 0.15s ease;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
}

.app-menu .menu-link i {
    font-size: 1.2rem;
    margin-right: 0.875rem;
    min-width: 1.5rem;
    text-align: center;
    opacity: 0.9;
}

.app-menu .menu-link span {
    line-height: 1.5;
    vertical-align: middle;
}

.app-menu .menu-link:hover {
    color: #fff;
    background: var(--vz-sidebar-menu-item-hover-bg);
}

.app-menu .menu-link:hover i {
    opacity: 1;
}

.app-menu .menu-link.active {
    color: var(--vz-sidebar-menu-item-active-color);
    background: var(--vz-sidebar-menu-item-active-bg);
    border-left: 3px solid rgba(255, 255, 255, 0.5);
}

.app-menu .menu-link.active i {
    opacity: 1;
}

/* Sub-menu (e.g. Reports children) */
.app-menu .sub-menu {
    list-style: none;
    padding: 0 0 0 0.5rem;
    margin: 0;
}
.app-menu .sub-menu .nav-item {
    margin: 0;
}
.app-menu .sub-menu .nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem 0.5rem 2.75rem;
    color: var(--vz-sidebar-menu-item-color);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.15s ease, background 0.15s ease;
}
.app-menu .sub-menu .nav-link:hover {
    color: #fff;
    background: var(--vz-sidebar-menu-item-hover-bg);
}
.app-menu .sub-menu .nav-link.active {
    color: var(--vz-sidebar-menu-item-active-color);
    background: var(--vz-sidebar-menu-item-active-bg);
}
.app-menu .sub-menu .nav-link i {
    margin-right: 0.5rem;
    font-size: 1rem;
}

/* Compact sidebar button in brand box */
.app-menu .btn-vertical-sm-compact-mode {
    color: rgba(255, 255, 255, 0.7);
    background: transparent;
    border: none;
    font-size: 1.25rem;
    padding: 0.25rem;
    line-height: 1;
}

.app-menu .btn-vertical-sm-compact-mode:hover {
    color: #fff;
}

.main-content {
    margin-left: var(--vz-sidebar-width);
    margin-top: var(--vz-header-height);
    padding: 1.5rem;
    min-height: calc(100vh - var(--vz-header-height));
    transition: margin-left .3s ease;
    line-height: var(--vz-body-line-height);
}

.page-content {
    padding: 1.5rem 0;
}

.footer {
    bottom: 0;
    padding: 1rem 1.5rem;
    background: #fff;
    box-shadow: 0 -1px 2px rgba(56, 65, 74, .08);
    font-size: 0.875rem;
    color: #878a99;
    line-height: 1.5;
}

/* Breadcrumb & page title - Velzon alignment (forms-elements style) */
.page-title-box {
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.page-title-box .page-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    line-height: var(--vz-heading-line-height);
    color: #262626;
}

/* Breadcrumb - Velzon style */
.breadcrumb {
    background: transparent !important;
    padding: 0;
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    flex-wrap: nowrap;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    color: #878a99;
}

.breadcrumb-item a {
    color: #878a99;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--vz-primary);
}

.breadcrumb-item.active {
    color: #262626;
    font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    padding: 0 0.4rem;
    color: #adb5bd;
    font-weight: 600;
    font-size: 1rem;
}

.page-title-right .breadcrumb {
    display: flex;
    align-items: center;
}

/* Cards - Velzon style */
.card {
    box-shadow: 0 1px 2px rgba(56, 65, 74, .15);
    border: none;
    margin-bottom: 1.5rem;
    border-radius: 0.375rem;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
    font-weight: 600;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    line-height: 1.5;
}

.card-body {
    line-height: var(--vz-body-line-height);
    padding: 1.5rem;
}

/* ----- Velzon Forms / Basic Elements style (forms-elements.html) ----- */

/* Page title area - match Velzon layout */
.page-title-box {
    margin-bottom: 1.5rem;
}

/* Form labels - Velzon Basic Elements */
.form-label {
    font-weight: 500;
    color: #262626;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Form controls - Velzon look */
.form-control,
.form-select {
    font-size: 0.9375rem;
    line-height: 1.5;
    padding: 0.47rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    color: #262626;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--vz-primary);
    box-shadow: 0 0 0 0.15rem rgba(var(--vz-primary-rgb), 0.25);
    outline: 0;
}

.form-control::placeholder {
    color: #878a99;
}

.form-control-plaintext {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #262626;
}

/* Form text / help text */
.form-text {
    font-size: 0.8125rem;
    color: #878a99;
    margin-top: 0.25rem;
}

/* Form icon (Velzon Basic Elements - input with icon left/right) */
.form-icon {
    position: relative;
}

.form-icon .form-control-icon {
    padding-left: 2.5rem;
}

.form-icon.right .form-control-icon {
    padding-left: 0.75rem;
    padding-right: 2.5rem;
}

.form-icon > i,
.form-icon .ri-mail-unread-line,
.form-icon [class^="ri-"] {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0.75rem;
    color: #878a99;
    font-size: 1.1rem;
    pointer-events: none;
}

.form-icon.right > i,
.form-icon.right .ri-mail-unread-line,
.form-icon.right [class^="ri-"] {
    left: auto;
    right: 0.75rem;
}

/* Input sizing - Velzon */
.form-control-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    border-radius: 0.2rem;
}

.form-control-lg {
    padding: 0.6rem 1rem;
    font-size: 1.0625rem;
    border-radius: 0.3rem;
}

/* Border dashed input */
.border-dashed {
    border-style: dashed !important;
}

/* Color picker - full width */
.form-control-color {
    height: 2.5rem;
    padding: 0.25rem;
}

/* Input group - Velzon style */
.input-group-text {
    font-size: 0.9375rem;
    padding: 0.47rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    background-color: #f6f6f6;
    color: #495057;
}

.input-group .form-control,
.input-group .form-select {
    border-radius: 0;
}

.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child) {
    border-left: 0;
}

.input-group > .input-group-text:first-child + .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > .form-control:last-child:not(:first-child) {
    border-top-right-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
}

.input-group > .input-group-text:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Form section heading inside cards (e.g. "Input Example") */
.card .card-title,
.card h5.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Form groups spacing - match Velzon layout */
.form-group,
.mb-3 {
    margin-bottom: 1rem;
}

/* Checkbox & radio in forms */
.form-check-input {
    margin-top: 0.2em;
}

.form-check-label {
    margin-left: 0.35em;
    font-weight: 500;
    color: #262626;
}

/* Sidebar scrollbar container - no extra horizontal padding that breaks alignment */
#sidebar-menu #scrollbar {
    padding: 0;
}

#sidebar-menu #scrollbar .container-fluid {
    padding-left: 0;
    padding-right: 0;
    max-width: 100%;
}

/* ----- Velzon Datatables style (tables-datatables.html) ----- */
.table-responsive {
    border-radius: 0.25rem;
    overflow: hidden;
}

.table {
    line-height: 1.5;
    margin-bottom: 0;
}

.table thead th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #878a99;
    letter-spacing: 0.02em;
    background-color: #f6f6f6;
    border-bottom: 1px solid #eff2f7;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.table tbody td {
    vertical-align: middle;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eff2f7;
    color: #262626;
}

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

.table-bordered {
    border: 1px solid #eff2f7;
}

.table-bordered thead th {
    border: 1px solid #eff2f7;
}

.table-bordered tbody td {
    border: 1px solid #eff2f7;
}

/* Table action buttons - Velzon style */
.table .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
}

/* Dropdown for export buttons */
.table-export-buttons .dropdown-menu {
    font-size: 0.9375rem;
}

.table-export-buttons .dropdown-item i {
    margin-right: 0.5rem;
}

/* Buttons */
.btn-primary {
    background-color: var(--vz-primary);
    border-color: var(--vz-primary);
}

.btn-primary:hover {
    background-color: #364574;
    border-color: #364574;
}

.btn-ghost-secondary {
    background: transparent;
    border: none;
    color: #495057;
}

.btn-ghost-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #262626;
}

/* Sidebar collapsed state */
[data-sidebar-size="sm"] #sidebar-menu {
    width: var(--vz-sidebar-width-sm);
}

[data-sidebar-size="sm"] .app-menu .logo-lg {
    display: none;
}

[data-sidebar-size="sm"] .app-menu .logo-sm {
    display: block;
}

[data-sidebar-size="sm"] .app-menu .menu-link span {
    display: none;
}

[data-sidebar-size="sm"] .app-menu .menu-link i {
    margin-right: 0;
}

[data-sidebar-size="sm"] #page-topbar {
    left: var(--vz-sidebar-width-sm);
}

[data-sidebar-size="sm"] .main-content {
    margin-left: var(--vz-sidebar-width-sm);
}

/* Button soft variants */
.btn-soft-primary { background-color: rgba(var(--vz-primary-rgb), 0.15); color: var(--vz-primary); border-color: transparent; }
.btn-soft-primary:hover { background-color: var(--vz-primary); color: #fff; }
.btn-soft-secondary { background-color: rgba(108, 117, 125, 0.15); color: #6c757d; border-color: transparent; }
.btn-soft-secondary:hover { background-color: #6c757d; color: #fff; }
.btn-soft-info { background-color: rgba(13, 202, 240, 0.15); color: #0dcaf0; border-color: transparent; }
.btn-soft-info:hover { background-color: #0dcaf0; color: #fff; }
.btn-soft-success { background-color: rgba(25, 135, 84, 0.15); color: #198754; border-color: transparent; }
.btn-soft-success:hover { background-color: #198754; color: #fff; }
.btn-soft-danger { background-color: rgba(220, 53, 69, 0.15); color: #dc3545; border-color: transparent; }
.btn-soft-danger:hover { background-color: #dc3545; color: #fff; }
.bg-primary-subtle { background-color: rgba(var(--vz-primary-rgb), 0.15); }
.bg-success-subtle { background-color: rgba(25, 135, 84, 0.15); }
.bg-info-subtle { background-color: rgba(13, 202, 240, 0.15); }
.text-primary { color: var(--vz-primary) !important; }
.text-success { color: #198754 !important; }
.text-info { color: #0dcaf0 !important; }

/* Overlay - always hidden by default, never block clicks when hidden */
.vertical-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: opacity 0.2s ease;
}

/* Responsive - mobile sidebar toggle */
@media (max-width: 991.98px) {
    #page-topbar {
        left: 0;
    }
    .main-content {
        margin-left: 0;
    }
    #sidebar-menu {
        transform: translateX(-100%);
        z-index: 1002;
    }
    #sidebar-menu.show {
        transform: translateX(0);
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    }
    .vertical-overlay.show {
        display: block;
    }
}
