/* ==========================================================================
   AlShamel API & Partner Portal - Modern Clean & Dual-Theme System
   Clean Minimalist / Dark & Light Modes / English & Arabic RTL
   ========================================================================== */

:root, [data-theme="dark"] {
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --font-arabic: 'Cairo', 'Plus Jakarta Sans', system-ui, sans-serif;

    /* Dark Theme Palette */
    --bg-base: #0a0e17;
    --bg-surface: #111726;
    --bg-surface-elevated: #161f33;
    --bg-surface-glass: rgba(17, 23, 38, 0.85);

    --border-hairline: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.14);
    --border-accent: rgba(16, 185, 129, 0.4);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dim: #475569;

    --accent-emerald: #10b981;
    --accent-emerald-hover: #059669;
    --accent-emerald-light: #34d399;
    --accent-emerald-subtle: rgba(16, 185, 129, 0.12);

    --accent-cyan: #06b6d4;
    --accent-indigo: #6366f1;
    --accent-amber: #f59e0b;
    --accent-danger: #ef4444;
    --accent-danger-subtle: rgba(239, 68, 68, 0.12);

    --input-bg: #090d16;
    --input-border: rgba(255, 255, 255, 0.12);
    --input-text: #f8fafc;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px -4px rgba(0, 0, 0, 0.6);

    --code-bg: #080c14;
    --table-header-bg: #0d1320;
    --table-hover-bg: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] {
    /* Light Theme Palette */
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f1f5f9;
    --bg-surface-glass: rgba(255, 255, 255, 0.92);

    --border-hairline: rgba(0, 0, 0, 0.08);
    --border-subtle: #e2e8f0;
    --border-accent: rgba(5, 150, 105, 0.35);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-dim: #94a3b8;

    --accent-emerald: #059669;
    --accent-emerald-hover: #047857;
    --accent-emerald-light: #10b981;
    --accent-emerald-subtle: rgba(5, 150, 105, 0.08);

    --accent-cyan: #0891b2;
    --accent-indigo: #4f46e5;
    --accent-amber: #d97706;
    --accent-danger: #dc2626;
    --accent-danger-subtle: rgba(220, 38, 38, 0.08);

    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --input-text: #0f172a;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px -4px rgba(0, 0, 0, 0.08);

    --code-bg: #0f172a;
    --table-header-bg: #f8fafc;
    --table-hover-bg: #f8fafc;
}

/* ==========================================================================
   Base & RTL Styling
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* RTL Support */
[dir="rtl"], [dir="rtl"] body {
    font-family: var(--font-arabic);
    text-align: right;
}

[dir="rtl"] .ms-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

[dir="rtl"] .me-auto {
    margin-left: auto !important;
    margin-right: 0 !important;
}

[dir="rtl"] .input-icon-wrapper i {
    left: auto;
    right: 1rem;
}

[dir="rtl"] .input-icon-wrapper .form-control-clean {
    padding-left: 1rem;
    padding-right: 2.75rem;
}

/* Simple Background */
.site-bg-clean {
    background-color: var(--bg-base);
    min-height: 100dvh;
}

a {
    color: var(--accent-emerald);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--accent-emerald-hover);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.font-mono-code {
    font-family: var(--font-mono);
}

/* ==========================================================================
   Clean Card Architecture (Simpler, Calm, Uncluttered)
   ========================================================================== */
.clean-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-hairline);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.clean-card:hover {
    border-color: var(--border-subtle);
    box-shadow: var(--shadow-md);
}

.clean-card-elevated {
    background: var(--bg-surface);
    border: 1px solid var(--border-hairline);
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

/* Glass floating panel */
.glass-panel {
    background: var(--bg-surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-hairline);
}

/* ==========================================================================
   Badges & Pills
   ========================================================================== */
.clean-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.clean-badge-emerald {
    background: var(--accent-emerald-subtle);
    border-color: var(--border-accent);
    color: var(--accent-emerald);
}

.clean-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-emerald);
}

/* ==========================================================================
   Button Architecture (Tactile & Clean)
   ========================================================================== */
.btn-primary-clean {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.65rem 1.4rem;
    border-radius: 0.75rem;
    background: var(--accent-emerald);
    border: 1px solid transparent;
    color: #ffffff !important;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-primary-clean:hover {
    background: var(--accent-emerald-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    color: #ffffff !important;
}

.btn-primary-clean:active {
    transform: scale(0.98);
}

.btn-ghost-clean {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary) !important;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-ghost-clean:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--text-muted);
    color: var(--text-primary) !important;
}

.btn-ghost-clean:active {
    transform: scale(0.98);
}

