/* =========================================================
   LIQUID QUARTZ — Design System
   Inspiré du Liquid Glass d'Apple / visionOS
   Palette neutre, surfaces givrées, zéro couleur vive
   Typographie : Figtree + DM Mono
   ========================================================= */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==================== TOKENS ==================== */
:root {
    /* Surfaces */
    --bg: #0a0a0c;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-input: rgba(255, 255, 255, 0.048);
    --bg-hover: rgba(255, 255, 255, 0.065);
    --bg-secondary: rgba(255, 255, 255, 0.015);

    /* Texte */
    --text: rgba(255, 255, 255, 0.88);
    --text-muted: rgba(255, 255, 255, 0.34);
    --text-subtle: rgba(255, 255, 255, 0.08);

    /* Bordures */
    --border: rgba(255, 255, 255, 0.072);
    --border-hover: rgba(255, 255, 255, 0.14);

    /* Accent — blanc neutre, zéro couleur vive */
    --accent: rgba(255, 255, 255, 0.86);
    --accent-hover: rgba(255, 255, 255, 1);
    --accent-dim: rgba(255, 255, 255, 0.07);
    --accent-border: rgba(255, 255, 255, 0.18);

    /* Typo */
    --font-sans: "Figtree", system-ui, sans-serif;
    --font-mono: "DM Mono", "Menlo", monospace;

    /* Layout — topnav horizontal */
    --topnav-height: 54px;
    --sidebar-width: 228px;
    --sidebar-collapsed-width: 0px;

    /* Radii */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --radius-pill: 999px;

    /* Transitions */
    --transition: 0.14s ease;
    --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Glass liquid */
    --glass-blur: blur(44px) saturate(170%);
    --glass-border: rgba(255, 255, 255, 0.072);
    --glass-shine: inset 0 1px 0 rgba(255, 255, 255, 0.08);

    /* Ombres neutres */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.55), var(--glass-shine);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.65), var(--glass-shine);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.75), var(--glass-shine);
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.45), var(--glass-shine);
}

[data-theme="light"] {
    --bg: #f2f2f7;
    --bg-card: rgba(255, 255, 255, 0.62);
    --bg-input: rgba(255, 255, 255, 0.8);
    --bg-hover: rgba(255, 255, 255, 0.92);
    --bg-secondary: rgba(255, 255, 255, 0.4);

    --text: rgba(0, 0, 0, 0.86);
    --text-muted: rgba(0, 0, 0, 0.36);
    --text-subtle: rgba(0, 0, 0, 0.09);

    --border: rgba(0, 0, 0, 0.07);
    --border-hover: rgba(0, 0, 0, 0.13);

    --accent: rgba(0, 0, 0, 0.84);
    --accent-hover: rgba(0, 0, 0, 1);
    --accent-dim: rgba(0, 0, 0, 0.05);
    --accent-border: rgba(0, 0, 0, 0.14);

    --glass-blur: blur(44px) saturate(190%);
    --glass-border: rgba(255, 255, 255, 0.58);
    --glass-shine: inset 0 1px 0 rgba(255, 255, 255, 0.72);

    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06), var(--glass-shine);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08), var(--glass-shine);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.1), var(--glass-shine);
    --shadow-card: 0 1px 8px rgba(0, 0, 0, 0.05), var(--glass-shine);
}

/* ==================== BASE ==================== */
html {
    font-size: 16px;
}

/* Options dropdown — fond solide pour éviter le blanc natif */
select option {
    background: #131315;
    color: rgba(255, 255, 255, 0.88);
}

[data-theme="light"] select option {
    background: #ffffff;
    color: rgba(0, 0, 0, 0.86);
}

/* Grain texture overlay */
html::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.022;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 128px 128px;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition:
        background var(--transition-slow),
        color var(--transition-slow);
    position: relative;
    overflow-x: hidden;
}

/* Orbes d'ambiance lumineux */
body::before,
body::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

body::before {
    width: 900px;
    height: 900px;
    top: -200px;
    left: -100px;
    background: radial-gradient(
        circle,
        rgba(180, 170, 210, 0.07) 0%,
        rgba(140, 130, 190, 0.04) 40%,
        transparent 68%
    );
    filter: blur(80px);
    animation: orb-drift-a 28s ease-in-out infinite;
}

body::after {
    width: 750px;
    height: 750px;
    top: 0;
    right: -150px;
    background: radial-gradient(
        circle,
        rgba(160, 170, 200, 0.06) 0%,
        rgba(140, 150, 190, 0.03) 45%,
        transparent 68%
    );
    filter: blur(70px);
    animation: orb-drift-b 34s ease-in-out infinite;
}

[data-theme="light"] body::before {
    background: radial-gradient(
        circle,
        rgba(180, 180, 200, 0.18) 0%,
        rgba(160, 160, 200, 0.08) 40%,
        transparent 70%
    );
}
[data-theme="light"] body::after {
    background: radial-gradient(
        circle,
        rgba(200, 200, 220, 0.14) 0%,
        rgba(180, 180, 210, 0.07) 45%,
        transparent 70%
    );
}

@keyframes orb-drift-a {
    0% {
        transform: translate(0, 0) scale(1);
    }
    20% {
        transform: translate(35vw, 25vh) scale(1.1);
    }
    40% {
        transform: translate(55vw, 60vh) scale(0.9);
    }
    60% {
        transform: translate(20vw, 80vh) scale(1.15);
    }
    80% {
        transform: translate(-5vw, 40vh) scale(1.05);
    }
    100% {
        transform: translate(0, 0) scale(1);
    }
}
@keyframes orb-drift-b {
    0% {
        transform: translate(0, 0) scale(1.1);
    }
    25% {
        transform: translate(-40vw, 30vh) scale(0.95);
    }
    50% {
        transform: translate(-60vw, 70vh) scale(1.2);
    }
    75% {
        transform: translate(-20vw, 55vh) scale(0.9);
    }
    100% {
        transform: translate(0, 0) scale(1.1);
    }
}

