/* ==========================================================================
   NGUYENDZ - Workplace Enterprise Dashboard (Lark + Notion Style)
   With Role-Based Access Control (RBAC) & Employee Account Management
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design System Tokens & Variables
   -------------------------------------------------------------------------- */
:root {
    /* Light Theme (Default - Clean Enterprise) */
    --bg-page: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #ffffff;
    
    --border-subtle: #e2e8f0;
    --border-hover: #cbd5e1;
    --border-accent: #3b82f6;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    /* Vibrant Icon Badge Colors */
    --color-blue: #0066ff;
    --color-cyan: #0284c7;
    --color-green: #10b981;
    --color-orange: #f59e0b;
    --color-purple: #8b5cf6;
    --color-red: #ef4444;
    --color-indigo: #6366f1;

    --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
    --shadow-card-hover: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
    --shadow-dropdown: 0 10px 30px -5px rgba(15, 23, 42, 0.12);

    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;

    --sidebar-width: 260px;
    --header-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

/* Dark Theme (Sleek Slate) */
[data-theme="dark"] {
    --bg-page: #0b0f19;
    --bg-sidebar: #0f172a;
    --bg-surface: #1e293b;
    --bg-surface-hover: #334155;
    --bg-card: #131b2e;
    --bg-card-hover: #1a243d;

    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --border-accent: #38bdf8;

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

    --shadow-card: 0 2px 6px rgba(0, 0, 0, 0.35);
    --shadow-card-hover: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.15);
    --shadow-dropdown: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* --------------------------------------------------------------------------
   2. Reset & Layout Setup
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: var(--font-main);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color 0.2s ease, color 0.2s ease;
}

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

ul {
    list-style: none;
}

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

.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* --------------------------------------------------------------------------
   3. Notion-Style Left Sidebar
   -------------------------------------------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.25s ease, background-color 0.2s ease;
}

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

.workspace-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.workspace-logo {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--color-blue), var(--color-cyan));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.35);
}

.workspace-logo i {
    width: 18px;
    height: 18px;
}

.workspace-meta {
    display: flex;
    flex-direction: column;
}

.workspace-name {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.workspace-badge {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
}

.sidebar-collapse-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

/* Sidebar Search */
.sidebar-search-wrap {
    padding: 14px 16px 8px 16px;
}

.search-input-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    cursor: text;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input-box:focus-within {
    border-color: var(--color-blue);
    background: var(--bg-surface);
    box-shadow: 0 0 0 2px rgba(0, 102, 255, 0.15);
}

.search-icon {
    width: 15px;
    height: 15px;
    color: var(--text-muted);
}

.search-input-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    width: 100%;
}

.search-kbd {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 2px 5px;
    border-radius: 4px;
    color: var(--text-muted);
}

/* Sidebar Navigation Menu */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nav-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px 0 8px;
}

.nav-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    padding: 0;
}

.btn-add-section-action {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.btn-add-section-action:hover {
    color: var(--color-blue);
    background-color: var(--bg-surface-hover);
    transform: scale(1.15);
}

.btn-add-section-action i {
    width: 14px;
    height: 14px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    cursor: pointer;
}

.nav-link i {
    width: 16px;
    height: 16px;
}

.nav-link:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background-color: rgba(0, 102, 255, 0.1);
    color: var(--color-blue);
    font-weight: 600;
}

[data-theme="dark"] .nav-link.active {
    background-color: rgba(56, 189, 248, 0.15);
    color: var(--border-accent);
}

.count-badge {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--bg-surface-hover);
    color: var(--text-muted);
    padding: 2px 7px;
    border-radius: 10px;
}

.role-admin-tag {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 800;
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-orange);
    padding: 2px 6px;
    border-radius: 4px;
}

.star-icon { color: var(--color-orange); }
.cat-icon-blue { color: var(--color-blue); }
.cat-icon-cyan { color: var(--color-cyan); }
.cat-icon-green { color: var(--color-green); }
.cat-icon-purple { color: var(--color-purple); }
.cat-icon-orange { color: var(--color-orange); }
.cat-icon-indigo { color: var(--color-indigo); }
.cat-icon-red { color: var(--color-red); }

