﻿@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300..900&display=swap");

/* =========================================================
   ADMIN.CSS — DIRA AUTH / ADMIN / MODALS
   Fully deduplicated + admin user list fixed
========================================================= */

/* =========================================================
   TOKENS
========================================================= */

:root {
    --brand: #4f6ef7;
    --brand-dark: #3f5fe0;
    --brand-soft: rgba(79, 110, 247, 0.14);
    --shell: #ffffff;
    --panel: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --hint: #475569;
    --border: #e5e7eb;
    --border-strong: #cbd5e1;
    --success: #188038;
    --danger: #dc2626;
    --warning: #f29900;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --shadow-xl: 0 35px 80px rgba(0, 0, 0, 0.32);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 12px 28px rgba(79, 110, 247, 0.18);
}

/* =========================================================
   RESET / BASE
========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0f172a;
    color: var(--text);
    overflow: hidden;
}

.hidden {
    display: none !important;
}

.container:not(.hidden) {
    display: flex;
}

/* =========================================================
   AUTH OVERLAY / SHELL
========================================================= */

.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background-color: var(--auth-bg, #1f2937);
}

    .auth-overlay.hidden {
        display: none !important;
    }

    .auth-overlay.admin-mode {
        align-items: flex-start;
        justify-content: center;
        padding: 24px;
        overflow: hidden;
    }

