
/* Pokivault Color & Layout Fixes */

/* Fix sidebar min-width - 255px instead of 225px */
#layoutSidenav #layoutSidenav_nav {
    width: 275px;
    min-width: 275px;
}

#layoutSidenav #layoutSidenav_content {
    padding-left: 275px !important;
}

#layoutSidenav #layoutSidenav_nav .sb-sidenav {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#layoutSidenav #layoutSidenav_nav .sb-sidenav-menu {
    flex: 1 1 auto;
}

/* Authentication layout */
.auth-layout {
    min-height: 100vh;
    background: linear-gradient(160deg, #eef2ff 0%, #e0f2f1 100%);
    color: var(--pv-text);
    transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode.auth-layout {
    background: linear-gradient(145deg, #0f172a 0%, #1f2937 60%, #0f172a 100%);
    color: var(--text-dark);
}

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 3rem 1rem;
    font-weight: 600;
    color: inherit;
}

.auth-header .auth-brand,
.auth-header .auth-brand:visited {
    color: inherit !important;
    text-decoration: none;
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-header .auth-brand:hover {
    color: inherit !important;
    text-decoration: none;
}

.auth-dark-toggle {
    color: inherit !important;
    font-size: 1.1rem;
}

.auth-header .auth-dark-toggle:focus,
.auth-header .auth-dark-toggle:hover {
    color: inherit !important;
    opacity: 0.8;
}

.auth-layout .btn-link {
    color: inherit !important;
}

.icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.25rem;
    background: rgba(79, 70, 229, 0.12);
    color: var(--pv-primary);
}

.icon-circle.icon-primary {
    background: rgba(79, 70, 229, 0.12);
    color: var(--pv-primary);
}

.icon-circle.icon-success {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
}

.icon-circle.icon-warning {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
}

.icon-circle.icon-info {
    background: rgba(14, 165, 233, 0.12);
    color: #0ea5e9;
}

.admin-tile {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.25rem;
    border-radius: 1rem;
    background: #ffffff;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    border: none;
    text-align: left;
}

button.admin-tile {
    width: 100%;
    background: none;
}

body.dark-mode .admin-tile {
    background: #1f2937;
    color: var(--text-dark);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.4);
}

.admin-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.15);
}

.admin-tile:focus {
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(79, 70, 229, 0.25);
}

button.admin-tile:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

button.admin-tile:disabled .admin-tile-sub {
    color: rgba(15, 23, 42, 0.55);
}

.admin-tile-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.admin-icon-primary {
    background: rgba(79, 70, 229, 0.12);
    color: var(--pv-primary);
}

.admin-icon-success {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
}

/* ------------------
   TCG card gallery
------------------- */
.tcg-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.75rem;
    margin-bottom: 3rem;
}

.tcg-card {
    background: linear-gradient(180deg, rgba(28, 30, 45, 0.95) 0%, rgba(16, 17, 30, 0.95) 100%);
    border-radius: 18px;
    padding: 1.1rem 1rem 1.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    border: 1px solid rgba(255, 255, 255, 0.03);
    border: none;
    cursor: pointer;
    color: inherit;
    width: 100%;
}

.tcg-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.45);
}

.collection-progress {
    border-radius: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(15, 23, 42, 0.04);
}

.collection-progress__meta span:last-child {
    font-weight: 600;
    color: #1f2937;
}

.collection-progress__bar {
    height: 6px;
    border-radius: 999px;
    background-color: rgba(99, 102, 241, 0.12);
    overflow: hidden;
}

.collection-progress__bar .progress-bar {
    background: linear-gradient(90deg, #6366f1 0%, #22d3ee 100%);
    border-radius: 999px;
}

.set-logo {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.set-logo__image {
    max-height: 80px;
    width: auto;
    object-fit: contain;
}

.tcg-card__frame {
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04) 70%);
    border-radius: 16px;
    padding: 0.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 320px;
}

.tcg-card__frame img {
    width: 100%;
    max-width: 230px;
    border-radius: 14px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.tcg-card__placeholder {
    width: 100%;
    max-width: 230px;
    padding: 2rem 1rem;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.35);
}

.tcg-card__body {
    width: 100%;
    margin-top: 1.05rem;
}

.tcg-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: #f4f6ff;
}

.tcg-card__meta {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    font-size: 0.82rem;
    color: #b8bed6;
}

.tcg-card__sub {
    font-size: 0.78rem;
    color: #8f94ab;
}

.tcg-card__types {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
}

.tcg-card__types .badge {
    font-size: 0.68rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: rgba(148, 163, 209, 0.22);
    font-weight: 500;
}

