/* orbpanel-ui.css - Premium Modern UI (Auto Responsive) */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Inter:wght@400;500;600;700&display=swap");

:root {
    /* Light — soft slate canvas (Stripe/Linear product UI, not pure white blast) */
    --fx-bg: #f6f8fa;
    --fx-surface: #ffffff;
    --fx-surface-2: #f6f8fa;
    --fx-surface-3: #eef1f4;
    --fx-border: #d0d7de;
    --fx-border-strong: #afb8c1;
    --fx-text: #1f2328;
    --fx-text-muted: #656d76;
    --fx-text-faint: #8c959f;

    /* Primary blue (GitHub/Cloudflare product blue — not neon purple) */
    --fx-primary: #0969da;
    --fx-primary-50: #ddf4ff;
    --fx-primary-100: #b6e3ff;
    --fx-primary-600: #0550ae;
    --fx-primary-700: #033d8b;
    --fx-primary-900: #0a3069;

    --fx-accent: #1a7f37;
    --fx-success: #1a7f37;
    --fx-success-50: #dafbe1;
    --fx-warning: #9a6700;
    --fx-warning-50: #fff8c5;
    --fx-danger: #cf222e;
    --fx-danger-50: #ffebe9;
    --fx-info: #0969da;

    /* Modern Shadows */
    --fx-shadow-sm: 0px 2px 5px rgba(0, 0, 0, 0.02);
    --fx-shadow: 0px 4px 15px rgba(0, 0, 0, 0.04);
    --fx-shadow-md: 0px 10px 25px rgba(0, 0, 0, 0.06);
    --fx-shadow-lg: 0px 20px 40px rgba(0, 0, 0, 0.08);
    --fx-shadow-hover: 0px 12px 28px rgba(9, 105, 218, 0.12);

    /* Radii */
    --fx-radius-sm: 8px;
    --fx-radius: 16px;
    --fx-radius-lg: 24px;
    --fx-radius-pill: 999px;

    /* Layout */
    --fx-sidebar-w: 280px;
    --fx-rightbar-w: 320px;
    --fx-topbar-h: 70px;

    /* Typography */
    --fx-font: "Inter", sans-serif;
    --fx-font-display: "Outfit", sans-serif;
    --fx-glass-bg: rgba(255, 255, 255, 0.85);
    --fx-glass-border: rgba(255, 255, 255, 0.4);
}

/*
 * Dark — GitHub Primer / industry control-panel neutrals
 * (canvas #0d1117, overlay #161b22, border #30363d)
 * Avoid purple “AI dashboard” indigo and pure #000 slabs.
 */
[data-bs-theme="dark"],
[data-theme="dark"] {
    --fx-bg: #0d1117;
    --fx-surface: #161b22;
    --fx-surface-2: #21262d;
    --fx-surface-3: #30363d;
    --fx-border: #30363d;
    --fx-border-strong: #484f58;
    --fx-text: #e6edf3;
    --fx-text-muted: #8b949e;
    --fx-text-faint: #6e7681;

    --fx-primary: #58a6ff;
    --fx-primary-50: rgba(56, 139, 253, 0.12);
    --fx-primary-100: rgba(56, 139, 253, 0.22);
    --fx-primary-600: #58a6ff;
    --fx-primary-700: #79b8ff;

    --fx-accent: #3fb950;
    --fx-success: #3fb950;
    --fx-success-50: rgba(63, 185, 80, 0.15);
    --fx-warning: #d29922;
    --fx-warning-50: rgba(210, 153, 34, 0.15);
    --fx-danger: #f85149;
    --fx-danger-50: rgba(248, 81, 73, 0.15);
    --fx-info: #58a6ff;

    --fx-shadow-sm: 0 1px 0 rgba(27, 31, 35, 0.04);
    --fx-shadow: 0 8px 24px rgba(1, 4, 9, 0.45);
    --fx-shadow-md: 0 12px 28px rgba(1, 4, 9, 0.55);
    --fx-shadow-hover: 0 12px 28px rgba(56, 139, 253, 0.18);

    --fx-glass-bg: rgba(22, 27, 34, 0.88);
    --fx-glass-border: rgba(240, 246, 252, 0.08);
    color-scheme: dark;
}

/* base ---------------------------------------------------- */
* {
    box-sizing: border-box;
}
html,
body {
    background: var(--fx-bg);
    color: var(--fx-text);
    font-family: var(--fx-font);
}
body {
    font-size: 14.5px;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--fx-font-display);
    font-weight: 700;
    color: var(--fx-text);
}
a {
    color: var(--fx-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}
a:hover {
    color: var(--fx-primary-700);
}
::selection {
    background: color-mix(in srgb, var(--fx-primary) 20%, transparent);
    color: var(--fx-primary-700);
}

/* Public authentication screens ----------------------------- */
.fx-auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(480px, 1.1fr) minmax(420px, 1fr);
    background: var(--fx-bg);
    position: relative;
    overflow: hidden;
}

.fx-auth-shell::before,
.fx-auth-shell::after {
    content: "";
    position: absolute;
    inset: auto;
    pointer-events: none;
    border-radius: 999px;
    filter: blur(16px);
    opacity: 0.75;
}

.fx-auth-shell::before {
    width: 28rem;
    height: 28rem;
    left: -10rem;
    top: -8rem;
    background: radial-gradient(circle, rgba(9,105,218,0.18), transparent 68%);
}

.fx-auth-shell::after {
    width: 24rem;
    height: 24rem;
    right: -8rem;
    bottom: -10rem;
    background: radial-gradient(circle, rgba(63,185,80,0.14), transparent 70%);
}

.fx-auth-toggle-wrap {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 3;
}

.fx-theme-toggle {
    min-width: 42px;
    min-height: 42px;
    border-radius: 999px;
    background: var(--fx-glass-bg);
    border: 1px solid var(--fx-glass-border);
    box-shadow: var(--fx-shadow);
    color: var(--fx-text);
    backdrop-filter: blur(18px);
}

.fx-theme-toggle:hover {
    transform: translateY(-1px);
    box-shadow: var(--fx-shadow-hover);
}

.fx-auth-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 6vw, 5rem);
    color: #fff;
    background:
        radial-gradient(circle at 80% 85%, rgba(56, 139, 253, 0.45), transparent 26rem),
        radial-gradient(circle at 20% 18%, rgba(63, 185, 80, 0.18), transparent 18rem),
        linear-gradient(145deg, #0b1220 0%, #123a63 48%, #164e8c 100%);
    position: relative;
    isolation: isolate;
}

.fx-auth-hero h1,
.fx-auth-hero h2,
.fx-auth-hero h3,
.fx-auth-hero h4,
.fx-auth-hero h5,
.fx-auth-hero h6,
.fx-auth-hero a {
    color: #fff;
}

.fx-auth-hero h1 {
    font-size: clamp(2rem, 3.2vw, 3.1rem);
    line-height: 1.15;
    margin: 0 0 1rem;
}

.fx-auth-hero p {
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.05rem;
    line-height: 1.55;
    margin: 0;
}

.fx-auth-form {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 5vw, 4rem);
}

.fx-auth-card {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
    background: color-mix(in srgb, var(--fx-surface) 92%, transparent);
    border: 1px solid var(--fx-border);
    border-radius: 24px;
    box-shadow: var(--fx-shadow-lg);
    padding: 1.5rem;
    backdrop-filter: blur(16px);
}

.fx-auth-card h3 {
    font-size: 1.85rem;
    line-height: 1.2;
}