/* Sidebar User Profile Footer Strip */
.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--border-subtle);
}

.user-profile-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-blue), var(--color-purple));
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-meta {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
}

.user-name {
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-switch-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-switch-btn:hover {
    color: var(--color-red);
    background: rgba(239, 68, 68, 0.1);
}

.user-switch-btn i { width: 15px; height: 15px; }

/* --------------------------------------------------------------------------
   4. Main Content Area & Header
   -------------------------------------------------------------------------- */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-page);
    transition: margin-left 0.25s ease;
}

.top-nav-bar {
    height: var(--header-height);
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 500;
}

.top-nav-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mobile-menu-trigger {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
}

.breadcrumb-trail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 600;
}

.breadcrumb-root {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.breadcrumb-root i { width: 15px; height: 15px; }
.breadcrumb-sep { color: var(--text-muted); }
.breadcrumb-current { color: var(--text-primary); font-weight: 700; }

.top-nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-search-bar {
    position: relative;
    display: flex;
    align-items: center;
    width: 260px;
}

.search-icon-sm {
    position: absolute;
    left: 10px;
    width: 15px;
    height: 15px;
    color: var(--text-muted);
    pointer-events: none;
}

.header-search-bar input {
    width: 100%;
    padding: 7px 28px 7px 32px;
    background: var(--bg-page);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
}

.header-search-bar input:focus {
    border-color: var(--color-blue);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12);
    width: 300px;
}

.clear-search-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    display: flex;
}

.clear-search-btn i { width: 13px; height: 13px; }

/* Action Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.82rem;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 4px;
}

.btn-block { width: 100%; }

.btn-primary {
    background-color: var(--color-blue);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 102, 255, 0.25);
}

.btn-primary:hover {
    background-color: #0052cc;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.35);
}

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

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

.btn-outline {
    background-color: transparent;
    border-color: var(--border-subtle);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: var(--bg-surface-hover);
}

.icon-tool-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-page);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.icon-tool-btn i { width: 17px; height: 17px; }

[data-theme="dark"] .dark-icon { display: none; }
[data-theme="dark"] .light-icon { display: block; }
[data-theme="light"] .dark-icon { display: block; }
[data-theme="light"] .light-icon { display: none; }

/* --------------------------------------------------------------------------
   5. Content Body & Permissions Banner
   -------------------------------------------------------------------------- */
