html, body {
    max-width: 100%;
    overflow-x: hidden;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

:root {
    --mafia-red: #c41e3a;
    --mafia-red-dark: #8b0000;
    --mafia-blood: #8b0000;
}

/* Wspólny wzorzec przycisku akcji. Używaj tej klasy w każdym komponencie,
   gdy przycisk ma wyglądać tak samo jak „Walcz” w zakładce Walki. */
.syndicate-global-action-btn {
    padding: 0.58rem 1rem;
    background: linear-gradient(180deg, var(--mafia-red) 0%, var(--mafia-red-dark) 100%);
    border: none;
    border-bottom: 2px solid var(--mafia-blood);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.82rem;
    clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 5px, 100% 100%, 0 100%, 0 5px);
}

.syndicate-global-action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.5);
    background: linear-gradient(180deg, #dc3545 0%, var(--mafia-red) 100%);
}

.syndicate-global-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Blokada przewijania strony, gdy otwarty jest dowolny modal Syndykatu (Pewex, Wiadomości, Podgląd itp.) */
html:has(.syndicate-modal-overlay),
body:has(.syndicate-modal-overlay) {
    overflow: hidden !important;
    touch-action: none;
}

body {
    background-color: #ffffff;
    color: #1f2937;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Wspólny wygląd wszystkich okien modalnych. */
.syndicate-modal {
    background: linear-gradient(rgba(10, 10, 15, 0.35), rgba(10, 10, 15, 0.55)),
                url('/images/gangs.jpg') center/cover no-repeat !important;
    background-color: #1a1208 !important;
    border: 1px solid var(--mafia-gold-dark) !important;
    color: #f3e9c4 !important;
    border-radius: 8px !important;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.85), inset 0 0 0 1px rgba(212, 175, 55, 0.15) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

/* Wyjątek dla okna „Moje oferty” musi być w globalnym CSS i po regule
   .syndicate-modal, ponieważ ta reguła używa !important. */
.syndicate-modal.my-auction-listings-modal {
    width: 900px !important;
    max-width: 900px !important;
    height: min(620px, calc(100vh - 2rem)) !important;
    max-height: min(620px, calc(100vh - 2rem)) !important;
    background: linear-gradient(rgba(5, 5, 5, 0.58), rgba(5, 5, 5, 0.72)),
                url('/images/trade.jpg') center / cover no-repeat !important;
}

.syndicate-modal.my-auction-listings-modal .my-auction-listings-close,
.syndicate-modal.my-auction-listings-modal .my-auction-listings-close:hover,
.syndicate-modal.my-auction-listings-modal .my-auction-listings-close:focus,
.syndicate-modal.my-auction-listings-modal .my-auction-listings-close:focus-visible,
.syndicate-modal.my-auction-listings-modal .my-auction-listings-close:active {
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-bottom: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    clip-path: none !important;
    color: var(--mafia-smoke) !important;
    font-size: 1.5rem !important;
    line-height: 1 !important;
    transform: none !important;
    text-transform: none !important;
}

.syndicate-modal.my-auction-listings-modal .my-auction-listings-close:hover,
.syndicate-modal.my-auction-listings-modal .my-auction-listings-close:focus-visible {
    color: inherit !important;
    outline: 1px dotted currentColor !important;
}

.syndicate-modal.heist-entry-modal-first-stage-success {
    border: 1px solid var(--mafia-gold-dark) !important;
    outline: 1px solid rgba(212, 175, 55, 0.15);
    outline-offset: -1px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.85), inset 0 0 0 1px rgba(212, 175, 55, 0.15) !important;
}

.syndicate-modal.heist-boss-team-report-modal {
    border: 1px solid var(--mafia-gold-dark) !important;
    border-top: 1px solid var(--mafia-gold-dark) !important;
    border-right: 1px solid var(--mafia-gold-dark) !important;
    border-bottom: 1px solid var(--mafia-gold-dark) !important;
    border-left: 1px solid var(--mafia-gold-dark) !important;
    outline: 1px solid rgba(212, 175, 55, 0.15) !important;
    outline-offset: -1px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.85), inset 0 0 0 1px rgba(212, 175, 55, 0.15) !important;
}

.syndicate-modal.heist-entry-modal.failure {
    border: 1px solid var(--mafia-gold-dark) !important;
    border-radius: 8px !important;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.85), inset 0 0 0 1px rgba(212, 175, 55, 0.15) !important;
}

/* Pokazuj tylko ostatni otwarty modal; wcześniejsze wracają po jego zamknięciu. */
.syndicate-modal-overlay:has(~ .syndicate-modal-overlay) {
    display: none !important;
}

.gang-tracking-overlay:has(~ .inspect-overlay) {
    display: none !important;
}

.pvp-result-overlay:has(~ .syndicate-modal-overlay:has(.battle-report-modal)) {
    display: none !important;
}

#components-reconnect-modal {
    display: none !important;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