[data-theme="light"] body {
    background: #f2f2f7;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ==================== TOPNAV ==================== */
.sidebar {
    width: 100%;
    height: var(--topnav-height);
    background: rgba(255, 255, 255, 0.038);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    z-index: 100;
    padding: 0 20px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04),
        0 8px 40px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .sidebar {
    background: rgba(255, 255, 255, 0.58);
    border-bottom-color: rgba(0, 0, 0, 0.06);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9),
        0 4px 24px rgba(0, 0, 0, 0.07);
}

.sidebar::before {
    display: none;
}

/* ---- Brand ---- */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 18px 0 0;
    height: 100%;
    border-right: 1px solid var(--glass-border);
    margin-right: 14px;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    white-space: nowrap;
    flex-shrink: 0;
    border-bottom: none;
    justify-content: flex-start;
}

.sidebar-header span,
.sidebar-nav li span,
.user-details,
.user-settings-icon,
.btn-logout span {
    max-width: none;
    opacity: 1;
    overflow: visible;
    white-space: nowrap;
}

.sidebar-header i {
    color: var(--text);
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ---- Nav links ---- */
.sidebar-nav {
    list-style: none;
    padding: 0;
    flex: 1;
    overflow: visible;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    height: 100%;
}

.sidebar-nav li {
    padding: 5px 11px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition:
        color var(--transition),
        background var(--transition);
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    border: 1px solid transparent;
    margin-bottom: 0;
    height: 32px;
    justify-content: flex-start;
}

.sidebar-nav li:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.sidebar-nav li.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    font-weight: 600;
    border-color: rgba(255, 255, 255, 0.11);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.18);
}

[data-theme="light"] .sidebar-nav li.active {
    background: rgba(0, 0, 0, 0.07);
    color: rgba(0, 0, 0, 0.86);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 1px 4px rgba(0, 0, 0, 0.06);
}

.sidebar-nav li i {
    font-size: 0.76rem;
    flex-shrink: 0;
    width: auto;
    text-align: center;
}

/* ---- Footer / actions à droite ---- */
.sidebar-footer {
    margin-top: 0;
    margin-left: auto;
    padding: 0 0 0 14px;
    border-top: none;
    border-left: 1px solid var(--glass-border);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    height: 100%;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    padding: 5px 9px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background var(--transition);
    justify-content: flex-start;
}

.user-info:hover {
    background: var(--bg-hover);
}

.user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.64rem;
    color: var(--text-muted);
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-bottom-actions {
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 2px;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 5px 9px;
    border-radius: var(--radius-pill);
    transition:
        color var(--transition),
        background var(--transition);
    white-space: nowrap;
    width: auto;
    justify-content: center;
}

.btn-logout:hover {
    color: rgba(255, 100, 100, 0.9);
    background: rgba(239, 68, 68, 0.08);
}

/* THEME TOGGLE */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px 8px;
    border-radius: var(--radius-pill);
    font-size: 0.76rem;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    color: var(--text);
    border-color: var(--border-hover);
    background: var(--bg-hover);
}

/* ==================== CONTENT ==================== */
.content {
    margin-left: 0;
    flex: 1;
    padding: calc(var(--topnav-height) + 36px) 44px 44px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeSlide 0.2s ease;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== HEADINGS ==================== */
h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 28px;
    line-height: 1.2;
}

/* ==================== SECTION HEADER ==================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.section-header h1,
.section-header h2 {
    margin-bottom: 0;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 3px;
}

/* ==================== DASHBOARD ACTIONS ==================== */
.dashboard-actions {
    display: flex;
    gap: 6px;
}

.dashboard-actions .btn {
    font-size: 0.78rem;
    padding: 6px 11px;
}

/* ==================== STATS GRID ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 28px;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-card);
}

.stat-card {
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    transition: background var(--transition);
    border-right: 1px solid var(--border);
}

.stat-card:last-child {
    border-right: none;
}

.stat-card:hover {
    background: var(--bg-hover);
}

/* Hide the icon — replaced by a subtle index number */
.stat-icon {
    display: none;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    display: block;
    letter-spacing: -0.05em;
    font-family: var(--font-mono);
    color: var(--text);
    line-height: 1;
}

.stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