.btn-danger-clean {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1rem;
    border-radius: 0.65rem;
    background: var(--accent-danger-subtle);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--accent-danger) !important;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-danger-clean:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--accent-danger);
    color: #ffffff !important;
}

/* Control Toggle Icons (Theme & Lang) */
.btn-control-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 0.65rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: 0.825rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-control-toggle:hover {
    background: var(--border-subtle);
}

/* ==========================================================================
   Form Inputs & Label Hierarchy
   ========================================================================== */
.form-group-clean {
    margin-bottom: 1.15rem;
}

.form-label-clean {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-control-clean {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 0.65rem;
    padding: 0.7rem 0.95rem;
    color: var(--input-text);
    font-family: inherit;
    font-size: 0.925rem;
    transition: all 0.15s ease;
}

.form-control-clean::placeholder {
    color: var(--text-dim);
}

.form-control-clean:focus {
    border-color: var(--accent-emerald);
    box-shadow: 0 0 0 3px var(--accent-emerald-subtle);
    outline: none;
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-wrapper i {
    position: absolute;
    left: 1rem;
    color: var(--text-dim);
    font-size: 0.875rem;
    pointer-events: none;
}

.input-icon-wrapper .form-control-clean {
    padding-left: 2.75rem;
}

.input-icon-wrapper:focus-within i {
    color: var(--accent-emerald);
}

/* Error Callout */
.alert-callout-error {
    background: var(--accent-danger-subtle);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.65rem;
    padding: 0.75rem 1rem;
    color: var(--accent-danger);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.15rem;
}

/* ==========================================================================
   Code Preview Block
   ========================================================================== */
.code-box {
    background: var(--code-bg);
    border: 1px solid var(--border-hairline);
    border-radius: 0.85rem;
    overflow: hidden;
    font-family: var(--font-mono);
    color: #f8fafc;
}

.code-box-header {
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--border-hairline);
    padding: 0.5rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #94a3b8;
}

.code-box-body {
    padding: 1rem 1.25rem;
    font-size: 0.85rem;
    line-height: 1.6;
    overflow-x: auto;
}

/* ==========================================================================
   Floating Navbar & Navigation
   ========================================================================== */
.floating-nav {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(1200px, calc(100% - 2rem));
    border-radius: 1rem;
    z-index: 100;
    padding: 0.65rem 1.25rem;
}

.nav-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.nav-brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--accent-emerald);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.9rem;
}

.nav-menu-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu-links a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-menu-links a:hover {
    color: var(--text-primary);
}

/* ==========================================================================
   Dashboard Shell & Sidebar
   ========================================================================== */
.dashboard-container {
    display: flex;
    min-height: 100dvh;
    background-color: var(--bg-base);
}

.dashboard-sidebar {
    width: 260px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-hairline);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100dvh;
    z-index: 40;
    transition: background-color 0.25s ease;
}

[dir="rtl"] .dashboard-sidebar {
    border-right: none;
    border-left: 1px solid var(--border-hairline);
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-hairline);
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.sidebar-nav-list {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.65rem;
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.sidebar-link i {
    font-size: 1rem;
    color: var(--text-dim);
    transition: color 0.15s ease;
}

.sidebar-link:hover {
    background: var(--bg-surface-elevated);
    color: var(--text-primary) !important;
}

.sidebar-link:hover i {
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--accent-emerald-subtle);
    color: var(--accent-emerald) !important;
    font-weight: 600;
}

.sidebar-link.active i {
    color: var(--accent-emerald);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-hairline);
    background: var(--bg-surface-elevated);
}

.dashboard-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dashboard-topbar {
    height: 64px;
    background: var(--bg-surface-glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-hairline);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 30;
}

.dashboard-workspace {
    flex: 1;
    padding: 1.75rem;
}

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    .dashboard-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .dashboard-workspace {
        padding: 1rem;
    }
    .dashboard-topbar {
        padding: 0 1rem;
    }
}

/* ==========================================================================
   Modal & Plugin Form Components (Redesigned & Clean)
   ========================================================================== */
.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 1.25rem;
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
}

.modal-header {
    border-bottom: 1px solid var(--border-hairline);
    padding: 1.15rem 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-hairline);
    padding: 1.15rem 1.5rem;
}

.modal-tab-nav {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem;
    background: var(--bg-surface-elevated);
    border-radius: 0.65rem;
    border: 1px solid var(--border-hairline);
    margin-bottom: 1.25rem;
}

