/* ═══════════════════════════════════════
   LAUMAZ DEVELOPERS — Premium Design
   Thème Indigo/Bleu Dev Studio
   ═══════════════════════════════════════ */

:root {
    /* Core palette — Laumaz midnight */
    --bg-deep:    #070a12;
    --bg-dark:    #0b101b;
    --bg-panel:   #101725;
    --bg-surface: #141d2c;
    --bg-hover:   #192439;
    --bg-active:  rgba(108, 145, 255, 0.10);

    /* Text */
    --text-primary:   #f5f7fb;
    --text-secondary: #aab4c7;
    --text-muted:     #727e94;

    /* Accent — electric blue */
    --accent:       #6c91ff;
    --accent-light: #91adff;
    --accent-dim:   rgba(108, 145, 255, 0.12);
    --accent-glow:  rgba(108, 145, 255, 0.20);
    --accent-ring:  rgba(108, 145, 255, 0.30);

    /* Secondary accent — purple */
    --accent2:      #a88cff;
    --accent2-dim:  rgba(168, 140, 255, 0.12);

    /* Semantic */
    --success:     #34d399;
    --success-dim: rgba(52, 211, 153, 0.10);
    --warning:     #fbbf24;
    --warning-dim: rgba(251, 191, 36, 0.10);
    --danger:      #f87171;
    --danger-dim:  rgba(248, 113, 113, 0.10);
    --info:        #60a5fa;
    --info-dim:    rgba(96, 165, 250, 0.10);

    /* Borders */
    --border:       rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);

    /* Shadows */
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.28);
    --shadow-md:  0 12px 32px rgba(0,0,0,0.28);
    --shadow-lg:  0 20px 52px rgba(0,0,0,0.38);
    --shadow-xl:  0 28px 80px rgba(0,0,0,0.48);
    --shadow-glow: 0 0 24px var(--accent-glow);

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shared application chrome */
    --app-header-height: 68px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    background:
        radial-gradient(circle at 78% -10%, rgba(108,145,255,0.09), transparent 30rem),
        var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.6;
    display: flex;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s var(--ease-out);
}
a:hover { color: var(--accent-light); text-decoration: none; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--accent-light);
    outline-offset: 3px;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

::selection {
    background: var(--accent-dim);
    color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.12); }


/* ═══════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════ */

.sidebar {
    width: 272px;
    background: linear-gradient(180deg, rgba(13,19,32,0.98), rgba(8,12,21,0.98));
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 0;
    flex-shrink: 0;
    height: 100vh;
    position: relative;
    z-index: 100;
}

.sidebar-logo {
    font-size: 18px;
    font-weight: 700;
    height: var(--app-header-height);
    min-height: var(--app-header-height);
    padding: 0 22px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 13px;
    letter-spacing: -0.03em;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
    flex: 0 0 var(--app-header-height);
}
.sidebar-logo > svg {
    width: 36px;
    height: 36px;
    padding: 8px;
    border: 1px solid rgba(108,145,255,.3);
    border-radius: 11px;
    fill: var(--accent-light);
    flex-shrink: 0;
    background: linear-gradient(145deg, rgba(108,145,255,.16), rgba(168,140,255,.06));
    box-shadow: inset 0 1px rgba(255,255,255,.08), 0 8px 20px rgba(65,89,186,.15);
}

/* Nav Groups */
.nav-group {
    margin-bottom: 8px;
    padding: 4px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    margin: 3px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.nav-item:hover {
    background: rgba(255,255,255,0.055);
    color: var(--text-primary);
    text-decoration: none;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(108,145,255,0.15), rgba(108,145,255,0.055));
    color: #b8c7ff;
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    background: linear-gradient(var(--accent-light), var(--accent2));
    box-shadow: 0 0 16px rgba(108,145,255,0.46);
    border-radius: 0 3px 3px 0;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.nav-item:hover svg { opacity: 1; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
    margin-top: auto;
    padding: 16px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-footer > div:first-child > button,
.sidebar-footer > div:first-child > a {
    width: 38px !important;
    height: 38px !important;
    border-color: var(--border) !important;
    border-radius: 11px !important;
    background: rgba(255,255,255,.025) !important;
}
.sidebar-footer > div:first-child > button:hover,
.sidebar-footer > div:first-child > a:hover {
    border-color: var(--border-hover) !important;
    background: rgba(255,255,255,.065) !important;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent2), var(--accent));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 8px 22px rgba(122, 115, 235, 0.28);
}