/* ==================== CHARTS ==================== */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.chart-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-card);
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.chart-header h3 {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.chart-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.chart-type-select {
    background: #131315;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: border-color var(--transition);
}

.chart-type-select:hover {
    border-color: var(--border-hover);
}

[data-theme="light"] .chart-type-select {
    background: #ffffff;
    color: #0d1628;
}

/* ==================== BUTTONS ==================== */
.btn {
    padding: 8px 15px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all var(--transition);
    background: transparent;
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: rgba(255, 255, 255, 0.14);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 2px 12px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.26);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 4px 16px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .btn-primary {
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    border-color: rgba(0, 0, 0, 0.8);
    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
[data-theme="light"] .btn-primary:hover {
    background: rgba(0, 0, 0, 0.92);
    border-color: rgba(0, 0, 0, 0.92);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
}

.btn-danger {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.35);
    background: transparent;
}

.btn-danger:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px 7px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    transition:
        color var(--transition),
        background var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.btn-small,
.btn-sm {
    padding: 5px 10px;
    font-size: 0.76rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 11px;
    font-size: 0.88rem;
}

/* ==================== FILTERS ==================== */
.api-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.input-search {
    flex: 1;
    min-width: 180px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    color: var(--text);
    padding: 9px 13px;
    border-radius: var(--radius-sm);
    font-size: 0.83rem;
    font-family: var(--font-sans);
    transition:
        border-color var(--transition),
        box-shadow var(--transition);
}

.input-search:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .input-search {
    background: rgba(255, 255, 255, 0.72);
}
[data-theme="light"] .input-search:focus {
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.input-search::placeholder {
    color: var(--text-muted);
}

.filter-select {
    background: #131315;
    color: var(--text);
    border: 1px solid var(--glass-border);
    padding: 9px 13px;
    border-radius: var(--radius-sm);
    font-size: 0.83rem;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: border-color var(--transition);
}

.filter-select:hover {
    border-color: var(--border-hover);
}
.filter-select:focus {
    outline: none;
    border-color: var(--border-hover);
}

[data-theme="light"] .filter-select {
    background: #ffffff;
    color: #0d1628;
}

/* ==================== API GRID ==================== */
.api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 10px;
}

.api-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 18px 20px;
    transition:
        border-color var(--transition),
        background var(--transition),
        box-shadow var(--transition-slow);
    position: relative;
    box-shadow: var(--shadow-card);
}

.api-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.5),
        var(--glass-shine);
}

[data-theme="light"] .api-card:hover {
    border-color: rgba(0, 0, 0, 0.14);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.08),
        var(--glass-shine);
}

.api-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 8px;
}

.api-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.api-card-provider {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 400;
}

.api-card-actions {
    display: flex;
    gap: 1px;
    flex-shrink: 0;
}

/* BADGES */
.api-card-badges {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.api-badge {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: transparent;
    font-family: var(--font-mono);
}

.badge-active {
    border-color: rgba(22, 163, 74, 0.35);
    color: #16a34a;
    background: rgba(22, 163, 74, 0.06);
}

[data-theme="light"] .badge-active {
    border-color: rgba(22, 163, 74, 0.4);
    color: #15803d;
    background: rgba(22, 163, 74, 0.08);
}

.badge-inactive {
    opacity: 0.5;
}

.badge-expired {
    border-color: rgba(220, 38, 38, 0.3);
    color: #dc2626;
    background: rgba(220, 38, 38, 0.05);
    text-decoration: line-through;
    opacity: 0.7;
}

.badge-syncable {
    border-color: var(--border);
    color: var(--text-muted);
    font-size: 0.6rem;
    opacity: 0.6;
}

.badge-tag {
    background: var(--bg-input);
    color: var(--text-muted);
    border-color: var(--border);
}

.badge-team {
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid var(--accent-border);
    cursor: pointer;
    transition: background var(--transition);
}

.badge-team:hover {
    background: var(--bg-hover);
}

.badge-personal {
    background: var(--bg-input);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* CARD DETAILS */
.api-card-details {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 12px;
}

.api-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.api-detail-label {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.api-detail-value {
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: 0.77rem;
    color: var(--text);
}

/* REVEAL KEY */
.api-key-masked {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-reveal-inline {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 2px;
    font-size: 0.72rem;
    transition: color var(--transition);
    line-height: 1;
}

.btn-reveal-inline:hover {
    color: var(--text);
}

.reveal-key-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-top: 8px;
    word-break: break-all;
    box-shadow: none;
}

.reveal-key-box code {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text);
}

/* TOKEN BAR */
.token-bar-container {
    margin-top: 12px;
}

.token-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.73rem;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.token-bar {
    width: 100%;
    height: 2px;
    background: var(--bg-hover);
    border-radius: 1px;
    overflow: hidden;
}

.token-bar-fill {
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(255, 255, 255, 0.85) 100%
    );
    border-radius: 1px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.25);
}

/* SYNC BUTTON */
.btn-sync {
    transition:
        color var(--transition),
        transform var(--transition);
}
.btn-sync:hover {
    transform: rotate(30deg);
}
.btn-sync:disabled {
    cursor: not-allowed;
    opacity: 0.3;
}

/* SYNC RESULT */
.sync-result {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.76rem;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    margin-top: 10px;
    line-height: 1.4;
    border: 1px solid var(--border);
    background: var(--bg-input);
}

.sync-result i {
    flex-shrink: 0;
    margin-top: 1px;
}

/* NOTES */
.api-card-notes {
    padding: 7px 10px;
    margin-top: 8px;
    font-size: 0.77rem;
    color: var(--text-muted);
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    line-height: 1.45;
    border-left: 2px solid var(--border-hover);
}

.api-card-notes i {
    margin-right: 5px;
    opacity: 0.5;
}

/* RENEWAL ALERT (on card) */
.renewal-alert {
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.74rem;
    font-weight: 600;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
}

.renewal-expired {
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
}
.renewal-critical {
    background: rgba(234, 88, 12, 0.08);
    color: #ea580c;
}
.renewal-warning {
    background: rgba(161, 98, 7, 0.08);
    color: #a16207;
}
.renewal-info {
    background: var(--bg-input);
    color: var(--text-muted);
}

/* ==================== HEALTH DOT ==================== */
.health-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    vertical-align: middle;
}

.health-up {
    background: #16a34a;
}
.health-down {
    background: #dc2626;
}
.health-unknown {
    background: var(--text-subtle);
}

/* ==================== TOKEN LIST ==================== */
.token-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.token-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-card);
    transition:
        border-color var(--transition),
        box-shadow var(--transition-slow);
}

.token-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.4),
        var(--glass-shine);
}