.content-body {
    padding: 24px 32px 60px 32px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.permission-notice-banner {
    background: rgba(0, 102, 255, 0.06);
    border: 1px solid rgba(0, 102, 255, 0.18);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.85rem;
}

.banner-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.banner-icon {
    width: 18px;
    height: 18px;
    color: var(--color-blue);
    flex-shrink: 0;
}

.banner-text {
    color: var(--text-secondary);
}

.banner-text strong {
    color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   6. Favorites & Apps Grid (Lark Style)
   -------------------------------------------------------------------------- */
.section-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.section-heading {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.star-filled { color: var(--color-orange); fill: var(--color-orange); }

.section-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.section-heading-lg {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
}

.fav-card-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease;
}

.fav-card-item:hover {
    border-color: var(--color-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

.fav-card-item .app-icon-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
}

.fav-card-item .fav-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
}

.fav-card-item .fav-title {
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fav-card-item .fav-domain {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-fav-pill {
    background-color: var(--bg-surface-hover);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    grid-column: 1 / -1;
}

.apps-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.filter-tabs-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-tab-btn {
    background: none;
    border: 1px solid transparent;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-tab-btn:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.filter-tab-btn.active {
    background-color: rgba(0, 102, 255, 0.1);
    color: var(--color-blue);
    border-color: rgba(0, 102, 255, 0.2);
    font-weight: 700;
}

[data-theme="dark"] .filter-tab-btn.active {
    background-color: rgba(56, 189, 248, 0.15);
    color: var(--border-accent);
    border-color: rgba(56, 189, 248, 0.3);
}

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

.app-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-card:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--color-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    z-index: 10;
}

.app-card.dropdown-active,
.app-card:has(.app-dropdown-menu.show) {
    z-index: 500 !important;
}

.app-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.app-icon-badge i { width: 22px; height: 22px; }

.bg-blue   { background: linear-gradient(135deg, #0066ff, #0052cc); }
.bg-cyan   { background: linear-gradient(135deg, #0284c7, #0369a1); }
.bg-purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.bg-orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.bg-green  { background: linear-gradient(135deg, #10b981, #059669); }
.bg-indigo { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.bg-red    { background: linear-gradient(135deg, #ef4444, #b91c1c); }

.app-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.app-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}

.app-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-badge-tag {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(0, 102, 255, 0.1);
    color: var(--color-blue);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.app-badge-tag.tag-bot {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-orange);
}

.app-badge-tag.tag-running {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-green);
}

.app-domain {
    font-size: 0.78rem;
    color: var(--color-cyan);
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.7;
    transition: opacity 0.15s ease;
    position: relative;
}

.app-card:hover .card-actions {
    opacity: 1;
}

.action-pin-btn, .action-launch-btn, .action-more-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-more-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-surface-hover);
}

.action-more-btn.active {
    color: var(--color-blue);
    background-color: rgba(0, 102, 255, 0.1);
}

/* 3-Dots Dropdown Context Menu */
.app-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 215px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);
    padding: 6px;
    z-index: 1000;
    display: none;
    flex-direction: column;
    gap: 2px;
    animation: dropdown-pop 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .app-dropdown-menu {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 4px 16px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.12);
}

.app-dropdown-menu.show {
    display: flex;
}

@keyframes dropdown-pop {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: all 0.12s ease;
}

.dropdown-item i {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.dropdown-item:hover {
    background-color: var(--bg-surface-hover);
    color: var(--color-blue);
}

.dropdown-item:hover i {
    color: var(--color-blue);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-subtle);
    margin: 4px 0;
}

.dropdown-item.item-danger {
    color: var(--color-red);
}

.dropdown-item.item-danger i {
    color: var(--color-red);
}

.dropdown-item.item-danger:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-red);
}

.action-pin-btn:hover {
    color: var(--color-orange);
    background-color: var(--bg-surface-hover);
}

.action-pin-btn.pinned { color: var(--color-orange); }
.action-pin-btn.pinned i { fill: var(--color-orange); }

.action-launch-btn:hover {
    color: var(--color-blue);
    background-color: var(--bg-surface-hover);
}

.empty-state-card {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background-color: var(--bg-card);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.empty-icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
}

.empty-state-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.empty-state-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    max-width: 400px;
}

/* --------------------------------------------------------------------------
   7. View 2: Users & Roles Management
   -------------------------------------------------------------------------- */
.users-header-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-card);
}

.users-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Role Stats */
.roles-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.role-stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-card);
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i { width: 20px; height: 20px; }

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

.stat-num {
    font-size: 1.4rem;
    font-weight: 800;
    font-family: var(--font-heading);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Users Table */
.users-table-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
}

.users-table th {
    background-color: var(--bg-surface-hover);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
}

.users-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.users-table tbody tr:hover {
    background-color: var(--bg-surface-hover);
}

/* User cell info */
.table-user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-user-name {
    font-weight: 700;
    color: var(--text-primary);
}

/* Role Pills */
.role-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.role-admin {
    background: rgba(245, 158, 11, 0.12);
    color: var(--color-orange);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.role-marketing {
    background: rgba(16, 185, 129, 0.12);
    color: var(--color-green);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.role-tech {
    background: rgba(0, 102, 255, 0.12);
    color: var(--color-blue);
    border: 1px solid rgba(0, 102, 255, 0.25);
}

.role-sales {
    background: rgba(139, 92, 246, 0.12);
    color: var(--color-purple);
    border: 1px solid rgba(139, 92, 246, 0.25);
}

/* Permissions Chip List in Table */
.perm-chips-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 280px;
}

.perm-chip {
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-subtle);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-secondary);
}

.perm-chip-all {
    background: rgba(0, 102, 255, 0.1);
    color: var(--color-blue);
    border-color: rgba(0, 102, 255, 0.2);
    font-weight: 700;
}

/* Status Pill */
.user-status-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
}

.user-status-tag.active { color: var(--color-green); }
.user-status-tag.inactive { color: var(--color-red); }

