:root {
    --bg-main: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --sidebar-bg: #1e293b;
    --glow-primary: rgba(59, 130, 246, 0.5);

    --python-color: #f59e0b;
    --wapp-color: #22c55e;
    --sidebar-width: clamp(240px, 19vw, 280px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    height: 100dvh;
    max-width: 100%;
    overflow: hidden;
    background-image:
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
}

.app-container {
    display: flex;
    height: 100vh;
    height: 100dvh;
    min-width: 0;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-width: 0;
    min-height: 0;
    flex: 0 0 var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 2rem 2rem 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.logo-icon {
    font-size: 2rem;
    color: var(--primary);
    text-shadow: 0 0 10px var(--glow-primary);
}

.sidebar-header h2 {
    min-width: 0;
    font-size: 1.5rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.sidebar-header span {
    color: var(--primary);
}

.nav-links {
    list-style: none;
    padding: 0 1rem;
}

.nav-links li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-muted);
    min-width: 0;
}

.nav-links li span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.nav-links li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-links li.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px var(--glow-primary);
}

.nav-links li i {
    font-size: 1.2rem;
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 2.5rem 3rem 1.5rem;
}

.header-title {
    min-width: 0;
    flex: 1 1 300px;
}

.topbar-account {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

#current-user-label {
    min-width: 0;
    color: #94a3b8;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.header-title h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.header-title p {
    color: var(--text-muted);
}

/* Tabs */
.tab-content {
    min-width: 0;
    max-width: 100%;
    padding: 0 3rem 3rem;
    flex: 1;
}

.tab-pane {
    display: none;
    min-width: 0;
    max-width: 100%;
    animation: fadeIn 0.4s ease;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Generic Glass Card */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
}

/* Bot Cards (Dashboard) */
.bot-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    gap: 2rem;
}

.card-header {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.icon-box {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.python-icon {
    background: rgba(245, 158, 11, 0.15);
    color: var(--python-color);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.wapp-icon {
    background: rgba(34, 197, 94, 0.15);
    color: var(--wapp-color);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 5px;
}

.status-badge.offline {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-badge.online {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.card-body p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.action-buttons .btn {
    min-width: 0;
    max-width: 100%;
    flex: 1 1 140px;
    justify-content: center;
}

/* Forms Content */
.form-card h3 {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    overflow-wrap: anywhere;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    min-width: 0;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Buttons */
.btn {
    min-width: 0;
    max-width: 100%;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    line-height: 1.25;
    overflow-wrap: anywhere;
    text-align: center;
}

.btn i {
    flex: 0 0 auto;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--glow-primary);
}

.btn-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.btn-save-top {
    background: var(--success);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-save-top:hover {
    background: #0ea5e9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.hidden {
    display: none !important;
}

/* Toast */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: #0f172a;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9999;
    width: max-content;
    max-width: calc(100vw - 32px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overflow-wrap: anywhere;
    text-align: center;
}

.toast.show {
    bottom: 40px;
    opacity: 1;
    visibility: visible;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

#helpModal {
    z-index: 2100 !important;
}

.modal-content {
    max-height: calc(100dvh - 32px);
    margin: max(16px, 5vh) auto;
    padding: 30px;
    width: min(600px, calc(100% - 32px));
    overflow: auto;
    overscroll-behavior: contain;
    position: relative;
    border-radius: 16px;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    color: var(--text-muted);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: var(--text-main);
}

.modal h2 {
    padding-right: 48px;
    margin-bottom: 20px;
    color: var(--primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    overflow-wrap: anywhere;
}

#modal-body {
    line-height: 1.6;
    color: var(--text-main);
}

#modal-body p {
    margin-bottom: 10px;
}

#modal-body ul {
    margin-left: 20px;
    margin-bottom: 10px;
}

#modal-body a {
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
}

#modal-body a:hover {
    text-decoration: underline;
}

.help-icon {
    margin-left: 8px;
    color: var(--primary);
    cursor: pointer;
    font-size: 1.1em;
    vertical-align: middle;
}

.help-icon:hover {
    color: var(--primary-hover);
}

/* ========================================================= */
/* UX/UI OVERHAUL - PHASE 1: CARDS, GRID & TOGGLES           */
/* ========================================================= */

/* Grid Settings for Modern Layout */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
}

.form-grid-2 > *,
.form-grid-3 > *,
.integration-grid > * {
    min-width: 0;
}

/* Integration Store Cards */
.integration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.integration-card {
    min-width: 0;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.integration-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.integration-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.integration-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.integration-title {
    min-width: 0;
}

.integration-title h4,
.integration-title p {
    overflow-wrap: anywhere;
}

.integration-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
}

.integration-title h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.integration-title p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.integration-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
}