/* Global action buttons: subtle trapezoid normally, stronger on hover. */
.mission-execute-btn,
.crew-toggle-btn,
.hire-crew-btn,
.fire-crew-btn,
.crew-modal-cancel-btn,
.crew-modal-mission-btn,
.syndicate-fight .syndicate-action-btn,
.gang-war-challenge-modal .syndicate-action-btn,
.my-auction-listings-actions .auction-test-action-btn,
.syndicate-fight .syndicate-attack-btn,
.avatar-selection-tabs .syndicate-action-btn,
.avatar-selection-actions .syndicate-action-btn,
.syndicate-rest-info > .syndicate-action-btn,
.syndicate-gym .syndicate-action-btn,
.syndicate-gym .syndicate-cancel-btn,
.syndicate-work .syndicate-action-btn,
.syndicate-work .syndicate-cancel-btn,
.building-action-btn,
.district-card-border-scope .building-action-btn,
.district-card-border-scope .syndicate-interior-view button:not(.building-photo-preview-button),
.arena-fight-btn,
.auction-test-action-btn,
.construction-cancel-control .syndicate-cancel-btn,
.show-battle-report-btn,
.hospital-treatment-btn,
.resurrection-btn,
.interior-build-btn,
.interior-upgrade-btn,
.interior-collect-btn,
.syndicate-pray-btn,
.syndicate-donate-btn,
.syndicate-blessing-btn,
.syndicate-bunker-btn,
.syndicate-buy-btn,
.syndicate-sell-btn,
.syndicate-gang button:not(.syndicate-tab),
.syndicate-gang-grill button,
.syndicate-ranking button,
.gang-tracking-actions button,
.gang-details-members-table button,
.gang-details-modal .syndicate-action-btn,
.gang-description-actions .syndicate-action-btn,
.inspect-actions .syndicate-action-btn,
.inspect-message .syndicate-action-btn,
.gang-mission-preview-actions .syndicate-action-btn,
.syndicate-shop-item.ammo-shop-item .syndicate-action-btn,
.pewex-gift-code-btn,
.pewex-referral-copy-btn,
.pvp-result-full-report-btn,
.heist-boss-team-report-modal .syndicate-action-btn,
.gang-mission-battle-reports-modal .syndicate-action-btn,
.syndicate-mission-loading-screen .syndicate-cancel-btn,
.apartment-reward-btn,
.villa-recovery-btn,
.bunker-action-btn,
.nightclub-send-btn,
.nightclub-fire-btn,
.nightclub-collect-btn,
.nightclub-stop-btn,
.nightclub-hire-btn,
.nightclub-private-room-remove-btn,
.nightclub-section-tab,
.server-room-card-training .syndicate-action-btn,
.server-room-panel-hack .syndicate-action-btn,
.hideout-safe-actions .syndicate-action-btn,
.heist-entry-modal.success .heist-entry-modal-actions .syndicate-action-btn,
.heist-entry-modal.failure .heist-entry-modal-actions .syndicate-action-btn,
.heist-entry-modal.reward .heist-entry-modal-actions .syndicate-action-btn,
.special-mission-chest-modal .syndicate-action-btn,
.syndicate-chest-tile-open-btn,
.backpack-sell-confirm-modal .syndicate-action-btn,
.passive-skill-removal-cancel,
.passive-skill-use-button,
.passive-skill-upgrade-button,
.passive-skill-upgrade-confirm,
.passive-skill-upgrade-cancel,
.passive-skill-unlock-confirm,
.passive-skill-unlock-cancel,
.gang-war-close-action .syndicate-action-btn,
.gang-war-report-body .syndicate-action-btn,
.heist-tutorial-actions .syndicate-action-btn,
.syndicate-quest-details .syndicate-action-btn,
.passive-skill-info-close,
.admin-tutorial-confirm,
.syndicate-welcome-wiki-btn,
.new-player-gift-claim-btn,
.locksmith-action-btn,
.syndicate-mission-loot-panel .show-report {
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.15) 0%, rgba(80, 8, 18, 0.15) 100%) !important;
    border: none !important;
    border-bottom: 0 !important;
    border-radius: 0 !important;
    color: #fff !important;
    font-weight: 700;
    transition: all 0.2s ease;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%) !important;
}

