:root {
    /* Premium SaaS palette - Indigo/Royal Blue/Cyan primary, Violet/Gold secondary accents */
    --fpb-indigo: #4f46e5;
    --fpb-royal-blue: #2563eb;
    --fpb-cyan: #06b6d4;
    --fpb-emerald: #10b981;
    --fpb-violet: #8b5cf6;
    --fpb-gold: #f59e0b;

    --fpb-success: #16a34a;
    --fpb-warning: #f59e0b;
    --fpb-danger: #dc2626;
    --fpb-info: #3b82f6;

    --fpb-bg-light: #eef1f8;
    --fpb-bg-dark: #0a0c17;
    --fpb-glass-light: rgba(255, 255, 255, 0.6);
    --fpb-glass-dark: rgba(20, 22, 38, 0.55);
    --fpb-border-light: rgba(255, 255, 255, 0.45);
    --fpb-border-dark: rgba(255, 255, 255, 0.09);
    --fpb-text-light: #171933;
    --fpb-text-dark: #eef1fa;

    /* Kept for backward compatibility with existing markup referencing these names */
    --fpb-accent-1: var(--fpb-indigo);
    --fpb-accent-2: var(--fpb-royal-blue);
    --fpb-accent-3: var(--fpb-cyan);

    --fpb-shadow-light: 0 8px 32px rgba(79, 70, 229, 0.12);
    --fpb-shadow-dark: 0 8px 40px rgba(0, 0, 0, 0.55);

    --fpb-font-display: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --fpb-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --fpb-font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
}

body {
    font-family: var(--fpb-font-body);
    background: var(--fpb-bg-light);
    color: var(--fpb-text-light);
    min-height: 100vh;
    transition: background .3s ease, color .3s ease;
}

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

h1, h2, h3, h4, h5, h6, .fpb-display {
    font-family: var(--fpb-font-display);
    letter-spacing: -0.01em;
}

code, .fpb-mono {
    font-family: var(--fpb-font-mono);
}

/* Signature element: a slow-drifting aurora of the brand palette behind glass surfaces,
   built from several independently-animated radial blobs rather than one static gradient. */
.fpb-animated-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: var(--fpb-bg-light);
}

body.dark-mode .fpb-animated-bg {
    background: var(--fpb-bg-dark);
}

.fpb-animated-bg::before,
.fpb-animated-bg::after,
.fpb-animated-bg .fpb-aurora-blob {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .55;
}

.fpb-animated-bg::before {
    width: 46vw;
    height: 46vw;
    top: -10%;
    left: -8%;
    background: radial-gradient(circle, var(--fpb-indigo), transparent 70%);
    animation: fpbDrift1 22s ease-in-out infinite;
}

.fpb-animated-bg::after {
    width: 40vw;
    height: 40vw;
    bottom: -12%;
    right: -6%;
    background: radial-gradient(circle, var(--fpb-cyan), transparent 70%);
    animation: fpbDrift2 26s ease-in-out infinite;
}

.fpb-animated-bg .fpb-aurora-blob {
    width: 34vw;
    height: 34vw;
    top: 30%;
    left: 55%;
    background: radial-gradient(circle, var(--fpb-violet), transparent 70%);
    animation: fpbDrift3 30s ease-in-out infinite;
}

body.dark-mode .fpb-animated-bg::before,
body.dark-mode .fpb-animated-bg::after,
body.dark-mode .fpb-animated-bg .fpb-aurora-blob {
    opacity: .35;
}

@keyframes fpbDrift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(6vw, 8vh) scale(1.12); }
}
@keyframes fpbDrift2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-7vw, -6vh) scale(1.08); }
}
@keyframes fpbDrift3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-5vw, 7vh) scale(0.94); }
}

@media (prefers-reduced-motion: reduce) {
    .fpb-animated-bg::before,
    .fpb-animated-bg::after,
    .fpb-animated-bg .fpb-aurora-blob {
        animation: none;
    }
}

.fpb-glass-card {
    background: var(--fpb-glass-light);
    border: 1px solid var(--fpb-border-light);
    border-radius: 20px;
    box-shadow: var(--fpb-shadow-light);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    transition: transform .25s ease, box-shadow .25s ease, background .3s ease;
}

body.dark-mode .fpb-glass-card {
    background: var(--fpb-glass-dark);
    border-color: var(--fpb-border-dark);
    box-shadow: var(--fpb-shadow-dark);
}

