:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --secondary-color: #6c757d;
    --bg-body: #f0f2f5;
    --bg-white: #ffffff;
    --text-main: #343a40;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --sidebar-width: 260px;
    --sidebar-bg: #ffffff;
    --sidebar-text: #495057;
    --sidebar-active-bg: #e7f1ff;
    --sidebar-active-text: #007bff;
    --header-height: 60px;
    --page-padding: 20px;
    --page-padding-mobile: 15px;
    --content-max-width: 1680px;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-body);
    margin: 0;
    padding: 0;
    color: var(--text-main);
    line-height: 1.6;
}

html,
body {
    min-height: 100%;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-main);
    margin-top: 0;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(11, 95, 255, 0.22), transparent 32%),
        radial-gradient(circle at bottom right, rgba(0, 182, 122, 0.18), transparent 28%),
        linear-gradient(135deg, #edf3ff 0%, #dfe9f5 100%);
    padding: 14px;
}

.login-shell {
    width: min(460px, 100%);
    display: block;
}

.login-panel {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 400px;
    border-top: 5px solid var(--primary-color);
}

.login-box-modern {
    width: 100%;
    max-width: 100%;
    border-top: none;
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    padding: 24px 20px 20px;
    background: rgba(255,255,255,0.96);
}

.login-language-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 18px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header-left {
    text-align: left;
    margin-bottom: 24px;
}

.login-header h2 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 1.8rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.login-input-wrap .form-control {
    padding-left: 42px;
}

.login-language-switcher {
    margin-top: 0;
    font-size: 0.8rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #f8f9fa;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 123, 255, 0.25);
}

.btn-block {
    display: inline-flex;
    width: 100%;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: #fff;
}

.btn-info {
    background-color: #17a2b8;
    color: #fff;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 0.85rem;
    border-radius: 6px;
}

.app-scroll-top-btn {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    color: #fff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.22);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, background-color 0.2s ease;
    z-index: 1040;
}

.app-scroll-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.app-scroll-top-btn:hover {
    background: #1d4ed8;
    color: #fff;
}

.app-sortable-table__header {
    white-space: nowrap;
}

.app-sortable-table__button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.4rem;
    border: 0;
    background: transparent;
    padding: 0;
    color: inherit;
    font: inherit;
    font-weight: 600;
    text-align: left;
}

.app-sortable-table__button:hover {
    color: var(--primary-color);
}

.app-sortable-table__icon {
    flex: 0 0 auto;
}

.app-sortable-table__header.is-sorted .app-sortable-table__button {
    color: var(--primary-color);
}

@media (max-width: 767.98px) {
    .app-scroll-top-btn {
        right: 1rem;
        bottom: 1rem;
    }
}

.global-upload-progress-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(6px);
}

.global-upload-progress-overlay[hidden] {
    display: none !important;
}

.global-upload-progress-card {
    width: min(520px, 100%);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    border: 1px solid rgba(148, 163, 184, 0.18);
    padding: 22px;
}

.global-upload-progress-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.global-upload-progress-subtitle {
    margin-top: 4px;
    color: #64748b;
    font-size: 0.9rem;
}

.global-upload-progress-track {
    margin-top: 16px;
    height: 14px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.global-upload-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0b5fff 0%, #00b67a 100%);
    transition: width 0.18s ease;
}

.global-upload-progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    font-size: 0.82rem;
    color: #475569;
    flex-wrap: wrap;
}

.global-upload-progress-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.global-upload-progress-stat {
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.16);
    padding: 10px 12px;
}

.global-upload-progress-stat-label {
    display: block;
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 700;
}

.global-upload-progress-stat-value {
    display: block;
    margin-top: 4px;
    font-size: 0.88rem;
    color: #0f172a;
    font-weight: 700;
}

.app-toast {
    overflow: hidden;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
}

.app-toast .toast-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.app-toast-success {
    border-left: 4px solid #16a34a;
}

.app-toast-success .toast-header i {
    color: #16a34a;
}

.app-floating-save {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1080;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.94);
    color: #fff;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(12px);
    max-width: min(92vw, 380px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.app-floating-save.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.app-floating-save-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.app-floating-save-title {
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1.15;
}

.app-floating-save-text {
    font-size: 0.72rem;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.78);
}

.app-floating-save .btn {
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .global-upload-progress-card {
        padding: 18px;
    }

    .global-upload-progress-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .app-floating-save {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
    }
}

.stock-management-filter-card {
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 22px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.stock-management-filter-card .card-body {
    padding: 18px;
}

.stock-management-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.stock-management-filter-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(150px, 0.7fr));
    gap: 10px;
    align-items: end;
}

.stock-management-filter-field .form-label {
    margin-bottom: 6px;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stock-management-filter-field .form-control,
.stock-management-filter-field .form-select {
    min-height: 40px;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    font-size: 0.92rem;
    border-radius: 14px;
    border-color: rgba(148, 163, 184, 0.24);
    box-shadow: none;
}

.stock-management-filter-input-wrap {
    position: relative;
}

.stock-management-filter-input-wrap .form-control {
    padding-left: 2.4rem;
}

.stock-management-filter-input-wrap i {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.stock-management-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.stock-management-filter-actions .btn {
    min-height: 40px;
    border-radius: 14px;
    padding-left: 1rem;
    padding-right: 1rem;
}

.stock-management-item-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.stock-management-item-photo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 auto;
}

.stock-management-item-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.stock-management-item-photo span {
    font-weight: 800;
    font-size: 0.75rem;
}

.stock-management-item-copy {
    min-width: 0;
}

.stock-management-item-name {
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stock-management-item-meta {
    color: #64748b;
    font-size: 0.82rem;
}

.stock-management-item-meta-stack {
    display: grid;
    gap: 0.2rem;
}

.stock-management-badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.stock-management-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    padding: 0.38rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
}

.stock-management-pill i {
    font-size: 0.74rem;
}

.stock-management-quantity-stack {
    display: grid;
    gap: 0.45rem;
}

.stock-management-detail-list {
    display: grid;
    gap: 0.75rem;
}

.stock-management-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 1));
}

.stock-management-detail-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    flex: 0 0 auto;
}

.stock-management-detail-copy {
    min-width: 0;
}

