body {
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
}

.brand-link {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    text-decoration: none;
    white-space: normal;
    line-height: 1.35;
    min-height: 70px;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.brand-link .brand-image {
    float: none;
    max-height: 34px;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0.1rem;
    opacity: 1;
}

.brand-link .brand-text {
    display: block;
    flex: 1 1 auto;
    overflow: visible;
    white-space: normal;
    word-break: break-word;
}

.app-main {
    background: #f4f6f9;
}

.content-header h1 {
    font-weight: 500;
}

.page-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.stat-card-classic {
    color: #fff;
    border-radius: 0.5rem;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    min-height: 130px;
}

.stat-card-classic .stat-icon {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 3rem;
    opacity: 0.2;
}

.stat-card-classic .stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.75rem;
}

.stat-card-classic .stat-label {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.stat-card-classic .stat-note {
    font-size: 0.9rem;
    opacity: 0.9;
}

.bg-classic-green { background: linear-gradient(180deg, #28a745, #23903c); }
.bg-classic-yellow { background: linear-gradient(180deg, #ffc107, #eba900); color: #3b2c00; }
.bg-classic-orange { background: linear-gradient(180deg, #fd7e14, #ea6d04); }
.bg-classic-red { background: linear-gradient(180deg, #dc3545, #c62838); }

.metric-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background: #fff;
    padding: 1rem;
}

.quick-module {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background: #fff;
    padding: 1.25rem;
    height: 100%;
}

.quick-module .icon-box {
    width: 4.5rem;
    height: 4rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #fff;
    margin-bottom: 1rem;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.floating-preview {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(720px, calc(100vw - 32px));
    height: min(82vh, 820px);
    display: none;
    grid-template-rows: auto 1fr;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.22);
    z-index: 1080;
}

.floating-preview.is-open { display: grid; }

.floating-preview.is-fullscreen {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    max-width: 1440px;
}

.floating-preview-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    background: rgba(0, 0, 0, 0.38);
    z-index: 1070;
}

.floating-preview-backdrop.is-open { display: block; }

.floating-preview-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #f8f9fa;
}

.content-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background: #fff;
}

.navbar-profile {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.navbar-avatar,
.user-avatar-photo,
.profile-preview-photo {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.navbar-avatar-fallback,
.user-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd, #0b5f92);
    color: #fff;
    font-weight: 700;
}

.navbar-avatar-fallback {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
}

.user-avatar-fallback {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 1rem;
}

.profile-menu {
    min-width: 280px;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid #dde5ee;
    box-shadow: 0 1rem 2rem rgba(15, 23, 42, 0.12);
    padding: 0;
}

.profile-menu-head {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1rem 0.9rem;
    background: linear-gradient(135deg, #f8fbff, #f1f6fb);
}

.profile-menu-body {
    padding: 0.85rem 1rem 0.35rem;
}

.profile-menu-role {
    color: #6c7f92;
    font-size: 0.88rem;
}

.profile-menu-name {
    font-weight: 700;
    color: #18324a;
    line-height: 1.35;
}

.page-grid,
.stack {
    display: grid;
    gap: 1rem;
}

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

.grid-4,
.stats-hero {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.panel {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    padding: 1rem;
}

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

.button,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
}

.button-primary {
    background: #0d6efd;
    color: #fff;
}

.button-secondary {
    background: #d9ecff;
    color: #0b5f92;
}

.button-ghost {
    background: #fff;
    color: #2f3a45;
    border-color: #ced4da;
}

.button-danger {
    background: #dc3545;
    color: #fff;
}

.soft-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background: #fff;
    padding: 1rem;
}

.filters,
.footer-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.inline-field {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
}

.muted,
.help {
    color: #6c757d;
}

.eyebrow {
    margin: 0 0 0.5rem;
    color: #6c757d;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
}

.badge-outgoing {
    background: #fff3cd;
    color: #856404;
}

.section-note {
    border: 1px dashed #cdd7e1;
    background: #f8fafc;
    border-radius: 0.5rem;
    padding: 1rem;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.empty {
    text-align: center;
    color: #6c757d;
    padding: 1.5rem;
}

.meter {
    height: 0.7rem;
    border-radius: 999px;
    background: #e9ecef;
    overflow: hidden;
}

.meter > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #0d6efd, #0b5ed7);
}

.meter-secondary > span {
    background: linear-gradient(90deg, #ffc107, #f59f00);
}

.kpi-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #adb5bd;
}

@media (max-width: 991.98px) {
    .grid-2,
    .grid-4,
    .stats-hero,
    .panel-header {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .page-actions,
    .table-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .inline-field {
        grid-template-columns: 1fr;
    }

    .floating-preview {
        width: calc(100vw - 12px);
        height: calc(100vh - 12px);
    }
}