.mission-execute-btn:hover:not(:disabled),
.crew-toggle-btn:hover:not(:disabled),
.hire-crew-btn:hover:not(:disabled),
.fire-crew-btn:hover:not(:disabled),
.crew-modal-cancel-btn:hover:not(:disabled),
.crew-modal-mission-btn:hover:not(:disabled),
.syndicate-fight .syndicate-action-btn:hover:not(:disabled),
.gang-war-challenge-modal .syndicate-action-btn:hover:not(:disabled),
.my-auction-listings-actions .auction-test-action-btn:hover:not(:disabled),
.syndicate-fight .syndicate-attack-btn:hover:not(:disabled),
.avatar-selection-tabs .syndicate-action-btn:hover:not(:disabled),
.avatar-selection-actions .syndicate-action-btn:hover:not(:disabled),
.syndicate-rest-info > .syndicate-action-btn:hover:not(:disabled),
.syndicate-gym .syndicate-action-btn:hover:not(:disabled),
.syndicate-gym .syndicate-cancel-btn:hover:not(:disabled),
.syndicate-work .syndicate-action-btn:hover:not(:disabled),
.syndicate-work .syndicate-cancel-btn:hover:not(:disabled),
.building-action-btn:hover:not(:disabled),
.district-card-border-scope .building-action-btn:hover:not(:disabled),
.district-card-border-scope .syndicate-interior-view button:not(.building-photo-preview-button):hover:not(:disabled),
.arena-fight-btn:hover:not(:disabled),
.auction-test-action-btn:hover:not(:disabled),
.construction-cancel-control .syndicate-cancel-btn:hover:not(:disabled),
.show-battle-report-btn:hover:not(:disabled),
.hospital-treatment-btn:hover:not(:disabled),
.resurrection-btn:hover:not(:disabled),
.interior-build-btn:hover:not(:disabled),
.interior-upgrade-btn:hover:not(:disabled),
.interior-collect-btn:hover:not(:disabled),
.syndicate-pray-btn:hover:not(:disabled),
.syndicate-donate-btn:hover:not(:disabled),
.syndicate-blessing-btn:hover:not(:disabled),
.syndicate-bunker-btn:hover:not(:disabled),
.syndicate-buy-btn:hover:not(:disabled),
.syndicate-sell-btn:hover:not(:disabled),
.syndicate-gang button:not(.syndicate-tab):hover:not(:disabled),
.syndicate-gang-grill button:hover:not(:disabled),
.syndicate-ranking button:hover:not(:disabled),
.gang-tracking-actions button:hover:not(:disabled),
.gang-details-members-table button:hover:not(:disabled),
.gang-details-modal .syndicate-action-btn:hover:not(:disabled),
.gang-description-actions .syndicate-action-btn:hover:not(:disabled),
.inspect-actions .syndicate-action-btn:hover:not(:disabled),
.inspect-message .syndicate-action-btn:hover:not(:disabled),
.gang-mission-preview-actions .syndicate-action-btn:hover:not(:disabled),
.syndicate-shop-item.ammo-shop-item .syndicate-action-btn:hover:not(:disabled),
.pewex-gift-code-btn:hover:not(:disabled),
.pewex-referral-copy-btn:hover:not(:disabled),
.pvp-result-full-report-btn:hover:not(:disabled),
.heist-boss-team-report-modal .syndicate-action-btn:hover:not(:disabled),
.gang-mission-battle-reports-modal .syndicate-action-btn:hover:not(:disabled),
.syndicate-quest-details .syndicate-action-btn:hover:not(:disabled),
.syndicate-mission-loading-screen .syndicate-cancel-btn:hover:not(:disabled),
.apartment-reward-btn:hover:not(:disabled),
.villa-recovery-btn:hover:not(:disabled),
.bunker-action-btn:hover:not(:disabled),
.nightclub-send-btn:hover:not(:disabled),
.nightclub-fire-btn:hover:not(:disabled),
.nightclub-collect-btn:hover:not(:disabled),
.nightclub-stop-btn:hover:not(:disabled),
.nightclub-hire-btn:hover:not(:disabled),
.nightclub-private-room-remove-btn:hover:not(:disabled),
.nightclub-section-tab:hover:not(:disabled),
.server-room-card-training .syndicate-action-btn:hover:not(:disabled),
.server-room-panel-hack .syndicate-action-btn:hover:not(:disabled),
.hideout-safe-actions .syndicate-action-btn:hover:not(:disabled),
.heist-entry-modal.success .heist-entry-modal-actions .syndicate-action-btn:hover:not(:disabled),
.heist-entry-modal.failure .heist-entry-modal-actions .syndicate-action-btn:hover:not(:disabled),
.special-mission-chest-modal .syndicate-action-btn:hover:not(:disabled),
.syndicate-chest-tile-open-btn:hover:not(:disabled),
.backpack-sell-confirm-modal .syndicate-action-btn:hover:not(:disabled),
.passive-skill-removal-cancel:hover:not(:disabled),
.passive-skill-use-button:hover:not(:disabled),
.passive-skill-upgrade-button:hover:not(:disabled),
.passive-skill-upgrade-confirm:hover:not(:disabled),
.passive-skill-upgrade-cancel:hover:not(:disabled),
.passive-skill-unlock-confirm:hover:not(:disabled),
.passive-skill-unlock-cancel:hover:not(:disabled),
.heist-entry-modal.reward .heist-entry-modal-actions .syndicate-action-btn:hover:not(:disabled),
.gang-war-close-action .syndicate-action-btn:hover:not(:disabled),
.gang-war-report-body .syndicate-action-btn:hover:not(:disabled),
.heist-tutorial-actions .syndicate-action-btn:hover:not(:disabled),
.syndicate-quest-details .syndicate-action-btn:hover:not(:disabled),
.passive-skill-info-close:hover:not(:disabled),
.admin-tutorial-confirm:hover:not(:disabled),
.syndicate-welcome-wiki-btn:hover:not(:disabled),
.new-player-gift-claim-btn:hover:not(:disabled),
.locksmith-action-btn:hover:not(:disabled),
.locksmith-action-btn:hover:not(:disabled),
.syndicate-mission-loot-panel .show-report:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(232, 34, 68, 0.65) 0%, rgba(160, 0, 32, 0.65) 100%) !important;
}

.avatar-selection-tabs .syndicate-action-btn:hover:not(:disabled),
.avatar-selection-tabs .syndicate-action-btn:focus-visible,
.avatar-selection-actions .syndicate-action-btn:hover:not(:disabled),
.avatar-selection-actions .syndicate-action-btn:focus-visible {
    background: linear-gradient(135deg, rgba(232, 34, 68, 0.65) 0%, rgba(160, 0, 32, 0.65) 100%) !important;
    color: #fff !important;
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.5);
}