.stock-management-detail-label {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.stock-management-detail-value {
    color: #0f172a;
    font-weight: 600;
    word-break: break-word;
}

.stock-management-modal-empty {
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: 16px;
    padding: 1rem;
    color: #64748b;
    background: rgba(248, 250, 252, 0.9);
}

.stock-management-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.stock-management-forecast-list {
    display: grid;
    gap: 0.75rem;
}

.stock-management-forecast-card {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    padding: 0.9rem;
    background: #fff;
}

@media (max-width: 1199px) {
    .stock-management-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .stock-management-filter-grid {
        grid-template-columns: 1fr;
    }

    .stock-management-filter-actions {
        justify-content: stretch;
    }

    .stock-management-filter-actions .btn {
        flex: 1 1 auto;
    }
}

.login-footer {
    margin-top: 20px;
    text-align: center;
}

.login-footer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* QR Code login panel */
.login-qr-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.login-qr-divider::before,
.login-qr-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}
.qr-login-scan-btn {
    background: #f8f9fa;
    color: #374151;
    border: 1.5px solid #d1d5db;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 0.95rem;
    width: 100%;
}
.qr-login-scan-btn:hover {
    background: #f1f5f9;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: none;
    box-shadow: none;
}
.qr-login-panel-header {
    margin-bottom: 14px;
    text-align: left;
}
.qr-login-panel-header h3 {
    font-size: 1.05rem;
    color: var(--primary-color);
    margin: 0 0 4px;
}
.qr-login-panel-header p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}
.qr-video-wrap {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #111;
    aspect-ratio: 1 / 1;
    max-height: 270px;
}
#qr-login-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.qr-scan-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.qr-scan-area {
    width: 58%;
    aspect-ratio: 1 / 1;
    border: 2.5px solid rgba(255,255,255,0.85);
    border-radius: 14px;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.38);
}
.qr-login-status {
    margin: 10px 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    min-height: 1.4em;
}
.qr-login-back-btn {
    background: #f8f9fa;
    color: #374151;
    border: 1.5px solid #d1d5db;
    gap: 6px;
    margin-top: 10px;
    font-size: 0.92rem;
}
.qr-login-back-btn:hover {
    background: #e9ecef;
    transform: none;
    box-shadow: none;
}

/* Camera switch button (inside video overlay) */
.qr-switch-cam-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    border: 1.5px solid rgba(255,255,255,0.45);
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    padding: 0;
    z-index: 10;
}
.qr-switch-cam-btn:hover {
    background: rgba(0,0,0,0.75);
}