.fpb-glass-card:hover {
    transform: translateY(-3px);
}

.fpb-auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
}

.fpb-auth-card {
    width: 100%;
    max-width: 440px;
    padding: 44px 40px;
    position: relative;
    overflow: hidden;
}

.fpb-auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--fpb-indigo), var(--fpb-royal-blue), var(--fpb-cyan));
}

.fpb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--fpb-font-display);
    font-weight: 700;
    font-size: 1.55rem;
    margin-bottom: 28px;
}

.fpb-brand .fpb-logo-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fpb-indigo), var(--fpb-cyan));
    box-shadow: 0 0 16px rgba(79, 70, 229, .7);
    flex-shrink: 0;
}

/* Auth-specific input styling: icon-prefixed, pill-rounded, focus glow */
.fpb-input-group {
    position: relative;
    margin-bottom: 18px;
}

.fpb-input-group .fpb-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    opacity: .55;
    pointer-events: none;
    font-size: .95rem;
}

.fpb-input-group .form-control {
    padding-left: 42px;
}

.fpb-input-group .fpb-toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    opacity: .55;
    cursor: pointer;
    padding: 4px;
}

.fpb-input-group .fpb-toggle-password:hover {
    opacity: .9;
}

.fpb-input-group label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    margin-bottom: 6px;
    opacity: .85;
}

.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 12px 16px;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--fpb-text-dark);
}

/* Fixes the dropdown popup (native <option> list) rendering with light-on-light /
   dark-on-dark text: color-scheme tells the browser to draw native form-control
   internals (the options popup) using a dark palette instead of the OS default. */
body.dark-mode select.form-select {
    color-scheme: dark;
}

body.dark-mode select.form-select option,
body.dark-mode select.form-select optgroup {
    background-color: #1b1e2b;
    color: var(--fpb-text-dark);
}

/* Light mode stays on the default (light) native popup explicitly, in case the OS
   itself is set to a dark theme - keeps our two modes independent of OS preference. */
body:not(.dark-mode) select.form-select {
    color-scheme: light;
}

.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .22);
    border-color: var(--fpb-indigo);
}

.btn-fpb-primary {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--fpb-indigo), var(--fpb-royal-blue) 55%, var(--fpb-cyan));
    background-size: 180% 180%;
    border: none;
    color: #fff;
    border-radius: 12px;
    padding: 12px 20px;
    font-weight: 600;
    font-family: var(--fpb-font-body);
    transition: transform .2s ease, box-shadow .2s ease, background-position .4s ease;
}

.btn-fpb-primary::before {
    content: '';
    position: absolute;
    top: 0; left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .35), transparent);
    transform: skewX(-20deg);
    transition: left .5s ease;
}

.btn-fpb-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(79, 70, 229, .35);
    background-position: 100% 50%;
    color: #fff;
}

.btn-fpb-primary:hover::before {
    left: 130%;
}

.btn-fpb-primary:active {
    transform: translateY(0);
}