.avatar-selection-actions .syndicate-action-btn:disabled {
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.15) 0%, rgba(80, 8, 18, 0.15) 100%) !important;
    color: #fff !important;
    opacity: 0.55;
}

/* Przyciski wyboru avatara muszą zachować widoczny trapez także poza stylem komponentu. */
.avatar-selection-button {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 38px !important;
    padding: 0.58rem 1rem !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.65) 0%, rgba(80, 8, 18, 0.65) 100%) !important;
    color: #fff !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%) !important;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease !important;
}

.avatar-selection-button:hover:not(:disabled),
.avatar-selection-button:focus-visible,
.avatar-selection-button.active {
    background: linear-gradient(135deg, rgba(232, 34, 68, 0.9) 0%, rgba(160, 0, 32, 0.9) 100%) !important;
    color: #fff !important;
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.5) !important;
    transform: translateY(-2px);
}

.avatar-selection-button:disabled {
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.65) 0%, rgba(80, 8, 18, 0.65) 100%) !important;
    color: #fff !important;
    opacity: 0.65;
    cursor: not-allowed !important;
}

.pvp-result-full-report-btn {
    width: min(70%, 620px) !important;
    min-width: 0 !important;
    max-width: calc(100% - 2.8rem) !important;
    box-sizing: border-box;
    padding-inline: 2.5rem !important;
}

.syndicate-modal.pvp-result-modal {
    border: 1px solid rgba(212, 175, 55, 0.35) !important;
    outline: none !important;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.85) !important;
}

.syndicate-modal.pvp-countdown-modal,
.syndicate-modal.pvp-result-modal,
.syndicate-modal.battle-report-modal {
    border: 1px solid rgba(212, 175, 55, 0.35) !important;
    border-top: 1px solid rgba(212, 175, 55, 0.35) !important;
    border-radius: 8px !important;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.85) !important;
}