/* QR result modal */
.qr-result-modal {
    text-align: center;
    padding: 8px 0;
}
.qr-result-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.qr-result-photo-wrap {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #22c55e;
    flex-shrink: 0;
}
.qr-result-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.qr-result-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 2px 0 0;
}
.qr-result-msg {
    font-size: 0.88rem;
    margin: 0;
}
.qr-result-msg--ok  { color: #16a34a; }
.qr-result-msg--err { color: #dc2626; }

.alert {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}
.alert-danger { background-color: #fff5f5; color: #c53030; border-color: #feb2b2; }
.alert-success { background-color: #f0fff4; color: #276749; border-color: #9ae6b4; }

.bug-report-fab {
    position: fixed;
    right: 24px;
    bottom: calc(var(--kimori-chat-bottom-clearance, 24px) - 72px);
    z-index: 1080;
    border-radius: 999px;
    padding: 0.85rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #fff;
    border: 0;
    box-shadow: 0 18px 40px rgba(234, 88, 12, 0.32);
}

.bug-report-fab i {
    font-size: 1rem;
}

.bug-report-fab:hover,
.bug-report-fab:focus {
    color: #fff;
    transform: translateY(-1px);
}

/* Mostrar rótulo apenas no hover (desktop) */
.bug-report-fab span {
    display: none;
}
.bug-report-fab:hover span {
    display: inline;
}

.bug-report-modal {
    border: 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}

.bug-report-modal-eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c2410c;
    margin-bottom: 0.35rem;
}

.bug-report-step-indicator {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.bug-report-step-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid rgba(251, 146, 60, 0.24);
}

.bug-report-step-pill.is-active {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #fff;
    border-color: transparent;
}

.bug-report-type-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.bug-report-type-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 132px;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: linear-gradient(180deg, #fff, #f8fafc);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.bug-report-type-card input,
.bug-report-choice-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.bug-report-type-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.bug-report-type-card.is-active {
    border-color: rgba(249, 115, 22, 0.52);
    box-shadow: 0 16px 36px rgba(249, 115, 22, 0.16);
    background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
}

.bug-report-type-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(249, 115, 22, 0.12);
    color: #c2410c;
    font-size: 1rem;
}

.bug-report-type-card strong {
    color: #0f172a;
}

.bug-report-type-card small {
    color: #64748b;
    line-height: 1.45;
}

.bug-report-choice-pill {
    position: relative;
}

.bug-report-choice-pill.is-active {
    background: #fff7ed;
    color: #c2410c;
    border-color: rgba(249, 115, 22, 0.42);
}

.bug-report-image-preview {
    margin-top: 0.9rem;
    padding: 0.9rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, #fff, #f8fafc);
}

.bug-report-image-preview-frame {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: 14px;
    background: #e2e8f0;
    max-height: 240px;
}

.bug-report-image-preview-frame img {
    display: block;
    max-width: 100%;
    max-height: 240px;
    object-fit: contain;
}

.bug-report-image-preview-actions {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.bug-report-image-preview-note {
    color: #64748b;
    font-size: 0.82rem;
}

.bug-report-image-editor-modal {
    border: 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}

.bug-report-image-editor-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 1rem;
}

.bug-report-image-editor-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1rem;
    border-radius: 18px;
    background: #fff7ed;
    border: 1px solid rgba(251, 146, 60, 0.18);
}

.bug-report-image-editor-toolbar-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.bug-report-image-editor-toolbar-actions .btn {
    flex: 1 1 120px;
}

.bug-report-image-editor-stage-wrap {
    min-width: 0;
}

.bug-report-image-editor-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 420px;
    padding: 1rem;
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fafc, #eef2f7);
    border: 1px solid rgba(148, 163, 184, 0.18);
    overflow: auto;
    position: relative;
}

.bug-report-image-editor-stage canvas {
    display: block;
    max-width: 100%;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
    touch-action: none;
    cursor: crosshair;
}

.bug-report-image-editor-stage::after {
    content: '';
    position: absolute;
    inset: 16px;
    border-radius: 14px;
    border: 1px dashed rgba(249, 115, 22, 0.18);
    pointer-events: none;
}

.bug-report-toast-wrap {
    position: fixed;
    right: 24px;
    bottom: 92px;
    z-index: 1085;
    width: min(360px, calc(100vw - 32px));
}

.bug-report-toast {
    margin: 0;
}

.global-notice-toast-wrap {
    position: fixed;
    right: 24px;
    .bug-report-type-grid {
        grid-template-columns: 1fr;
    }
    top: 88px;
    z-index: 1090;
    width: min(420px, calc(100vw - 32px));
}

.global-notice-toast {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: start;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.global-notice-toast.is-hidden {
    opacity: 0;
    transform: translateY(-8px);
}

.global-notice-toast-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.global-notice-toast-copy {
    display: grid;
    gap: 4px;
}

.global-notice-toast-copy strong {
    color: #0f172a;
    font-size: 0.96rem;
    line-height: 1.2;
}

.global-notice-toast-copy span {
    color: #475569;
    font-size: 0.88rem;
    line-height: 1.45;
}

.global-notice-toast-close {
    border: 0;
    background: transparent;
    color: #64748b;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.global-notice-toast-close:hover {
    background: rgba(148, 163, 184, 0.12);
    color: #0f172a;
}

.global-notice-toast.is-success {
    border-color: rgba(34, 197, 94, 0.22);
}

.global-notice-toast.is-success .global-notice-toast-icon {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.global-notice-toast.is-error {
    border-color: rgba(239, 68, 68, 0.22);
}

.global-notice-toast.is-error .global-notice-toast-icon {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.global-notice-toast.is-warning {
    border-color: rgba(245, 158, 11, 0.24);
}

.global-notice-toast.is-warning .global-notice-toast-icon {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.global-notice-toast.is-info {
    border-color: rgba(59, 130, 246, 0.22);
}

.global-notice-toast.is-info .global-notice-toast-icon {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

@media (max-width: 768px) {
    .bug-report-fab {
        right: 16px;
        bottom: calc(var(--kimori-chat-bottom-clearance, 16px) - 64px);
        padding: 0.8rem 0.9rem;
    }

    .bug-report-fab span {
        display: none;
    }

    .bug-report-image-editor-layout {
        grid-template-columns: 1fr;
    }

    .bug-report-image-editor-stage {
        min-height: 280px;
        padding: 0.6rem;
    }

    .bug-report-toast-wrap {
        right: 16px;
        bottom: 76px;
        width: calc(100vw - 32px);
    }

    .global-notice-toast-wrap {
        right: 16px;
        top: 72px;
        width: calc(100vw - 32px);
    }
}

@media print {
    .global-notice-toast-wrap {
        display: none !important;
    }
}

.profile-page {
    padding-bottom: 24px;
}

.profile-hero {
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(0, 123, 255, 0.16), transparent 30%),
        linear-gradient(145deg, #ffffff 0%, #f7fbff 100%);
}

.profile-hero .card-body {
    padding: 28px;
}

.profile-eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.profile-hero-title {
    font-size: clamp(1.9rem, 3.3vw, 2.8rem);
    margin-bottom: 8px;
}

.profile-hero-subtitle {
    color: var(--text-muted);
    max-width: 64ch;
    margin: 0;
}

.profile-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.95fr);
    gap: 22px;
    align-items: center;
}

.profile-identity-block {
    display: flex;
    align-items: center;
    gap: 18px;
}

.profile-avatar-large {
    width: 88px;
    height: 88px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #0b5fff, #00a8c8);
    color: #fff;
    font-size: 1.8rem;
    font-weight: 800;
    box-shadow: 0 18px 30px rgba(11, 95, 255, 0.22);
}

.profile-chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 600;
}

.profile-chip-primary {
    background: rgba(0, 123, 255, 0.12);
    color: var(--primary-color);
}

.profile-contact-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    color: var(--text-muted);
    min-width: 0;
}

.profile-contact-line i {
    flex: 0 0 16px;
    width: 16px;
    color: var(--primary-color);
}

.profile-contact-line span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.profile-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.profile-summary-card,
.profile-module-card,
.profile-history-summary,
.profile-side-card,
.profile-qr-card,
.profile-section-card {
    border-radius: 20px;
}

.profile-summary-card {
    padding: 16px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.profile-summary-card span,
.profile-side-list span,
.profile-history-summary span,
.profile-qr-meta span {
    display: block;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.profile-summary-card strong,
.profile-side-list strong,
.profile-history-summary strong,
.profile-qr-meta strong {
    display: block;
    color: var(--text-main);
    font-size: 1rem;
    margin-top: 4px;
}

.profile-summary-card small {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
}

.profile-section-title {
    font-size: 1.2rem;
    font-weight: 800;
}

.profile-qr-card .card-body,
.profile-side-card .card-body,
.profile-section-card .card-body {
    padding: 24px;
}

.profile-qr-canvas {
    min-height: 230px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: linear-gradient(145deg, #f8fbff, #eef6ff);
    border: 1px dashed rgba(0, 123, 255, 0.22);
}

.profile-qr-canvas canvas {
    max-width: 100%;
    height: auto;
}

.profile-qr-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.profile-empty-state {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border-radius: 18px;
    background: #f8fafc;
    color: var(--text-muted);
}

.profile-empty-state i {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.profile-side-list {
    display: grid;
    gap: 14px;
}

.profile-history-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    background: #f8fbff;
    padding: 18px;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.profile-module-card {
    height: 100%;
    padding: 18px;
    background: linear-gradient(145deg, #fff, #f8fbff);
    border: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
}

.profile-module-card strong {
    font-size: 1rem;
    margin-bottom: 6px;
}

.profile-module-card span {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.dashboard-page {
    padding-bottom: 26px;
}

.dashboard-hero {
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(0, 123, 255, 0.16), transparent 30%),
        linear-gradient(145deg, #ffffff 0%, #f7fbff 100%);
}

.dashboard-hero .card-body {
    padding: 28px;
}

.dashboard-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.9fr);
    gap: 18px;
    align-items: center;
}

.dashboard-title {
    font-size: clamp(1.9rem, 3.2vw, 2.7rem);
    margin: 0 0 8px;
}

.dashboard-subtitle {
    margin: 0;
    color: var(--text-muted);
    max-width: 70ch;
}

.dashboard-chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.dashboard-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 700;
}

.dashboard-status-panel {
    display: grid;
    gap: 12px;
}

.dashboard-status-card {
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.92);
    padding: 16px 18px;
}

.dashboard-status-card span,
.dashboard-kpi-card span,
.dashboard-link-card small {
    display: block;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.dashboard-status-card strong,
.dashboard-kpi-card strong {
    display: block;
    margin-top: 4px;
    color: var(--text-main);
    font-size: 1.1rem;
}

.dashboard-status-card small {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
}

.dashboard-section-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.dashboard-kpi-card,
.dashboard-link-card,
.dashboard-shortcut-card {
    height: 100%;
    border-radius: 20px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.dashboard-kpi-card .card-body,
.dashboard-link-card .card-body,
.dashboard-shortcut-card .card-body {
    padding: 18px;
}

.dashboard-kpi-card {
    position: relative;
    background: linear-gradient(145deg, #ffffff 0%, #f9fbff 100%);
}

.dashboard-kpi-card::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--dashboard-accent, var(--primary-color));
}

.dashboard-kpi-card strong {
    font-size: clamp(1.35rem, 3vw, 2rem);
}

.dashboard-kpi-card p {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.dashboard-kpi-card.is-primary { --dashboard-accent: #0d6efd; }
.dashboard-kpi-card.is-success { --dashboard-accent: #198754; }
.dashboard-kpi-card.is-warning { --dashboard-accent: #f59f00; }
.dashboard-kpi-card.is-danger { --dashboard-accent: #dc3545; }
.dashboard-kpi-card.is-info { --dashboard-accent: #0dcaf0; }
.dashboard-kpi-card.is-purple { --dashboard-accent: #6f42c1; }
.dashboard-kpi-card.is-slate { --dashboard-accent: #64748b; }
.dashboard-kpi-card.is-teal { --dashboard-accent: #14b8a6; }

.dashboard-link-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fbff 100%);
}

.dashboard-link-card .card-body {
    display: flex;
    gap: 12px;
    align-items: center;
}

.dashboard-link-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 110, 253, 0.08);
    color: var(--primary-color);
    flex: 0 0 42px;
}

.dashboard-link-label {
    font-weight: 800;
    color: var(--text-main);
    overflow-wrap: anywhere;
}

.dashboard-shortcut-card {
    background: var(--shortcut-bg, linear-gradient(145deg, #fff, #f7fbff));
    color: var(--shortcut-color, var(--text-main));
}

.dashboard-shortcut-card .card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dashboard-shortcut-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.22);
    font-size: 1.1rem;
}

.dashboard-shortcut-card h3 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    color: inherit;
}

.dashboard-shortcut-card p {
    margin: 0;
    color: inherit;
    opacity: 0.88;
    font-size: 0.92rem;
}

.dashboard-shortcut-primary {
    --shortcut-bg: linear-gradient(145deg, #0d6efd, #4f8cff);
    --shortcut-color: #ffffff;
}

.dashboard-shortcut-success {
    --shortcut-bg: linear-gradient(145deg, #198754, #34b372);
    --shortcut-color: #ffffff;
}

.dashboard-shortcut-warning {
    --shortcut-bg: linear-gradient(145deg, #f59f00, #ffbd45);
    --shortcut-color: #ffffff;
}

.dashboard-shortcut-slate {
    --shortcut-bg: linear-gradient(145deg, #ffffff, #eef4fb);
    --shortcut-color: var(--text-main);
}

@media (max-width: 768px) {
    .login-page {
        padding: 14px;
    }

    .login-box-modern,
    .profile-hero .card-body,
    .profile-qr-card .card-body,
    .profile-side-card .card-body,
    .profile-section-card .card-body {
        padding: 20px;
    }

    .login-footer-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-page .page-actions,
    .dashboard-page .page-actions,
    .page-toolbar .page-actions,
    .cadastros-page-actions,
    .notifications-page-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .profile-page .page-actions .btn,
    .dashboard-page .page-actions .btn,
    .page-toolbar .page-actions .btn,
    .cadastros-page-actions .btn,
    .notifications-page-actions .btn {
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
        white-space: normal;
    }

    .profile-summary-grid,
    .profile-history-summary,
    .dashboard-status-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-hero .card-body {
        padding: 22px;
    }

    .dashboard-link-card .card-body {
        padding: 16px;
    }
}

@media (max-width: 992px) {
    .dashboard-hero-grid,
    .profile-summary-grid,
    .profile-history-summary,
    .profile-identity-block {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-hero-grid,
    .profile-hero-grid {
        grid-template-columns: 1fr;
    }

    .profile-identity-block {
        gap: 14px;
    }
}

@media (max-width: 576px) {
    .profile-summary-grid,
    .profile-history-summary {
        grid-template-columns: 1fr;
    }

    .dashboard-kpi-card .card-body,
    .dashboard-shortcut-card .card-body,
    .dashboard-link-card .card-body {
        padding: 16px;
    }

    .dashboard-status-panel {
        grid-template-columns: 1fr;
    }
}

/* Dashboard Layout */
.wrapper {
    display: flex;
    width: 100%;
    max-width: 100%;
    align-items: stretch;
    min-height: 100vh;
    position: relative;
    overflow-x: clip;
}

body.sidebar-no-scroll {
    overflow: hidden;
}

#page-content-wrapper {
    flex: 1 1 auto;
    width: auto;
    max-width: 100%;
    min-width: 0; /* Prevent flex overflow issues */
    display: flex;
    flex-direction: column;
    overflow-x: clip;
}

/* Sidebar */
#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    transition: margin-left 0.28s ease, transform 0.28s ease, box-shadow 0.28s ease;
    box-shadow: 2px 0 5px rgba(0,0,0,0.03);
    z-index: 1000;
    border-right: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
}

.wrapper.sidebar-collapsed #sidebar {
    margin-left: calc(var(--sidebar-width) * -1);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
    z-index: 1040;
}

.wrapper.sidebar-mobile-open .sidebar-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.sidebar-header {
    padding: 0 20px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    flex: 0 0 var(--header-height);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    text-decoration: none;
}

.sidebar-brand-logo {
    display: block;
    max-width: 100%;
    max-height: 38px;
    object-fit: contain;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar-brand:hover h3 {
    color: var(--primary-hover);
}

#sidebar ul.components {
    padding: 15px 10px;
    margin: 0;
    list-style: none;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

#sidebar ul li {
    margin-bottom: 5px;
}

#sidebar ul li a {
    padding: 12px 15px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

#sidebar ul li a i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

#sidebar ul li a:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
}

#sidebar ul li a:hover i {
    color: var(--primary-color);
}

#sidebar ul li.active > a {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
}

#sidebar ul li.active > a i {
    color: var(--sidebar-active-text);
}

#sidebar ul li.open > a.has-submenu {
    background-color: #f8f9fa;
    color: var(--text-main);
}

#sidebar ul li.open > a.has-submenu i,
#sidebar ul li.open > a.has-submenu .submenu-caret {
    color: var(--text-muted);
}

/* Footer */
.app-footer {
    margin-top: auto;
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-muted);
    font-size: 0.75rem;
    flex-shrink: 0;
    width: 100%;
}

.app-footer > small {
    display: block;
    padding: 0 var(--page-padding);
    max-width: var(--content-max-width);
    margin: 0 auto;
}

/* Utilities override for Bootstrap */
/* Removed .card and .row overrides to let Bootstrap handle grid */

/* Top Navbar */
.navbar {
    height: var(--header-height);
    padding: 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 900;
}

.container-fluid-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 var(--page-padding);
    gap: 16px;
}

.topbar-start {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
}

.topbar-end {
    margin-left: auto;
    min-width: 0;
}

.btn-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background-color 0.2s, transform 0.2s;
}

.btn-toggle:hover {
    color: var(--primary-color);
    background-color: #f8f9fa;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.topbar-search-form {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 1 clamp(280px, 28vw, 400px);
    width: min(400px, 100%);
}

.topbar-search-icon {
    position: absolute;
    left: 14px;
    color: #64748b;
    pointer-events: none;
}

.topbar-search-input {
    width: 100%;
    min-height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.94);
    padding-left: 40px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.topbar-search-suggestions {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 1025;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.14);
    overflow: hidden;
}

.topbar-search-suggestions-list {
    display: flex;
    flex-direction: column;
    padding: 8px;
    gap: 6px;
}

.topbar-search-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-main);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.topbar-search-item:hover {
    background: #f8fafc;
    color: var(--text-main);
    transform: translateY(-1px);
}