.fx-auth-card form {
    margin: 0;
}

.fx-auth-card .row,
.fx-auth-hero .row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}

.fx-auth-card .col-6,
.fx-auth-hero .col-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0.5rem;
}

.fx-auth-hero .rounded-3 {
    min-height: 72px;
    color: #fff;
}

.input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-group-text {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    padding: 0.65rem 0.8rem;
    color: var(--fx-text-muted);
    background: var(--fx-surface-3);
    border: 1px solid transparent;
    border-right: 0;
    border-radius: var(--fx-radius-sm) 0 0 var(--fx-radius-sm);
}

.fx-auth-card .form-control,
.fx-auth-card .input-group-text,
.fx-auth-card .btn {
    min-height: 46px;
}

.fx-auth-card .form-control {
    border-color: var(--fx-border);
    background: var(--fx-surface);
    color: var(--fx-text);
}

.fx-auth-card .form-control:focus {
    border-color: var(--fx-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--fx-primary) 22%, transparent);
}

.fx-auth-card .btn-primary {
    box-shadow: var(--fx-shadow-sm);
}

[data-bs-theme="dark"] .fx-auth-card {
    background: rgba(22, 27, 34, 0.88);
    border-color: rgba(240, 246, 252, 0.08);
}

[data-bs-theme="dark"] .fx-auth-card .form-control,
[data-bs-theme="dark"] .fx-auth-card .input-group-text {
    background: rgba(13, 17, 23, 0.92);
}

.input-group > .form-control {
    flex: 1 1 auto;
    min-width: 0;
    border-radius: 0 var(--fx-radius-sm) var(--fx-radius-sm) 0;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    margin: 0;
}

.form-check-label {
    color: var(--fx-text);
}

.d-flex {
    display: flex !important;
}
.align-items-center {
    align-items: center !important;
}
.justify-content-between {
    justify-content: space-between !important;
}
.gap-2 {
    gap: 0.5rem !important;
}
.w-100 {
    width: 100% !important;
}
.small {
    font-size: 0.875em !important;
}
.fw-bold {
    font-weight: 700 !important;
}
.fw-semibold {
    font-weight: 600 !important;
}
.text-center {
    text-align: center !important;
}
.text-muted {
    color: var(--fx-text-muted) !important;
}
.text-primary {
    color: var(--fx-primary) !important;
}
.mb-0 {
    margin-bottom: 0 !important;
}
.mb-1 {
    margin-bottom: 0.25rem !important;
}
.mb-2 {
    margin-bottom: 0.5rem !important;
}
.mb-3 {
    margin-bottom: 1rem !important;
}
.mb-4 {
    margin-bottom: 1.5rem !important;
}
.mt-2 {
    margin-top: 0.5rem !important;
}
.mt-4 {
    margin-top: 1.5rem !important;
}
.me-1 {
    margin-right: 0.25rem !important;
}
.me-2 {
    margin-right: 0.5rem !important;
}
.p-3 {
    padding: 1rem !important;
}
.rounded-3 {
    border-radius: var(--fx-radius-sm) !important;
}
.h4 {
    font-size: 1.5rem !important;
    line-height: 1.2;
}
.h5 {
    font-size: 1.25rem !important;
    line-height: 1.2;
}

@media (min-width: 992px) {
    .d-lg-none {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    .fx-auth-shell {
        display: block;
    }

    .fx-auth-hero {
        display: none;
    }

    .fx-auth-form {
        min-height: 100vh;
    }
}

/* scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--fx-border-strong);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--fx-text-faint);
}

/* App shell --------------------------------------------------- */
.fx-app {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}
.fx-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
}
.fx-content {
    flex: 1;
    padding: 2rem;
    min-width: 0;
}
.fx-content-narrow {
    max-width: 1440px;
    margin: 0 auto;
}

/* Sidebar ----------------------------------- */
.fx-sidebar {
    width: var(--fx-sidebar-w);
    background: var(--fx-surface);
    border-right: 1px solid var(--fx-border);
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1020;
    box-shadow: var(--fx-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.fx-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1.5rem 1.5rem;
    font-weight: 700;
    font-size: 1.4rem;
    font-family: var(--fx-font-display);
    color: var(--fx-text);
    height: var(--fx-topbar-h);
    flex: 0 0 var(--fx-topbar-h);
}
.fx-sidebar-brand i {
    background: linear-gradient(135deg, var(--fx-primary), var(--fx-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.fx-sidebar-section {
    padding: 1rem 1.25rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.fx-sidebar-group {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fx-text-faint);
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}
.fx-sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1rem;
    margin-bottom: 4px;
    color: var(--fx-text-muted);
    border-radius: var(--fx-radius-sm);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}
.fx-sidebar-link:hover {
    background: var(--fx-surface-2);
    color: var(--fx-text);
    transform: translateX(4px);
}
.fx-sidebar-link.active {
    background: var(--fx-primary);
    color: #fff;
    box-shadow: 0px 4px 10px rgba(67, 24, 255, 0.2);
}
.fx-sidebar-link > i {
    width: 22px;
    text-align: center;
    font-size: 1.1rem;
}
.fx-sidebar-foot {
    flex: 0 0 auto;
    margin-top: 0;
    padding: 1.25rem;
    border-top: 1px solid var(--fx-border);
}

/* Top navigation bar ----------------------------------------- */
.fx-topbar {
    height: var(--fx-topbar-h);
    background: var(--fx-glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--fx-glass-border);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1010;
    flex: 0 0 var(--fx-topbar-h);
    min-height: var(--fx-topbar-h);
}
.fx-topbar-title {
    font-weight: 700;
    font-size: 1.25rem;
    font-family: var(--fx-font-display);
}
.fx-topbar-search {
    flex: 1;
    max-width: 400px;
    position: relative;
}
.fx-topbar-search input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    background: var(--fx-bg);
    border: 1px solid transparent;
    border-radius: var(--fx-radius-pill);
    color: var(--fx-text);
    font-size: 0.9rem;
    transition: all 0.2s;
}
.fx-topbar-search input:focus {
    background: var(--fx-surface);
    border-color: var(--fx-primary);
    box-shadow: 0 0 0 4px var(--fx-primary-50);
}
.fx-topbar-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fx-text-muted);
}
.fx-topbar-search kbd {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--fx-font-mono, ui-monospace, monospace);
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: var(--fx-surface);
    color: var(--fx-text-muted);
    border: 1px solid var(--fx-border);
    line-height: 1.4;
}

/* Spacer pushes right-side items (icons, profile) to the far right */
.fx-topbar-spacer {
    flex: 1;
}

/* Notification red dot indicator */
.fx-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--fx-danger, #dc3545);
    border: 2px solid var(--fx-glass-bg);
}
.fx-topbar-icon {
    position: relative;
}

.fx-topbar-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--fx-text-muted);
    background: var(--fx-surface);
    box-shadow: var(--fx-shadow-sm);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}
.fx-topbar-icon:hover {
    color: var(--fx-primary);
    box-shadow: var(--fx-shadow);
    transform: translateY(-2px);
}

.fx-topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--fx-surface);
    padding: 6px 16px 6px 6px;
    border-radius: var(--fx-radius-pill);
    box-shadow: var(--fx-shadow-sm);
    cursor: pointer;
    transition: all 0.2s;
}
.fx-topbar-user:hover {
    box-shadow: var(--fx-shadow);
}
.fx-topbar-user .fx-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fx-primary), var(--fx-info));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--fx-font-display);
}