.btn-icon {
    display: inline-block;
    margin-right: 0.35rem;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

body.theme-dark {
    background-color: #2b2d31;
    color: #e5e7eb;
}

body.theme-dark main,
body.theme-dark .content,
body.theme-dark .home-page,
body.theme-dark .page {
    background-color: #2b2d31;
    color: #e5e7eb;
}

body.theme-dark .top-row,
body.theme-dark .home-panel,
body.theme-dark .settings-panel,
body.theme-dark .ticket-description-box,
body.theme-dark .reminder-popup,
body.theme-dark .employee-broadcast-modal,
body.theme-dark .employee-month-modal,
body.theme-dark .home-task-card,
body.theme-dark .home-task-group,
body.theme-dark .home-empty-state,
body.theme-dark .settings-toggle-card {
    background: #3a3d42 !important;
    color: #f3f4f6 !important;
    border-color: #575b63 !important;
}

body.theme-dark .top-row-user,
body.theme-dark .home-panel-description,
body.theme-dark .home-task-meta,
body.theme-dark .settings-description,
body.theme-dark .settings-toggle-text,
body.theme-dark .settings-status,
body.theme-dark .ticket-edit-meta,
body.theme-dark .employee-broadcast-meta {
    color: #d1d5db !important;
}

body.theme-dark .home-panel-header h1,
body.theme-dark .home-panel-header h2,
body.theme-dark .home-task-group-header h2,
body.theme-dark .home-task-title-row strong,
body.theme-dark .settings-panel h1,
body.theme-dark .settings-toggle-title,
body.theme-dark .employee-broadcast-title,
body.theme-dark .employee-month-name {
    color: #f9fafb !important;
}

body.theme-dark .form-control,
body.theme-dark .form-select,
body.theme-dark textarea,
body.theme-dark .home-notes-textarea,
body.theme-dark .home-shared-textarea {
    background: #d1d5db !important;
    color: #111827 !important;
    border-color: #9ca3af !important;
}

body.theme-dark .form-control::placeholder,
body.theme-dark textarea::placeholder {
    color: #4b5563 !important;
}

body.theme-dark .form-label {
    color: #e5e7eb !important;
}

body.theme-dark .home-task-description,
body.theme-dark .employee-broadcast-message,
body.theme-dark .ticket-description-box,
body.theme-dark .ticket-description-box p {
    color: #e5e7eb !important;
}

body.theme-dark .employee-broadcast-message,
body.theme-dark .calendar-sheet,
body.theme-dark .reminder-popup-body,
body.theme-dark .reminder-popup-header,
body.theme-dark .reminder-popup-footer {
    background: #3f4349 !important;
    color: #f3f4f6 !important;
    border-color: #5b616a !important;
}

body.theme-dark .sidebar-card {
    background: linear-gradient(180deg, rgba(95, 99, 106, 0.55) 0%, rgba(69, 72, 78, 0.65) 100%);
    border-color: rgba(209, 213, 219, 0.2);
}

body.theme-dark .calendar-sheet {
    background: linear-gradient(180deg, #fff 0%, #f8fbff 100%) !important;
    color: #1a2842 !important;
}

body.theme-dark .calendar-day,
body.theme-dark .calendar-sheet-top,
body.theme-dark .calendar-month,
body.theme-dark .calendar-year,
body.theme-dark .calendar-time {
    color: #f9fafb !important;
}

body.theme-dark .calendar-sheet-top {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%) !important;
    color: #ffffff !important;
}

body.theme-dark .calendar-day {
    color: #1a2842 !important;
}

body.theme-dark .nav-item .nav-link {
    background: rgba(255, 255, 255, 0.08);
}

body.theme-dark .ticket-meta-badge {
    color: #f3f4f6 !important;
    background-color: #4b5563 !important;
    border-color: #6b7280 !important;
}

body.theme-dark .receivables-hero-card,
body.theme-dark .receivables-card,
body.theme-dark .receivables-form,
body.theme-dark .receivables-stat-card,
body.theme-dark .receivables-tab,
body.theme-dark .receivables-table-wrapper,
body.theme-dark .receivables-empty-row,
body.theme-dark .phone-book-hero-card,
body.theme-dark .phone-book-panel-card,
body.theme-dark .phone-book-summary-card,
body.theme-dark .dollars-hero,
body.theme-dark .dollars-balance-card,
body.theme-dark .employee-history-card,
body.theme-dark .employee-of-month-card,
body.theme-dark .employee-of-month-stat,
body.theme-dark .leaderboard-card,
body.theme-dark .transfer-card,
body.theme-dark .transfer-panel,
body.theme-dark .tamagotchi-modal,
body.theme-dark .tamagotchi-store-panel,
body.theme-dark .tamagotchi-balance-panel {
    background: #3a3d42 !important;
    color: #f3f4f6 !important;
    border-color: #575b63 !important;
}

body.theme-dark .receivables-page .card-body,
body.theme-dark .phone-book-page .card-body,
body.theme-dark .dollars-page .card-body,
body.theme-dark .dollars-hero,
body.theme-dark .transfer-panel,
body.theme-dark .employee-of-month-body {
    background: transparent !important;
}

body.theme-dark .receivables-page h1,
body.theme-dark .receivables-page h5,
body.theme-dark .receivables-page .card-title,
body.theme-dark .receivables-kicker,
body.theme-dark .receivables-stat-value,
body.theme-dark .receivables-form-title,
body.theme-dark .receivables-section-summary strong,
body.theme-dark .receivables-table-footer strong,
body.theme-dark .phone-book-page h1,
body.theme-dark .phone-book-page h5,
body.theme-dark .phone-book-page .card-title,
body.theme-dark .phone-book-kicker,
body.theme-dark .phone-book-summary-value,
body.theme-dark .dollars-page h1,
body.theme-dark .dollars-page h5,
body.theme-dark .dollars-page .card-title,
body.theme-dark .dollars-kicker,
body.theme-dark .dollars-amount,
body.theme-dark .employee-of-month-name,
body.theme-dark .employee-of-month-title,
body.theme-dark .employee-of-month-score,
body.theme-dark .tamagotchi-header h5,
body.theme-dark .tamagotchi-kicker {
    color: #f9fafb !important;
}

body.theme-dark .receivables-page p.text-muted,
body.theme-dark .receivables-stat-label,
body.theme-dark .receivables-stat-meta,
body.theme-dark .receivables-form-subtitle,
body.theme-dark .receivables-input-suffix,
body.theme-dark .receivables-active-tab-label,
body.theme-dark .receivables-section-summary,
body.theme-dark .receivables-table-footer,
body.theme-dark .phone-book-page p.text-muted,
body.theme-dark .phone-book-page .text-muted,
body.theme-dark .phone-book-page .form-text,
body.theme-dark .phone-book-page .small.text-muted,
body.theme-dark .phone-book-summary-label,
body.theme-dark .dollars-subtitle,
body.theme-dark .dollars-balance-label,
body.theme-dark .dollars-balance-unit,
body.theme-dark .dollars-card-subtitle,
body.theme-dark .employee-of-month-description,
body.theme-dark .employee-of-month-stat-label,
body.theme-dark .dollars-page p.text-muted,
body.theme-dark .dollars-page .text-muted,
body.theme-dark .dollars-page .form-text,
body.theme-dark .dollars-page .small.text-muted,
body.theme-dark .receivables-page .text-muted,
body.theme-dark .receivables-page .form-text,
body.theme-dark .receivables-page .small.text-muted,
body.theme-dark .tamagotchi-store-subtitle,
body.theme-dark .tamagotchi-store-balance,
body.theme-dark .tamagotchi-balance-action,
body.theme-dark .tamagotchi-balance-group-title,
body.theme-dark .tamagotchi-mood,
body.theme-dark .tamagotchi-form,
body.theme-dark .tamagotchi-name {
    color: #d1d5db !important;
}

body.theme-dark .tamagotchi-modal {
    background: linear-gradient(180deg, #fffdf8 0%, #ffffff 100%) !important;
    color: #111827 !important;
    border-color: #fed7aa !important;
}

body.theme-dark .tamagotchi-store-panel,
body.theme-dark .tamagotchi-balance-panel {
    background: linear-gradient(180deg, #fff7ed 0%, #fffbeb 100%) !important;
    color: #111827 !important;
    border-color: #fdba74 !important;
}

body.theme-dark .tamagotchi-header h5,
body.theme-dark .tamagotchi-kicker,
body.theme-dark .tamagotchi-name,
body.theme-dark .tamagotchi-mood,
body.theme-dark .tamagotchi-form,
body.theme-dark .tamagotchi-store-toggle,
body.theme-dark .tamagotchi-store-title,
body.theme-dark .tamagotchi-store-balance,
body.theme-dark .tamagotchi-store-subtitle,
body.theme-dark .tamagotchi-egg-name,
body.theme-dark .tamagotchi-egg-meta,
body.theme-dark .tamagotchi-egg-price,
body.theme-dark .tamagotchi-balance-toggle,
body.theme-dark .tamagotchi-balance-title,
body.theme-dark .tamagotchi-balance-group-title,
body.theme-dark .tamagotchi-balance-action,
body.theme-dark .tamagotchi-mini-stat span,
body.theme-dark .tamagotchi-mini-stat strong,
body.theme-dark .tamagotchi-retro-stat-name,
body.theme-dark .tamagotchi-retro-stat-value,
body.theme-dark .tamagotchi-care-title,
body.theme-dark .tamagotchi-care-item {
    color: #111827 !important;
}

body.theme-dark .receivables-page .form-label,
body.theme-dark .phone-book-page .form-label,
body.theme-dark .dollars-page .form-label,
body.theme-dark .receivables-page .table,
body.theme-dark .phone-book-page .table,
body.theme-dark .dollars-page .table,
body.theme-dark .receivables-page td,
body.theme-dark .phone-book-page td,
body.theme-dark .dollars-page td,
body.theme-dark .receivables-page th,
body.theme-dark .phone-book-page th,
body.theme-dark .dollars-page th {
    color: #f3f4f6 !important;
}

body.theme-dark .receivables-page .form-control,
body.theme-dark .receivables-page .form-select,
body.theme-dark .receivables-page textarea,
body.theme-dark .phone-book-page .form-control,
body.theme-dark .phone-book-page .form-select,
body.theme-dark .phone-book-page textarea,
body.theme-dark .dollars-page .form-control,
body.theme-dark .dollars-page .form-select,
body.theme-dark .dollars-page textarea,
body.theme-dark .transfer-input {
    background: #ffffff !important;
    color: #111827 !important;
    border-color: #9ca3af !important;
}

body.theme-dark .phone-book-page .phone-book-table,
body.theme-dark .phone-book-page .phone-book-table > :not(caption) > * > *,
body.theme-dark .phone-book-page .phone-book-table > thead > tr > th,
body.theme-dark .phone-book-page .phone-book-table > tbody > tr > td {
    background: #ffffff !important;
    color: #111827 !important;
    border-color: #d1d5db !important;
}

body.theme-dark .receivables-tab.active,
body.theme-dark .tamagotchi-store-tab.active,
body.theme-dark .tamagotchi-species-tab.active {
    color: #ffffff !important;
}

body.theme-dark .receivables-status-neutral {
    color: #f3f4f6 !important;
    background: #4b5563 !important;
    border-color: #6b7280 !important;
}

body.theme-dark .receivables-status-warning {
    color: #ffffff !important;
    background: #92400e !important;
    border-color: #b45309 !important;
}

body.theme-dark .receivables-status-success {
    color: #ffffff !important;
    background: #166534 !important;
    border-color: #15803d !important;
}

body.theme-dark .receivables-row-settled,
body.theme-dark .leaderboard-table tbody tr.table-primary {
    background: #40444b !important;
}

body.theme-dark .leaderboard-table tbody tr.table-primary > td {
    background: #40444b !important;
    color: #f9fafb !important;
    border-color: #52565d !important;
}

body.theme-dark .settings-management-card,
body.theme-dark .ticket-create-page .card,
body.theme-dark #ticket-create-form .card {
    background: #3a3d42 !important;
    color: #f3f4f6 !important;
    border-color: #575b63 !important;
}

body.theme-dark .settings-management-card .card-body,
body.theme-dark .ticket-create-page .card-body,
body.theme-dark #ticket-create-form .card-body {
    background: transparent !important;
}

body.theme-dark .settings-management-card h5,
body.theme-dark .settings-management-card .card-title,
body.theme-dark .settings-management-card .profile-summary-value,
body.theme-dark .ticket-create-page h1,
body.theme-dark .ticket-create-page h5,
body.theme-dark .ticket-create-page .card-title,
body.theme-dark .ticket-create-page .form-label,
body.theme-dark .ticket-create-page strong {
    color: #f9fafb !important;
}

body.theme-dark .settings-management-card p.text-muted,
body.theme-dark .settings-management-card .form-text,
body.theme-dark .settings-management-card .profile-photo-hint,
body.theme-dark .settings-management-card .profile-summary-label,
body.theme-dark .settings-management-card .small.text-muted,
body.theme-dark .ticket-create-page p.text-muted,
body.theme-dark .ticket-create-page .form-text,
body.theme-dark .ticket-create-page .small.text-muted,
body.theme-dark .ticket-create-page .form-check-label {
    color: #d1d5db !important;
}

body.theme-dark .settings-management-card .profile-summary {
    background: #4b4f56 !important;
    border-color: #6b7280 !important;
}

body.theme-dark .settings-management-card .form-control,
body.theme-dark .settings-management-card .form-select,
body.theme-dark .settings-management-card textarea,
body.theme-dark .ticket-create-page .form-control,
body.theme-dark .ticket-create-page .form-select,
body.theme-dark .ticket-create-page textarea,
body.theme-dark #ticket-create-form .form-control,
body.theme-dark #ticket-create-form .form-select,
body.theme-dark #ticket-create-form textarea {
    background: #ffffff !important;
    color: #111827 !important;
    border-color: #9ca3af !important;
}