.table-action-btns {
    display: flex;
    align-items: center;
    gap: 6px;
}

.table-btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.table-btn-icon:hover {
    color: var(--color-blue);
    border-color: var(--color-blue);
}

.table-btn-icon.btn-del:hover {
    color: var(--color-red);
    border-color: var(--color-red);
}

.table-btn-icon i { width: 15px; height: 15px; }

/* --------------------------------------------------------------------------
   8. Permissions Checkbox Grid in Modal
   -------------------------------------------------------------------------- */
.modal-lg {
    max-width: 620px;
}

.perm-title-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-text-action {
    background: none;
    border: none;
    color: var(--color-blue);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-text-action:hover { text-decoration: underline; }

.permissions-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    background: var(--bg-page);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.perm-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
}

.perm-checkbox-item:hover {
    background: var(--bg-surface-hover);
}

.perm-checkbox-item input[type="checkbox"] {
    accent-color: var(--color-blue);
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   8. View 3: Content Library (Social & Ads)
   -------------------------------------------------------------------------- */
.library-header-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-card);
}

.library-badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--color-cyan);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 4px;
}

.library-badge-tag i { width: 14px; height: 14px; }

.library-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.library-tabs-bar {
    display: flex;
    gap: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 6px;
    border-radius: var(--radius-md);
    width: fit-content;
}

.lib-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: none;
    background: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.lib-tab-btn i { width: 16px; height: 16px; }

.lib-tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
}

.lib-tab-btn.active {
    background: var(--color-blue);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.3);
}

.lib-tab-badge {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.1);
}

.lib-tab-btn.active .lib-tab-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.library-filter-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.lib-search-box {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 260px;
    max-width: 420px;
}

.lib-search-box i {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.lib-search-box input {
    width: 100%;
    padding: 9px 14px 9px 38px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.15s ease;
}

.lib-search-box input:focus {
    border-color: var(--color-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12);
}

.lib-platform-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.lib-pill {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.lib-pill:hover {
    border-color: var(--color-blue);
    color: var(--text-primary);
}

.lib-pill.active {
    background: rgba(0, 102, 255, 0.1);
    color: var(--color-blue);
    border-color: rgba(0, 102, 255, 0.3);
    font-weight: 700;
}

[data-theme="dark"] .lib-pill.active {
    background: rgba(56, 189, 248, 0.15);
    color: var(--border-accent);
    border-color: rgba(56, 189, 248, 0.35);
}

/* Library Cards Grid */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 18px;
}

.library-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all 0.2s ease;
}

.library-card:hover {
    border-color: var(--color-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

.lib-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.lib-platform-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--bg-surface-hover);
    color: var(--text-secondary);
    text-transform: uppercase;
}

.lib-badge-tag {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-orange);
}

.lib-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
}

.lib-content-preview-box {
    background: var(--bg-page);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
    font-family: inherit;
}

.lib-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
    margin-top: auto;
}

.btn-copy-template {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    background: rgba(0, 102, 255, 0.1);
    color: var(--color-blue);
    border: 1px solid rgba(0, 102, 255, 0.2);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-copy-template:hover {
    background: var(--color-blue);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.3);
}

.btn-copy-template i { width: 14px; height: 14px; }

.lib-sub-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lib-btn-icon {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: none;
    background: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.lib-btn-icon.btn-lib-del:hover {
    color: var(--color-red);
    background: rgba(239, 68, 68, 0.1);
}

.lib-btn-icon i { width: 14px; height: 14px; }

/* --------------------------------------------------------------------------
   9. Quick Login Modal
   -------------------------------------------------------------------------- */
.modal-login {
    max-width: 440px;
}

.quick-login-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.accounts-selection-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.account-quick-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-page);
    cursor: pointer;
    transition: all 0.15s ease;
}

.account-quick-item:hover {
    border-color: var(--color-blue);
    background: var(--bg-surface-hover);
    transform: translateX(3px);
}

.account-quick-item.active-account {
    border-color: var(--color-blue);
    background: rgba(0, 102, 255, 0.08);
}

.account-quick-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.account-quick-name {
    font-size: 0.88rem;
    font-weight: 700;
}