/* iOS Style Toggles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex: 0 0 50px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.25);
    transition: .4s;
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: var(--success);
    border-color: var(--success);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--success);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* Users */
.users-shell {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.users-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.users-hero h2 {
    font-size: 1.45rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    overflow-wrap: anywhere;
}

.users-hero p,
.user-panel-header p,
.users-section-header p {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.users-hero-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    color: var(--text-muted);
}

.users-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 1.25rem;
}

.user-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-panel-header,
.users-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.user-panel-header>div:nth-child(2),
.users-section-header>div:first-child {
    min-width: 0;
    flex: 1;
}

.user-panel-header h3,
.users-section-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.12rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.user-panel-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    font-size: 1.35rem;
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.25);
}

.user-panel-icon.success {
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(52, 211, 153, 0.25);
}

.user-field-grid,
.user-create-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.user-field-grid .form-group,
.user-create-fields .form-group {
    margin-bottom: 0;
}

.users-actions-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.security-badge {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: var(--text-muted);
    background: rgba(148, 163, 184, 0.08);
}

.security-badge.muted {
    color: var(--text-muted);
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.25);
}

.security-badge.primary {
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(96, 165, 250, 0.35);
}

.security-badge.success {
    color: #bbf7d0;
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(52, 211, 153, 0.35);
}

.security-badge.warning {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(251, 191, 36, 0.35);
}

.security-badge.danger {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(248, 113, 113, 0.35);
}

.totp-setup-box {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.35);
}

.totp-setup-box img {
    width: 220px;
    max-width: 100%;
    background: white;
    padding: 10px;
    border-radius: 8px;
}

.totp-secret-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.totp-secret-row .form-control {
    min-width: 0;
    flex: 1 1 0;
}

.users-team-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.user-create-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.32);
}

.user-create-fields {
    grid-template-columns: minmax(160px, 1fr) minmax(210px, 1.25fr) minmax(180px, 1fr) auto;
    align-items: end;
}

.user-admin-toggle {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.users-table-wrap {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
}

.users-table {
    width: 100%;
    min-width: 940px;
    border-collapse: separate;
    border-spacing: 0;
}

.users-table th {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-align: left;
    text-transform: uppercase;
    padding: 0 0.75rem 0.65rem;
    letter-spacing: 0;
}

.users-table td {
    padding: 0.75rem;
    vertical-align: middle;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.users-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.025);
}

.user-identity-cell {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(96, 165, 250, 0.16);
    color: #bfdbfe;
    border: 1px solid rgba(96, 165, 250, 0.28);
    font-weight: 700;
}

.user-inline-fields {
    display: grid;
    gap: 0.45rem;
}

.users-table .form-control {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 0.92rem;
}

.table-toggle-row {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.user-row-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.btn.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    flex: 0 0 40px;
}

.users-empty-row {
    color: var(--text-muted);
    padding: 1.25rem !important;
    text-align: center;
}

.users-empty-row.danger {
    color: #fecaca;
}