.btn-fpb-primary:disabled,
.btn-fpb-primary.disabled {
    opacity: .6;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

.fpb-theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* ============================================================
   App shell: sidebar + sticky topbar (admin & member panels)
   ============================================================ */
.fpb-app-shell {
    display: flex;
    align-items: flex-start;
    min-height: 100vh;
}

.fpb-sidebar {
    width: 260px;
    flex-shrink: 0;
    min-height: calc(100vh - 24px);
    padding: 24px 16px;
    margin: 12px;
    position: sticky;
    top: 12px;
    display: flex;
    flex-direction: column;
    transition: width .25s ease, padding .25s ease;
}

.fpb-sidebar .fpb-brand {
    margin-bottom: 24px;
}

.fpb-sidebar .nav-link {
    color: inherit;
    opacity: .75;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background .2s ease, opacity .2s ease;
    white-space: nowrap;
    overflow: hidden;
}

.fpb-sidebar .nav-link.active,
.fpb-sidebar .nav-link:hover {
    opacity: 1;
    background: linear-gradient(135deg, rgba(79, 70, 229, .16), rgba(6, 182, 212, .12));
}

.fpb-sidebar .nav-link.active {
    box-shadow: inset 3px 0 0 var(--fpb-indigo);
}

.fpb-sidebar-collapse-btn {
    display: none;
    align-self: flex-end;
    background: none;
    border: none;
    opacity: .6;
    padding: 6px;
    margin-top: 12px;
}

@media (min-width: 993px) {
    .fpb-sidebar-collapse-btn { display: block; }
}

/* Collapsed desktop sidebar: icon-only rail */
body.fpb-sidebar-collapsed .fpb-sidebar {
    width: 76px;
}
body.fpb-sidebar-collapsed .fpb-sidebar .fpb-brand-text,
body.fpb-sidebar-collapsed .fpb-sidebar .nav-link span:not(.badge) {
    display: none;
}
body.fpb-sidebar-collapsed .fpb-sidebar .nav-link {
    justify-content: center;
}
body.fpb-sidebar-collapsed .fpb-sidebar-collapse-btn i {
    transform: rotate(180deg);
}

.fpb-main-col {
    flex: 1;
    min-width: 0;
}

.fpb-topbar {
    position: sticky;
    top: 12px;
    z-index: 20;
    margin: 12px 12px 0 0;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.fpb-main-content {
    padding: 20px 24px 32px;
}

.fpb-hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    opacity: .8;
}

.fpb-topbar-search {
    flex: 1;
    max-width: 420px;
    position: relative;
    display: flex;
    align-items: center;
}

.fpb-topbar-search i {
    position: absolute;
    left: 14px;
    opacity: .5;
    font-size: .9rem;
}

.fpb-topbar-search input {
    width: 100%;
    background: rgba(255, 255, 255, .5);
    border: 1px solid var(--fpb-border-light);
    border-radius: 999px;
    padding: 9px 14px 9px 38px;
    font-size: .88rem;
    color: inherit;
}

body.dark-mode .fpb-topbar-search input {
    background: rgba(255, 255, 255, .05);
    border-color: var(--fpb-border-dark);
}

.fpb-topbar-search input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .2);
}

.fpb-topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fpb-theme-toggle-inline {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: .8;
    transition: background .2s ease;
}
.fpb-theme-toggle-inline:hover {
    background: rgba(0, 0, 0, .05);
}

.fpb-icon-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: .8;
    transition: background .2s ease;
}
.fpb-icon-btn:hover {
    background: rgba(0, 0, 0, .05);
}

.fpb-icon-badge {
    position: absolute;
    top: 6px;
    right: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--fpb-danger);
    box-shadow: 0 0 0 2px var(--fpb-glass-light);
}

.fpb-profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 4px 8px 4px 4px;
    border-radius: 999px;
    color: inherit;
    transition: background .2s ease;
}
.fpb-profile-btn:hover {
    background: rgba(0, 0, 0, .05);
}

.fpb-avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fpb-indigo), var(--fpb-cyan));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
}

.fpb-dropdown {
    position: relative;
}

.fpb-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 300px;
    max-height: 380px;
    overflow-y: auto;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    z-index: 30;
}

.fpb-dropdown-menu-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fpb-dropdown-header {
    font-size: .75rem;
    text-transform: uppercase;
    opacity: .6;
    font-weight: 700;
    padding: 8px 10px 4px;
}

.fpb-dropdown-empty {
    padding: 20px 10px;
    text-align: center;
    opacity: .6;
    font-size: .85rem;
}

.fpb-dropdown-item {
    padding: 9px 10px;
    border-radius: 10px;
    transition: background .15s ease;
}
.fpb-dropdown-item:hover {
    background: rgba(0, 0, 0, .04);
}

.fpb-dropdown-footer {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: .8rem;
    font-weight: 600;
    border-top: 1px solid var(--fpb-border-light);
    margin-top: 4px;
}

.fpb-dropdown-item-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    color: inherit;
    font-size: .88rem;
    transition: background .15s ease;
}
.fpb-dropdown-item-link:hover {
    background: rgba(0, 0, 0, .04);
    color: inherit;
}

.fpb-sidebar-backdrop {
    display: none;
}

@media (max-width: 992px) {
    .fpb-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 50;
        margin: 0;
        border-radius: 0;
        transform: translateX(-105%);
        transition: transform .3s ease;
    }
    .fpb-sidebar.fpb-sidebar-open {
        transform: translateX(0);
    }
    .fpb-sidebar-collapse-btn { display: none; }
    .fpb-hamburger { display: block; }
    .fpb-topbar { margin-right: 12px; }
    .fpb-topbar-search { max-width: none; }
    .fpb-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .4);
        z-index: 40;
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s ease, visibility .25s ease;
    }
    .fpb-sidebar-backdrop-visible {
        opacity: 1;
        visibility: visible;
    }
}