.account-quick-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.login-divider::before, .login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-subtle);
}

.login-divider span {
    padding: 0 10px;
}

/* --------------------------------------------------------------------------
   10. Modal Common
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    padding: 24px 28px;
    box-shadow: var(--shadow-dropdown);
    transform: scale(0.95);
    transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.open .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-icon-badge {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: rgba(0, 102, 255, 0.1);
    color: var(--color-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon-badge i { width: 16px; height: 16px; }

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.modal-close-btn:hover { color: var(--text-primary); }

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.req { color: var(--color-red); }

.form-group input, .form-group select {
    background-color: var(--bg-page);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 0.88rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.15s ease;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--color-blue);
    background-color: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12);
}

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

.color-picker-row {
    display: flex;
    gap: 12px;
}

.color-option { cursor: pointer; }
.color-option input { display: none; }

.color-swatch {
    display: block;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.color-option input:checked + .color-swatch {
    transform: scale(1.15);
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--bg-surface);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

/* Modal Danger & Safe Delete Confirmation */
.modal-danger {
    border-top: 4px solid var(--color-red);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.12) !important;
    color: var(--color-red) !important;
}

.delete-warning-body {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.delete-target-box {
    margin-top: 14px;
    padding: 12px 16px;
    background-color: var(--bg-page);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.delete-target-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.delete-target-name {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--color-red);
}

.danger-input {
    border: 1px solid var(--border-subtle);
    background-color: var(--bg-page);
    font-weight: 600;
}

.danger-input:focus {
    border-color: var(--color-red) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18) !important;
}

.btn-danger {
    background-color: var(--color-red);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
    border: 1px solid transparent;
}

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.btn-danger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

/* --------------------------------------------------------------------------
   11. Toast Notification
   -------------------------------------------------------------------------- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--text-primary);
    color: var(--bg-sidebar);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-dropdown);
    animation: toast-in 0.2s ease;
    pointer-events: auto;
}

.toast i { color: var(--color-green); }

@keyframes toast-in {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --------------------------------------------------------------------------
   12. Dedicated Enterprise Login Screen
   -------------------------------------------------------------------------- */
.login-screen-wrapper {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-page);
    display: flex;
    flex-direction: column;
    z-index: 2500;
    overflow-y: auto;
    overflow-x: hidden;
}

.login-ambient-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
}

.glow-orb-1 {
    top: -150px;
    left: 20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--color-blue), transparent 70%);
}

.glow-orb-2 {
    bottom: -150px;
    right: 20%;
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, var(--color-purple), transparent 70%);
}

.glow-grid-overlay {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(15, 23, 42, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.6;
}

[data-theme="dark"] .glow-grid-overlay {
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
}

.login-top-bar {
    position: relative;
    z-index: 10;
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.login-domain-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-cyan);
    box-shadow: var(--shadow-card);
}

.login-domain-badge i { width: 15px; height: 15px; }

.live-dot-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--color-green);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: live-pulse 2s infinite;
}

@keyframes live-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.login-center-container {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 20px 50px 20px;
}

.login-card {
    width: 100%;
    max-width: 480px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

[data-theme="dark"] .login-card {
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 102, 255, 0.1);
    background: rgba(19, 27, 46, 0.9);
    backdrop-filter: blur(16px);
}

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

.login-brand-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--color-blue), var(--color-cyan));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.35);
}

.login-brand-logo i { width: 22px; height: 22px; }

.login-brand-titles {
    display: flex;
    flex-direction: column;
}