.auth-shell {
    width: min(960px, 92vw);
    height: min(740px, 92vh);
    background: var(--shell);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* =========================================================
   BRAND HEADER
========================================================= */

.auth-brand {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 24px 10px;
    background: linear-gradient(180deg, #ffffff, #f8faff);
    border-bottom: 1px solid #e6ebff;
}

.brand-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.brand-logo-img {
    width: 190px;
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* =========================================================
   AUTH PANELS
========================================================= */

.auth-panels {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 22px 32px 28px;
}

.auth-panel {
    min-width: 0;
    min-height: 0;
    background: var(--panel);
    border-radius: var(--radius-md);
    padding: 22px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.025);
    display: flex;
    flex-direction: column;
}

    .auth-panel h2,
    .auth-panel .panel-header h2 {
        margin: 0 0 14px;
        color: var(--text);
        font-size: 18px;
        font-weight: 800;
        line-height: 1.2;
    }

.panel-subtitle {
    margin: 8px 0 0;
    color: var(--hint);
    font-size: 13px;
    line-height: 1.55;
    font-weight: 650;
}

/* =========================================================
   AUTH ROLE TABS
========================================================= */

.auth-role-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 12px 0 8px;
}

.auth-role-tab {
    appearance: none;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #ffffff;
    color: var(--hint);
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

    .auth-role-tab.active,
    .auth-role-tab[aria-selected="true"] {
        background: linear-gradient(180deg, #5b7cff, var(--brand));
        color: #ffffff;
        border-color: transparent;
    }

/* =========================================================
   AUTH MODE TABS
========================================================= */

.auth-mode-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 7px;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    margin-bottom: 22px;
}

.auth-mode-tab {
    min-height: 44px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #475569;
    font-size: 14px;
    font-weight: 950;
    cursor: pointer;
}

    .auth-mode-tab.active,
    .auth-mode-tab[aria-selected="true"] {
        background: #ffffff;
        color: #061124;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    }

/* =========================================================
   FORMS
========================================================= */

.auth-form {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

    .auth-form input,
    .auth-form select {
        width: 100%;
        min-height: 42px;
        padding: 11px 14px;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        background: #ffffff;
        color: var(--text);
        font: inherit;
        font-size: 13.5px;
        font-weight: 600;
        outline: none;
    }

        .auth-form input:focus,
        .auth-form select:focus {
            border-color: var(--brand);
            box-shadow: 0 0 0 3px var(--brand-soft);
        }

        .auth-form input::placeholder {
            color: #94a3b8;
        }

.secure-password {
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: normal;
    color: var(--text);
    caret-color: var(--text);
    background-color: inherit;
}

/* =========================================================
   BUTTONS
========================================================= */

.primary-btn {
    width: 100%;
    min-height: 42px;
    margin-top: 0;
    padding: 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, #5b7cff, var(--brand));
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(79, 110, 247, 0.32);
}

    .primary-btn:hover:not(:disabled) {
        background: linear-gradient(180deg, var(--brand), var(--brand-dark));
    }

    .primary-btn:disabled,
    .primary-btn[disabled] {
        background: linear-gradient(180deg, #cbd5f5, #cbd5f5);
        color: #64748b;
        cursor: not-allowed;
        opacity: 0.65;
        pointer-events: none;
        box-shadow: none;
    }

.secondary-btn {
    border: none;
    border-radius: 10px;
    background: #e5e7eb;
    color: #1f2937;
    padding: 10px 16px;
    font-weight: 700;
    cursor: pointer;
}

/* =========================================================
   PROVIDER BUTTONS / ICONS
========================================================= */

.provider-btn {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--text);
    font-size: 13.5px;
    font-weight: 750;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

    .provider-btn:hover {
        background: #f3f6ff;
        border-color: var(--brand);
    }

.icon {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

    .icon.google {
        background-image: url("https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg");
    }

    .icon.facebook {
        background-image: url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/icons/facebook.svg");
        filter: invert(26%) sepia(89%) saturate(3583%) hue-rotate(203deg);
    }

    .icon.institute,
    .icon.institution {
        background-image: url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/icons/bank.svg");
    }

/* =========================================================
   LINKS
========================================================= */

.auth-links {
    margin-top: 10px;
    text-align: center;
    font-size: 12.5px;
}

    .auth-links a {
        color: var(--brand);
        text-decoration: none;
    }

        .auth-links a:hover {
            text-decoration: underline;
        }

.link-separator {
    margin: 0 6px;
    color: var(--muted);
}

/* =========================================================
   SECURE AUTH FRAME
========================================================= */

.panel-divider {
    position: relative;
    margin: 18px 0 16px;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(79, 110, 247, 0.06);
    color: var(--brand);
    text-align: center;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    opacity: 0;
    transform: translateY(4px);
    animation: dividerFadeIn 0.6s ease-out 0.2s forwards;
}

    .panel-divider::before {
        content: "";
        position: absolute;
        inset: 0;
        border: 1.5px solid var(--brand);
        border-radius: inherit;
        opacity: 0;
        transform: scaleX(0.85);
        animation: dividerFrame 0.9s ease-out 0.4s forwards;
    }

.secure-auth-frame {
    position: relative;
    margin-top: 14px;
    padding: 16px 14px 18px;
    border: 1.5px solid transparent;
    border-radius: 18px;
    background: linear-gradient(#ffffff, #ffffff) padding-box, linear-gradient(120deg, #4f6ef7, #6f8cff, #4f6ef7) border-box;
    animation: secureFrameGlow 6s ease-in-out infinite;
}

    .secure-auth-frame .panel-divider {
        width: fit-content;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin: 0 auto 12px;
        padding: 6px 16px;
        background: rgba(79, 110, 247, 0.08);
    }

    .secure-auth-frame .provider-btn {
        margin-top: 8px;
    }

        .secure-auth-frame .provider-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 18px rgba(79, 110, 247, 0.18);
        }

/* =========================================================
   PASSWORD FEEDBACK
========================================================= */

.password-hint-wrap {
    margin: 2px 0;
    min-height: 28px;
    transition: opacity 0.2s ease;
}

    .password-hint-wrap.hidden {
        opacity: 0;
        pointer-events: none;
        display: block !important;
    }

.password-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--hint);
    font-size: 11px;
    line-height: 1;
}

.password-rules {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

    .password-rules span {
        color: #9aa0a6;
        font-weight: 600;
    }

        .password-rules span + span::before {
            content: "|";
            margin: 0 2px;
            color: #c7c7c7;
        }

    .password-rules .bad {
        color: #d93025;
    }

    .password-rules .ok {
        color: var(--success);
    }

.password-strength {
    margin-left: auto;
    font-size: 11px;
    font-weight: 800;
}

    .password-strength.weak,
    #password-strength.weak {
        color: #d93025;
    }

    .password-strength.moderate,
    #password-strength.moderate {
        color: var(--warning);
    }

    .password-strength.strong,
    #password-strength.strong {
        color: var(--success);
    }

.password-strength-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}

    .password-strength-bar span {
        flex: 1;
        height: 3px;
        border-radius: 2px;
        background: #e0e0e0;
        transition: background-color 0.25s ease;
    }

    .password-strength-bar.weak span:nth-child(1) {
        background: #d93025;
    }

    .password-strength-bar.moderate span:nth-child(-n + 2) {
        background: var(--warning);
    }

    .password-strength-bar.strong span {
        background: var(--success);
    }

.password-policy-line {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 18px;
    margin-bottom: 6px;
    color: var(--hint);
    font-size: 12.5px;
    line-height: 1.3;
}

    .password-policy-line span {
        color: #16a34a;
        font-weight: 600;
    }

    .password-policy-line .sep {
        margin: 0 4px;
        color: #94a3b8;
    }

    .password-policy-line .error {
        color: var(--danger);
        font-weight: 700;
    }

.kbd-select {
    margin-left: 8px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: #ffffff;
    color: var(--text);
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
    outline: none;
    appearance: none;
}

    .kbd-select:hover {
        border-color: #cbd5f5;
    }

    .kbd-select:focus {
        border-color: var(--brand);
        box-shadow: 0 0 0 2px rgba(79, 110, 247, 0.25);
    }

    .kbd-select:disabled {
        background-color: #f8fafc;
        color: #94a3b8;
        cursor: not-allowed;
    }

.auth-form:has(#reg-password) {
    position: relative;
}

#reg-password {
    --pwd-top: 0px;
    padding-right: 92px;
}