[data-theme="light"] .token-card:hover {
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.08),
        var(--glass-shine);
}

.token-card-name {
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: 2px;
    letter-spacing: -0.02em;
}

.token-card-provider {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* ==================== COST SECTION ==================== */
.total-cost-banner {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 36px;
    margin-bottom: 24px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.cost-amount {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.06em;
    font-family: var(--font-mono);
    color: var(--text);
    line-height: 1;
}

.cost-amount small {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
    font-family: var(--font-sans);
    letter-spacing: 0;
}

.cost-annual {
    margin-top: 10px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.cost-table-container {
    overflow-x: auto;
    margin-top: 20px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-card);
}

.cost-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

.cost-table thead {
    background: var(--bg-input);
}

.cost-table th,
.cost-table td {
    padding: 11px 16px;
    text-align: left;
    font-size: 0.82rem;
}

.cost-table th {
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    font-family: var(--font-mono);
}

.cost-table tbody tr {
    border-top: 1px solid var(--border);
}

.cost-table tbody tr:hover {
    background: var(--bg-hover);
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 14px;
    opacity: 0.2;
    display: block;
}

.empty-state p {
    font-size: 0.875rem;
    line-height: 1.5;
}

/* ==================== MODAL ==================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 4, 20, 0.78);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

[data-theme="light"] .modal-overlay {
    background: rgba(0, 0, 0, 0.35);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: rgba(12, 12, 14, 0.78);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.8),
        var(--glass-shine);
}

[data-theme="light"] .modal {
    background: rgba(255, 255, 255, 0.72);
    box-shadow:
        0 16px 60px rgba(0, 0, 0, 0.1),
        var(--glass-shine);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.modal-header h2 {
    font-size: 0.98rem;
    letter-spacing: -0.02em;
    font-weight: 700;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-small {
    max-width: 400px;
}
.modal-profile {
    max-width: 560px;
}

.modal-small .form-group {
    padding: 0 20px;
    margin-bottom: 16px;
}
.modal-small .form-actions {
    padding: 12px 20px 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: 13px;
}

.form-group label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: #131315;
    border: 1px solid var(--glass-border);
    color: var(--text);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.845rem;
    font-family: var(--font-sans);
    transition:
        border-color var(--transition),
        box-shadow var(--transition);
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group select,
[data-theme="light"] .form-group textarea {
    background: rgba(255, 255, 255, 0.85);
    color: rgba(0, 0, 0, 0.86);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .form-group input:focus,
[data-theme="light"] .form-group select:focus,
[data-theme="light"] .form-group textarea:focus {
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.form-group input::placeholder {
    color: var(--text-muted);
}
.form-group textarea {
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.field-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==================== TOASTS ==================== */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: rgba(12, 12, 14, 0.85);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 11px 15px;
    font-size: 0.81rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 320px;
    opacity: 0;
    transform: translateX(8px);
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
    pointer-events: auto;
    line-height: 1.45;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        var(--glass-shine);
}

[data-theme="light"] .toast {
    background: rgba(255, 255, 255, 0.8);
}

.toast-visible {
    opacity: 1;
    transform: translateX(0);
}

.toast-success i {
    color: #16a34a;
}
.toast-error i {
    color: #dc2626;
}
.toast-info i {
    color: var(--text-muted);
}

/* ==================== ALERTS SECTION (dashboard) ==================== */
.alerts-section {
    margin-top: 24px;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-card);
}

.alerts-header {
    margin-bottom: 14px;
}

.alerts-header h3 {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 7px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.alerts-header h3 i {
    color: var(--text-muted);
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-card);
    transition:
        background var(--transition),
        border-color var(--transition),
        box-shadow var(--transition-slow);
}

.alert-item:hover {
    background: var(--bg-hover);
    border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="light"] .alert-item:hover {
    border-color: rgba(0, 0, 0, 0.12);
}

.alert-expired {
    border-left: 2px solid #dc2626;
}
.alert-critical {
    border-left: 2px solid #ea580c;
}
.alert-warning {
    border-left: 2px solid var(--text-muted);
}
.alert-info {
    border-left: 2px solid var(--border-hover);
}

.alert-icon {
    font-size: 0.88rem;
}

.alert-expired .alert-icon {
    color: #dc2626;
}
.alert-critical .alert-icon {
    color: #ea580c;
}
.alert-warning .alert-icon {
    color: var(--text-muted);
}
.alert-info .alert-icon {
    color: var(--text-muted);
}

.alert-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.alert-api-name {
    font-weight: 600;
    font-size: 0.845rem;
    color: var(--text);
}

.alert-provider {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.alert-label {
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 3px 9px;
    border-radius: 3px;
    white-space: nowrap;
}

.alert-label-expired {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}
.alert-label-critical {
    background: rgba(234, 88, 12, 0.1);
    color: #ea580c;
}
.alert-label-warning {
    background: var(--bg-hover);
    color: var(--text-muted);
}
.alert-label-info {
    background: var(--bg-hover);
    color: var(--text-muted);
}

/* ==================== AUTH PAGES ==================== */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
    overflow: hidden;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    padding: 36px;
    animation: modalIn 0.28s ease;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.65),
        var(--glass-shine);
}

[data-theme="light"] .auth-card {
    background: rgba(255, 255, 255, 0.68);
    border-top-color: rgba(255, 255, 255, 0.9);
    box-shadow:
        0 16px 60px rgba(0, 0, 0, 0.08),
        var(--glass-shine);
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-header i {
    font-size: 1.6rem;
    color: var(--text);
    margin-bottom: 14px;
    display: block;
}

.auth-header h1 {
    font-size: 1.2rem;
    margin-bottom: 6px;
    letter-spacing: -0.03em;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.845rem;
}

.auth-theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
}