.topbar-search-item-icon,
.search-group-icon,
.search-result-icon,
.search-top-match-icon,
.search-shortcut-icon {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #eff6ff, #f8fafc);
    color: #1d4ed8;
    flex-shrink: 0;
}

.topbar-search-item-copy,
.search-result-copy,
.search-top-match-copy,
.search-shortcut-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.topbar-search-item-copy strong,
.search-result-copy strong,
.search-top-match-copy strong,
.search-shortcut-copy strong {
    color: var(--text-main);
    font-size: 0.95rem;
}

.topbar-search-item-copy span,
.topbar-search-item-copy .topbar-search-item-meta,
.search-result-copy small,
.search-result-copy span,
.search-top-match-copy small,
.search-top-match-copy span,
.search-shortcut-copy small {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.topbar-search-suggestions-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    text-decoration: none;
    color: #1d4ed8;
    font-weight: 700;
}

.topbar-search-suggestions-footer:hover {
    background: #f8fafc;
    color: #1d4ed8;
}

.topbar-search-empty {
    padding: 14px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.topbar-clock-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 182px;
    padding: 8px 14px;
    margin-right: 10px;
    border-radius: 14px;
    border: 1px solid #ff8a00;
    background: linear-gradient(135deg, #ff8a00, #ff6a00);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(255, 122, 0, 0.22);
    animation: topbarClockPulse 1.4s ease-in-out infinite;
}

.topbar-clock-cta:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(255, 122, 0, 0.28);
}