#password-strength {
    position: absolute;
    right: 26px;
    top: calc(var(--pwd-top, 0px) + 50%);
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
}

.pwd-rules {
    margin: 8px 0 0;
    padding-left: 18px;
    font-size: 13px;
}

    .pwd-rules li {
        margin: 4px 0;
        color: #9ca3af;
    }

        .pwd-rules li.pass {
            color: #059669;
        }

        .pwd-rules li.fail {
            color: var(--danger);
        }

/* =========================================================
   TOASTS
========================================================= */

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 10050;
    padding: 10px 14px;
    border-radius: 8px;
    background: #0f172a;
    color: #ffffff;
    font-size: 13px;
    opacity: 0;
    transform: translateY(6px);
    transition: all 0.25s ease;
}

    .toast.show {
        opacity: 1;
        transform: translateY(0);
    }

.toast-success {
    background: var(--success);
}

/* =========================================================
   RECOVERY / ADMIN CHALLENGE MODALS
========================================================= */

.recovery-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.65);
}

.recovery-card {
    width: 440px;
    max-width: 92%;
    padding: 32px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    font-family: "Inter", system-ui, sans-serif;
}

    .recovery-card h2 {
        margin: 0 0 8px;
        color: var(--text);
        font-size: 21px;
        font-weight: 800;
    }

    .recovery-card p,
    .recovery-desc {
        margin: 0 0 18px;
        color: var(--hint);
        font-size: 14px;
        line-height: 1.6;
    }

    .recovery-card input {
        width: 100%;
        margin-bottom: 12px;
        padding: 12px 14px;
        border: 1px solid var(--border-strong);
        border-radius: 10px;
        font-size: 14px;
        outline: none;
    }

        .recovery-card input:focus {
            border-color: #5b7cff;
        }

.recovery-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
}

.captcha-wrap {
    margin: 12px 0;
}

/* =========================================================
   PLANS / BILLING MODALS
========================================================= */

.plans-overlay,
.billing-overlay {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.65);
}

    .plans-overlay.hidden,
    .billing-overlay.hidden {
        display: none !important;
    }

.plans-modal,
.billing-modal {
    width: min(1100px, 94vw);
    max-height: 90vh;
    padding: 28px 32px;
    border-radius: var(--radius-lg);
    background: var(--shell);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.plans-modal-header,
.billing-modal-header {
    margin-bottom: 24px;
    text-align: center;
}

    .plans-modal-header h2,
    .billing-modal-header h2 {
        margin: 0;
        color: var(--text);
        font-size: 22px;
        font-weight: 800;
    }

    .plans-modal-header .muted,
    .billing-modal-header .muted {
        margin-top: 6px;
        color: var(--muted);
        font-size: 14px;
    }

.plans-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.plan-card {
    display: flex;
    flex-direction: column;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--panel);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

    .plan-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

    .plan-card.active {
        border-color: var(--brand);
        box-shadow: 0 0 0 2px var(--brand-soft);
    }

.plan-title {
    margin-bottom: 6px;
    font-size: 16px;
    font-weight: 800;
}

.plan-price {
    margin: 8px 0 4px;
    font-size: 28px;
    font-weight: 900;
}

    .plan-price span {
        color: var(--muted);
        font-size: 13px;
        font-weight: 600;
    }

.plan-desc {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 13px;
}

.plan-features {
    list-style: none;
    margin: 12px 0 18px;
    padding: 0;
    font-size: 13px;
}

    .plan-features li {
        position: relative;
        margin-bottom: 6px;
        padding-left: 18px;
    }

        .plan-features li::before {
            content: "✓";
            position: absolute;
            left: 0;
            color: var(--brand);
            font-weight: 800;
        }

.plan-card .primary-btn {
    margin-top: auto;
}

.billing-section {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
}

.billing-panel {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--panel);
}

    .billing-panel h3 {
        margin: 0 0 12px;
        font-size: 16px;
        font-weight: 800;
    }

.billing-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13.5px;
}

    .billing-row strong {
        font-weight: 700;
    }