.variant-chip-strip {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.variant-chip {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    background-color: #9ca3af;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.25);
}

.variant-chip--inline {
    width: 14px;
    height: 14px;
}

.variant-chip--more {
    min-width: 22px;
    height: 12px;
    padding: 0 4px;
    border-radius: 6px;
    font-size: 0.65rem;
    line-height: 12px;
    text-align: center;
    background-color: #4b5563;
    color: #f9fafb;
    box-shadow: none;
}

.variant-chip.variant-normal {
    background-color: #9ca3af;
}

.variant-chip.variant-holo {
    background: linear-gradient(135deg, #38bdf8, #2563eb);
}

.variant-chip.variant-reverse {
    background: linear-gradient(135deg, #ec4899, #a855f7);
}

.variant-chip.variant-first {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.variant-chip.variant-special {
    background: linear-gradient(135deg, #a855f7, #6366f1);
}

.variant-chip--owned {
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.75);
}

.variant-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.variant-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.variant-row:last-child {
    border-bottom: none;
}

.variant-row__name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    flex: 1 1 40%;
}

.variant-row__prices {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.variant-row__controls {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
}

.variant-control {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: #ffffff;
    color: #1f2937;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.variant-control:hover:not(:disabled) {
    background-color: #e0f2ff;
    border-color: #38bdf8;
    color: #0f172a;
}

.variant-control:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.variant-row__quantity {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #1f2937;
}

.variant-login-hint {
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0.5rem 0 0.5rem 0.2rem;
}

.import-output {
    background-color: rgba(15, 23, 42, 0.8);
    color: #e5e7eb;
    padding: 0.75rem;
    border-radius: 0.5rem;
    max-height: 240px;
    overflow-y: auto;
    font-size: 0.8rem;
    font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.modal .form-text {
    color: #6b7280;
}

.variant-price-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: rgba(148, 163, 184, 0.25);
    color: #0f172a;
}

.variant-price-chip__label {
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.variant-price-chip__value {
    font-variant-numeric: tabular-nums;
}

.variant-price-chip--tcg {
    background-color: rgba(56, 189, 248, 0.2);
    color: #0c4a6e;
}

.variant-price-chip--cm {
    background-color: rgba(168, 85, 247, 0.2);
    color: #4c1d95;
}

.variant-price-chip--na {
    background-color: rgba(148, 163, 184, 0.2);
    color: #1f2937;
}

.tcg-modal__section-title {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #4b5563;
    margin-bottom: 0;
}

.tcg-card:focus-visible {
    outline: 2px solid rgba(129, 140, 248, 0.8);
    outline-offset: 4px;
}

.tcg-modal-open {
    overflow: hidden;
}

.tcg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.tcg-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 12, 24, 0.85);
    backdrop-filter: blur(8px);
}

.tcg-modal__dialog {
    position: relative;
    max-width: 1180px;
    width: 92%;
    background: rgba(18, 20, 32, 0.98);
    border-radius: 22px;
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.6);
    padding: 3rem 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-height: 90vh;
    overflow: auto;
}

.tcg-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #f7f8ff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.tcg-modal__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tcg-modal__body {
    display: grid;
    grid-template-columns: minmax(340px, 380px) minmax(0, 1fr);
    gap: 2.4rem;
}

.tcg-modal__left {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.tcg-modal__left img {
    width: 100%;
    max-width: 360px;
    border-radius: 20px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.tcg-modal__image-placeholder {
    width: 100%;
    max-width: 360px;
    padding: 3.5rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.tcg-modal__title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.tcg-modal__subtitle {
    margin-bottom: 0.75rem;
}

.tcg-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0.75rem 0 1rem;
}

.tcg-action-btn {
    border: 1px solid rgba(129, 140, 248, 0.35);
    background: rgba(30, 41, 59, 0.45);
    color: #e5e7ff;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.tcg-action-btn:hover {
    background: rgba(79, 70, 229, 0.25);
    border-color: rgba(129, 140, 248, 0.7);
}

.tcg-action-btn--active {
    background: rgba(79, 70, 229, 0.5);
    border-color: rgba(129, 140, 248, 0.85);
    color: #fff;
}

.tcg-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tcg-modal__series {
    display: inline-block;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(129, 140, 248, 0.9);
}

.tcg-modal__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tcg-modal__section:not(:empty) {
    margin-bottom: 2rem;
}

.tcg-modal__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem 1.5rem;
}

.tcg-modal__list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.9rem;
    color: #d1d5f0;
}

.tcg-modal__list span {
    color: #a6accf;
}

.tcg-modal__list strong {
    font-weight: 600;
    color: #f7f8ff;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.tcg-modal__ability, .tcg-modal__attack {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.15rem 1.4rem;
    margin-bottom: 1.2rem;
}

.tcg-modal__ability h4,
.tcg-modal__attack h4 {
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.tcg-modal__attack-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.tcg-modal__attack-cost {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.6rem;
    font-size: 0.8rem;
    color: #9da3c0;
}

.tcg-modal__attack-cost span:first-child {
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
}

.tcg-modal__attack-damage {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fee45a;
}

.tcg-modal__attack-meta {
    font-size: 0.8rem;
    color: #9da3c0;
}

.tcg-modal__flavor {
    font-size: 0.9rem;
    font-style: italic;
    color: #c5cae9;
}

.tcg-modal__right {
    display: flex;
    flex-direction: column;
}

.tcg-type-list {
    display: inline-flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tcg-type-chip {
    --tcg-icon-height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: rgba(148, 163, 209, 0.18);
    border-radius: 999px;
    padding: 0.3rem 0.6rem;
    font-size: 0.78rem;
    color: #e2e6ff;
    backdrop-filter: blur(6px);
}

.tcg-type-chip img {
    height: var(--tcg-icon-height);
    width: auto;
    max-height: var(--tcg-icon-height);
    object-fit: contain;
    display: block;
}

.tcg-type-chip--text {
    padding: 0.24rem 0.8rem;
    background: linear-gradient(135deg, rgba(148, 163, 209, 0.35), rgba(92, 105, 160, 0.35));
    border: 1px solid rgba(168, 184, 233, 0.25);
}

.tcg-type-chip--text .tcg-type-chip__label {
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* Forum */
.forum-page .forum-search .form-control {
    min-width: 220px;
}

.forum-table th,
.forum-table td {
    vertical-align: middle;
}

.forum-category .card {
    background: rgba(31, 41, 55, 0.85);
}

.forum-post {
    background: rgba(30, 41, 59, 0.75);
    color: #e2e8f0;
}

.forum-post__content {
    color: #e2e8f0;
    line-height: 1.6;
}

.forum-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.forum-like-btn .forum-like-count {
    font-weight: 600;
    min-width: 1.5rem;
    text-align: center;
}

.forum-report summary {
    cursor: pointer;
}

.tcg-type-chip__label {
    font-size: 0.72rem;
    line-height: 1;
    color: inherit;
}

.tcg-type-chip--compact {
    padding: 0.2rem 0.35rem;
}

.tcg-type-chip--icon-only {
    gap: 0;
    padding: 0.24rem 0.34rem;
}

.tcg-type-chip--icon-only.tcg-type-chip--compact {
    padding: 0.18rem 0.28rem;
}

.tcg-tag-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(148, 163, 209, 0.18);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
    color: #dbe2ff;
}

.tcg-type-chip-value {
    font-size: 0.78rem;
    font-weight: 600;
    color: #f8d36a;
    margin-left: 0.25rem;
}

.tcg-type-chip[data-icon="basic"],
.tcg-type-chip[data-icon="item"],
.tcg-type-chip[data-icon="pokemon_tool"],
.tcg-type-chip[data-icon="stadium"],
.tcg-type-chip[data-icon="supporter"],
.tcg-type-chip[data-icon="tag_team"],
.tcg-type-chip[data-icon="single_strike"],
.tcg-type-chip[data-icon="rapid_strike"],
.tcg-type-chip[data-icon="fusion_strike"],
.tcg-type-chip[data-icon="ultra_beast"],
.tcg-type-chip[data-icon="ex"],
.tcg-type-chip[data-icon="stage_1"] {
    --tcg-icon-height: 20px;
}

.tcg-type-chip[data-icon="stage_2"],
.tcg-type-chip[data-icon="ace_spec"],
.tcg-type-chip[data-icon="v_max"] {
    --tcg-icon-height: 18px;
}

.tcg-modal__rule {
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-style: normal;
}

.tcg-modal__rule strong {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: #f4f6ff;
}

@media (max-width: 768px) {
    .tcg-modal__dialog {
        padding: 1.5rem;
    }
    .tcg-modal__body {
        grid-template-columns: 1fr;
    }
    .tcg-modal__left img,
    .tcg-modal__image-placeholder {
        max-width: 260px;
    }
}

.admin-icon-info {
    background: rgba(14, 165, 233, 0.12);
    color: #0ea5e9;
}

.admin-icon-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.admin-icon-warning {
    background: rgba(251, 191, 36, 0.12);
    color: #f59e0b;
}

.admin-icon-secondary {
    background: rgba(148, 163, 184, 0.12);
    color: #64748b;
}

.admin-tile-title {
    font-weight: 600;
    font-size: 1rem;
}

.admin-tile-sub {
    font-size: 0.85rem;
    color: var(--pv-muted);
}

body.dark-mode .admin-tile-sub {
    color: rgba(226, 232, 240, 0.7);
}

.auth-container {
    padding-top: 1rem;
    padding-bottom: 3rem;
}

.auth-card {
    background: #ffffff;
    border-radius: 1rem;
}

body.dark-mode .auth-card {
    background: #1f2937;
    color: var(--text-dark);
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.4);
}

.auth-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(79, 70, 229, 0.12);
    color: var(--pv-primary);
}

body.dark-mode .auth-icon {
    background: rgba(45, 212, 191, 0.12);
    color: var(--pv-accent);
}

.auth-layout .form-control,
.auth-layout .form-select {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: inherit;
}

body.dark-mode.auth-layout .form-control,
body.dark-mode.auth-layout .form-select {
    background-color: #111827;
    border-color: #374151;
    color: var(--text-dark);
}

.auth-layout .form-control:focus,
.auth-layout .form-select:focus {
    border-color: var(--pv-primary);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.15);
}

