html {
    font-size: 14px;
    min-height: 100%;
    position: relative;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

:root {
    --fluent-background: #f3f3f3;
    --fluent-card-background: rgba(255, 255, 255, 0.8);
    --fluent-text-primary: #333;
    --fluent-text-secondary: #666;
    --fluent-accent: #0078d4;
    --fluent-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --fluent-border-radius: 8px;
    --fluent-backdrop-blur: 10px;
}

body {
    background-color: var(--fluent-background);
    color: var(--fluent-text-primary);
    font-family: 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    margin-bottom: 0;
}

.page-shell {
    max-width: 1400px;
}

.page-title {
    font-weight: 700;
    margin-bottom: 1rem;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.card,
.table-card,
.section-card {
    -webkit-backdrop-filter: blur(var(--fluent-backdrop-blur));
    backdrop-filter: blur(var(--fluent-backdrop-blur));
    background-color: var(--fluent-card-background);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--fluent-border-radius);
    box-shadow: var(--fluent-shadow);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.card-title {
    color: var(--fluent-text-primary);
    font-weight: 600;
}

.card-subtitle {
    color: var(--fluent-text-secondary);
}

.btn-primary {
    background-color: var(--fluent-accent);
    border-color: var(--fluent-accent);
    border-radius: 4px;
    transition: background-color 0.2s ease-in-out;
}

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

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem #258cfb;
}

.nav-pills .nav-link {
    border-radius: 4px;
    color: var(--fluent-text-secondary);
}

.nav-pills .nav-link.active {
    background-color: var(--fluent-accent);
    box-shadow: 0 2px 4px rgba(0, 120, 212, 0.3);
    color: #fff;
}

.list-group-item {
    background-color: transparent;
    border-color: rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-weight: 700;
}

.profile-picture-preview {
    max-height: 220px;
    object-fit: cover;
}

.actions-col-sm {
    min-width: 360px;
}

.actions-col-md {
    min-width: 440px;
}

.actions-col-lg {
    min-width: 460px;
}

.actions-col-xl {
    min-width: 520px;
}

.progress-thin {
    height: 6px;
}

.color-swatch {
    min-width: 1.5rem;
}

.fab-container {
    bottom: 30px;
    position: fixed;
    right: 30px;
    z-index: 1000;
}

.fab-main {
    align-items: center;
    background-color: var(--bs-primary);
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
    color: #fff;
    display: flex;
    font-size: 24px;
    height: 56px;
    justify-content: center;
    transition: all 0.3s ease;
    width: 56px;
}

.fab-actions {
    bottom: 65px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    right: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    visibility: hidden;
}

.fab-container:hover .fab-actions,
.fab-container:focus-within .fab-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
}

.fab-action {
    align-items: center;
    background-color: var(--bs-secondary);
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
    color: #fff;
    display: flex;
    font-size: 20px;
    height: 48px;
    justify-content: center;
    text-decoration: none;
    width: 48px;
}

.fab-action:hover,
.fab-main:hover {
    color: #fff;
    filter: brightness(1.05);
}

.date-range-presets {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.preset-btn {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
}

.preset-btn.active {
    background-color: #0078d4;
    color: white;
    border-color: #0078d4;
}

/* QW-3: Dark Mode Support */
[data-theme="dark"] {
    --fluent-background: #1a1a2e;
    --fluent-card-background: rgba(30, 30, 50, 0.95);
    --fluent-text-primary: #e8e8e8;
    --fluent-text-secondary: #aaa;
    --fluent-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] body {
    background-color: var(--fluent-background);
    color: var(--fluent-text-primary);
}

[data-theme="dark"] .card,
[data-theme="dark"] .table-card,
[data-theme="dark"] .section-card {
    background-color: var(--fluent-card-background);
    border-color: rgba(255,255,255,0.08);
}

[data-theme="dark"] .card-header {
    border-bottom-color: rgba(255,255,255,0.08);
}

[data-theme="dark"] .table {
    --bs-table-color: #e8e8e8;
    --bs-table-bg: transparent;
    --bs-table-border-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .navbar,
[data-theme="dark"] .sidebar {
    background-color: #111122 !important;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: #2a2a3e;
    border-color: rgba(255,255,255,0.15);
    color: #e8e8e8;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: #2a2a3e;
    color: #e8e8e8;
}

[data-theme="dark"] .modal-content {
    background-color: #1e1e30;
    color: #e8e8e8;
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .dropdown-menu {
    background-color: #1e1e30;
    border-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .dropdown-item {
    color: #e8e8e8;
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: rgba(255,255,255,0.08);
    color: #fff;
}

[data-theme="dark"] .list-group-item {
    background-color: transparent;
    border-color: rgba(255,255,255,0.08);
    color: #e8e8e8;
}

[data-theme="dark"] .text-muted {
    color: #999 !important;
}

[data-theme="dark"] .alert-info {
    background-color: rgba(13, 110, 253, 0.15);
    border-color: rgba(13, 110, 253, 0.3);
    color: #90caf9;
}

[data-theme="dark"] .app-footer {
    background: #0d0d1a;
    border-top-color: rgba(255,255,255,0.06);
    color: #999;
}

[data-theme="dark"] .app-footer-brand {
    color: #ddd;
}

[data-theme="dark"] .app-footer-links a {
    color: #888;
}

[data-theme="dark"] .app-footer-links a:hover {
    color: #ddd;
}

[data-theme="dark"] .app-footer-copy {
    color: #555;
}

/* Dark mode toggle button */
.dark-mode-toggle {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    color: inherit;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 10px;
    transition: all 0.2s;
}

.dark-mode-toggle:hover {
    background: rgba(255,255,255,0.1);
}

/* ── App Footer ── */
.app-footer {
    background: #1a1a2e;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #bbb;
    font-size: 0.82rem;
    margin-top: 2rem;
    padding: 0.9rem 1.5rem;
}

.app-footer-inner {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1400px;
}

.app-footer-brand {
    color: #e8e8e8;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.app-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.app-footer-links a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.2s;
}

.app-footer-links a:hover {
    color: #fff;
    text-decoration: underline;
}

.app-footer-copy {
    color: #777;
}

/* ── FAB tooltip labels ── */
.fab-label {
    display: none;
}

@media (max-width: 575.98px) {
    .app-footer-inner {
        flex-direction: column;
        gap: 0.4rem;
        text-align: center;
    }

    .app-footer-links {
        justify-content: center;
    }
}