.payment-card {
    padding: 14px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 13px;
}

.plans-modal-footer,
.billing-modal-footer {
    margin-top: 24px;
    text-align: center;
}

.link-btn {
    border: none;
    background: none;
    color: var(--brand);
    font-size: 13.5px;
    cursor: pointer;
}

    .link-btn:hover {
        text-decoration: underline;
    }

/* =========================================================
   ADMIN USERS PANEL — FIXED 3 COLUMNS ONLY
========================================================= */

.admin-users-card {
    position: relative;
    width: min(920px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    margin: 0 auto;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    color: var(--text);
    box-shadow: var(--shadow-lg);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-header-wrapper {
    flex-shrink: 0;
    padding: 14px 24px 10px;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
}

.auth-header {
    margin: 0;
    text-align: center;
}

    .auth-header h2 {
        margin: 0;
        color: var(--text);
        font-size: 17px;
        font-weight: 800;
        letter-spacing: -0.01em;
    }

.auth-subtitle {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.admin-users-back {
    appearance: none;
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0 0 14px;
    padding: 9px 14px;
    border: none;
    border-radius: 9px;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #e5e7eb;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.32), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

    .admin-users-back:hover {
        background: linear-gradient(135deg, #2563eb, #1d4ed8);
        color: #ffffff;
        transform: translateY(-1px);
        box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    }

    .admin-users-back:active {
        transform: translateY(0);
    }

    .admin-users-back:focus-visible {
        outline: none;
        box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.6), 0 0 0 6px rgba(37, 99, 235, 0.25);
    }

.admin-users-search {
    flex-shrink: 0;
    padding: 10px 24px;
    border-bottom: 1px solid var(--border);
}

    .admin-users-search input {
        width: 100%;
        padding: 10px 14px;
        border: 1px solid var(--border-strong);
        border-radius: 8px;
        background: #f8fafc;
        color: #334155;
        font-size: 13.5px;
        outline: none;
    }

        .admin-users-search input:focus {
            background: #ffffff;
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
        }

.admin-users-header,
.admin-user-row {
    display: grid;
    grid-template-columns: minmax(120px, 0.8fr) minmax(220px, 1.4fr) 190px;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
}

.admin-users-header {
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.admin-users-list {
    flex: 1;
    min-height: 0;
    background: #ffffff;
    overflow-y: auto;
}

    .admin-users-list::-webkit-scrollbar {
        width: 6px;
    }

    .admin-users-list::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }

.admin-user-row {
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 12px;
}

    .admin-user-row:hover {
        background: #f8fafc;
    }

    .admin-users-header span,
    .admin-user-row span {
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        line-height: 1.25;
    }

.admin-user-name {
    color: var(--text);
    font-weight: 800;
}

.admin-user-email {
    color: var(--hint);
    font-size: 11.5px;
    font-weight: 650;
}

.admin-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.role-btn {
    min-height: 32px;
    padding: 5px 11px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 10.5px;
    line-height: 1.05;
    font-weight: 850;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

    .role-btn:hover {
        transform: translateY(-1px);
    }

    .role-btn.user {
        background-color: #dcfce7;
        color: #166534;
        border-color: #86efac;
    }

        .role-btn.user.active {
            background-color: #22c55e;
            color: #ffffff;
        }

    .role-btn.admin {
        background-color: #dbeafe;
        color: #1e40af;
        border-color: #93c5fd;
    }

        .role-btn.admin.active {
            background-color: #2563eb;
            color: #ffffff;
        }

    .role-btn:disabled {
        cursor: default;
        opacity: 0.95;
        transform: none;
    }

/* =========================================================
   DATASET LIBRARY MINI TILES — LOGIN MODAL
========================================================= */

#login-modal .auth-info-card img {
    max-width: 100%;
    height: auto;
    display: block;
}

#login-modal .auth-info-mini-tiles {
    width: 100%;
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

#login-modal .auth-info-mini-empty {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px dashed var(--border-strong);
    border-radius: 14px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.45;
}

#login-modal .auth-info-mini-tile {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    min-height: 74px;
    padding: 10px;
    border: 1px solid #dbe3f0;
    border-radius: 16px;
    background: #ffffff;
    color: var(--text);
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.045);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

    #login-modal .auth-info-mini-tile:hover {
        transform: translateY(-1px);
        border-color: #b9c6ff;
        background: #f8fbff;
        box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    }

    #login-modal .auth-info-mini-tile.selected,
    #login-modal .auth-info-mini-tile[aria-selected="true"] {
        border-color: var(--brand);
        background: linear-gradient(180deg, #eef4ff 0%, #ffffff 100%);
        box-shadow: inset 0 0 0 1px rgba(79, 110, 247, 0.18), 0 10px 22px rgba(79, 110, 247, 0.14);
    }

    #login-modal .auth-info-mini-tile:focus-visible {
        outline: none;
        border-color: var(--brand);
        box-shadow: 0 0 0 4px rgba(79, 110, 247, 0.18), 0 10px 22px rgba(15, 23, 42, 0.08);
    }