.topbar-clock-cta-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    font-size: 1rem;
    flex: 0 0 auto;
}

.topbar-clock-cta-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.topbar-clock-cta-title {
    font-size: 0.84rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.topbar-clock-cta-subtitle {
    font-size: 0.76rem;
    opacity: 0.92;
    margin-top: 2px;
}

@keyframes topbarClockPulse {
    0%, 100% {
        box-shadow: 0 10px 24px rgba(255, 122, 0, 0.20);
        filter: saturate(1);
    }
    50% {
        box-shadow: 0 16px 34px rgba(255, 122, 0, 0.34);
        filter: saturate(1.08);
    }
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 14px;
}

#sidebar .menu-section {
    padding: 12px 15px;
    margin-top: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

#sidebar ul.submenu {
    list-style: none;
    padding: 6px 0 10px 0;
    margin: 0 0 8px 0;
}

#sidebar ul.submenu li a {
    padding: 10px 15px 10px 34px;
    font-size: 0.9rem;
    border-radius: 8px;
}

#sidebar ul.submenu li a i {
    margin-right: 10px;
    width: 18px;
    font-size: 1rem;
}

#sidebar ul.submenu li a.active {
    background: var(--sidebar-active-bg);
    color: var(--primary-color);
}

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: var(--sidebar-active-bg);
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
}

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.user-meta-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
}

.user-meta-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.lang-selector {
    margin-right: 12px;
}

.lang-selector select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-main);
}

.user-name {
    font-weight: 600;
    color: var(--text-main);
    margin-right: 15px;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
}

.user-name i {
    margin-right: 8px;
    font-size: 1.2rem;
    color: var(--text-muted);
}

.btn-logout {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.1rem;
    padding: 5px;
    transition: color 0.2s;
}

.btn-logout:hover {
    color: #dc3545;
}

/* Main Content Area */
.content {
    padding: var(--page-padding);
    flex: 1;
    background-color: var(--bg-body);
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
    overflow-x: clip;
}

.content > .container,
.content > .container-fluid,
.content > .row,
.content .card,
.content .standard-section-card,
.content .standard-filter-card,
.content .ops-table-wrap,
.content .table-responsive,
.content .table-scroll-wrapper {
    max-width: 100%;
    min-width: 0;
}

.content h1 {
    font-size: 1.75rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.content p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Cards */
/* Let Bootstrap handle card styles mostly */
.card {
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* kpi-label and kpi-value are custom, keep them */
.kpi-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 900;
    margin: 6px 0 0 0;
    color: var(--text-main);
}

.page-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.page-toolbar-copy {
    min-width: 0;
    flex: 1 1 320px;
}

.page-toolbar-copy h1,
.page-toolbar-copy .h1,
.page-toolbar-copy .h2,
.page-toolbar-copy .h3 {
    margin-bottom: 0.25rem;
}

.page-toolbar-copy .text-muted,
.page-toolbar-copy .muted,
.page-toolbar-copy p {
    margin-bottom: 0;
}

.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.page-toolbar .page-actions,
.profile-page .page-actions,
.dashboard-page .page-actions,
.cadastros-page-actions,
.notifications-page-actions {
    justify-content: flex-end;
}

.page-actions .btn,
.cadastros-page-actions .btn,
.notifications-page-actions .btn {
    --page-action-icon-bg: rgba(15, 23, 42, 0.08);
    --page-action-icon-color: currentColor;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 40px;
    padding: 0.55rem 0.9rem;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.page-actions .btn i:first-child,
.cadastros-page-actions .btn i:first-child,
.notifications-page-actions .btn i:first-child {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin: 0;
    background: var(--page-action-icon-bg);
    color: var(--page-action-icon-color);
    font-size: 0.82rem;
}

.page-actions .btn .badge,
.page-actions .btn .page-action-badge,
.cadastros-page-actions .btn .badge,
.notifications-page-actions .btn .badge {
    border-radius: 999px;
    padding: 0.22rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
}

.page-actions .btn-primary,
.page-actions .btn-success,
.page-actions .btn-danger,
.page-actions .btn-secondary,
.page-actions .btn-info,
.cadastros-page-actions .btn-primary,
.cadastros-page-actions .btn-success,
.cadastros-page-actions .btn-danger,
.cadastros-page-actions .btn-secondary,
.notifications-page-actions .btn-primary,
.notifications-page-actions .btn-secondary {
    --page-action-icon-bg: rgba(255, 255, 255, 0.18);
    --page-action-icon-color: inherit;
}

.page-actions .btn-outline-primary,
.page-actions .btn-outline-secondary,
.page-actions .btn-outline-dark,
.page-actions .btn-outline-danger,
.page-actions .btn-light,
.page-actions .border,
.cadastros-page-actions .btn-outline-primary,
.cadastros-page-actions .btn-outline-secondary,
.cadastros-page-actions .btn-light,
.notifications-page-actions .btn-outline-secondary {
    --page-action-icon-bg: rgba(15, 23, 42, 0.06);
    --page-action-icon-color: currentColor;
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(148, 163, 184, 0.22);
}

.page-actions .btn:hover,
.cadastros-page-actions .btn:hover,
.notifications-page-actions .btn:hover {
    transform: translateY(-1px);
}

.page-actions.shortcut-toolbar {
    align-items: center;
    justify-content: flex-end;
}

.page-actions .shortcut-action-btn {
    white-space: nowrap;
}

.global-shortcuts-card.is-relocated {
    display: none;
}

.calendar-side-tabs .nav-link {
    min-width: 48px;
    text-align: center;
    font-size: 1rem;
    line-height: 1;
}

.table-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.table-toolbar .form-control {
    max-width: 320px;
}

.table-toolbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.standard-filter-card {
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
    padding: 16px 18px;
}

.standard-filter-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(140px, 1fr));
    gap: 10px;
}

.standard-filter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: end;
}

.standard-section-card {
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.empty-link-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.12);
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
}

.ops-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ops-hero {
    padding: 24px 26px;
    border-radius: 24px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
}