body.theme-dark #ticket-details-page .card,
body.theme-dark #ticket-details-page .border.rounded,
body.theme-dark #ticket-details-page .ticket-description-box {
    background: #3a3d42 !important;
    color: #f3f4f6 !important;
    border-color: #575b63 !important;
}

body.theme-dark #ticket-details-page .card-body {
    background: transparent !important;
}

body.theme-dark #ticket-details-page h1,
body.theme-dark #ticket-details-page h5,
body.theme-dark #ticket-details-page .card-title,
body.theme-dark #ticket-details-page .form-label,
body.theme-dark #ticket-details-page strong,
body.theme-dark #ticket-details-page .border.rounded strong {
    color: #f9fafb !important;
}

body.theme-dark #ticket-details-page p.text-muted,
body.theme-dark #ticket-details-page .text-muted,
body.theme-dark #ticket-details-page .form-text,
body.theme-dark #ticket-details-page .small.text-muted,
body.theme-dark #ticket-details-page .ticket-edit-meta,
body.theme-dark #ticket-details-page .border.rounded span.text-muted,
body.theme-dark .login-card p.text-muted,
body.theme-dark .forgot-password-panel .text-muted {
    color: #d1d5db !important;
}

body.theme-dark .login-page .login-card,
body.theme-dark .login-page .login-card h1,
body.theme-dark .login-page .login-card p,
body.theme-dark .login-page .login-card .form-label,
body.theme-dark .login-page .forgot-password-toggle,
body.theme-dark .login-page .forgot-password-panel,
body.theme-dark .login-page .forgot-password-panel .text-muted {
    color: inherit !important;
}