#login-modal .auth-info-mini-icon {
    width: 54px;
    height: 54px;
    min-width: 54px;
    min-height: 54px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    color: #315bea;
    display: grid;
    place-items: center;
    overflow: hidden;
    font-size: 24px;
    font-weight: 950;
    line-height: 1;
}

    #login-modal .auth-info-mini-icon img {
        width: 54px;
        height: 54px;
        max-width: 54px;
        max-height: 54px;
        padding: 5px;
        border: 0;
        border-radius: 12px;
        object-fit: contain;
        object-position: center;
        display: block;
    }

#login-modal .auth-info-mini-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

    #login-modal .auth-info-mini-copy strong {
        display: block;
        max-width: 100%;
        color: var(--text);
        font-size: 12px;
        line-height: 1.2;
        font-weight: 950;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #login-modal .auth-info-mini-copy small {
        display: -webkit-box;
        max-width: 100%;
        color: var(--hint);
        font-size: 10.5px;
        line-height: 1.35;
        font-weight: 650;
        overflow: hidden;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

/* =========================================================
   UNIVERSAL MODAL
========================================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.65);
}

    .modal-overlay.hidden {
        display: none !important;
    }

.modal-card {
    width: 380px;
    max-width: calc(100vw - 32px);
    padding: 20px 22px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    animation: modalPop 0.15s ease-out;
}

    .modal-card h3 {
        margin: 0 0 10px;
        color: var(--text);
        font-size: 18px;
    }

    .modal-card p {
        margin: 0 0 18px;
        color: #334155;
        font-size: 14px;
    }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

    .modal-btn.primary {
        background: #2563eb;
        color: #ffffff;
    }

    .modal-btn.secondary {
        background: #e5e7eb;
        color: #1f2937;
    }

/* =========================================================
   FORM MESSAGES
========================================================= */

.form-msg {
    min-height: 18px;
    padding: 0;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 650;
}

    .form-msg.error {
        color: var(--danger);
    }

    .form-msg.success {
        color: var(--success);
    }

/* =========================================================
   KEYFRAMES
========================================================= */

@keyframes dividerFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dividerFrame {
    from {
        opacity: 0;
        transform: scaleX(0.85);
    }

    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

@keyframes secureFrameGlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 980px) {
    .plans-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 880px) {
    .auth-shell {
        width: 92vw;
        height: auto;
        max-height: 92vh;
    }

    .auth-panels {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 18px 22px 24px;
        overflow-y: auto;
    }

    .billing-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .auth-mode-tabs {
        grid-template-columns: 1fr;
        border-radius: 20px;
    }

    #login-modal .auth-info-mini-tile {
        grid-template-columns: 50px minmax(0, 1fr);
        min-height: 66px;
        padding: 8px;
    }

    #login-modal .auth-info-mini-icon,
    #login-modal .auth-info-mini-icon img {
        width: 46px;
        height: 46px;
        max-width: 46px;
        max-height: 46px;
    }

    .admin-users-card {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
    }

    .admin-users-header,
    .admin-user-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 10px 16px;
    }

        .admin-users-header span:last-child {
            text-align: left !important;
        }

    .admin-users-search {
        padding: 10px 16px;
    }

    .admin-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .plans-grid {
        grid-template-columns: 1fr;
    }

    .auth-shell {
        width: 96vw;
    }

    .auth-brand {
        padding: 16px 18px 8px;
    }

    .brand-logo-img {
        width: 160px;
    }

    .auth-panels {
        padding: 16px;
    }

    .auth-panel {
        padding: 18px;
    }

    .recovery-card {
        padding: 24px;
    }

    .plans-modal,
    .billing-modal {
        padding: 22px;
    }

    .role-btn {
        min-height: 30px;
        padding: 5px 10px;
        font-size: 10px;
    }
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
    .panel-divider,
    .panel-divider::before,
    .secure-auth-frame,
    .toast,
    .modal-card,
    .provider-btn,
    .plan-card,
    .role-btn,
    .admin-users-back {
        animation: none !important;
        transition: none !important;
    }

        .panel-divider,
        .panel-divider::before {
            opacity: 1;
            transform: none;
        }
}