.ops-hero h1 {
    margin: 0;
    font-size: clamp(1.45rem, 2.2vw, 1.95rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.ops-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
    gap: 18px;
    align-items: start;
}

.ops-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.ops-subtitle {
    margin-top: 10px;
    color: var(--text-muted);
    max-width: 72ch;
}

.ops-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.ops-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.ops-stat {
    padding: 16px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.ops-stat span {
    display: block;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.ops-stat strong {
    display: block;
    font-size: 1.85rem;
    line-height: 1;
}

.ops-hero-neutral {
    background: linear-gradient(140deg, #ffffff 0%, #f4f8ff 55%, #f8fafc 100%);
}

.ops-kicker-neutral {
    background: rgba(51, 65, 85, 0.1);
    color: #334155;
}

.ops-table-wrap {
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.ops-table-wrap table {
    margin: 0;
}

.ops-table-wrap > .table-responsive,
.ops-table-wrap.table-responsive,
.ops-table-wrap > .table-scroll-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.ops-table-wrap > .table-responsive > table,
.ops-table-wrap.table-responsive > table,
.ops-table-wrap > .table-scroll-wrapper > table {
    width: max-content;
    min-width: 100%;
}

.ops-table-wrap th {
    white-space: nowrap;
}

.ops-table-wrap td {
    vertical-align: top;
}

.ops-title-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
}

.ops-title-link:hover {
    color: var(--text-main);
    text-decoration: none;
}

.search-page-shell {
    gap: 20px;
}

.global-search-hero {
    margin-bottom: 0;
}

.global-search-hero-grid {
    align-items: stretch;
}

.global-search-filter-card {
    display: flex;
    align-items: center;
}

.global-search-main-form {
    width: 100%;
}

.global-search-form-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.global-search-input-wrap {
    position: relative;
    flex: 1 1 auto;
}

.global-search-page-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}

.global-search-page-input {
    min-height: 48px;
    padding-left: 42px;
    border-radius: 16px;
}

.global-search-help {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.global-search-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.search-page-card {
    overflow: hidden;
}

.search-page-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.search-top-match-grid,
.search-shortcut-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.search-top-match-card,
.search-shortcut-card,
.search-shortcut-row,
.search-result-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 18px;
    padding: 14px 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.search-top-match-card:hover,
.search-shortcut-card:hover,
.search-shortcut-row:hover,
.search-result-card:hover {
    color: var(--text-main);
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.24);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.search-shortcut-stack,
.search-group-stack,
.search-result-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-result-card {
    align-items: center;
}

.search-result-arrow {
    margin-left: auto;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.search-empty-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(29, 78, 216, 0.08);
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 700;
}

.search-page-empty-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 220px;
    background: linear-gradient(145deg, #ffffff, #eff6ff);
}

.ops-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.ops-main-cell {
    min-width: 320px;
}

.ops-ref-code {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
}

.ops-ref-code:hover {
    color: var(--text-main);
    text-decoration: none;
}

.ops-ref-meta,
.ops-data-meta,
.ops-owner-copy small,
.ops-timeline small,
.ops-report-user small {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.ops-inline-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.ops-badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #475569;
    font-size: 0.74rem;
    font-weight: 700;
}

.ops-badge-soft-primary {
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
}

.ops-timeline {
    display: grid;
    gap: 8px;
    min-width: 170px;
}

.ops-timeline strong {
    display: block;
    font-size: 0.92rem;
    line-height: 1.2;
}

.ops-status.is-success {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.ops-status.is-warning {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.ops-status.is-danger {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.ops-status.is-info {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.ops-status.is-slate {
    background: rgba(71, 85, 105, 0.1);
    color: #475569;
}

.ops-owner-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ops-report-user {
    display: grid;
    gap: 4px;
}

.ops-route-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
    font-size: 0.76rem;
    overflow-wrap: anywhere;
}

.standard-filter-grid-report {
    grid-template-columns: minmax(0, 1.8fr) minmax(220px, 1.1fr) repeat(2, minmax(150px, 1fr)) minmax(190px, 0.9fr);
}

.ops-owner {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
}

.ops-avatar,
.ops-avatar-fallback {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.ops-avatar {
    object-fit: cover;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.ops-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

/* Responsive Grid - REMOVED manual col-md-* definitions to use Bootstrap */

@media (min-width: 769px) and (max-width: 991.98px) {
    #sidebar {
        margin-left: 0;
        position: fixed;
        top: 0;
        right: auto;
        bottom: 0;
        left: 0;
        min-height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        z-index: 1050;
        transform: translateX(calc(var(--sidebar-width) * -1));
        overflow: hidden;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .wrapper.sidebar-mobile-open #sidebar {
        transform: translateX(0);
        box-shadow: 0 0 20px rgba(0,0,0,0.2);
    }

    #sidebar ul.components {
        height: calc(100dvh - var(--header-height));
        max-height: calc(100dvh - var(--header-height));
        overflow-y: auto;
        overflow-x: hidden;
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
    }
}

@media (max-width: 768px) {
    #sidebar {
        margin-left: 0;
        position: fixed;
        top: 0;
        right: auto;
        bottom: 0;
        left: 0;
        min-height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        z-index: 1050;
        transform: translateX(calc(var(--sidebar-width) * -1));
        overflow: hidden;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .wrapper.sidebar-mobile-open #sidebar {
        transform: translateX(0);
        box-shadow: 0 0 20px rgba(0,0,0,0.2);
    }

    #sidebar ul.components {
        height: calc(100dvh - var(--header-height));
        max-height: calc(100dvh - var(--header-height));
        overflow-y: auto;
        overflow-x: hidden;
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
    }

    .content {
        padding: var(--page-padding-mobile);
        padding-bottom: calc(var(--page-padding-mobile) + 20px);
    }

    .page-actions.shortcut-toolbar {
        width: 100%;
        justify-content: flex-start;
    }

    .page-actions.shortcut-toolbar .btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    .standard-filter-grid {
        grid-template-columns: 1fr;
    }

    .ops-hero-grid,
    .ops-stats {
        grid-template-columns: 1fr;
    }

    .container-fluid-nav {
        padding: 0 var(--page-padding-mobile);
    }

    .user-info {
        margin-right: 8px;
    }

    .topbar-search-form {
        display: none !important;
    }

    .global-search-stats,
    .search-top-match-grid,
    .search-shortcut-grid {
        grid-template-columns: 1fr;
    }

    .global-search-form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .user-meta {
        display: none;
    }

    .lang-selector {
        margin-right: 4px;
    }

    .app-footer > small {
        padding: 0 var(--page-padding-mobile);
    }
}

.wrapper {
    overflow-x: hidden;
}

@media (max-width: 991.98px) {
    .user-menu {
        gap: 4px;
    }

    .topbar-clock-cta {
        min-width: 40px;
        width: 40px;
        height: 40px;
        padding: 0;
        margin-right: 4px;
        gap: 0;
        border-radius: 12px;
        justify-content: center;
    }

    .topbar-clock-cta-icon {
        width: 28px;
        height: 28px;
        font-size: 0.92rem;
    }

    .topbar-clock-cta-copy {
        display: none;
    }

    .card-body {
        padding: 18px;
    }

    .btn-icon,
    .btn-toggle {
        width: 38px;
        height: 38px;
    }

    .search-top-match-card,
    .search-shortcut-card,
    .search-shortcut-row,
    .search-result-card {
        padding: 13px 14px;
    }
}

.container-fluid {
    width: 100%;
}

/* Sidebar accordion */
#sidebar ul.submenu {
    display: none;
}

#sidebar li.open > ul.submenu,
#sidebar li.active > ul.submenu {
    display: block;
}

#sidebar a.has-submenu {
    justify-content: space-between;
}

#sidebar a.has-submenu .menu-label {
    display: inline-flex;
    align-items: center;
}

#sidebar a.has-submenu .submenu-caret {
    margin-left: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

#sidebar li.open > a.has-submenu .submenu-caret {
    transform: rotate(180deg);
}