.fpb-stat-card {
    padding: 22px;
}

.fpb-stat-card .fpb-stat-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.fpb-widget-card {
    position: relative;
    overflow: hidden;
}

.fpb-widget-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 8px 18px rgba(79, 70, 229, .28);
}

.fpb-alert-card {
    transition: transform .2s ease, box-shadow .2s ease;
}
.fpb-alert-card:hover {
    transform: translateY(-2px);
}

.min-w-0 {
    min-width: 0;
}

.fpb-skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,.15) 25%, rgba(255,255,255,.35) 37%, rgba(255,255,255,.15) 63%);
    background-size: 400% 100%;
    animation: fpbSkeleton 1.4s ease infinite;
    border-radius: 10px;
}

@keyframes fpbSkeleton {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* Poster placeholder editor */
.fpb-ph-box.selected {
    z-index: 5;
}
#editorStage {
    touch-action: none;
}

/* My Poster History cards */
.fpb-history-card {
    background: var(--fpb-glass-light);
    border: 1px solid var(--fpb-border-light);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--fpb-shadow-light);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: transform .25s ease, box-shadow .25s ease;
    display: flex;
    flex-direction: column;
}

body.dark-mode .fpb-history-card {
    background: var(--fpb-glass-dark);
    border-color: var(--fpb-border-dark);
    box-shadow: var(--fpb-shadow-dark);
}

.fpb-history-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(124, 92, 255, .25);
}

.fpb-history-thumb {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: rgba(0, 0, 0, .06);
}

.fpb-history-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.fpb-history-card:hover .fpb-history-thumb img {
    transform: scale(1.08);
}

.fpb-history-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, 0) 45%);
    display: flex;
    align-items: flex-end;
    padding: 10px;
    opacity: 0;
    transition: opacity .25s ease;
}

.fpb-history-card:hover .fpb-history-overlay {
    opacity: 1;
}

.fpb-history-stats {
    display: flex;
    gap: 10px;
}

.fpb-history-stats span {
    background: rgba(255, 255, 255, .18);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ============================================================
   Premium data tables - applies to every .table inside a
   .fpb-glass-card across the whole app, no per-page markup needed
   ============================================================ */
.fpb-glass-card .table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.fpb-glass-card .table thead th {
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .04em;
    font-weight: 700;
    opacity: .6;
    border-bottom: 1px solid var(--fpb-border-light);
    padding: 12px 14px;
    background: transparent;
    position: sticky;
    top: 0;
    z-index: 2;
}

body.dark-mode .fpb-glass-card .table thead th {
    border-bottom-color: var(--fpb-border-dark);
}

.fpb-glass-card .table tbody td {
    padding: 13px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, .045);
    vertical-align: middle;
}

body.dark-mode .fpb-glass-card .table tbody td {
    border-bottom-color: rgba(255, 255, 255, .05);
}

.fpb-glass-card .table tbody tr {
    transition: background .15s ease;
}

.fpb-glass-card .table tbody tr:hover {
    background: linear-gradient(90deg, rgba(79, 70, 229, .06), rgba(6, 182, 212, .04));
}

.fpb-glass-card .table tbody tr:last-child td {
    border-bottom: none;
}

.fpb-glass-card .table-responsive {
    border-radius: 16px;
}

/* Lightweight client-side quick-filter, auto-injected by table-enhance.js
   above any data table that doesn't already have a server-side search */
.fpb-table-quickfilter {
    position: relative;
    max-width: 280px;
    margin-bottom: 14px;
}
.fpb-table-quickfilter i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: .5;
    font-size: .85rem;
}
.fpb-table-quickfilter input {
    width: 100%;
    padding: 7px 12px 7px 32px;
    border-radius: 999px;
    border: 1px solid var(--fpb-border-light);
    background: rgba(255, 255, 255, .5);
    font-size: .85rem;
    color: inherit;
}
body.dark-mode .fpb-table-quickfilter input {
    background: rgba(255, 255, 255, .05);
    border-color: var(--fpb-border-dark);
}
.fpb-table-quickfilter input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .18);
}

/* ============================================================
   Premium forms - required-field indicator, better focus states,
   file upload preview thumbnails (injected by upload-preview.js)
   ============================================================ */