/* =========================================================
   FINAL OVERRIDE — AUTH TABS + ADMIN USER ROW FIX
   Keeps Sign In / Create Account / Admin in one row
   Removes horizontal scroll from Normal User / Admin buttons
========================================================= */

/* ---------- Auth mode tabs: always one line ---------- */
#login-modal .auth-mode-tabs,
.auth-mode-tabs {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 7px !important;
    border-radius: 999px !important;
    overflow: hidden !important;
}

#login-modal .auth-mode-tab,
.auth-mode-tab {
    min-width: 0 !important;
    min-height: 44px;
    padding: 0 8px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: clamp(12px, 1.6vw, 14px) !important;
}

/* Never stack auth tabs on mobile/tablet */
@media (max-width: 760px) {
    #login-modal .auth-mode-tabs,
    .auth-mode-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        border-radius: 999px !important;
    }
}

/* ---------- Admin user list: no horizontal scroll ---------- */
.admin-users-card,
.admin-users-list {
    overflow-x: hidden !important;
}

.admin-users-header,
.admin-user-row {
    width: 100%;
    display: grid !important;
    grid-template-columns: minmax(90px, 0.8fr) minmax(150px, 1.3fr) minmax(150px, 170px) !important;
    gap: 8px !important;
    align-items: center !important;
    padding: 10px 14px !important;
    overflow: hidden !important;
}

    .admin-users-header span,
    .admin-user-row span,
    .admin-user-name,
    .admin-user-email {
        min-width: 0 !important;
        max-width: 100% !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

.admin-actions {
    min-width: 0 !important;
    max-width: 100% !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 6px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
}

.role-btn {
    min-width: 0 !important;
    min-height: 30px !important;
    padding: 5px 9px !important;
    font-size: 10px !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    flex: 0 1 auto !important;
}

/* Keep buttons visible on smaller widths */
@media (max-width: 760px) {
    .admin-users-header,
    .admin-user-row {
        grid-template-columns: minmax(76px, 0.8fr) minmax(120px, 1.2fr) minmax(132px, 150px) !important;
        gap: 6px !important;
        padding: 9px 10px !important;
    }

    .admin-actions {
        justify-content: flex-end !important;
        gap: 4px !important;
    }

    .role-btn {
        padding: 5px 7px !important;
        font-size: 9.5px !important;
    }
}

.dira-library-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(10px);
}

.dira-library-modal-card {
    width: min(520px, calc(100vw - 32px));
    background: #ffffff;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 30px 90px rgba(15, 23, 42, 0.32);
    position: relative;
    color: #0f172a;
}

    .dira-library-modal-card.wide {
        width: min(760px, calc(100vw - 32px));
    }

.dira-library-modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    border: 0;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
}

.dira-library-modal-icon,
.dira-library-logo-fallback {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: #eff6ff;
    color: #2563eb;
    font-size: 28px;
    margin-bottom: 14px;
}

    .dira-library-modal-icon.warning {
        background: #fff7ed;
        color: #ea580c;
    }

.dira-library-confirm-layout {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 22px;
    align-items: start;
}

.dira-library-logo-box {
    width: 120px;
    height: 120px;
    border-radius: 22px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: grid;
    place-items: center;
    overflow: hidden;
}

    .dira-library-logo-box img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

.dira-library-kicker {
    font-size: 12px;
    font-weight: 900;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.dira-library-modal-card h2 {
    margin: 6px 0 10px;
    font-size: 24px;
    font-weight: 950;
}

.dira-library-modal-card p {
    margin: 10px 0;
    color: #334155;
    line-height: 1.55;
}

.dira-library-modal-card code {
    display: inline-flex;
    margin: 4px 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-weight: 800;
}

.dira-library-modal-note {
    margin-top: 14px;
    padding: 14px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 14px;
}

.dira-library-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.dira-library-modal-ok,
.dira-library-modal-secondary {
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 900;
    cursor: pointer;
}

.dira-library-modal-ok {
    background: #2563eb;
    color: #ffffff;
}

.dira-library-modal-secondary {
    background: #f1f5f9;
    color: #334155;
}


.dataset-library-choice,
.library-mini-tile {
    position: relative;
    border: 1px solid #dbe3f0;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

    .dataset-library-choice:hover,
    .library-mini-tile:hover {
        border-color: #4f6ef7;
        background: #f8fbff;
        transform: translateY(-1px);
    }

    .dataset-library-choice.selected,
    .dataset-library-choice.active,
    .dataset-library-choice.is-selected,
    .library-mini-tile.selected,
    .library-mini-tile.active,
    .library-mini-tile.is-selected {
        border-color: #2563eb !important;
        background: linear-gradient(180deg, #eff6ff, #ffffff) !important;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18), 0 14px 30px rgba(37, 99, 235, 0.14) !important;
    }

.library-choice-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #2563eb;
    color: #ffffff;
    font-size: 14px;
    font-weight: 950;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}

#login-modal .library-mini-tile,
#login-modal .dataset-library-choice,
#login-modal [data-library-dataset],
#login-modal [data-dataset-key] {
    position: relative !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

    #login-modal .library-mini-tile.selected,
    #login-modal .library-mini-tile.active,
    #login-modal .library-mini-tile.is-selected,
    #login-modal .dataset-library-choice.selected,
    #login-modal .dataset-library-choice.active,
    #login-modal .dataset-library-choice.is-selected,
    #login-modal [data-library-dataset].selected,
    #login-modal [data-library-dataset].active,
    #login-modal [data-library-dataset].is-selected {
        border: 2px solid #2563eb !important;
        background: linear-gradient(180deg, #dbeafe, #ffffff) !important;
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.22), 0 18px 36px rgba(37, 99, 235, 0.20) !important;
        transform: translateY(-2px);
    }

#login-modal .library-choice-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #2563eb;
    color: #ffffff;
    font-size: 15px;
    font-weight: 950;
    z-index: 5;
}