.sidebar-icon-shortcuts {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 2px 8px 0;
    margin: 6px 0 0;
    width: 100%;
    overflow-x: auto;
}

.sidebar-icon-shortcut {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #0f172a;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.14s ease, opacity 0.14s ease, border-color 0.14s ease, background-color 0.14s ease, color 0.14s ease;
}

.sidebar-icon-shortcut:hover {
    background: #f3f6fb;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
    opacity: 0.98;
}

.sidebar-icon-shortcut:active {
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
    opacity: 0.96;
}

.sidebar-icon-shortcut:focus-visible {
    outline: 2px solid rgba(0, 123, 255, 0.2);
    outline-offset: 2px;
}

.sidebar-icon-shortcut i {
    font-size: 0.92rem;
    line-height: 1;
}

.sidebar-icon-shortcut-demand { color: #b91c1c; }

.sidebar-icon-shortcut-purchase {
    color: #6d28d9;
}

.sidebar-icon-shortcut-ai {
    color: #155e75;
}

.sidebar-icon-shortcut-bug {
    color: #b45309;
}

.sidebar-icon-shortcut-preview {
    color: #0f766e;
}

#sidebar .sidebar-icon-shortcuts + ul.components {
    padding-top: 6px;
}

@media (max-width: 992px) {
    .sidebar-icon-shortcut {
        width: 36px;
        height: 36px;
    }
}

/* Sidebar section quick-action first item (desktop only) */
#sidebar ul.submenu li.sidebar-quick-action-item > a {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 10px;
    background: #eef4ff;
    border: 1px solid rgba(13, 110, 253, 0.22);
    margin-bottom: 2px;
    padding-bottom: 6px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

#sidebar ul.submenu li.sidebar-quick-action-item > a i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

#sidebar ul.submenu li.sidebar-quick-action-item > a:hover {
    background: #eef4ff;
    border-color: rgba(13, 110, 253, 0.22);
    color: var(--primary-color);
}

/* Topbar notifications */
.btn-icon {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    position: relative;
}

.btn-icon:hover {
    background: #f8f9fa;
    border-color: var(--border-color);
    color: var(--text-main);
}

.notif-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    border: 2px solid var(--bg-white);
    box-sizing: border-box;
}

.dropdown-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    max-width: min(380px, calc(100vw - 24px));
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    padding: 10px;
    display: none;
    z-index: 1200;
}

.dropdown-panel.active {
    display: block;
}

.dropdown-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
}

.dropdown-panel-title {
    font-weight: 800;
    font-size: 0.95rem;
}

.dropdown-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 292px;
    overflow-y: auto;
}

.dropdown-item {
    padding: 4px 6px;
    border-radius: 10px;
    border: 1px solid transparent;
    min-width: 0;
}

/* IA models list contrast fixes */
.ai-settings-model-list .accordion-button {
    color: #0f172a;
    background-color: #ffffff;
    border-radius: 10px;
}
.ai-settings-model-list .accordion-button:not(.collapsed) {
    color: #0f172a;
    background-color: #ffffff;
    box-shadow: none;
}
.ai-settings-model-list .accordion .accordion-item {
    background-color: #ffffff;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
}
.ai-settings-model-list .accordion-button .badge {
    color: #0f172a;
    background-color: #eef2ff;
    border: 1px solid #e5e7eb;
}
.ai-settings-model-list .accordion-body {
    background-color: #fafafa;
    border-top: 1px solid #f1f3f5;
}

.dropdown-item.notification-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    min-height: 40px;
}

.notification-entry-main {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
}