body.theme-dark .login-page .login-card .form-control {
    background: rgba(255, 255, 255, 0.82) !important;
    color: #111827 !important;
    border-color: rgba(148, 163, 184, 0.45) !important;
}

body.theme-dark .login-page .login-card .form-control::placeholder {
    color: #6b7280 !important;
}

body.theme-dark #ticket-details-page .form-control,
body.theme-dark #ticket-details-page .form-select,
body.theme-dark #ticket-details-page textarea,
body.theme-dark #ticket-details-page input[type=time].form-control {
    background: #ffffff !important;
    color: #111827 !important;
    border-color: #9ca3af !important;
}

body.theme-dark .admin-zone-hero-card,
body.theme-dark .admin-zone-panel-card,
body.theme-dark .admin-zone-action-card,
body.theme-dark .admin-zone-stat-card,
body.theme-dark .admin-broadcast-modal,
body.theme-dark .admin-zone-table-wrapper,
body.theme-dark .profile-card {
    background: #3a3d42 !important;
    color: #f3f4f6 !important;
    border-color: #575b63 !important;
}

body.theme-dark .admin-zone-hero-card .card-body,
body.theme-dark .admin-zone-panel-card .card-body,
body.theme-dark .profile-card .card-body {
    background: transparent !important;
}

body.theme-dark .admin-zone-kicker,
body.theme-dark .admin-zone-section-icon,
body.theme-dark .admin-zone-action-icon,
body.theme-dark .admin-zone-stat-card-accent,
body.theme-dark .admin-zone-page .badge.text-bg-light.border {
    background: #4b5563 !important;
    color: #f9fafb !important;
    border-color: #6b7280 !important;
}

body.theme-dark .admin-zone-action-title,
body.theme-dark .admin-zone-stat-value,
body.theme-dark .admin-zone-page .card-title,
body.theme-dark .admin-zone-page h1,
body.theme-dark .admin-zone-page h4,
body.theme-dark .admin-zone-page h5,
body.theme-dark .admin-zone-page th,
body.theme-dark .admin-zone-page td,
body.theme-dark .admin-zone-page label,
body.theme-dark .admin-zone-page .table,
body.theme-dark .admin-zone-page .table > :not(caption) > * > * {
    color: #f3f4f6 !important;
}

body.theme-dark .admin-zone-page .admin-zone-action-text,
body.theme-dark .admin-zone-page .admin-zone-stat-label,
body.theme-dark .admin-zone-page .profile-photo-hint,
body.theme-dark .admin-zone-page .form-text,
body.theme-dark .admin-zone-page .small.text-muted,
body.theme-dark .admin-zone-page p.text-muted {
    color: #d1d5db !important;
}

body.theme-dark .admin-zone-page .form-control,
body.theme-dark .admin-zone-page .form-select,
body.theme-dark .admin-zone-page textarea,
body.theme-dark .admin-broadcast-textarea {
    background: #ffffff !important;
    color: #111827 !important;
    border-color: #9ca3af !important;
}

body.theme-dark .table {
    color: #e5e7eb;
}

body.theme-dark .table thead th,
body.theme-dark table thead th {
    color: #f9fafb !important;
    background-color: #3f4349;
    border-color: #5b616a;
}