@media (max-width: 1280px) {
    .topbar {
        padding: 2rem 1.5rem 1.25rem;
    }

    .tab-content {
        padding: 0 1.5rem 2rem;
    }

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

    .users-top-grid,
    .user-create-panel {
        grid-template-columns: 1fr;
    }

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

    .user-create-panel .btn {
        justify-content: center;
    }
}

@media (max-width: 1024px) {
    body {
        min-height: 100vh;
        overflow: auto;
    }

    .app-container {
        min-height: 100vh;
        height: auto;
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex: 0 0 auto;
        padding: 1rem 0;
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar-header {
        padding: 0 1rem 1rem;
        margin-bottom: 0.75rem;
    }

    .nav-links {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        padding: 0 1rem 0.25rem;
        scrollbar-width: thin;
    }

    .nav-links li {
        flex: 0 0 auto;
        margin-bottom: 0;
        padding: 0.85rem 1rem;
        border-radius: 8px;
    }

    .main-content {
        overflow: visible;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
        padding: 1.25rem 1rem 1rem;
    }

    .header-title {
        flex: 0 1 auto;
    }

    .topbar-account {
        justify-content: space-between;
    }

    .topbar-account > form {
        flex: 0 0 auto;
    }

    .tab-content {
        padding: 0 1rem 1.5rem;
    }
}

@media (max-width: 760px) {
    body {
        min-height: 100vh;
        overflow: auto;
    }

    .app-container {
        min-height: 100vh;
        height: auto;
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex: 0 0 auto;
        padding: 1rem 0;
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar-header {
        padding: 0 1rem 1rem;
        margin-bottom: 0.75rem;
    }

    .nav-links {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        padding: 0 1rem 0.25rem;
    }

    .nav-links li {
        flex: 0 0 auto;
        margin-bottom: 0;
        padding: 0.85rem 1rem;
        border-radius: 8px;
    }

    .main-content {
        overflow: visible;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1rem;
        padding: 1.25rem 1rem 1rem;
    }

    .tab-content {
        padding: 0 1rem 1.5rem;
    }

    .glass-card {
        padding: 1.25rem;
    }

    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .integration-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .users-hero,
    .user-panel-header,
    .users-section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .users-hero-meta {
        justify-content: flex-start;
    }

    .user-field-grid,
    .user-create-fields,
    .totp-setup-box {
        grid-template-columns: 1fr;
    }

    .totp-secret-row {
        align-items: stretch;
    }

    .totp-secret-row .btn {
        align-self: stretch;
    }

    .users-table-wrap {
        overflow: visible;
    }

    .users-table {
        min-width: 0;
    }

    .users-table thead {
        display: none;
    }

    .users-table,
    .users-table tbody,
    .users-table tr,
    .users-table td {
        display: block;
        width: 100%;
    }

    .users-table tr {
        padding: 1rem 0;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .users-table td {
        border-top: 0;
        padding: 0.45rem 0;
    }

    .users-table td:not(:first-child)::before {
        display: block;
        margin-bottom: 0.35rem;
        color: var(--text-muted);
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0;
        text-transform: uppercase;
    }

    .users-table td:nth-child(2)::before {
        content: "Permissão";
    }

    .users-table td:nth-child(3)::before {
        content: "Status";
    }

    .users-table td:nth-child(4)::before {
        content: "2FA";
    }

    .users-table td:nth-child(5)::before {
        content: "Nova senha";
    }

    .users-table td:nth-child(6)::before {
        content: "Ações";
    }

    .table-toggle-row,
    .user-row-actions {
        width: 100%;
        justify-content: space-between;
    }

    .user-row-actions .btn {
        flex: 1 1 0;
    }
}

@media (max-width: 480px) {
    .topbar-account {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar-account > form,
    .topbar-account .btn,
    .btn-save-top {
        width: 100%;
    }

    .modal-content {
        width: calc(100% - 20px);
        max-height: calc(100dvh - 20px);
        margin: 10px auto;
        padding: 22px 18px;
    }

    .toast.show {
        bottom: max(18px, env(safe-area-inset-bottom));
    }
}