/* ═══════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════ */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    background:
        radial-gradient(circle at 86% 2%, rgba(108,145,255,0.07), transparent 27rem),
        var(--bg-deep);
    min-height: 100vh;
}

.topbar {
    height: var(--app-header-height);
    min-height: var(--app-header-height);
    flex: 0 0 var(--app-header-height);
    padding: 0 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: rgba(7, 10, 18, 0.78);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar > div:last-child .btn {
    min-height: 38px;
    padding-inline: 14px;
    border-color: var(--border);
    background: rgba(255,255,255,.025);
}

.documentation-api-button {
    width: 176px !important;
    min-width: 176px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 16px !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    color: var(--text-secondary) !important;
    background: rgba(255,255,255,.025) !important;
    font-family: var(--font-sans) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
}

.documentation-api-button:hover {
    border-color: var(--border-hover) !important;
    color: var(--text-primary) !important;
    background: rgba(255,255,255,.065) !important;
}

.documentation-api-button svg {
    width: 15px !important;
    height: 15px !important;
    flex: 0 0 15px !important;
}

.page-title {
    font-size: 19px;
    font-weight: 680;
    letter-spacing: -0.035em;
}

.content-area {
    padding: 36px;
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
}


/* ═══════════════════════════════════════
   GLASS / SURFACES
   ═══════════════════════════════════════ */

.glass {
    background: rgba(16, 23, 37, 0.72) !important;
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg);
}

.card {
    background: linear-gradient(145deg, rgba(18,26,43,0.94), rgba(13,19,32,0.94));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 26px;
    margin-bottom: 22px;
    transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 16px 38px rgba(0,0,0,0.22);
}

.glow-primary {
    box-shadow: var(--shadow-glow);
    transition: box-shadow 0.35s var(--ease-out);
}
.glow-primary:hover {
    box-shadow: 0 0 36px var(--accent-ring);
}


/* ═══════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 17px;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-weight: 650;
    font-size: 13.5px;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
    color: var(--text-secondary);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
    transition-duration: 0.05s;
}

.btn.primary {
    background: linear-gradient(135deg, #557ef3, #775ee5);
    color: white;
    border: none;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(82, 104, 226, 0.25), inset 0 1px rgba(255,255,255,0.18);
}
.btn.primary:hover {
    background: linear-gradient(135deg, #678fff, #8970f2);
    box-shadow: 0 14px 32px rgba(82, 104, 226, 0.38);
    transform: translateY(-1px);
}
.btn.primary:active {
    transform: scale(0.97) translateY(0);
}

.btn.danger {
    color: var(--danger);
    border-color: rgba(248, 113, 113, 0.2);
}
.btn.danger:hover {
    background: var(--danger-dim);
    border-color: rgba(248, 113, 113, 0.3);
}

.btn.success {
    color: var(--success);
    border-color: rgba(52, 211, 153, 0.2);
}
.btn.success:hover {
    background: var(--success-dim);
    border-color: rgba(52, 211, 153, 0.3);
}


/* ═══════════════════════════════════════
   TABLES
   ═══════════════════════════════════════ */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.table th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.025);
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}

.table tbody tr {
    transition: background 0.15s var(--ease-out);
}
.table tbody tr:hover {
    background: rgba(108,145,255,0.035);
}

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

.table-row-hover .hover-actions {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}
.table-row-hover:hover .hover-actions {
    opacity: 1;
}


/* ═══════════════════════════════════════
   BADGES
   ═══════════════════════════════════════ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    background: var(--accent-dim);
    color: var(--accent);
}

.badge.free {
    background: rgba(90, 96, 112, 0.12);
    color: var(--text-muted);
}
.badge.active {
    background: var(--success-dim);
    color: var(--success);
}
.badge.inactive {
    background: var(--danger-dim);
    color: var(--danger);
}
.badge.pro {
    background: var(--accent2-dim);
    color: var(--accent2);
}


/* ═══════════════════════════════════════
   FORMS
   ═══════════════════════════════════════ */