.dropdown-item.notification-entry > a {
    display: flex !important;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.dropdown-item.notification-entry.unread {
    box-shadow: inset 3px 0 0 rgba(59, 130, 246, 0.82);
}

.dropdown-item.notification-entry.tone-slate { background: linear-gradient(135deg, #ffffff, #f8fafc); }
.dropdown-item.notification-entry.tone-blue { background: linear-gradient(135deg, #ffffff, #eff6ff); }
.dropdown-item.notification-entry.tone-indigo { background: linear-gradient(135deg, #ffffff, #eef2ff); }
.dropdown-item.notification-entry.tone-sky { background: linear-gradient(135deg, #ffffff, #f0f9ff); }
.dropdown-item.notification-entry.tone-green { background: linear-gradient(135deg, #ffffff, #f0fdf4); }
.dropdown-item.notification-entry.tone-emerald { background: linear-gradient(135deg, #ffffff, #ecfdf5); }
.dropdown-item.notification-entry.tone-amber { background: linear-gradient(135deg, #ffffff, #fffbeb); }
.dropdown-item.notification-entry.tone-orange { background: linear-gradient(135deg, #ffffff, #fff7ed); }
.dropdown-item.notification-entry.tone-red { background: linear-gradient(135deg, #ffffff, #fef2f2); }
.dropdown-item.notification-entry.tone-violet { background: linear-gradient(135deg, #ffffff, #f5f3ff); }
.dropdown-item.notification-entry.tone-pink { background: linear-gradient(135deg, #ffffff, #fdf2f8); }
.dropdown-item.notification-entry.tone-cyan { background: linear-gradient(135deg, #ffffff, #ecfeff); }

.notification-mini-icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.15);
    flex: 0 0 auto;
}

.dropdown-item:hover {
    background: #f8f9fa;
    border-color: var(--border-color);
}

.notification-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.notification-entry-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-left: 36px;
}

.notification-inline-form {
    margin: 0;
}

.notification-inline-btn {
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.69rem;
    line-height: 1.2;
}

.notification-title-row {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
}

.notification-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: #334155;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    flex: 0 0 auto;
    margin-left: auto;
}

.notification-title,
.notification-body {
    display: block;
    min-width: 0;
    overflow-wrap: normal;
    word-break: normal;
}

.notification-title {
    font-weight: 800;
    font-size: 0.76rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-entry-main > a {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.dropdown-panel-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid var(--border-color);
}

.notification-body {
    font-size: 0.72rem;
    line-height: 1.25;
}

.notification-title-clamp,
.notification-body-clamp {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-title-clamp {
    line-clamp: 1;
    -webkit-line-clamp: 1;
}

.notification-body-clamp {
    line-clamp: 2;
    -webkit-line-clamp: 2;
}

@media (max-width: 768px) {
    .dropdown-panel {
        position: fixed;
        top: calc(var(--header-height) + 8px);
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
        margin: 0;
    }
}

.notification-body-clamp {
    line-clamp: 2;
    -webkit-line-clamp: 2;
}

.notification-feed-item {
    min-width: 0;
}

.notification-feed-head {
    gap: 12px;
}

.notification-feed-meta {
    flex: 0 0 auto;
}

.muted {
    color: var(--text-muted);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.tab-btn {
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-main);
    padding: 10px 12px;
    border-radius: 12px 12px 0 0;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.92rem;
}

.tab-btn.active {
    border-bottom-color: #fff;
    background: #fff;
    color: var(--primary-color);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal-overlay .work-history-dialog {
    width: 860px;
    max-width: 100%;
    background: var(--bg-white);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.modal-overlay .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-overlay .modal-title {
    font-weight: 900;
}

.modal-overlay .modal-body {
    padding: 16px;
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    font-size: 0.95rem;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    vertical-align: middle;
}

.table .badge,
.table .btn,
.table .btn-group,
.table .form-control,
.table .form-select,
.table .text-nowrap,
.table th.text-nowrap,
.table td.text-nowrap {
    white-space: nowrap;
}

.table thead th {
    font-weight: 700;
    color: var(--text-main);
    background-color: #f8f9fa;
}

.table tbody tr:hover {
    background-color: #fafbfd;
}

.table-responsive,
.table-scroll-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-y: hidden;
}

.table-responsive > table,
.table-scroll-wrapper > table,
.table-responsive > .table,
.table-scroll-wrapper > .table {
    margin-bottom: 0;
}

@media screen and (max-width: 991.98px) {
    :root {
        --sidebar-width: 228px;
        --page-padding: 22px;
    }

    .container-fluid-nav {
        padding: 0 20px;
    }

    .sidebar-header {
        padding: 0 16px;
    }

    #sidebar ul.components {
        padding: 12px 8px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    }

    #sidebar ul li a {
        padding: 11px 12px;
    }

    .content {
        padding-bottom: calc(var(--page-padding) + 12px);
    }

    .page-actions.shortcut-toolbar {
        justify-content: flex-start;
    }

    .standard-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ops-hero-grid,
    .ops-stats,
    .global-search-stats,
    .search-top-match-grid,
    .search-shortcut-grid {
        grid-template-columns: 1fr;
    }

    .table-toolbar {
        align-items: stretch;
    }

    .table-toolbar .form-control {
        max-width: 100%;
    }

    .content .table-responsive,
    .content .table-scroll-wrapper,
    .content .ops-table-wrap {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    .content .table-responsive > table,
    .content .table-responsive > .table,
    .content .table-scroll-wrapper > table,
    .content .table-scroll-wrapper > .table,
    .content .ops-table-wrap > table,
    .content .ops-table-wrap > .table {
        width: max-content;
        min-width: 100%;
        margin-bottom: 0;
    }

    .content .table-responsive > table th,
    .content .table-responsive > table td,
    .content .table-responsive > .table th,
    .content .table-responsive > .table td,
    .content .table-scroll-wrapper > table th,
    .content .table-scroll-wrapper > table td,
    .content .table-scroll-wrapper > .table th,
    .content .table-scroll-wrapper > .table td,
    .content .ops-table-wrap > table th,
    .content .ops-table-wrap > table td,
    .content .ops-table-wrap > .table th,
    .content .ops-table-wrap > .table td {
        white-space: nowrap;
        overflow-wrap: normal;
        word-break: normal;
    }
}

@media (max-width: 768px) {
    .table-responsive,
    .table-scroll-wrapper {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    .table-responsive > table,
    .table-scroll-wrapper > table {
        width: max-content;
        min-width: 100%;
    }

    .table-responsive > .table,
    .table-scroll-wrapper > .table {
        width: max-content;
        min-width: 100%;
    }

    .ops-table-wrap,
    .ops-table-wrap.table-responsive,
    .ops-table-wrap > .table-responsive,
    .ops-table-wrap > .table-scroll-wrapper {
        max-width: 100%;
    }

    .table-responsive > table th,
    .table-responsive > table td,
    .table-responsive > .table th,
    .table-responsive > .table td,
    .table-scroll-wrapper > table th,
    .table-scroll-wrapper > table td,
    .table-scroll-wrapper > .table th,
    .table-scroll-wrapper > .table td,
    .ops-table-wrap > table th,
    .ops-table-wrap > table td,
    .ops-table-wrap > .table th,
    .ops-table-wrap > .table td {
        white-space: nowrap;
        overflow-wrap: normal;
        word-break: normal;
    }
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background-color: rgba(40, 167, 69, 0.15);
    color: #1e7e34;
}

.badge-secondary {
    background-color: rgba(108, 117, 125, 0.15);
    color: #6c757d;
}

/* ============================================
   Kimori Page Load Overlay (kplo)
   ============================================ */
#kimoriPageLoadOverlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-body, #f0f2f5);
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transition: opacity 0.16s ease, visibility 0.16s ease;
}

#kimoriPageLoadOverlay.kplo-effect-slide-up {
    transform: translateY(0);
    transition: opacity 0.16s ease, visibility 0.16s ease, transform 0.16s ease;
}

#kimoriPageLoadOverlay.kplo-effect-zoom {
    transform: scale(1);
    transition: opacity 0.16s ease, visibility 0.16s ease, transform 0.16s ease;
}

#kimoriPageLoadOverlay.kplo-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#kimoriPageLoadOverlay.kplo-effect-slide-up.kplo-hidden {
    transform: translateY(-6px);
}

#kimoriPageLoadOverlay.kplo-effect-zoom.kplo-hidden {
    transform: scale(1.03);
}

#kimoriPageLoadOverlay.kplo-gone {
    display: none;
}

.kplo-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    padding: 24px;
    max-width: 260px;
    width: 100%;
    text-align: center;
}

.kplo-logo {
    width: min(160px, 52vw);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: kplo-breathe 1.8s ease-in-out infinite;
}

.kplo-logo img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.kplo-logo-fallback {
    font-size: 3rem;
    color: var(--primary-color, #007bff);
}

@keyframes kplo-breathe {
    0%, 100% { opacity: 1;    transform: scale(1);    }
    50%       { opacity: 0.72; transform: scale(0.95); }
}

.kplo-bar-track {
    width: min(200px, 64vw);
    height: 3px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.kplo-bar {
    height: 100%;
    border-radius: 3px;
    background: var(--primary-color, #007bff);
    width: 0%;
    animation: kplo-progress 2.8s ease-out forwards;
}

@keyframes kplo-progress {
    0%   { width: 0%;  }
    20%  { width: 22%; }
    55%  { width: 58%; }
    85%  { width: 80%; }
    100% { width: 90%; }
}

#kimoriPageLoadOverlay.kplo-completing .kplo-bar {
    animation: none;
    width: 100%;
    transition: width 0.12s ease;
}

.login-page #kimoriPageLoadOverlay {
    background: linear-gradient(135deg, #edf3ff 0%, #dfe9f5 100%);
}