/* Right sidebar ------------------------------------------------ */
.fx-rightbar {
    width: var(--fx-rightbar-w, 320px);
    flex-shrink: 0;
    padding: 1.5rem 0 1.5rem 1.5rem;
    max-height: calc(100vh - var(--fx-topbar-h));
    overflow-y: auto;
    position: sticky;
    top: var(--fx-topbar-h);
}
.fx-rightbar::-webkit-scrollbar {
    width: 4px;
}
.fx-rightbar::-webkit-scrollbar-thumb {
    background: var(--fx-border);
    border-radius: 4px;
}

.fx-rb-card {
    background: var(--fx-surface);
    border-radius: var(--fx-radius);
    box-shadow: var(--fx-shadow-sm);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.fx-rb-card:hover {
    box-shadow: var(--fx-shadow);
}

.fx-rb-header {
    padding: 0.85rem 1.1rem;
    font-weight: 700;
    font-family: var(--fx-font-display);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--fx-text-muted);
    border-bottom: 1px solid var(--fx-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fx-rb-body {
    padding: 0.75rem 1.1rem;
}

.fx-rb-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid
        color-mix(in srgb, var(--fx-border) 50%, transparent);
}
.fx-rb-row:last-child {
    border-bottom: none;
}

.fx-rb-key {
    font-size: 0.82rem;
    color: var(--fx-text-muted);
    display: flex;
    align-items: center;
}

.fx-rb-val {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--fx-text);
    text-align: right;
    max-width: 55%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fx-rb-val code {
    font-size: 0.78rem;
    padding: 0.1rem 0.4rem;
    background: var(--fx-bg);
    border-radius: 4px;
}

.fx-rb-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 0.5rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    background: var(--fx-primary-50, rgba(21, 112, 239, 0.1));
    color: var(--fx-primary);
}

/* Rightbar progress bars */
.fx-rb-progress-group {
    margin-bottom: 0.85rem;
}
.fx-rb-progress-group:last-child {
    margin-bottom: 0;
}

.fx-rb-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--fx-text-muted);
    margin-bottom: 0.35rem;
}

.fx-rb-progress-pct {
    font-size: 0.72rem;
    color: var(--fx-text-muted);
    text-align: right;
    margin-top: 0.2rem;
}

.fx-rightbar .progress {
    height: 6px;
    background: var(--fx-bg);
    border-radius: 3px;
}
.fx-rightbar .progress-bar {
    border-radius: 3px;
    transition: width 0.8s ease;
}

/* Rightbar quick links */
.fx-rb-links {
    padding: 0.5rem 0;
}

.fx-rb-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1.1rem;
    font-size: 0.84rem;
    color: var(--fx-text);
    text-decoration: none;
    transition: all 0.15s;
    border-radius: 6px;
}
.fx-rb-link:hover {
    background: var(--fx-primary-50, rgba(21, 112, 239, 0.08));
    color: var(--fx-primary);
}
.fx-rb-link i {
    width: 20px;
    text-align: center;
    color: var(--fx-text-muted);
    font-size: 0.9rem;
}
.fx-rb-link:hover i {
    color: var(--fx-primary);
}

/* Cards ------------------------------------------------------- */
.card {
    background: var(--fx-surface);
    border: none;
    border-radius: var(--fx-radius);
    box-shadow: var(--fx-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--fx-border);
    font-weight: 700;
    font-family: var(--fx-font-display);
    font-size: 1.1rem;
    padding: 1.25rem 1.5rem;
}
.card-body {
    padding: 1.5rem;
}
.card-footer {
    background: transparent;
    border-top: 1px solid var(--fx-border);
    padding: 1.25rem 1.5rem;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--fx-shadow-hover);
}

/* Stat cards */
.fx-stat {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
}
.fx-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--fx-primary-50);
    color: var(--fx-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    transition: transform 0.3s;
}
.card:hover .fx-stat-icon {
    transform: scale(1.1) rotate(5deg);
}
.fx-stat-icon.success {
    background: var(--fx-success-50);
    color: var(--fx-success);
}
.fx-stat-icon.warning {
    background: var(--fx-warning-50);
    color: var(--fx-warning);
}
.fx-stat-icon.danger {
    background: var(--fx-danger-50);
    color: var(--fx-danger);
}
.fx-stat-label {
    color: var(--fx-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}
.fx-stat-value {
    color: var(--fx-text);
    font-size: 1.75rem;
    font-weight: 700;
    font-family: var(--fx-font-display);
    line-height: 1;
}

/* Buttons ----------------------------------------------------- */
.btn {
    display: inline-block;
    border: 1px solid transparent;
    border-radius: var(--fx-radius-sm);
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    transition: all 0.2s ease;
    font-family: var(--fx-font);
    line-height: 1.5;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
}
.btn-sm {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
}
.btn-primary {
    background: var(--fx-primary);
    border-color: var(--fx-primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(67, 24, 255, 0.2);
}
.btn-primary:hover {
    background: var(--fx-primary-700);
    border-color: var(--fx-primary-700);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(67, 24, 255, 0.3);
}
.btn-outline-primary {
    color: var(--fx-primary);
    border-color: var(--fx-primary);
}
.btn-outline-primary:hover {
    background: var(--fx-primary);
    color: #fff;
    transform: translateY(-2px);
}

/* Forms ------------------------------------------------------- */
.form-control,
.form-select {
    display: block;
    width: 100%;
    background: var(--fx-bg);
    border: 1px solid transparent;
    border-radius: var(--fx-radius-sm);
    font-size: 0.95rem;
    padding: 0.7rem 1rem;
    color: var(--fx-text);
    transition: all 0.2s;
    line-height: 1.5;
}
.form-control:focus,
.form-select:focus {
    background: var(--fx-surface);
    border-color: var(--fx-primary);
    box-shadow: 0 0 0 4px var(--fx-primary-50);
}
.form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--fx-text);
    margin-bottom: 0.5rem;
}
.form-check-input:checked {
    background-color: var(--fx-primary);
    border-color: var(--fx-primary);
}

/* Tables ------------------------------------------------------ */
.table {
    color: var(--fx-text);
    vertical-align: middle;
}
.table th {
    background: var(--fx-surface-2);
    color: var(--fx-text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 2px solid var(--fx-border);
    padding: 1rem;
}
.table td {
    border-bottom: 1px solid var(--fx-border);
    padding: 1rem;
    transition: background 0.2s;
}
.table tbody tr {
    transition: all 0.2s;
}
.table tbody tr:hover td {
    background: var(--fx-surface-3);
}

/* Badges ----------------------------------------------------- */
.badge {
    font-weight: 600;
    border-radius: var(--fx-radius-sm);
    padding: 0.4em 0.8em;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}
.bg-success-subtle {
    background: var(--fx-success-50) !important;
    color: var(--fx-success) !important;
}
.bg-warning-subtle {
    background: var(--fx-warning-50) !important;
    color: var(--fx-warning) !important;
}
.bg-danger-subtle {
    background: var(--fx-danger-50) !important;
    color: var(--fx-danger) !important;
}
.bg-info-subtle {
    background: var(--fx-primary-50) !important;
    color: var(--fx-primary) !important;
}

/* Alerts ----------------------------------------------------- */
.alert {
    border: none;
    border-radius: var(--fx-radius-sm);
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}
.alert i {
    font-size: 1.25rem;
    margin-right: 0.75rem;
}
.alert-success {
    background: var(--fx-success-50);
    color: #027a48;
    border-left: 4px solid var(--fx-success);
}
.alert-warning {
    background: var(--fx-warning-50);
    color: #b54708;
    border-left: 4px solid var(--fx-warning);
}
.alert-danger {
    background: var(--fx-danger-50);
    color: #b42318;
    border-left: 4px solid var(--fx-danger);
}
.alert-info {
    background: var(--fx-primary-50);
    color: var(--fx-primary-700);
    border-left: 4px solid var(--fx-primary);
}

/* Responsive Overhaul ----------------------------------------- */
@media (max-width: 1199.98px) {
    .fx-content {
        padding: 1.5rem;
    }
}

@media (max-width: 991.98px) {
    .fx-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        width: 280px;
        z-index: 1040;
    }
    .fx-sidebar.open {
        transform: translateX(0);
        box-shadow: var(--fx-shadow-lg);
    }
    .fx-topbar {
        padding: 0 1.5rem;
        height: 60px;
        min-height: 60px;
        flex-basis: 60px;
        gap: 0.6rem;
    }
    .fx-content {
        padding: 1.25rem;
    }
    .fx-rightbar {
        display: none;
    }

    /* Make tables responsive by wrapping them in mobile view */
    .table-responsive {
        border: 1px solid var(--fx-border);
        border-radius: var(--fx-radius-sm);
    }
}