.input-field, input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], select, textarea {
    background: rgba(7,10,18,0.72);
    border: 1px solid var(--border);
    color: var(--text-primary);
    min-height: 44px;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 14px;
    width: 100%;
    outline: none;
    transition: border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.input-field:focus, input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}


/* ═══════════════════════════════════════
   LOGIN / REGISTER
   ═══════════════════════════════════════ */

.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background:
        radial-gradient(circle at 50% 40%, rgba(108,145,255,0.13), transparent 27rem),
        radial-gradient(circle at 72% 65%, rgba(168,140,255,0.08), transparent 22rem),
        var(--bg-deep);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.login-wrap::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 44px 44px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: .45;
}

.login-box {
    background: rgba(15, 22, 37, 0.88);
    border: 1px solid rgba(255,255,255,0.11);
    padding: 46px 42px;
    border-radius: var(--radius-xl);
    width: 420px;
    max-width: 90%;
    text-align: center;
    box-shadow: var(--shadow-xl), inset 0 1px rgba(255,255,255,.06);
    position: relative;
    z-index: 1;
}

.login-box h1 {
    margin-bottom: 8px;
    font-size: 28px;
    font-weight: 730;
    letter-spacing: -0.045em;
}
.login-box p {
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 14px;
}

.login-box form { text-align: left; }
.login-box .input-field { min-height: 48px; }


/* ═══════════════════════════════════════
   MODALS
   ═══════════════════════════════════════ */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(6px);
    z-index: 999;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 560px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideUp 0.3s var(--ease-out);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}


/* ═══════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════ */

.mono { font-family: var(--font-mono); font-size: 13px; }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.fade-in { animation: fadeIn 0.4s var(--ease-out); }

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

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

.slide-up { animation: slideUp 0.5s var(--ease-out) both; }

/* Code blocks */
.code-block {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
    overflow-x: auto;
    line-height: 1.7;
}

.code-block .keyword { color: var(--accent2); }
.code-block .string { color: var(--success); }
.code-block .comment { color: var(--text-muted); font-style: italic; }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}


/* ═══════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════ */

#toast {
    visibility: hidden;
    min-width: 250px;
    background: var(--bg-surface);
    color: var(--text-primary);
    text-align: center;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 14px 20px;
    position: fixed;
    z-index: 1100;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: opacity 0.3s var(--ease-out), bottom 0.3s var(--ease-out);
}
#toast.show { visibility: visible; opacity: 1; bottom: 40px; }


/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -272px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s var(--ease-out);
    }
    .sidebar.open {
        left: 0;
    }
    .topbar {
        padding: 0 16px;
    }
    .content-area {
        padding: 20px 16px;
    }
    .mobile-menu-btn {
        display: flex !important;
    }
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    margin-right: 12px;
    transition: background 0.2s;
}
.mobile-menu-btn:hover {
    background: var(--bg-hover);
}

/* Profile Pill */
.profile-pill-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,.035) !important;
    padding: 6px 16px 6px 6px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    border: 1px solid var(--border) !important;
}
.profile-pill-trigger:hover {
    background: rgba(255,255,255,.07) !important;
    border-color: var(--border-hover) !important;
}

@media (max-width: 520px) {
    .topbar > div:last-child .btn { display: none; }
    .page-title { font-size: 17px; }
    .login-box { padding: 36px 24px; }
}

/* Profile Menu */
.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-primary) !important;
    text-decoration: none;
    font-size: 13.5px;
    transition: background 0.15s var(--ease-out);
}
.profile-menu-item:hover {
    background: var(--bg-hover);
    text-decoration: none;
}
.profile-menu-item svg {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* Row fade-out animation */
.row-fade-out { animation: fadeOut 0.4s var(--ease-out) forwards; }
@keyframes fadeOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(-20px); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