/* =========================================================
   FINAL — PROFESSIONAL DATASET LIBRARY PICKER MODAL
========================================================= */

#login-modal .library-picker-summary {
    width: 100%;
    margin: 14px 0;
}

#login-modal .library-picker-open-btn {
    width: 100%;
    min-height: 72px;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 18px;
    background: #ffffff;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-align: left;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

#login-modal .library-picker-open-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #eef4ff;
    display: grid;
    place-items: center;
    font-size: 22px;
}

#login-modal .library-picker-open-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

    #login-modal .library-picker-open-copy strong {
        color: #0f172a;
        font-size: 14px;
        font-weight: 950;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #login-modal .library-picker-open-copy small {
        color: #64748b;
        font-size: 12px;
        font-weight: 750;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

#login-modal .library-picker-open-arrow {
    color: #2563eb;
    font-size: 20px;
    font-weight: 950;
}

#login-modal .selected-library-preview {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

    #login-modal .selected-library-preview strong {
        display: block;
        color: #1d4ed8;
        font-size: 11px;
        font-weight: 950;
        text-transform: uppercase;
    }

    #login-modal .selected-library-preview span {
        display: block;
        margin-top: 3px;
        color: #0f172a;
        font-size: 13px;
        font-weight: 850;
    }

.library-picker-modal {
    position: fixed;
    inset: 0;
    z-index: 13000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.library-picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(12px);
}

.library-picker-dialog {
    position: relative;
    z-index: 1;
    width: min(980px, calc(100vw - 32px));
    height: min(760px, calc(100vh - 32px));
    background: #ffffff;
    border-radius: 28px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.38);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: hidden;
}

.library-picker-header {
    padding: 24px 28px 18px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.library-picker-kicker {
    color: #2563eb;
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.library-picker-header h2 {
    margin: 6px 0 6px;
    color: #0f172a;
    font-size: 28px;
    font-weight: 950;
}

.library-picker-header p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
}

.library-picker-close {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 24px;
    font-weight: 900;
    cursor: pointer;
}

.library-picker-search-row {
    padding: 16px 28px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

#library-picker-search {
    width: 100%;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    font-size: 14px;
    font-weight: 750;
    outline: none;
}

    #library-picker-search:focus {
        border-color: #4f6ef7;
        box-shadow: 0 0 0 4px rgba(79, 110, 247, 0.14);
    }

.library-picker-list {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 28px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    background: #ffffff;
}

.library-picker-item {
    position: relative;
    min-width: 0;
    min-height: 118px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    background: #ffffff;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

    .library-picker-item.hidden-by-search {
        display: none !important;
    }

.library-picker-thumb {
    width: 92px;
    height: 92px;
    border-radius: 18px;
    background: #f8fafc;
    overflow: hidden;
    display: grid;
    place-items: center;
    font-size: 34px;
}

    .library-picker-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        display: block;
    }