.login-brand-name {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.login-brand-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.login-welcome-text h2 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.login-welcome-text p {
    font-size: 0.84rem;
    color: var(--text-muted);
}

.login-main-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.field-icon {
    position: absolute;
    left: 12px;
    width: 17px;
    height: 17px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-with-icon input {
    width: 100%;
    padding: 11px 40px 11px 38px;
    background-color: var(--bg-page);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.15s ease;
}

.input-with-icon input:focus {
    border-color: var(--color-blue);
    background-color: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.15);
}

.btn-toggle-pw {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-toggle-pw:hover { color: var(--text-primary); }
.btn-toggle-pw i { width: 16px; height: 16px; }

.label-row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forgot-hint-text {
    font-size: 0.75rem;
    color: var(--color-blue);
    cursor: pointer;
    font-weight: 600;
}

.forgot-hint-text:hover { text-decoration: underline; }

.login-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.remember-me-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.remember-me-checkbox input {
    accent-color: var(--color-blue);
    width: 15px;
    height: 15px;
}

.btn-lg {
    padding: 12px 20px;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
}

/* Quick Accounts Preset Selector */
.quick-accounts-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.quick-accounts-divider {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-accounts-divider::before, .quick-accounts-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-subtle);
}

.quick-accounts-divider span {
    padding: 0 10px;
}

.quick-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-acc-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-page);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-acc-btn:hover {
    background: var(--bg-surface-hover);
    border-color: var(--color-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.1);
}

.quick-acc-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.quick-acc-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.quick-acc-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.quick-acc-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.quick-acc-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-acc-arrow {
    width: 15px;
    height: 15px;
    color: var(--text-muted);
    transition: transform 0.15s ease;
}

.quick-acc-btn:hover .quick-acc-arrow {
    color: var(--color-blue);
    transform: translateX(3px);
}

.login-card-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
}

.login-card-footer i { width: 14px; height: 14px; color: var(--color-green); }

/* --------------------------------------------------------------------------
   13. Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.25);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .sidebar-backdrop.active {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .mobile-menu-trigger {
        display: flex;
    }

    .content-body {
        padding: 20px 18px 40px 18px;
    }

    .header-search-bar {
        width: 180px;
    }

    .header-search-bar input:focus {
        width: 220px;
    }

    .permissions-checkbox-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .top-nav-bar {
        padding: 0 14px;
    }

    .hide-mobile {
        display: none;
    }

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

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

/* --------------------------------------------------------------------------
   10. SSO Intercept & Security Gateway Styles
   -------------------------------------------------------------------------- */
.sso-intercept-banner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    animation: pulseBorder 3s infinite ease-in-out;
}

[data-theme="dark"] .sso-intercept-banner {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.45);
}

@keyframes pulseBorder {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.2); }
    50% { box-shadow: 0 0 16px 2px rgba(245, 158, 11, 0.25); }
}

.sso-intercept-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sso-intercept-icon i {
    width: 20px;
    height: 20px;
}

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

.sso-intercept-title {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #f59e0b;
    margin-bottom: 4px;
}

.sso-intercept-desc {
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 4px;
}

.sso-intercept-desc code {
    background: var(--bg-surface-hover);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.82rem;
    color: var(--color-blue);
    border: 1px solid var(--border-subtle);
}

.sso-intercept-subhint {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.sso-intercept-cancel {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sso-intercept-cancel:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

/* SSO Modal Styles */
.sso-modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sso-architecture-card {
    background: var(--bg-page);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sso-arch-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.sso-step-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-blue);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.sso-badge-alert {
    background: #f59e0b;
}

.sso-badge-check {
    background: var(--color-green);
}

.sso-step-content {
    flex: 1;
}

.sso-step-content strong {
    font-size: 0.88rem;
    color: var(--text-primary);
    display: block;
    margin-bottom: 2px;
}

.sso-step-content p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

.sso-step-content code {
    background: var(--bg-surface);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.8rem;
    border: 1px solid var(--border-subtle);
}

.sso-sim-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sso-sim-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sso-sim-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.sso-sim-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.sso-sim-card:hover {
    border-color: var(--color-blue);
    box-shadow: var(--shadow-sm);
}

.sso-sim-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sso-sim-icon.bg-orange {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.sso-sim-icon.bg-red {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.sso-sim-icon.bg-green {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

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

.sso-sim-info strong {
    display: block;
    font-size: 0.88rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.sso-sim-info span {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.sso-config-preview {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.sso-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    font-weight: 600;
    color: #cbd5e1;
}

.sso-config-header span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sso-code-block {
    margin: 0;
    padding: 14px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #38bdf8;
    background: transparent;
    overflow-x: auto;
    white-space: pre;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 0.74rem;
    border-radius: 4px;
}

.btn-text {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.btn-text:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