@media (max-width: 767.98px) {
    .fx-topbar {
        padding: 0 1rem;
        gap: 0.5rem;
    }
    .fx-topbar-search kbd {
        display: none;
    }
    .fx-topbar-title {
        font-size: 1.1rem;
    }
    .fx-topbar-search {
        display: none;
    }
    .fx-topbar-user .fx-name {
        display: none;
    }
    .fx-content {
        padding: 1rem 1rem 5rem 1rem;
    }

    .card-header,
    .card-body,
    .card-footer {
        padding: 1rem;
    }
    .fx-stat {
        padding: 1rem;
        gap: 1rem;
    }
    .fx-stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
    .fx-stat-value {
        font-size: 1.4rem;
    }

    /* Stack tables vertically on mobile */
    .table.mobile-stack thead {
        display: none;
    }
    .table.mobile-stack tbody tr {
        display: block;
        border-bottom: 2px solid var(--fx-border);
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }
    .table.mobile-stack tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        padding: 0.5rem 1rem;
        text-align: right;
    }
    .table.mobile-stack tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--fx-text-muted);
        text-align: left;
        margin-right: 1rem;
    }
}

@media (max-width: 575.98px) {
    body {
        font-size: 14px;
    }
    .fx-sidebar {
        width: 85vw;
        max-width: 300px;
    }
    .fx-topbar-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    .fx-topbar-user .fx-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        width: 100%;
        display: block;
        margin-bottom: 0.5rem;
    }
    .btn-sm {
        width: auto;
        display: inline-block;
        margin-bottom: 0;
    }
    .btn-icon {
        width: 36px;
        height: 36px;
        display: inline-flex;
        justify-content: center;
        align-items: center;
    }
}

.fx-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1035;
    opacity: 0;
    transition: opacity 0.3s;
}
.fx-backdrop.show {
    display: block;
    opacity: 1;
}