.modal-tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border-radius: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-tab-btn.active {
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* Media / Image Upload Box */
.file-upload-box {
    background: var(--bg-surface-elevated);
    border: 1px dashed var(--border-subtle);
    border-radius: 0.85rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color 0.15s ease;
}

.file-upload-box:hover {
    border-color: var(--accent-emerald);
}

.file-preview-thumb {
    width: 72px;
    height: 72px;
    min-width: 72px;
    border-radius: 0.65rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-hairline);
    background-size: cover;
    background-position: center;
}

/* Scope Permission Row */
.scope-row-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-hairline);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.scope-name-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.scope-actions-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.scope-toggle-pill {
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.scope-toggle-pill.active {
    background: var(--accent-emerald-subtle);
    border-color: var(--accent-emerald);
    color: var(--accent-emerald);
}

/* Addon Page Scope Selection Grid */
.scope-select-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-hairline);
    border-radius: 0.75rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    height: 100%;
}

.scope-select-card:hover {
    border-color: var(--accent-emerald);
    transform: translateY(-1px);
}

.scope-select-card.selected {
    border-color: var(--accent-emerald);
    background: var(--accent-emerald-subtle);
    box-shadow: 0 0 0 1px var(--accent-emerald);
}

.scope-check-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid var(--border-subtle);
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.scope-select-card.selected .scope-check-circle {
    background: var(--accent-emerald);
    border-color: var(--accent-emerald);
}

/* ==========================================================================
   Table & Lists
   ========================================================================== */
.table {
    color: var(--text-primary);
    border-color: var(--border-hairline);
    vertical-align: middle;
}

.table th {
    background-color: var(--table-header-bg) !important;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-hairline) !important;
    padding: 0.75rem 1rem;
}

.table td {
    background-color: transparent !important;
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-hairline);
}

.table tr:hover td {
    background-color: var(--table-hover-bg) !important;
}

/* Blazor Error UI */
#blazor-error-ui {
    background: #1e1014;
    border-top: 1px solid #7f1d1d;
    color: #fca5a5;
    bottom: 0;
    left: 0;
    padding: 0.65rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 10000;
    display: none;
    font-size: 0.85rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.65rem;
}

/* ==========================================================================
   Webhook System & Granular Scope Domain Cards (Salla Partner Style)
   ========================================================================== */
.webhook-row-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 0.85rem;
    padding: 1.15rem 1.25rem;
    transition: all 0.15s ease;
}

.webhook-row-card:hover {
    border-color: var(--accent-emerald);
    box-shadow: var(--shadow-sm);
}

.webhook-endpoint-preview {
    display: flex;
    flex-direction: row;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 0.65rem;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    direction: ltr !important;
    text-align: left !important;
}

.webhook-base-url {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.6rem 0.85rem;
    color: var(--accent-emerald);
    border-right: 1px solid var(--border-subtle);
    border-left: none;
    white-space: nowrap;
    user-select: none;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
    direction: ltr !important;
}

.webhook-path-input {
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--text-primary) !important;
    padding: 0.6rem 0.85rem !important;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    width: 100%;
    direction: ltr !important;
    text-align: left !important;
}

.webhook-path-input:focus {
    box-shadow: none !important;
    outline: none !important;
}

/* Plugin Hero Profile Card (Top Executive Card) */
.plugin-hero-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-hairline);
    border-radius: 1.25rem;
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.plugin-hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-emerald), #059669);
}

.hero-avatar-wrapper {
    position: relative;
    width: 110px;
    height: 110px;
    min-width: 110px;
    border-radius: 1rem;
    overflow: hidden;
    background: var(--bg-surface-elevated);
    border: 2px solid var(--border-subtle);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.hero-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-position: center;
    background-size: cover;
}

.hero-avatar-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.35rem;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    gap: 0.4rem;
}

.domain-scope-box {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-hairline);
    border-radius: 0.85rem;
    padding: 1.25rem;
}

.domain-scope-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding-bottom: 0.85rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-hairline);
}

/* Domain Permission Cards & Toggle Rows */
.domain-perm-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 0.85rem;
    padding: 1rem 1.15rem;
    transition: all 0.2s ease;
    height: 100%;
}

.domain-perm-card:hover {
    border-color: var(--border-accent);
}

.domain-perm-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-hairline);
}

.perm-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.85rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-hairline);
    border-radius: 0.65rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.perm-toggle-row:hover {
    border-color: var(--accent-emerald);
    background: var(--bg-surface-elevated);
}

.perm-toggle-row.active {
    border-color: var(--accent-emerald);
    background: var(--accent-emerald-subtle);
}

.perm-checkbox-circle {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 6px;
    border: 1.5px solid var(--border-subtle);
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.perm-toggle-row.active .perm-checkbox-circle {
    background: var(--accent-emerald);
    border-color: var(--accent-emerald);
}