.auth-error {
    color: #dc2626;
    font-size: 0.8rem;
    min-height: 18px;
    margin-bottom: 6px;
    text-align: center;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.83rem;
}

.auth-footer a {
    color: var(--text);
    font-weight: 600;
    transition: opacity var(--transition);
}

.auth-footer a:hover {
    opacity: 0.7;
}

/* INPUT WITH ICON */
.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.input-icon input,
.input-icon select {
    padding-left: 36px;
}

/* AUTH BANNERS */
.auth-banner {
    padding: 10px 13px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid;
}

.auth-banner-error {
    background: rgba(220, 38, 38, 0.06);
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.18);
}

.auth-banner-success {
    background: rgba(22, 163, 74, 0.06);
    color: #16a34a;
    border-color: rgba(22, 163, 74, 0.18);
}

/* REMEMBER DEVICE */
.auth-remember {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.remember-label {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    user-select: none;
    width: fit-content;
}

.remember-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.remember-checkmark {
    width: 16px;
    height: 16px;
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition:
        background var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
}

.remember-label input:checked + .remember-checkmark {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.18);
}

.remember-label input:checked + .remember-checkmark::after {
    content: "";
    display: block;
    width: 4px;
    height: 7px;
    border: 2px solid #0a0a0c;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

[data-theme="light"] .remember-label input:checked + .remember-checkmark {
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.12);
}
[data-theme="light"]
    .remember-label
    input:checked
    + .remember-checkmark::after {
    border-color: #fff;
}

.remember-text {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
}

.remember-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    padding-left: 25px;
    line-height: 1.4;
}

/* EMAIL VERIFY BANNER */
.email-verify-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    margin-bottom: 20px;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-left: 3px solid var(--text-muted);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.83rem;
    box-shadow: var(--shadow-card);
}

.email-verify-banner i {
    flex-shrink: 0;
}
.email-verify-banner span {
    flex: 1;
}

/* 2FA */
.twofa-header {
    text-align: center;
    margin-bottom: 24px;
}

.twofa-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-input);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin: 0 auto 12px;
    border: 1px solid var(--border);
}

.twofa-header h3 {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.twofa-header p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.twofa-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.twofa-digit {
    width: 46px;
    height: 54px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-mono);
    transition: border-color var(--transition);
    caret-color: transparent;
}

.twofa-digit:focus {
    outline: none;
    border-color: var(--border-hover);
}

/* OAUTH */
.oauth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.oauth-divider::before,
.oauth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.oauth-divider span {
    padding: 0 12px;
}

.oauth-buttons {
    display: flex;
    gap: 9px;
    margin-bottom: 6px;
}

.btn-oauth {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.83rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all var(--transition);
    cursor: pointer;
    font-family: var(--font-sans);
    background: var(--bg-input);
    color: var(--text);
}

.btn-oauth:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-subtle);
}

/* ==================== MOBILE TOP BAR ==================== */
.mobile-topbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.038);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .mobile-topbar {
    background: rgba(255, 255, 255, 0.72);
    border-bottom-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
}

.mobile-topbar-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 7px;
    letter-spacing: -0.02em;
}

.mobile-topbar-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .content {
        padding: calc(var(--topnav-height) + 24px) 24px 24px;
    }

    .charts-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card:nth-child(2) {
        border-right: none;
    }
    .stat-card:nth-child(3) {
        border-top: 1px solid var(--border);
    }
    .stat-card:nth-child(4) {
        border-top: 1px solid var(--border);
    }

    .api-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .modal {
        max-width: 480px;
        padding: 24px;
    }
}

@media (max-width: 860px) {
    /* Masquer texte nav, garder icônes */
    .sidebar-nav li span {
        display: none;
    }
    .sidebar-nav li {
        padding: 5px 9px;
        gap: 0;
    }
    .user-details,
    .user-role,
    .user-name,
    .user-settings-icon {
        display: none;
    }
    .btn-logout span {
        display: none;
    }
    .sidebar-header span {
        display: none;
    }
    .sidebar-header {
        padding-right: 12px;
        margin-right: 8px;
    }
}