body.dark-mode.auth-layout .form-control:focus,
body.dark-mode.auth-layout .form-select:focus {
    border-color: var(--pv-accent);
    box-shadow: 0 0 0 0.2rem rgba(45, 212, 191, 0.15);
}

.auth-footer {
    background: transparent;
}

body.dark-mode .auth-footer {
    background: transparent;
}

/* Harmonised Light Mode palette */
:root {
    --pv-bg: #f4f5fb;
    --pv-text: #1f2933;
    --pv-muted: #556070;
    --pv-primary: #4f46e5;
    --pv-primary-light: #eef2ff;
    --pv-primary-dark: #3730a3;
    --pv-accent: #2dd4bf;
    --pv-sidebar-bg: #1c2333;
    --pv-sidebar-active: rgba(79, 70, 229, 0.12);
    --pv-sidebar-border: rgba(79, 70, 229, 0.3);
    --pv-card-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

body:not(.dark-mode) {
    background-color: var(--pv-bg);
    color: var(--pv-text);
}

body:not(.dark-mode) .sb-topnav {
    background: linear-gradient(135deg, var(--pv-primary), var(--pv-accent)) !important;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.25);
}

body:not(.dark-mode) .sb-topnav .navbar-brand,
body:not(.dark-mode) .sb-topnav .nav-link,
body:not(.dark-mode) .sb-topnav .btn-link {
    color: #fff !important;
}