.form-label .fpb-required::after {
    content: ' *';
    color: var(--fpb-danger);
}

.form-control,
.form-select {
    transition: border-color .18s ease, box-shadow .18s ease, background .2s ease;
}

.was-validated .form-control:invalid,
.form-control.is-invalid {
    border-color: var(--fpb-danger);
}
.was-validated .form-control:valid,
.form-control.is-valid {
    border-color: var(--fpb-success);
}

.fpb-upload-preview {
    display: none;
    margin-top: 10px;
    align-items: center;
    gap: 10px;
}
.fpb-upload-preview.fpb-upload-preview-visible {
    display: flex;
}
.fpb-upload-preview img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--fpb-border-light);
}
body.dark-mode .fpb-upload-preview img {
    border-color: var(--fpb-border-dark);
}
.fpb-upload-preview .fpb-upload-preview-name {
    font-size: .8rem;
    opacity: .75;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   Premium modals - frosted glass, smooth entrance
   ============================================================ */
.modal-content {
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--fpb-border-light);
    border-radius: 18px;
    box-shadow: var(--fpb-shadow-light);
}
body.dark-mode .modal-content {
    background: rgba(23, 26, 44, .96);
    border-color: var(--fpb-border-dark);
    box-shadow: var(--fpb-shadow-dark);
}
.modal-header, .modal-footer {
    border-color: var(--fpb-border-light);
}
body.dark-mode .modal-header,
body.dark-mode .modal-footer {
    border-color: var(--fpb-border-dark);
}
.modal.fade .modal-dialog {
    transform: translateY(20px) scale(.97);
    transition: transform .25s ease, opacity .25s ease;
}
.modal.show .modal-dialog {
    transform: translateY(0) scale(1);
}
.modal-backdrop.show {
    opacity: .55;
}

/* Toast notifications */
.toast {
    background: var(--fpb-glass-light);
    backdrop-filter: blur(20px);
    border: 1px solid var(--fpb-border-light);
    border-radius: 14px;
}
body.dark-mode .toast {
    background: var(--fpb-glass-dark);
    border-color: var(--fpb-border-dark);
}

/* ============================================================
   Premium profile header - cover banner + overlapping avatar
   ============================================================ */
.fpb-profile-header {
    overflow: hidden;
}

.fpb-profile-cover {
    height: 130px;
    background: linear-gradient(120deg, var(--fpb-indigo), var(--fpb-royal-blue) 45%, var(--fpb-cyan));
    background-size: 200% 200%;
    animation: fpbGradientMove 12s ease infinite;
    position: relative;
}

@keyframes fpbGradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.fpb-profile-header-body {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    padding: 0 24px 20px;
    margin-top: -48px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.fpb-profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--fpb-glass-light);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
    flex-shrink: 0;
    background: #fff;
    position: relative;
    z-index: 2;
}

body.dark-mode .fpb-profile-avatar {
    border-color: #171a2c;
}