@media (max-width: 768px) {
    .content {
        padding: calc(var(--topnav-height) + 20px) 16px 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0;
    }

    .stat-card {
        padding: 18px 20px;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    .api-grid,
    .team-grid {
        grid-template-columns: 1fr;
    }

    .token-list {
        grid-template-columns: 1fr;
    }

    .marketplace-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .marketplace-filters {
        flex-direction: column;
    }

    .marketplace-search {
        min-width: unset;
    }

    #marketplace-category {
        width: 100%;
        min-width: unset;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .api-filters {
        flex-direction: column;
    }

    .input-search {
        min-width: unset;
        width: 100%;
    }

    .filter-select {
        width: 100%;
    }

    .cost-amount {
        font-size: 2.2rem;
    }

    .modal {
        max-width: calc(100vw - 80px);
        max-height: 85vh;
    }

    h1 {
        font-size: 1.2rem;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .notification-panel {
        width: 100%;
        right: -100%;
    }
}

@media (max-width: 480px) {
    /* Nav bar en bas sur mobile */
    .sidebar {
        top: auto;
        bottom: 0;
        height: 60px;
        padding: 0;
        border-bottom: none;
        border-top: 1px solid var(--glass-border);
        box-shadow:
            0 -4px 24px rgba(0, 0, 0, 0.3),
            var(--glass-shine);
    }

    .sidebar-header {
        display: none;
    }

    .sidebar-footer {
        display: none;
    }

    .sidebar-nav {
        flex: 1;
        padding: 0;
        justify-content: space-around;
        align-items: stretch;
        height: 100%;
        gap: 0;
    }

    .sidebar-nav li {
        flex: 1;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3px;
        padding: 4px 2px;
        border-radius: 0;
        height: 100%;
        font-size: 0.56rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        border: none;
        box-shadow: none;
    }

    .sidebar-nav li span {
        display: block;
        text-align: center;
        font-size: 0.56rem;
    }

    .sidebar-nav li i {
        font-size: 1.05rem;
    }

    .sidebar-nav li.active {
        background: transparent;
        border: none;
        box-shadow: none;
        color: var(--text);
    }

    .sidebar-nav li.active i {
        opacity: 1;
    }

    /* Masquer Marketplace sur mobile */
    .sidebar-nav li[data-section="marketplace"] {
        display: none;
    }

    .mobile-topbar {
        display: flex;
    }

    .content {
        margin-top: 0;
        padding: 72px 14px 76px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    h1 {
        font-size: 1.1rem;
        margin-bottom: 16px;
    }

    .chart-card {
        padding: 14px;
    }

    .total-cost-banner {
        padding: 24px 16px;
    }

    .cost-amount {
        font-size: 1.9rem;
    }

    .cost-table-container {
        max-width: calc(100vw - 28px);
    }

    .cost-table {
        min-width: 480px;
    }

    .marketplace-grid {
        grid-template-columns: 1fr;
    }

    .modal-overlay {
        align-items: flex-end;
    }

    .modal {
        max-width: 100%;
        max-height: 92vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        padding: 22px 16px 28px;
        margin: 0;
    }

    .btn {
        padding: 10px 14px;
        font-size: 0.83rem;
    }

    .section-header .btn {
        width: 100%;
        justify-content: center;
    }

    .btn-icon {
        padding: 9px;
        font-size: 0.95rem;
    }

    .form-group input,
    .form-group select {
        padding: 12px 13px;
        font-size: 0.88rem;
    }

    #toast-container {
        right: 12px;
        left: 12px;
    }

    .toast {
        max-width: 100%;
    }

    .auth-container {
        padding: 14px;
    }

    .auth-card {
        padding: 24px 18px;
    }

    .auth-header h1 {
        font-size: 1.1rem;
    }

    .auth-theme-toggle {
        top: 12px;
        right: 12px;
    }
}

/* ==================== TEAMS ==================== */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 10px;
}

.team-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition:
        border-color var(--transition),
        background var(--transition),
        box-shadow var(--transition-slow);
}

.team-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background: var(--bg-hover);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.4),
        var(--glass-shine);
}

[data-theme="light"] .team-card:hover {
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.08),
        var(--glass-shine);
}

.team-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.team-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.team-card-actions {
    display: flex;
    gap: 2px;
}

.team-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.5;
}

.team-card-stats {
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.team-card-stats i {
    margin-right: 4px;
}

/* Team Detail */
.team-detail-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.team-detail-desc {
    font-size: 0.845rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.5;
}

.team-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}

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

.team-member-info {
    display: flex;
    align-items: center;
    gap: 9px;
}

.team-member-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.team-member-avatar-icon {
    font-size: 1.5rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.team-member-name {
    font-weight: 600;
    font-size: 0.845rem;
    display: block;
}

.team-member-role-text {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.team-member-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.team-member-pending {
    opacity: 0.55;
}

.pending-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Team invite */
.team-invite-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.team-invite-row input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.83rem;
    font-family: var(--font-sans);
    transition: border-color var(--transition);
}

.team-invite-row input:focus {
    outline: none;
    border-color: var(--border-hover);
}

/* User search */
.user-search-results {
    margin-top: 4px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: none;
    background: rgba(12, 12, 14, 0.9);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        var(--glass-shine);
}

.user-search-results:not(:empty) {
    display: block;
}

.user-search-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    cursor: pointer;
    font-size: 0.83rem;
    transition: background var(--transition);
}

.user-search-item:hover {
    background: var(--bg-hover);
}

.user-search-role {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.user-search-empty {
    padding: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

.api-card-owner {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Role select */
.role-select {
    background: #131315;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    outline: none;
    font-family: var(--font-sans);
    transition: border-color var(--transition);
}

.role-select:focus {
    border-color: var(--border-hover);
}

/* Badges */
.badge-pending {
    background: var(--bg-input);
    color: var(--text-muted);
    border: 1px dashed var(--border);
}

/* Team links */
.team-links-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.team-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--bg-input);
    transition:
        border-color var(--transition),
        background var(--transition);
}

.team-link-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.team-link-discord {
    border-color: rgba(88, 101, 242, 0.4);
    color: #8b96f8;
}
.team-link-discord:hover {
    background: rgba(88, 101, 242, 0.08);
}

.team-link-meet {
    border-color: rgba(0, 137, 123, 0.4);
    color: #26a69a;
}
.team-link-meet:hover {
    background: rgba(0, 137, 123, 0.08);
}

/* Meetings */
.meeting-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.meeting-form input,
.meeting-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text);
    font-size: 0.845rem;
    font-family: var(--font-sans);
    box-sizing: border-box;
    transition: border-color var(--transition);
}

.meeting-form input:focus,
.meeting-form textarea:focus {
    outline: none;
    border-color: var(--border-hover);
}

.meeting-form textarea {
    resize: vertical;
}

.meeting-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    box-shadow: var(--shadow-card);
    transition:
        border-color var(--transition),
        background var(--transition),
        box-shadow var(--transition-slow);
}