body:not(.dark-mode) .sb-sidenav {
    background: var(--pv-sidebar-bg) !important;
    border-right: 1px solid var(--pv-sidebar-border);
}

body:not(.dark-mode) .sb-sidenav .sb-sidenav-menu .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
}

body:not(.dark-mode) .sb-sidenav .sb-sidenav-menu .nav-link:hover,
body:not(.dark-mode) .sb-sidenav .sb-sidenav-menu .nav-link.active {
    background-color: var(--pv-sidebar-active);
    color: #fff !important;
}

body:not(.dark-mode) .sb-sidenav .sb-sidenav-menu .nav-link .sb-nav-link-icon {
    color: var(--pv-accent);
}

body:not(.dark-mode) .sb-sidenav .sb-sidenav-menu-heading {
    color: rgba(255, 255, 255, 0.55) !important;
    letter-spacing: 0.08em;
}

body:not(.dark-mode) .sb-sidenav-footer {
    background-color: rgba(17, 24, 39, 0.9);
    color: rgba(255, 255, 255, 0.8) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 1.5rem;
}

body:not(.dark-mode) #layoutSidenav_content {
    background-color: var(--pv-bg);
}

body:not(.dark-mode) .card {
    box-shadow: var(--pv-card-shadow);
    border: 0;
}

/* Fix dark mode text colors */
body.dark-mode .text-center {
    color: var(--text-dark) !important;
}

body.dark-mode td {
    color: var(--text-dark);
}

body.dark-mode .table td,
body.dark-mode .table th {
    color: var(--text-dark);
}

/* Dark mode navbar stays dark */
body.dark-mode .sb-topnav {
    background: #212529 !important;
}

body.dark-mode .sb-sidenav {
    background: #212529 !important;
}

/* Ensure all text in cards is visible in dark mode */
body.dark-mode .card-body {
    color: var(--text-dark);
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
    color: var(--text-dark);
}


/* Fix breadcrumbs in both modes */
body:not(.dark-mode) .breadcrumb-item {
    color: #495057;
}

body:not(.dark-mode) .breadcrumb-item.active {
    color: #6c757d;
}