.fpb-plan-badge {
    background: linear-gradient(135deg, var(--fpb-gold), #f97316);
    color: #fff;
}

.fpb-social-icon-link {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    opacity: .75;
    transition: opacity .2s ease, transform .2s ease;
}
.fpb-social-icon-link:hover {
    opacity: 1;
    transform: translateY(-2px);
    color: inherit;
}
body.dark-mode .fpb-social-icon-link {
    background: rgba(255, 255, 255, .08);
}

@media (max-width: 576px) {
    .fpb-profile-header-body {
        flex-direction: column;
        align-items: flex-start;
        margin-top: -40px;
    }
    .fpb-profile-avatar {
        width: 80px;
        height: 80px;
    }
}

/* Fixes a borderline-low-contrast combination in dark mode: a badge with a
   faint tinted background (bg-opacity-25) paired with text-secondary uses
   the same base gray for both, which is fine in light mode but drops below
   a reasonable contrast threshold once that same tint sits on a dark card. */
body.dark-mode .badge.bg-secondary.bg-opacity-25.text-secondary {
    color: #b8bcc4 !important;
}

/* ============================================================
   PREMIUM DATA TABLE REDESIGN
   Pure CSS/JS enhancement layer over every existing .table inside
   a .fpb-glass-card, app-wide - no PHP, IDs, classes, queries, or
   JS logic touched. Every table already gets this automatically
   since the wrapper/markup pattern is shared across the whole app.
   ============================================================ */

/* Header: premium tinted background instead of transparent, for
   real contrast against the rows beneath it while scrolling. */
.fpb-glass-card .table thead {
    background: linear-gradient(180deg, rgba(79, 70, 229, .07), rgba(79, 70, 229, .02));
}
body.dark-mode .fpb-glass-card .table thead {
    background: linear-gradient(180deg, rgba(129, 140, 248, .10), rgba(129, 140, 248, .03));
}
.fpb-glass-card .table thead th {
    /* Sticky top already set above - just raising header text weight/size
       slightly and giving it breathing room now that it has a real
       background to sit on. */
    font-size: .74rem;
    padding: 13px 14px;
    white-space: nowrap;
}

/* Subtle zebra striping - faint enough not to fight the existing
   hover gradient, distinct enough to help scan a dense table. */
.fpb-glass-card .table.table-striped tbody tr:nth-of-type(odd) td,
.fpb-glass-card .table tbody tr:nth-of-type(odd) td {
    background: rgba(79, 70, 229, .02);
}
body.dark-mode .fpb-glass-card .table.table-striped tbody tr:nth-of-type(odd) td,
body.dark-mode .fpb-glass-card .table tbody tr:nth-of-type(odd) td {
    background: rgba(129, 140, 248, .035);
}
.fpb-glass-card .table tbody tr:hover td {
    background: transparent; /* the existing row hover gradient already handles this - avoid double-tinting a striped row on hover */
}

/* Row line-height/readability - a touch more room than the browser
   default without inflating row height meaningfully. */
.fpb-glass-card .table tbody td,
.fpb-glass-card .table thead th {
    line-height: 1.45;
}

/* Long, unbroken content (emails, URLs, tokens) truncates cleanly
   with a native tooltip instead of stretching the row or breaking
   the table's width - opt-in per cell via this class so it never
   silently truncates content that was never a problem. */
.fpb-table-truncate {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Responsive: the existing .table-responsive already scrolls
   horizontally rather than breaking the page - this just makes that
   scrolling feel native on touch devices and gives the scrollable
   area the same rounded, card-matching edges as everything else. */
.fpb-glass-card .table-responsive {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.fpb-glass-card .table-responsive::-webkit-scrollbar {
    height: 8px;
}
.fpb-glass-card .table-responsive::-webkit-scrollbar-thumb {
    background: rgba(79, 70, 229, .25);
    border-radius: 999px;
}
body.dark-mode .fpb-glass-card .table-responsive::-webkit-scrollbar-thumb {
    background: rgba(129, 140, 248, .3);
}

/* Optional opt-in sticky first column, for tables where the leading
   column (name/ID) needs to stay visible while scrolling wide data
   sideways on mobile - purely additive, no existing table is
   affected unless this class is deliberately added to it. */
.fpb-table-sticky-col table thead th:first-child,
.fpb-table-sticky-col table tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--fpb-glass-light);
}
body.dark-mode .fpb-table-sticky-col table thead th:first-child,
body.dark-mode .fpb-table-sticky-col table tbody td:first-child {
    background: var(--fpb-glass-dark);
}

@media (max-width: 576px) {
    .fpb-glass-card .table thead th,
    .fpb-glass-card .table tbody td {
        padding: 10px 10px;
        font-size: .82rem;
    }
    .fpb-table-quickfilter {
        max-width: 100%;
    }
}

/* Premium pagination - rounded pills, clear active state, generous
   touch targets. Targets Bootstrap's own .pagination markup used
   throughout the app as-is, nothing renamed. */
.fpb-glass-card .pagination,
.pagination {
    gap: 4px;
    flex-wrap: wrap;
}
.fpb-glass-card .pagination .page-link,
.pagination .page-link {
    border-radius: 10px !important;
    border: 1px solid var(--fpb-border-light);
    min-width: 38px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    background: transparent;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
body.dark-mode .fpb-glass-card .pagination .page-link,
body.dark-mode .pagination .page-link {
    border-color: var(--fpb-border-dark);
}
.fpb-glass-card .pagination .page-item.active .page-link,
.pagination .page-item.active .page-link {
    background: var(--fpb-royal-blue);
    border-color: var(--fpb-royal-blue);
    color: #fff;
    font-weight: 600;
}
.fpb-glass-card .pagination .page-link:hover,
.pagination .page-link:hover {
    background: rgba(79, 70, 229, .1);
    border-color: var(--fpb-royal-blue);
}
body.dark-mode .fpb-glass-card .pagination .page-link:hover,
body.dark-mode .pagination .page-link:hover {
    background: rgba(129, 140, 248, .14);
}
.fpb-glass-card .pagination .page-item.disabled .page-link,
.pagination .page-item.disabled .page-link {
    opacity: .4;
}

/* Skeleton loading state - opt-in via .fpb-table-loading on the
   table-responsive wrapper, for the handful of tables that populate
   via AJAX (e.g. a modal's fetch-on-open content) rather than being
   rendered server-side. Doesn't affect any table that never adds it. */
.fpb-table-loading {
    position: relative;
    min-height: 140px;
}
.fpb-table-loading table {
    visibility: hidden;
}
.fpb-table-loading::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent, rgba(79, 70, 229, .06), transparent),
        repeating-linear-gradient(180deg, rgba(120, 120, 140, .08) 0, rgba(120, 120, 140, .08) 14px, transparent 14px, transparent 28px);
    background-size: 200% 100%, 100% 100%;
    animation: fpb-skeleton-sweep 1.3s ease-in-out infinite;
    border-radius: 12px;
}
body.dark-mode .fpb-table-loading::before {
    background:
        linear-gradient(90deg, transparent, rgba(129, 140, 248, .10), transparent),
        repeating-linear-gradient(180deg, rgba(255, 255, 255, .05) 0, rgba(255, 255, 255, .05) 14px, transparent 14px, transparent 28px);
    background-size: 200% 100%, 100% 100%;
}
@keyframes fpb-skeleton-sweep {
    0% { background-position: -200% 0, 0 0; }
    100% { background-position: 200% 0, 0 0; }
}
@media (prefers-reduced-motion: reduce) {
    .fpb-table-loading::before { animation: none; }
}

