@font-face {
    font-family: 'Inter';
    src: url('/fonts/Inter-Variable.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('/fonts/JetBrainsMono-Variable.ttf') format('truetype');
    font-weight: 100 800;
    font-style: normal;
    font-display: swap;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: #eef0f5;
    color: #0f172a;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

button, input, select, textarea {
    font-family: inherit;
}

.e-control,
.e-css,
.e-grid,
.e-btn,
.e-input-group,
.e-dlg-container {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

.mono,
.mono-cell,
.e-grid .mono-cell,
.e-grid .e-rowcell.mono-cell {
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 12px;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 52px;
    padding: 0 24px;
    background: #000040;
    color: #ffffff;
}

.app-bar-brand {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}

.app-bar-mark {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #C19DEC;
    flex-shrink: 0;
    align-self: center;
}

.app-bar-title {
    font-size: 14px;
    font-weight: 700;
}

.app-bar-sub {
    font-size: 12px;
    color: #9ba8cc;
}

.header-auth {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-auth-user {
    font-size: 13px;
    color: #e2e8f0;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-auth-link {
    color: #C19DEC;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.header-auth-link:hover {
    color: #ffffff;
}

.header-signout-form {
    margin: 0;
}

.header-auth-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

.app-body {
    flex: 1;
}

.users-page {
    max-width: 1600px;
    margin: 0 auto;
    padding: 28px 24px 48px;
    width: 100%;
}

.users-eyebrow {
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #3A00AC;
    margin: 0 0 6px;
}

.users-page h1 {
    margin: 0 0 6px;
    font-size: 1.75rem;
    font-weight: 700;
}

.users-sub {
    margin: 0 0 20px;
    color: #64748b;
    font-size: 0.95rem;
}

.tenant-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.tenant-item {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 12px;
    padding: 12px 14px;
}

.tenant-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 4px;
}

.tenant-value {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.users-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.users-count {
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 12px;
    color: #64748b;
}

.users-panel {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 18px 38px -28px rgba(30, 41, 59, 0.35);
}

.users-loading,
.users-empty {
    padding: 28px 12px;
    text-align: center;
    color: #64748b;
}

.users-error {
    border-left: 3px solid #ef4444;
    background: rgba(239, 68, 68, 0.06);
    border-radius: 0 10px 10px 0;
    padding: 14px 16px;
    margin-bottom: 16px;
    color: #b91c1c;
}

.users-error p {
    margin: 8px 0 0;
}

.users-consent {
    display: inline-flex;
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #F3EBFB;
    border: 1px solid #C19DEC;
    color: #3A00AC;
    font-weight: 600;
    text-decoration: none;
}

.users-consent:hover {
    background: #E7D7F8;
}

.user-detail {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 16px;
    padding: 8px 4px 4px;
}

.user-detail-item {
    min-width: 0;
}

.user-detail-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 2px;
}

.user-detail-value {
    display: block;
    color: #0f172a;
    overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
    .tenant-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .user-detail {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .app-bar {
        padding: 0 12px;
    }

    .app-bar-sub {
        display: none;
    }

    .users-page {
        max-width: 100vw;
        padding: 18px 12px 36px;
    }

    .tenant-strip,
    .user-detail {
        grid-template-columns: 1fr;
    }
}

.home-wrap {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    padding: 1rem;
}

.home-wrap button,
.home-wrap input,
.home-wrap select,
.home-wrap textarea {
    font-family: inherit;
}

.auth-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.10), 0 1.5px 6px rgba(15, 23, 42, 0.06);
    padding: 2.5rem 2.25rem 2rem;
    width: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    animation: fadeUp 300ms ease-out both;
}

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

.card-logo {
    width: 48px;
    height: 48px;
    background: #e2e8f0;
    border-radius: 12px;
}

.card-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.card-sub {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: -0.5rem;
}

.btn-signin {
    display: block;
    width: 100%;
    background: #475569;
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 0.65rem 1.5rem;
    border-radius: 8px;
    transition: background 150ms ease;
    margin-top: 0.5rem;
}

.btn-signin:hover { background: #334155; }

.avatar {
    width: 56px;
    height: 56px;
    background: #cbd5e1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: #475569;
    letter-spacing: -0.02em;
}

.user-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
}

.user-email {
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 0.82rem;
    color: #94a3b8;
    text-align: center;
    margin-top: -0.4rem;
}

.divider {
    width: 100%;
    height: 1px;
    background: #f1f5f9;
    margin: 0.25rem 0;
}

.signout-form { width: 100%; }

.btn-signout {
    width: 100%;
    background: transparent;
    color: #64748b;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 150ms ease, color 150ms ease;
}

.btn-signout:hover {
    border-color: #94a3b8;
    color: #334155;
}