/* Utilities */
.text-gradient {
    background: linear-gradient(135deg, var(--fx-primary), var(--fx-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.glass-panel {
    background: var(--fx-glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--fx-glass-border);
    border-radius: var(--fx-radius);
}

/* ============================================
   COMPREHENSIVE RESPONSIVE OVERHAUL
   ============================================ */

/* ── Tablet landscape / small laptop (≤1199px) ── */
@media (max-width: 1199.98px) {
    .fx-content {
        padding: 1.5rem;
    }
    .fx-hero {
        padding: 2rem;
    }
    .fx-hero h1 {
        font-size: 1.75rem;
    }
    .fx-resource-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Tablet portrait (≤991px) ── */
@media (max-width: 991.98px) {
    /* Auth shell stacks vertically */
    .fx-auth-shell {
        display: block;
    }
    .fx-auth-hero {
        display: none;
    }
    .fx-auth-form {
        min-height: 100vh;
    }

    /* Rightbar hidden on tablets */
    .fx-rightbar {
        display: none !important;
    }

    /* Content */
    .fx-content {
        padding: 1.25rem;
    }

    /* Dashboard hero */
    .fx-hero {
        padding: 1.5rem;
    }
    .fx-hero h1 {
        font-size: 1.5rem;
    }
    .fx-hero-stats {
        gap: 1rem;
    }
    .fx-hero-stat {
        padding: 0.75rem 1rem;
    }
    .fx-hero-stat-value {
        font-size: 1.25rem;
    }

    /* Resource grid: 3 cols on tablet */
    .fx-resource-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    /* Quick actions: 4 cols */
    .fx-quick-actions {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Tables — horizontal scroll wrapper */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border: 1px solid var(--fx-border);
        border-radius: var(--fx-radius-sm);
    }

    /* Backup/restore page: hide less important columns */
    .backup-table th:nth-child(n + 5),
    .backup-table td:nth-child(n + 5) {
        display: none;
    }
}

/* ── Mobile (≤767px) ── */
@media (max-width: 767.98px) {
    .fx-topbar {
        padding: 0 1rem;
        gap: 0.5rem;
    }
    .fx-topbar-search kbd {
        display: none;
    }
    .fx-topbar-title {
        font-size: 1.1rem;
    }
    .fx-topbar-search {
        display: none;
    }
    .fx-topbar-user .fx-name {
        display: none;
    }
    .fx-content {
        padding: 1rem 1rem 5rem 1rem;
    }

    /* Dashboard hero compact */
    .fx-hero {
        padding: 1.25rem;
        border-radius: 12px;
        margin-bottom: 1.25rem;
    }
    .fx-hero h1 {
        font-size: 1.35rem;
    }
    .fx-hero .lead {
        font-size: 0.95rem;
    }
    .fx-hero-stats {
        gap: 0.75rem;
        flex-wrap: wrap;
    }
    .fx-hero-stat {
        padding: 0.6rem 0.75rem;
        flex: 1;
        min-width: calc(50% - 0.5rem);
    }
    .fx-hero-stat-value {
        font-size: 1.1rem;
    }
    .fx-hero-stat-label {
        font-size: 0.75rem;
    }

    /* Resource grid: 2 cols on mobile */
    .fx-resource-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }
    .fx-resource-card {
        padding: 1rem;
    }
    .fx-resource-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        border-radius: 10px;
    }
    .fx-resource-value {
        font-size: 1.5rem;
    }

    /* Quick actions: 3 cols on mobile */
    .fx-quick-actions {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    .fx-quick-action {
        min-height: 80px;
        padding: 0.6rem 0.4rem;
    }
    .fx-quick-action-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        border-radius: 8px;
        margin-bottom: 0.4rem;
    }
    .fx-quick-action-label {
        font-size: 0.7rem;
    }

    /* Cards */
    .card-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch !important;
        padding: 1rem;
    }
    .card-header .btn {
        width: 100%;
    }
    .card-body,
    .card-footer {
        padding: 1rem;
    }

    /* Stat cards */
    .fx-stat {
        padding: 1rem;
        gap: 1rem;
    }
    .fx-stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
    .fx-stat-value {
        font-size: 1.4rem;
    }

    /* Backup/restore: hide more columns */
    .backup-table th:nth-child(n + 3),
    .backup-table td:nth-child(n + 3) {
        display: none;
    }

    /* Action buttons stack vertically in tables */
    .table td .d-flex {
        flex-direction: column;
    }
    .table td .d-flex .btn {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    /* List group items */
    .list-group-item {
        padding: 0.75rem;
    }
    .list-group-item .d-flex {
        flex-wrap: wrap;
    }

    /* File browser */
    .form-check-label {
        word-break: break-all;
    }

    /* Modals — full-width on mobile */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    .modal-body {
        max-height: 60vh;
        overflow-y: auto;
    }

    /* Progress bars */
    .progress-bar {
        font-size: 0.7rem;
    }

    /* Dashboard card grid rows stack */
    .row.g-4 > [class*="col-"] {
        margin-bottom: 0;
    }

    /* Security score */
    .fx-score-circle {
        width: 120px;
        height: 120px;
    }
    .fx-score-value {
        font-size: 2rem;
    }

    /* Timeline */
    .fx-timeline {
        padding-left: 1.5rem;
    }
    .fx-timeline-dot {
        left: -1.5rem;
        width: 14px;
        height: 14px;
    }
}

/* ── Small phone (≤575px) ── */
@media (max-width: 575.98px) {
    body {
        font-size: 13.5px;
    }
    .fx-sidebar {
        width: 85vw;
        max-width: 300px;
    }
    .fx-topbar {
        padding: 0 0.75rem;
        gap: 0.35rem;
    }
    .fx-topbar-icon {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
    .fx-topbar-user .fx-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    .fx-topbar-user {
        padding: 4px 10px 4px 4px;
        gap: 0.5rem;
    }

    .fx-content {
        padding: 0.75rem 0.75rem 5rem 0.75rem;
    }

    /* Hero — single column stat chips */
    .fx-hero {
        padding: 1rem;
    }
    .fx-hero h1 {
        font-size: 1.2rem;
    }
    .fx-hero .lead {
        font-size: 0.85rem;
    }
    .fx-hero-stats {
        gap: 0.5rem;
    }
    .fx-hero-stat {
        min-width: calc(50% - 0.25rem);
        padding: 0.5rem;
    }
    .fx-hero-stat-value {
        font-size: 1rem;
    }
    .fx-hero-stat-label {
        font-size: 0.7rem;
    }

    /* Resource grid: single column on very small */
    .fx-resource-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    /* Quick actions: 2 cols */
    .fx-quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Buttons full-width on small phone */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    .btn-sm {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }

    /* Compact badges */
    .badge {
        font-size: 0.65rem;
        padding: 0.25em 0.5em;
    }

    /* Smaller icons */
    .fa-2x {
        font-size: 1.5em;
    }
    .fa-3x {
        font-size: 2em;
    }

    /* Card body compact */
    .card-body {
        padding: 0.75rem;
    }

    /* Form elements */
    .form-select-sm {
        font-size: 0.8rem;
    }
    .form-control,
    .form-select {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }

    /* Code blocks */
    code {
        font-size: 0.75rem;
        word-break: break-all;
    }
    pre {
        font-size: 0.7rem;
        max-height: 150px !important;
    }

    /* Chart container smaller */
    .fx-chart-container {
        height: 200px;
    }

    /* Notifications compact */
    .fx-notification {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    .fx-notification-icon {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    .fx-notification-title {
        font-size: 0.8rem;
    }
    .fx-notification-text {
        font-size: 0.75rem;
    }

    /* Security compact */
    .fx-score-circle {
        width: 100px;
        height: 100px;
    }
    .fx-score-value {
        font-size: 1.5rem;
    }
    .fx-score-value small {
        font-size: 0.8rem;
    }
    .fx-security-item {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    /* Renewals compact */
    .fx-renewal-item {
        padding: 0.75rem;
        flex-wrap: wrap;
    }
    .fx-renewal-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    /* Status items compact */
    .fx-status-item {
        padding: 0.6rem 0.75rem;
    }
    .fx-status-icon {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
    .fx-status-name {
        font-size: 0.8rem;
    }
    .fx-status-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
}

/* ── Very small phone (≤375px — iPhone SE, etc.) ── */
@media (max-width: 375.98px) {
    .fx-topbar {
        padding: 0 0.5rem;
    }
    .fx-topbar-title {
        font-size: 1rem;
    }
    .fx-topbar-icon {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    .fx-topbar-user .fx-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
    .fx-topbar-user {
        padding: 3px 8px 3px 3px;
        gap: 0.35rem;
    }
    .fx-content {
        padding: 0.5rem 0.5rem 4rem 0.5rem;
    }

    .fx-hero h1 {
        font-size: 1.1rem;
    }
    .fx-hero-stat {
        min-width: 100%;
    }
    .fx-quick-action-label {
        font-size: 0.65rem;
    }
}

/* Role-aware mobile navigation and hardened panel chrome. */
.fx-mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    display: none;
    background: color-mix(in srgb, var(--fx-surface) 92%, transparent);
    border-top: 1px solid var(--fx-border);
    box-shadow: 0 -8px 24px rgba(1, 4, 9, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.fx-mobile-nav-inner {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: 60px;
}
.fx-mobile-nav-link {
    min-width: 0;
    min-height: 52px;
    padding: 0.45rem 0.2rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--fx-text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    font: inherit;
    line-height: 1.05;
    cursor: pointer;
    transition: color 0.18s ease, background-color 0.18s ease;
}
.fx-mobile-nav-link i {
    font-size: 1rem;
}
.fx-mobile-nav-link small {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fx-mobile-nav-link:hover,
.fx-mobile-nav-link:focus-visible,
.fx-mobile-nav-link.active {
    color: var(--fx-primary);
    background: var(--fx-primary-50);
}

@media (max-width: 991.98px) {
    .fx-topbar-search {
        display: none;
    }
    .fx-topbar-title {
        min-width: 0;
        max-width: min(40vw, 280px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .fx-topbar-user .fx-name {
        display: none !important;
    }
    .fx-topbar-icon,
    .fx-topbar-user {
        min-width: 44px;
        min-height: 44px;
    }
    .modal-header .btn-close,
    .alert .btn-close {
        box-sizing: border-box;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        padding: 0.75rem;
        margin: -0.65rem -0.65rem -0.65rem auto;
    }
    .fx-topbar-user {
        padding: 4px 8px 4px 4px;
    }
}

@media (max-width: 767.98px) {
    .fx-mobile-nav {
        display: block;
    }
    .fx-content {
        padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)) !important;
    }
    .fx-topbar-icon,
    .fx-topbar-user {
        min-width: 44px;
        min-height: 44px;
    }
    .table.mobile-stack {
        display: block;
        margin: 0;
    }
    .table.mobile-stack tbody {
        display: grid;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    .table.mobile-stack tbody tr {
        margin: 0;
        padding: 0.25rem 0.75rem;
        background: var(--fx-surface);
        border: 1px solid var(--fx-border);
        border-radius: var(--fx-radius-sm);
        box-shadow: var(--fx-shadow-sm);
    }
    .table.mobile-stack tbody td {
        width: 100%;
        min-height: 44px;
        gap: 1rem;
        padding: 0.65rem 0;
        border-bottom: 1px solid color-mix(in srgb, var(--fx-border) 65%, transparent);
        white-space: normal !important;
        overflow-wrap: anywhere;
    }
    .table.mobile-stack tbody td:last-child {
        border-bottom: 0;
    }
    .table.mobile-stack tbody td::before {
        flex: 0 0 34%;
        max-width: 34%;
        color: var(--fx-text-muted);
        font-size: 0.75rem;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }
    .table.mobile-stack .btn-sm {
        min-width: 44px !important;
        min-height: 44px !important;
    }
}

/* Keep the package catalogue scannable on laptops without removing details
   from phone cards or wide desktop tables. */
@media (min-width: 768px) and (max-width: 1399.98px) {
    .crud-table-hosting_packages th:nth-child(7),
    .crud-table-hosting_packages td:nth-child(7),
    .crud-table-hosting_packages th:nth-child(8),
    .crud-table-hosting_packages td:nth-child(8),
    .crud-table-hosting_packages th:nth-child(9),
    .crud-table-hosting_packages td:nth-child(9),
    .crud-table-hosting_packages th:nth-child(10),
    .crud-table-hosting_packages td:nth-child(10) {
        display: none;
    }
}

@media (max-width: 375.98px) {
    .fx-topbar-icon {
        width: 44px;
        height: 44px;
    }
    .fx-topbar-user .fx-avatar {
        width: 34px;
        height: 34px;
    }
    .fx-topbar-user {
        padding: 4px;
    }
}

/* ── Touch device improvements (all sizes) ── */
@media (hover: none) and (pointer: coarse) {
    /* Touch targets ≥44px */
    .btn {
        min-height: 44px;
    }
    .btn-sm {
        min-height: 44px;
        min-width: 44px;
    }
    .btn-icon {
        min-width: 44px;
        min-height: 44px;
    }
    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 16px; /* prevent iOS zoom */
    }
    .form-check-input {
        width: 1.25rem;
        height: 1.25rem;
    }
    .list-group-item-action {
        padding: 1rem;
    }
    .dropdown-item {
        padding: 0.75rem 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    .nav-link {
        min-height: 44px;
    }
    .fx-sidebar-link {
        min-height: 44px;
    }

    /* Disable hover effects on touch */
    .card-hover:hover {
        transform: none;
    }
    .fx-quick-action:hover {
        transform: none;
    }
}

.fx-password-generator {
    min-width: 44px;
    min-height: 44px;
    white-space: nowrap;
}

.fx-password-feedback {
    margin-top: 0.4rem;
}

/* ── Large laptop (≥1536px) ── */
@media (min-width: 1536px) {
    .fx-content {
        padding: 2.5rem;
    }
    .fx-hero {
        padding: 3rem;
    }
    .fx-hero h1 {
        font-size: 2.25rem;
    }
    .fx-resource-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ── Desktop HD (≥1920px) ── */
@media (min-width: 1920px) {
    body {
        font-size: 15px;
    }
    .fx-content {
        padding: 3rem;
        max-width: 1800px;
    }
    .fx-hero h1 {
        font-size: 2.5rem;
    }
}

/* ── 4K / UHD (≥2560px) ── */
@media (min-width: 2560px) {
    body {
        font-size: 16px;
    }
    :root {
        --fx-sidebar-w: 320px;
        --fx-rightbar-w: 380px;
        --fx-topbar-h: 80px;
    }
    .fx-content {
        padding: 3.5rem;
        max-width: 2200px;
    }
    .fx-topbar {
        padding: 0 3rem;
    }
    .fx-topbar-search {
        max-width: 500px;
    }
    .fx-topbar-search input {
        font-size: 1rem;
        padding: 0.75rem 1rem 0.75rem 2.75rem;
    }
    .fx-hero {
        padding: 4rem;
        border-radius: 24px;
    }
    .fx-hero h1 {
        font-size: 3rem;
    }
    .fx-resource-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 1.5rem;
    }
}

/* Utility classes for responsive visibility */
.w-sm-auto {
    width: auto !important;
}
@media (max-width: 575.98px) {
    .w-sm-auto {
        width: 100% !important;
    }
}

/* ── Print styles ── */
@media print {
    .fx-sidebar,
    .fx-topbar,
    .fx-rightbar,
    .fx-backdrop {
        display: none !important;
    }
    .fx-content {
        padding: 0;
    }
    .fx-main {
        height: auto;
        overflow: visible;
    }
}

/* =============================================================
   FILE MANAGER — Full-width Layout Fix
   ============================================================= */

.file-manager.fm-pro {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
}

.fm-shell {
    width: 100%;
    max-width: 100%;
}

.fm-commandbar {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px 20px;
    gap: 12px;
}

.fm-titleblock {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fm-titleblock h1 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
}

.fm-titleblock .fm-subtitle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--fx-text-muted);
    flex-wrap: wrap;
}

.fm-title-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fx-primary-50);
    color: var(--fx-primary);
    border-radius: 12px;
    font-size: 1.2rem;
}

.fm-cpanel-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--fx-border);
    background: var(--fx-surface);
}

.fm-cpanel-toolbar .btn-group {
    display: inline-flex;
}

.fm-cpanel-toolbar .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
}

.fm-cpanel-toolbar .btn:disabled {
    opacity: 0.45;
}

.fm-utilitybar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    background: var(--fx-surface-2);
    border-bottom: 1px solid var(--fx-border);
    gap: 8px;
}

.fm-breadcrumb {
    flex: 1;
    min-width: 150px;
}

.fm-breadcrumb .breadcrumb {
    margin: 0;
    font-size: 0.82rem;
}

/* cPanel-style URL bar breadcrumb */
.fm-urlbar {
    display: flex;
    align-items: center;
    background: var(--fx-surface);
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    padding: 3px 8px;
    font-size: 0.82rem;
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 34px;
    flex-wrap: wrap;
    gap: 0;
}

.fm-urlbar .fm-urlbar-prefix {
    color: var(--fx-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    margin-right: 4px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px 2px 0;
    border-right: 1px solid var(--fx-border);
}

.fm-urlbar .fm-urlbar-segment {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    color: var(--fx-text);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.12s;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
}

.fm-urlbar .fm-urlbar-segment:hover {
    background: var(--fx-primary-50);
    color: var(--fx-primary-700);
    text-decoration: none;
}

.fm-urlbar .fm-urlbar-segment.active {
    color: var(--fx-text-muted);
    cursor: default;
    font-weight: 400;
}

.fm-urlbar .fm-urlbar-segment.active:hover {
    background: transparent;
    color: var(--fx-text-muted);
}

.fm-urlbar .fm-urlbar-sep {
    color: var(--fx-text-faint);
    font-size: 0.7rem;
    margin: 0 1px;
    user-select: none;
}

.fm-urlbar .fm-urlbar-path {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}

/* Dark mode URL bar */
[data-bs-theme="dark"] .fm-urlbar,
[data-theme="dark"] .fm-urlbar {
    background: var(--fx-surface-2);
    border-color: var(--fx-border);
}

[data-bs-theme="dark"] .fm-urlbar .fm-urlbar-prefix,
[data-theme="dark"] .fm-urlbar .fm-urlbar-prefix {
    border-right-color: var(--fx-border);
}

[data-bs-theme="dark"] .fm-urlbar .fm-urlbar-segment:hover,
[data-theme="dark"] .fm-urlbar .fm-urlbar-segment:hover {
    background: rgba(129, 140, 248, 0.15);
    color: #818cf8;
}

[data-bs-theme="dark"] .fm-urlbar .fm-urlbar-segment.active:hover,
[data-theme="dark"] .fm-urlbar .fm-urlbar-segment.active:hover {
    background: transparent;
    color: var(--fx-text-muted);
}

.fm-toolcluster {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.fm-searchbox {
    max-width: 220px;
}

.fm-searchbox .input-group-text {
    padding: 4px 8px;
    font-size: 0.78rem;
}

.fm-searchbox input {
    font-size: 0.8rem;
    padding: 4px 8px;
}

.fm-subtitle .fm-domain-badge {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    padding: 2px 10px !important;
    background: var(--fx-primary-50) !important;
    color: var(--fx-primary-700) !important;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--fx-primary-100);
}

[data-bs-theme="dark"] .fm-domain-badge,
[data-theme="dark"] .fm-domain-badge {
    background: rgba(129, 140, 248, 0.15);
    color: #818cf8;
    border-color: rgba(129, 140, 248, 0.25);
}

/* Dark mode file manager */
[data-bs-theme="dark"] .fm-shell,
[data-theme="dark"] .fm-shell {
    border-color: var(--fx-border);
    background: var(--fx-surface);
}

[data-bs-theme="dark"] .fm-commandbar,
[data-theme="dark"] .fm-commandbar {
    background: var(--fx-surface);
    border-color: var(--fx-border);
}

[data-bs-theme="dark"] .fm-cpanel-toolbar,
[data-theme="dark"] .fm-cpanel-toolbar {
    background: var(--fx-surface-2);
    border-color: var(--fx-border);
}

[data-bs-theme="dark"] .fm-utilitybar,
[data-theme="dark"] .fm-utilitybar {
    background: var(--fx-surface-2);
    border-color: var(--fx-border);
}

[data-bs-theme="dark"] .fm-title-icon,
[data-theme="dark"] .fm-title-icon {
    background: rgba(129, 140, 248, 0.15);
    color: #818cf8;
}

[data-bs-theme="dark"] .fm-perm-cell .fm-perm-display,
[data-theme="dark"] .fm-perm-cell .fm-perm-display {
    color: var(--fx-text);
}

[data-bs-theme="dark"] .fm-perm-cell .fm-perm-input,
[data-theme="dark"] .fm-perm-cell .fm-perm-input {
    background: var(--fx-surface);
    color: var(--fx-text);
    border-color: var(--fx-border);
}

[data-bs-theme="dark"] .file-grid-item,
[data-theme="dark"] .file-grid-item {
    background: var(--fx-surface);
    border-color: var(--fx-border);
}

[data-bs-theme="dark"] .file-grid-item.selected,
[data-theme="dark"] .file-grid-item.selected {
    background: rgba(129, 140, 248, 0.15);
    border-color: #818cf8;
}

[data-bs-theme="dark"] .fm-context-menu,
[data-theme="dark"] .fm-context-menu {
    background: var(--fx-surface);
    border-color: var(--fx-border);
}

[data-bs-theme="dark"] .fm-context-menu-item:hover,
[data-theme="dark"] .fm-context-menu-item:hover {
    background: var(--fx-surface-2);
}

[data-bs-theme="dark"] .fm-selectionbar,
[data-theme="dark"] .fm-selectionbar {
    background: rgba(129, 140, 248, 0.1);
    border-color: var(--fx-border);
}

[data-bs-theme="dark"] .split-file-item:hover,
[data-theme="dark"] .split-file-item:hover {
    background: var(--fx-surface-2);
}

[data-bs-theme="dark"] .fm-searchbox input,
[data-theme="dark"] .fm-searchbox input {
    background: var(--fx-surface);
    color: var(--fx-text);
    border-color: var(--fx-border);
}

/* Override filemanager.css breadcrumb background in dark mode */
[data-bs-theme="dark"] .fm-breadcrumb,
[data-theme="dark"] .fm-breadcrumb,
[data-bs-theme="dark"] nav.fm-breadcrumb,
[data-theme="dark"] nav.fm-breadcrumb,
[data-bs-theme="dark"] #path-breadcrumb,
[data-theme="dark"] #path-breadcrumb {
    background: transparent !important;
    background-color: transparent !important;
}

/* Override filemanager.css commandbar gradient in dark mode */
[data-bs-theme="dark"] .fm-commandbar,
[data-theme="dark"] .fm-commandbar {
    background: var(--fx-surface) !important;
    background-color: var(--fx-surface) !important;
    background-image: none !important;
}

.fm-workspace {
    padding: 0;
    min-height: 300px;
}

.fm-workspace .table-responsive {
    margin: 0;
}

.fm-workspace .fm-table {
    margin: 0;
}

/* Selection bar */
.fm-selectionbar {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    background: var(--fx-primary-50);
    border-bottom: 1px solid var(--fx-border);
    gap: 10px;
}

.fm-selection-count {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--fx-primary-700);
    white-space: nowrap;
}

/* File Grid */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    padding: 16px;
}

.file-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border: 1px solid var(--fx-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    background: var(--fx-surface);
}

.file-grid-item:hover {
    border-color: var(--fx-primary);
    box-shadow: 0 2px 8px rgba(67, 24, 255, 0.1);
}

.file-grid-item.selected {
    border-color: var(--fx-primary);
    background: var(--fx-primary-50);
}

.file-grid-checkbox {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 2;
}

.file-grid-thumbnail {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

.file-grid-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.file-grid-thumbnail i {
    font-size: 2.5rem;
}

.file-grid-name {
    font-size: 0.78rem;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.file-grid-info {
    font-size: 0.68rem;
}

/* Split file list for split pane */
.split-file-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.split-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s;
}

.split-file-item:hover {
    background: var(--fx-surface-2);
}

.split-file-item.fm-dragging {
    opacity: 0.5;
}

.split-file-icon {
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.split-file-name {
    flex: 1;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--fx-text);
    text-decoration: none;
}

.split-file-name:hover {
    color: var(--fx-primary);
}

.split-file-size {
    font-size: 0.7rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.fm-drop-target {
    background: var(--fx-primary-50) !important;
    outline: 2px dashed var(--fx-primary);
    outline-offset: -2px;
}

/* FM Context Menu */
.fm-context-menu {
    position: fixed;
    z-index: 9999;
    background: var(--fx-surface);
    border: 1px solid var(--fx-border);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 6px;
    min-width: 200px;
    display: none;
}

.fm-context-menu.fm-active {
    display: block;
}

.fm-context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--fx-text);
    font-size: 0.82rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.1s;
}

.fm-context-menu-item:hover {
    background: var(--fx-surface-2);
}

.fm-context-menu-item--danger {
    color: var(--fx-danger);
}

.fm-context-menu-separator {
    height: 1px;
    background: var(--fx-border);
    margin: 4px 8px;
}

.fm-context-menu-shortcut {
    margin-left: auto;
    color: var(--fx-text-muted);
    font-size: 0.72rem;
}

.fm-context-menu .fm-icon {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

/* Inline Permission Editor */
.fm-perm-cell {
    position: relative;
}

.fm-perm-display:hover {
    color: var(--fx-primary);
    text-decoration: underline;
    text-decoration-style: dotted;
}

.fm-perm-input:focus {
    border-color: var(--fx-primary);
    box-shadow: 0 0 0 2px rgba(67, 24, 255, 0.15);
    outline: none;
}

/* Drag ghost */
.fm-drag-ghost {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--fx-primary);
    color: #fff;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* =============================================================
   FILE MANAGER — Split Pane, Responsive & Advanced Features
   ============================================================= */

/* ── Split Pane ── */
.fm-split-pane {
    display: flex;
    flex-direction: row;
    gap: 4px;
    height: 100%;
    min-height: 400px;
    position: relative;
}
.fm-split-left,
.fm-split-right {
    flex: 1 1 50%;
    min-width: 200px;
    overflow: auto;
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius-sm);
    background: var(--fx-surface);
    padding: 8px;
    position: relative;
}
.fm-split-divider {
    width: 6px;
    cursor: col-resize;
    background: var(--fx-border);
    border-radius: 3px;
    flex-shrink: 0;
    transition: background 0.2s;
    position: relative;
}
.fm-split-divider:hover,
.fm-split-divider:active {
    background: var(--fx-primary);
}
.fm-split-divider::after {
    content: "⋮";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--fx-text-muted);
    font-size: 12px;
    line-height: 1;
}
.fm-split-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    margin-bottom: 6px;
    background: var(--fx-surface-2);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--fx-text-muted);
    font-weight: 600;
}
.fm-split-header .fm-split-path {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 4px;
}
.fm-split-header .btn {
    padding: 2px 6px;
    font-size: 0.75rem;
}