body.theme-dark .table tbody td,
body.theme-dark table tbody td {
    color: #e5e7eb;
    border-color: #52565d;
}

body.theme-dark .future-row {
    background-color: #3a3d42;
}

body.theme-dark .future-row td,
body.theme-dark .overdue-row td {
    border-color: #52565d;
}

body.theme-dark .blazor-error-boundary {
    background-color: #7f1d1d;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.overdue-row {
    background-color: #fff1f1;
}

.ticket-badge-red {
    color: #b42318 !important;
    background-color: #fff1f1 !important;
    border: 1px solid #f3c3c3 !important;
}

.ticket-badge-green {
    color: #166534 !important;
    background-color: #ecfdf3 !important;
    border: 1px solid #b7ebc6 !important;
}

.ticket-badge-amber {
    color: #92400e !important;
    background-color: #fffbeb !important;
    border: 1px solid #f4d28d !important;
}

.ticket-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
}

.ticket-meta-badge {
    color: #1f2937 !important;
    background-color: #f8fafc !important;
    border-color: #d1d5db !important;
}

.ticket-edit-meta {
    color: #6b7280;
    font-size: 0.86rem;
}

.ticket-edit-meta strong {
    color: #374151;
}

.overdue-row td {
    border-color: #f1b0b7;
}

.future-row {
    background-color: #f6f7f9;
}

.future-row td {
    border-color: #e6e8ec;
}

.overdue-indicator-cell {
    width: 42px;
    text-align: center;
}

.overdue-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background-color: #dc3545;
    color: #fff;
    font-weight: 700;
    animation: overdue-pulse 1s infinite;
}

.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.06);
}

.status-dot.online {
    background-color: #16a34a;
}

.status-dot.offline {
    background-color: #dc2626;
}

@keyframes overdue-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.18);
        opacity: 0.55;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.reminder-container {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1050;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 1rem;
    max-width: calc(100vw - 2rem);
}

.reminder-popup {
    width: 400px;
    min-height: 250px;
    background: #fff;
    border: 1px solid #d7dce2;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.reminder-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid #edf0f3;
    font-weight: 600;
}

.reminder-popup-body {
    flex: 1;
    padding: 1rem;
    display: grid;
    gap: 0.6rem;
}

.reminder-popup-alert {
    margin-top: 0.5rem;
    color: #b42318;
    font-weight: 700;
}

.reminder-popup-footer {
    padding: 0 1rem 1rem;
    display: flex;
    justify-content: flex-end;
}

.ticket-description-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #0d6efd;
    border-left: 5px solid #0d6efd;
    border-radius: 8px;
    padding: 1.25rem;
    margin: 0.75rem 0;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    font-size: 1.05rem;
    line-height: 1.6;
    color: #1f2937;
    font-weight: 500;
}

.ticket-description-box p {
    color: #1f2937;
    word-wrap: break-word;
}

body.theme-dark .text-muted,
body.theme-dark p.text-muted,
body.theme-dark .small.text-muted,
body.theme-dark .form-text {
    color: #d1d5db !important;
}

body.theme-dark .table {
    --bs-table-color: #e5e7eb;
    --bs-table-bg: #3a3d42;
    --bs-table-border-color: #52565d;
    --bs-table-striped-color: #e5e7eb;
    --bs-table-striped-bg: #40444b;
    --bs-table-hover-color: #ffffff;
    --bs-table-hover-bg: #474b52;
    --bs-table-active-color: #ffffff;
    --bs-table-active-bg: #4d525a;
    color: #e5e7eb !important;
}

body.theme-dark .table > :not(caption) > * > * {
    color: #e5e7eb !important;
    border-bottom-color: #52565d !important;
}

body.theme-dark .table > thead > tr > th,
body.theme-dark table > thead > tr > th {
    color: #ffffff !important;
    background-color: #3f4349 !important;
    border-color: #5b616a !important;
}

body.theme-dark .table > tbody > tr > td,
body.theme-dark table > tbody > tr > td,
body.theme-dark .ticket-row td,
body.theme-dark .future-row td,
body.theme-dark .overdue-row td {
    color: #e5e7eb !important;
}

body.theme-dark .ticket-row.highlighted-row-1 td,
body.theme-dark .ticket-row.highlighted-row-2 td,
body.theme-dark .ticket-row.highlighted-row-3 td,
body.theme-dark .table > tbody > tr.highlighted-row-1 > td,
body.theme-dark .table > tbody > tr.highlighted-row-2 > td,
body.theme-dark .table > tbody > tr.highlighted-row-3 > td {
    color: #111827 !important;
}

body.theme-dark .ticket-badge-red {
    color: #ffffff !important;
    background-color: #7f1d1d !important;
    border-color: #991b1b !important;
}

body.theme-dark .ticket-badge-green {
    color: #ffffff !important;
    background-color: #166534 !important;
    border-color: #15803d !important;
}

body.theme-dark .ticket-badge-amber {
    color: #ffffff !important;
    background-color: #92400e !important;
    border-color: #b45309 !important;
}

body.theme-dark .ticket-meta-badge {
    color: #f3f4f6 !important;
    background-color: #4b5563 !important;
    border-color: #6b7280 !important;
}