/* Accessibility - visible keyboard focus on every interactive table
   element (sort links, action buttons, pagination, quick-filter),
   since a mouse-only hover state isn't enough for keyboard/screen
   reader users. */
.fpb-glass-card .table a:focus-visible,
.fpb-glass-card .table button:focus-visible,
.fpb-table-quickfilter input:focus-visible,
.pagination .page-link:focus-visible {
    outline: 2px solid var(--fpb-royal-blue);
    outline-offset: 2px;
}

/* Quick-filter search box: slightly larger touch target and a
   clearer placeholder color for real premium-input feel, without
   changing table-enhance.js's markup or behavior at all. */
.fpb-table-quickfilter input {
    padding: 8px 14px 8px 34px;
    font-size: .87rem;
    transition: box-shadow .15s ease, border-color .15s ease, background .2s ease;
}
.fpb-table-quickfilter input::placeholder {
    opacity: .55;
}

/* The pagination clone table-enhance.js duplicates to the top of a long
   table - deliberately smaller and visually set apart (a bottom
   border, tighter spacing) so it reads as a quick-nav convenience, not
   a confusing duplicate of the real pagination still at the bottom. */
.fpb-table-pagination-top {
    margin: 0 0 14px !important;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--fpb-border-light);
}
body.dark-mode .fpb-table-pagination-top {
    border-bottom-color: var(--fpb-border-dark);
}
.fpb-table-pagination-top .pagination {
    transform: scale(.92);
    transform-origin: left center;
}

/* Soft edge-fade shown by table-enhance.js on whichever side of a
   horizontally-scrollable table still has hidden content - a quiet,
   standard affordance that there's more to scroll to. */
.table-responsive {
    position: relative;
}
.fpb-scroll-shadow-left::before,
.fpb-scroll-shadow-right::after {
    content: '';
    position: sticky;
    top: 0;
    display: block;
    width: 18px;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    margin-bottom: -100%;
}
.fpb-scroll-shadow-left::before {
    left: 0;
    float: left;
    background: linear-gradient(90deg, rgba(0, 0, 0, .08), transparent);
}
.fpb-scroll-shadow-right::after {
    right: 0;
    float: right;
    background: linear-gradient(270deg, rgba(0, 0, 0, .08), transparent);
}
body.dark-mode .fpb-scroll-shadow-left::before {
    background: linear-gradient(90deg, rgba(0, 0, 0, .35), transparent);
}
body.dark-mode .fpb-scroll-shadow-right::after {
    background: linear-gradient(270deg, rgba(0, 0, 0, .35), transparent);
}