/* ── PDF Viewer ── */
.fm-pdf-viewer {
    display: flex;
    flex-direction: column;
    height: 80vh;
    background: var(--fx-surface);
    border-radius: var(--fx-radius-sm);
    overflow: hidden;
}
.fm-pdf-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--fx-surface-2);
    border-bottom: 1px solid var(--fx-border);
    flex-wrap: wrap;
}
.fm-pdf-toolbar .btn {
    padding: 4px 10px;
    font-size: 0.8rem;
}
.fm-pdf-toolbar .fm-pdf-page-info {
    font-size: 0.8rem;
    color: var(--fx-text-muted);
    font-weight: 600;
}
.fm-pdf-toolbar .fm-pdf-search {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}
.fm-pdf-toolbar .fm-pdf-search input {
    width: 140px;
    padding: 3px 8px;
    border: 1px solid var(--fx-border);
    border-radius: 6px;
    font-size: 0.8rem;
    background: var(--fx-surface);
    color: var(--fx-text);
}
.fm-pdf-canvas-container {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    padding: 16px;
    background: #525659;
}
.fm-pdf-canvas-container canvas {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    max-width: 100%;
}
.fm-pdf-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--fx-text-muted);
    font-size: 1.1rem;
}

/* ── Media Preview (enhanced) ── */
.fm-media-preview {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
.fm-media-preview video,
.fm-media-preview audio {
    width: 100%;
    max-width: 720px;
}
.fm-preview-modal .modal-body {
    padding: 0;
    background: #000;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fm-preview-modal .modal-content {
    background: transparent;
    border: none;
}
.fm-preview-modal .modal-header {
    background: var(--fx-surface);
    border-radius: var(--fx-radius-sm) var(--fx-radius-sm) 0 0;
}

/* ── Permission Editor (enhanced) ── */
.fm-perm-visual {
    display: flex;
    gap: 16px;
    margin: 12px 0;
    flex-wrap: wrap;
}
.fm-perm-group {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    background: var(--fx-surface-2);
}
.fm-perm-group h6 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fx-text-muted);
    margin-bottom: 6px;
    text-align: center;
}
.fm-perm-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    padding: 2px 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
}
.fm-perm-group label:hover {
    background: var(--fx-surface-3);
}
.fm-perm-group label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.fm-perm-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 8px 0;
}
.fm-perm-presets .btn {
    font-size: 0.75rem;
    padding: 3px 10px;
    font-family: monospace;
}