.meeting-item:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background: var(--bg-hover);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.4),
        var(--glass-shine);
}

[data-theme="light"] .meeting-item:hover {
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.07),
        var(--glass-shine);
}

.meeting-item.meeting-past {
    opacity: 0.45;
}

.meeting-info {
    flex: 1;
    min-width: 0;
}

.meeting-title {
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: 2px;
}

.meeting-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.meeting-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-bottom: 2px;
}

.meeting-by {
    font-size: 0.72rem;
    color: var(--text-subtle);
}

.meeting-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.empty-state-small {
    color: var(--text-muted);
    font-size: 0.83rem;
    padding: 6px 0;
}

/* ==================== PROFILE ==================== */
.user-info-clickable {
    cursor: pointer;
    padding: 6px 8px;
    margin: -6px -8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.user-info-clickable:hover {
    background: var(--bg-hover);
}

.user-settings-icon {
    margin-left: auto;
    font-size: 0.68rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity var(--transition);
}

.user-info-clickable:hover .user-settings-icon {
    opacity: 1;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.profile-modal-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-avatar-section {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.profile-avatar-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid var(--border);
}

.profile-avatar-preview i {
    font-size: 2.2rem;
    color: var(--text-muted);
}

.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-fields {
    flex: 1;
    min-width: 0;
}

.profile-link-row {
    display: flex;
    gap: 8px;
    margin-bottom: 7px;
    align-items: center;
}

.profile-link-row input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 11px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-family: var(--font-sans);
    transition: border-color var(--transition);
}

.profile-link-row input:focus {
    outline: none;
    border-color: var(--border-hover);
}

.profile-link-label {
    max-width: 130px;
}

.profile-readonly {
    border-top: 1px solid var(--border);
    margin-top: 10px;
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-readonly-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.profile-readonly-label {
    color: var(--text-muted);
}

.profile-readonly-value {
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: 0.77rem;
}

/* BIO char count */
.bio-count {
    font-size: 0.68rem;
    color: var(--text-muted);
    float: right;
}

/* ==================== NOTIFICATIONS ==================== */
.notif-bell {
    position: relative;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #dc2626;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 15px;
    height: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--bg-card);
    font-family: var(--font-mono);
}

.notification-panel {
    position: fixed;
    top: 0;
    right: -380px;
    width: 360px;
    height: 100vh;
    background: rgba(12, 12, 14, 0.86);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-left: 1px solid var(--glass-border);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transition: right var(--transition-slow);
    box-shadow: -12px 0 60px rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .notification-panel {
    background: rgba(255, 255, 255, 0.82);
    box-shadow: -8px 0 48px rgba(0, 0, 0, 0.1);
}

.notification-panel.active {
    right: 0;
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
    height: 56px;
    flex-shrink: 0;
}

.notif-panel-header h3 {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.notif-panel-body {
    flex: 1;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    gap: 11px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.notif-item:hover {
    background: var(--bg-hover);
}

.notif-unread {
    background: var(--bg-input);
    border-left: 2px solid var(--accent);
}

.notif-icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.78rem;
    border: 1px solid var(--border);
}

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text);
    margin-bottom: 2px;
}

.notif-message {
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 4px;
}

.notif-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.notif-actions {
    display: flex;
    gap: 7px;
    margin-top: 7px;
}

.notif-acted {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.notif-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.notif-empty i {
    font-size: 1.8rem;
    margin-bottom: 12px;
    display: block;
    opacity: 0.25;
}

/* ==================== SYNC HISTORY ==================== */
.sync-history-content {
    padding: 0 20px 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.sync-history-content canvas {
    margin-bottom: 20px;
}

.sync-history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sync-history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 13px;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    transition:
        border-color var(--transition),
        background var(--transition),
        box-shadow var(--transition-slow);
}

.sync-history-item:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background: var(--bg-hover);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.4),
        var(--glass-shine);
}

[data-theme="light"] .sync-history-item:hover {
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.07),
        var(--glass-shine);
}

.sync-history-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    min-width: 155px;
    font-family: var(--font-mono);
}

.sync-history-info {
    flex: 1;
    font-size: 0.83rem;
    color: var(--text);
}

.sync-history-tokens {
    font-size: 0.77rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    font-family: var(--font-mono);
}

/* ==================== MEMBER PROFILE MODAL ==================== */
.member-profile-modal {
    max-width: 360px;
}

.member-profile-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

.member-profile-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.member-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.member-profile-avatar i {
    font-size: 1.8rem;
    color: var(--text-muted);
}

.member-profile-name {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 5px;
}

.member-profile-role {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.member-profile-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    background: var(--bg-hover);
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.member-profile-team-role {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.member-profile-bio {
    font-size: 0.83rem;
    color: var(--text-muted);
    line-height: 1.6;
    padding: 11px 13px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    border-left: 2px solid var(--border-hover);
}

.member-profile-links {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.member-profile-links-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 2px;
}

.member-profile-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
    text-decoration: none;
    font-size: 0.83rem;
    font-weight: 500;
    transition: all var(--transition);
}

.member-profile-link:hover {
    border-color: var(--border-hover);
    background: var(--bg-hover);
}

.member-profile-link i {
    font-size: 0.72rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ==================== MARKETPLACE ==================== */
#section-marketplace .section-header {
    margin-bottom: 20px;
}

.marketplace-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.marketplace-search {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.marketplace-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.marketplace-search input {
    width: 100%;
    padding: 10px 12px 10px 34px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.845rem;
    font-family: var(--font-sans);
    transition: border-color var(--transition);
    box-sizing: border-box;
}

.marketplace-search input:focus {
    outline: none;
    border-color: var(--border-hover);
}

#marketplace-category {
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.845rem;
    font-family: var(--font-sans);
    cursor: pointer;
    min-width: 180px;
    transition: border-color var(--transition);
}

#marketplace-category:hover {
    border-color: var(--border-hover);
}