.library-picker-item-copy {
    min-width: 0;
    padding-right: 56px;
}

    .library-picker-item-copy strong {
        display: -webkit-box;
        color: #0f172a;
        font-size: 15px;
        line-height: 1.25;
        font-weight: 950;
        overflow: hidden;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .library-picker-item-copy span {
        display: -webkit-box;
        margin-top: 6px;
        color: #64748b;
        font-size: 12px;
        line-height: 1.4;
        font-weight: 700;
        overflow: hidden;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .library-picker-item-copy code {
        display: inline-flex;
        max-width: 100%;
        margin-top: 8px;
        padding: 4px 8px;
        border-radius: 999px;
        background: #eef2ff;
        color: #3730a3;
        font-size: 11px;
        font-weight: 850;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.library-picker-select-pill {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #2563eb;
    font-size: 11px;
    font-weight: 950;
}

.library-picker-item:hover {
    border-color: #4f6ef7;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
    transform: translateY(-2px);
}

    .library-picker-item:hover .library-picker-select-pill {
        background: #2563eb;
        color: #ffffff;
    }

.library-picker-footer {
    padding: 14px 28px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

    .library-picker-footer span {
        color: #64748b;
        font-size: 13px;
        font-weight: 800;
    }

.library-picker-cancel {
    border: 0;
    border-radius: 999px;
    background: #e2e8f0;
    color: #0f172a;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

@media (max-width: 760px) {
    .library-picker-dialog {
        height: calc(100vh - 20px);
        width: calc(100vw - 20px);
        border-radius: 22px;
    }

    .library-picker-list {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .library-picker-header,
    .library-picker-search-row,
    .library-picker-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}


/* =====================================================
   Clean Dataset Library Picker — Professional Button List
===================================================== */

.library-picker-modal--list .library-picker-dialog {
    width: min(560px, calc(100vw - 36px)) !important;
    max-height: min(680px, calc(100vh - 36px)) !important;
    border-radius: 20px !important;
    overflow: hidden !important;
}

.library-picker-modal--list .library-picker-header {
    padding: 22px 26px 18px !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.library-picker-modal--list .library-picker-kicker {
    font-size: 11px !important;
    font-weight: 900 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: #2563eb !important;
}

.library-picker-modal--list .library-picker-header h2 {
    margin: 8px 0 4px !important;
    font-size: 24px !important;
    font-weight: 900 !important;
    color: #0f172a !important;
}

.library-picker-modal--list .library-picker-header p {
    margin: 0 !important;
    font-size: 13px !important;
    color: #64748b !important;
}

.library-picker-modal--list .library-picker-search-row {
    padding: 14px 24px !important;
    border-bottom: 1px solid #e5e7eb !important;
    background: #f8fafc !important;
}

.library-picker-modal--list #library-picker-search {
    width: 100% !important;
    height: 42px !important;
    border-radius: 12px !important;
    border: 1px solid #cbd5e1 !important;
    padding: 0 14px !important;
    font-size: 14px !important;
}

.library-picker-modal--list #library-picker-list,
.library-picker-modal--list .library-name-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 16px 24px !important;
    max-height: 360px !important;
    overflow-y: auto !important;
    background: #ffffff !important;
}

.library-picker-modal--list .library-name-button {
    width: 100% !important;
    min-height: 48px !important;
    height: auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 11px 14px !important;
    border: 1px solid #dbe4f0 !important;
    border-radius: 13px !important;
    background: #ffffff !important;
    box-shadow: none !important;
    text-align: left !important;
    cursor: pointer !important;
    transition: 140ms ease !important;
}

    .library-picker-modal--list .library-name-button:hover {
        border-color: #2563eb !important;
        background: #f8fbff !important;
    }

    .library-picker-modal--list .library-name-button.selected,
    .library-picker-modal--list .library-name-button.active,
    .library-picker-modal--list .library-name-button.is-selected {
        border-color: #2563eb !important;
        background: #eff6ff !important;
    }

.library-picker-modal--list .library-name-main {
    min-width: 0 !important;
    font-size: 15px !important;
    font-weight: 850 !important;
    color: #0f172a !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.library-picker-modal--list .library-name-key {
    padding: 4px 9px !important;
    border-radius: 999px !important;
    background: #eef2ff !important;
    color: #334155 !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
}

.library-picker-modal--list .library-name-check {
    width: 22px !important;
    height: 22px !important;
    border-radius: 999px !important;
    display: grid !important;
    place-items: center !important;
    background: #2563eb !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 900 !important;
}

.library-picker-modal--list .library-name-button:not(.selected):not(.active):not(.is-selected) .library-name-check {
    background: #e5e7eb !important;
    color: transparent !important;
}

.library-picker-modal--list .library-picker-footer {
    padding: 14px 24px !important;
    border-top: 1px solid #e5e7eb !important;
    background: #f8fafc !important;
}

.hidden-by-search {
    display: none !important;
}

.library-picker-modal--list .library-name-button.hidden-by-search,
.library-picker-modal--list .library-picker-item.hidden-by-search,
#library-picker-list .hidden-by-search {
    display: none !important;
}