/* ── Responsive File Manager ── */

/* Tablet (max-width: 991.98px) */
@media (max-width: 991.98px) {
    .fm-cpanel-toolbar .btn span {
        display: none;
    }
    .fm-cpanel-toolbar .btn {
        padding: 6px 10px;
    }
    .fm-utilitybar {
        flex-wrap: wrap;
        gap: 6px;
    }
    .fm-toolcluster {
        width: 100%;
        justify-content: flex-start;
    }
    .fm-searchbox {
        max-width: 200px;
    }
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
        gap: 8px !important;
    }
    .fm-split-pane {
        flex-direction: column;
    }
    .fm-split-left,
    .fm-split-right {
        flex: none;
        min-height: 250px;
        max-height: 50vh;
    }
    .fm-split-divider {
        width: 100%;
        height: 6px;
        cursor: row-resize;
    }
    .fm-split-divider::after {
        content: "⋯";
    }
    .fm-pdf-toolbar {
        padding: 6px 8px;
    }
    .fm-pdf-toolbar .fm-pdf-search input {
        width: 100px;
    }
}

/* Mobile (max-width: 767.98px) */
@media (max-width: 767.98px) {
    .fm-titleblock h1 {
        font-size: 1.1rem;
    }
    .fm-titleblock .fm-subtitle {
        font-size: 0.75rem;
    }
    .fm-cpanel-toolbar {
        gap: 4px;
    }
    .fm-cpanel-toolbar .btn-group {
        gap: 0;
    }
    .fm-cpanel-toolbar .btn {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    .fm-cpanel-toolbar .btn span {
        display: none;
    }
    .fm-commandbar {
        flex-direction: column;
        gap: 6px;
    }
    .fm-toolcluster {
        flex-wrap: wrap;
    }
    #file-table th:nth-child(3),
    #file-table td:nth-child(3),
    #file-table th:nth-child(4),
    #file-table td:nth-child(4) {
        display: none;
    }
    #file-table th:nth-child(5),
    #file-table td:nth-child(5) {
        display: none;
    }
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
        gap: 6px !important;
    }
    .file-grid-item .file-grid-thumbnail i,
    .file-grid-item .file-grid-thumbnail img {
        font-size: 2rem !important;
        width: 48px !important;
        height: 48px !important;
    }
    .file-grid-item .file-grid-name {
        font-size: 0.7rem;
    }
    .fm-selectionbar {
        flex-wrap: wrap;
        padding: 6px;
    }
    .fm-selectionbar .btn span {
        display: none;
    }
    .fm-pdf-toolbar {
        gap: 4px;
    }
    .fm-pdf-toolbar .btn {
        padding: 3px 6px;
        font-size: 0.7rem;
    }
    .fm-pdf-toolbar .fm-pdf-search {
        width: 100%;
        margin-left: 0;
        margin-top: 4px;
    }
    .fm-pdf-toolbar .fm-pdf-search input {
        width: 100%;
    }
    .fm-pdf-canvas-container {
        padding: 8px;
    }
    /* Modals full-screen on mobile */
    .modal-dialog {
        margin: 0;
        max-width: 100%;
    }
    .modal-dialog .modal-content {
        border-radius: 0;
        min-height: 100vh;
    }
    .modal-dialog .modal-header {
        border-radius: 0;
    }
    .upload-drop-zone .drop-zone-content {
        padding: 1.5rem !important;
    }
    .upload-drop-zone .drop-zone-content i {
        font-size: 2.5rem !important;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .file-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 4px !important;
    }
    .file-grid-item .file-grid-thumbnail i,
    .file-grid-item .file-grid-thumbnail img {
        font-size: 1.5rem !important;
        width: 36px !important;
        height: 36px !important;
    }
    .file-grid-item .file-grid-name {
        font-size: 0.65rem;
    }
    .file-grid-item .file-grid-info {
        font-size: 0.6rem;
    }
    .file-item td:first-child {
        width: 30px !important;
    }
    .file-item td:first-child input {
        width: 14px;
        height: 14px;
    }
    .fm-perm-visual {
        flex-direction: column;
        gap: 8px;
    }
    .fm-perm-group {
        min-width: auto;
    }
}