.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 10px;
}

.marketplace-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 18px;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition:
        border-color var(--transition),
        background var(--transition),
        box-shadow var(--transition-slow);
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.marketplace-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background: var(--bg-hover);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.4),
        var(--glass-shine);
}

[data-theme="light"] .marketplace-card:hover {
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.08),
        var(--glass-shine);
}

.marketplace-card-header {
    display: flex;
    align-items: center;
    gap: 11px;
}

.marketplace-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.marketplace-card-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 3px 0;
    letter-spacing: -0.015em;
}

.marketplace-category-badge {
    font-size: 0.64rem;
    background: var(--bg-input);
    color: var(--text-muted);
    padding: 2px 7px;
    border-radius: 3px;
    border: 1px solid var(--border);
    font-weight: 700;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.marketplace-card-desc {
    font-size: 0.79rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
    flex: 1;
}

.marketplace-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2px;
}

.marketplace-free-badge {
    font-size: 0.7rem;
    color: #16a34a;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.marketplace-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.marketplace-empty i {
    font-size: 1.8rem;
    margin-bottom: 12px;
    display: block;
    opacity: 0.25;
}

/* Marketplace Modal */
.marketplace-modal-content {
    max-width: 480px;
    width: 90%;
}

.marketplace-modal-title {
    display: flex;
    align-items: center;
    gap: 13px;
}

.marketplace-modal-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.mkt-modal-desc {
    color: var(--text-muted);
    font-size: 0.845rem;
    line-height: 1.6;
    margin: 0 0 12px 0;
}

.mkt-free-tier {
    background: rgba(22, 163, 74, 0.06);
    color: #16a34a;
    border: 1px solid rgba(22, 163, 74, 0.18);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.8rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.mkt-readonly {
    background: var(--bg-hover) !important;
    color: var(--text-muted) !important;
    font-family: var(--font-mono) !important;
    font-size: 0.78rem !important;
}

.mkt-key-link {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
}

.mkt-key-link:hover {
    color: var(--text);
}

/* ==================== DANGER ZONE ==================== */
.danger-zone {
    background: rgba(220, 38, 38, 0.05);
    border: 1px solid rgba(220, 38, 38, 0.25);
    border-radius: var(--radius);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
}

.danger-zone .danger-zone-desc {
    font-size: 0.8rem;
    color: #ef4444;
    margin: 0;
}

.danger-zone .btn-danger {
    flex-shrink: 0;
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.4);
    color: #ef4444;
    font-weight: 700;
}

.danger-zone .btn-danger:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

/* ==================== HTTP METHOD / STATUS ==================== */
.http-method {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.68rem;
    font-weight: 700;
    font-family: var(--font-mono);
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.method-get {
    background: rgba(22, 163, 74, 0.1);
    color: #16a34a;
}
.method-post {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}
.method-put {
    background: rgba(202, 138, 4, 0.1);
    color: #ca8a04;
}
.method-patch {
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
}
.method-delete {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.http-status {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.68rem;
    font-weight: 700;
    font-family: var(--font-mono);
    margin-left: 4px;
}

.status-2xx {
    background: rgba(22, 163, 74, 0.1);
    color: #16a34a;
}
.status-3xx {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}
.status-4xx {
    background: rgba(202, 138, 4, 0.1);
    color: #ca8a04;
}
.status-5xx {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

/* ==================== API SCOPE BAR ==================== */
.api-scope-bar {
    margin-bottom: 12px;
}

.api-scope-bar select {
    min-width: 210px;
}

/* ==================== IMPORT EN MASSE ==================== */
.section-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.import-info {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.import-dropzone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 40px 24px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.import-dropzone:hover,
.import-dropzone.dragover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.05);
}

[data-theme="light"] .import-dropzone:hover,
[data-theme="light"] .import-dropzone.dragover {
    background: rgba(99, 102, 241, 0.08);
}

.import-dropzone i {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 12px;
    display: block;
}

.import-dropzone p {
    margin: 6px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.import-dropzone span {
    color: var(--text-muted);
    font-size: 0.82rem;
    display: block;
    margin: 8px 0;
}

.import-formats {
    font-size: 0.8rem !important;
    color: var(--text-muted) !important;
    margin-top: 12px !important;
}

.import-browse-btn {
    cursor: pointer;
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.import-file-info {
    margin: 12px 0;
}

.import-file-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.9rem;
}

.import-file-badge i:first-child {
    color: var(--accent);
}

.import-preview-wrapper {
    margin-top: 18px;
}

.import-preview-wrapper h3 {
    font-size: 0.95rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.import-preview-scroll {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.import-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.import-preview-table th {
    position: sticky;
    top: 0;
    background: var(--card-bg);
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.import-preview-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--border);
}

.import-preview-table tr:last-child td {
    border-bottom: none;
}

.import-url-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.import-row-invalid {
    opacity: 0.5;
    text-decoration: line-through;
}

.import-preview-warnings {
    margin-top: 10px;
}

.import-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 8px;
    font-size: 0.85rem;
    color: #f59e0b;
    margin-bottom: 6px;
}

.import-warning i {
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .section-header-actions {
        flex-wrap: wrap;
    }
    .import-preview-scroll {
        max-height: 200px;
    }
    .import-dropzone {
        padding: 24px 16px;
    }
    .import-dropzone i {
        font-size: 1.8rem;
    }
}
