@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-root: #07050d;
    --bg-primary: #0d0b17;
    --bg-card: #131120;
    --bg-input: #0a0814;
    --bg-hover: #1c1929;
    --text-primary: #edeaf8;
    --text-secondary: #7c7994;
    --text-muted: #4d4b64;
    --border: rgba(255,255,255,0.07);
    --accent: #a855f7;
    --accent-dim: #7c3aed;
    --accent-glow: rgba(168,85,247,0.15);
    --border-accent: rgba(168,85,247,0.3);
    --success: #059669;
    --error: #dc2626;
    --warning: #d97706;
    --info: #2563eb;
    --radius: 12px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --density-px: 20px;
    --density-py: 14px;
    --sidebar-w: 240px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.5);
    --sidebar-text: #edeaf8;
    --sidebar-text-dim: #7c7994;
    --sidebar-text-muted: #4d4b64;
    --sidebar-border: rgba(255,255,255,0.07);
    --sidebar-hover: #1c1929;
    --sidebar-active-bg: rgba(168,85,247,0.15);
    --stat-bg: #0d0b17;
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body { font-family: var(--font); background: var(--bg-root); color: var(--text-primary); height: 100vh; overflow: hidden; }

/* ── Layout ── */
.app-layout { display: flex; height: 100vh; overflow: hidden; }
.hidden { display: none !important; }

/* ── Sidebar ── */
.sidebar { width: var(--sidebar-w); background: var(--bg-primary); border-right: 1px solid var(--sidebar-border);
    display: flex; flex-direction: column; flex-shrink: 0; transition: width 0.2s; overflow: hidden; }
.sidebar.collapsed { width: 56px; }
.sidebar.collapsed .sidebar-title, .sidebar.collapsed .nav-link span:last-child,
.sidebar.collapsed .sidebar-footer, .sidebar.collapsed .nav-group-label,
.sidebar.collapsed .nav-divider { display: none; }
.sidebar.collapsed .nav-link { justify-content: center; padding: 10px 0; position: relative; }
.sidebar.collapsed .nav-link .entity-dot { width: 12px; height: 12px; }
.sidebar.collapsed .nav-link:hover::after {
    content: attr(title); position: absolute; left: 60px; top: 50%; transform: translateY(-50%);
    background: var(--bg-secondary); color: var(--text-primary); padding: 4px 10px; border-radius: 6px;
    font-size: 0.8em; white-space: nowrap; z-index: 100; border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3); pointer-events: none;
}
.sidebar-header { display: flex; align-items: center; gap: 10px; padding: 18px 14px 14px;
    border-bottom: 1px solid var(--sidebar-border); min-height: 60px; }
.sidebar-icon { font-size: 1.4em; flex-shrink: 0; }
.sidebar-title { font-weight: 700; font-size: 0.92em; color: var(--sidebar-text); white-space: nowrap; flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sidebar-toggle { background: none; border: none; color: var(--sidebar-text-muted); cursor: pointer; padding: 4px; font-size: 1em; flex-shrink: 0; }
.sidebar-toggle:hover { color: var(--sidebar-text); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 8px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-md);
    color: var(--sidebar-text-dim); text-decoration: none; font-size: 0.88em; font-weight: 500;
    transition: background 0.15s, color 0.15s; white-space: nowrap; }
.nav-link:hover { background: var(--sidebar-hover); color: var(--sidebar-text); }
.nav-link.active { background: var(--sidebar-active-bg); color: var(--accent); }
.nav-divider { height: 1px; background: var(--sidebar-border); margin: 8px 0; }
.entity-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sidebar-footer { padding: 10px 12px; border-top: 1px solid var(--sidebar-border); display: flex; flex-direction: column; gap: 4px; }
.footer-link { font-size: 0.76em; color: var(--sidebar-text-muted); text-decoration: none; }
.footer-link:hover { color: var(--accent); }

/* ── Main ── */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.top-bar { display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; height: 60px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.top-bar-left { display: flex; align-items: center; gap: 12px; }
.top-bar-right { display: flex; align-items: center; gap: 10px; }
.page-title { font-size: 1.15em; font-weight: 700; color: var(--text-primary); }
.page-sub { font-size: 0.78em; color: var(--text-secondary); margin-top: 1px; }
.item-count { background: var(--accent-glow); color: var(--accent); border: 1px solid var(--border-accent);
    border-radius: 12px; padding: 2px 10px; font-size: 0.78em; font-weight: 600; }
.breadcrumbs { display: flex; gap: 4px; align-items: center; font-size: 0.82em; }
.breadcrumbs:empty { display: none; }
.breadcrumbs a { color: var(--accent); cursor: pointer; text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { color: var(--text-muted); }

/* ── Search ── */
.search-bar { display: flex; align-items: center; gap: 8px; padding: 10px 24px;
    border-bottom: 1px solid var(--border); flex-shrink: 0; }
.search-icon { color: var(--text-muted); }
.search-input { background: none; border: none; outline: none; color: var(--text-primary);
    font-size: 0.9em; font-family: var(--font); flex: 1; }
.search-input::placeholder { color: var(--text-muted); }

/* ── Stats Bar ── */
.stats-bar { display: flex; gap: 1px; background: var(--border); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.stat-card { flex: 1; background: var(--stat-bg); padding: 12px 20px; text-align: center; }
.stat-value { font-size: 1.4em; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.74em; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.3px; }

/* ── Content scrollable area ── */
.main-content > .card, .main-content > .cards-grid, .main-content > .kanban-board,
.main-content > .feed-list, .main-content > .messaging-wrap,
.main-content > .dash-stats, .main-content > .recent-activity, .main-content > .data-table-section,
#data-card, .main-content > .p-6 { flex: 1; overflow-y: auto; margin: 16px; }
.data-table-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

/* ── Card ── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 0.92em; }
.empty-hint { color: var(--text-muted); font-size: 0.88em; padding: 32px; text-align: center; }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88em; }
.data-table thead { position: sticky; top: 0; z-index: 2; }
.th { background: var(--bg-card); color: var(--text-secondary); font-weight: 600; text-align: left;
    padding: var(--density-py) var(--density-px); font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.4px;
    border-bottom: 2px solid var(--border); cursor: pointer; user-select: none; white-space: nowrap; }
.th:hover { color: var(--accent); }
.td { padding: var(--density-py) var(--density-px); border-bottom: 1px solid var(--border); color: var(--text-primary);
    max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-row:hover .td { background: var(--bg-hover); cursor: pointer; }
.td.actions { white-space: nowrap; text-align: right; }

/* ── Badges ── */
.badge { display: inline-block; padding: 2px 9px; border-radius: var(--radius-full); font-size: 0.76em; font-weight: 600; white-space: nowrap; }
.badge-green { background: rgba(16,185,129,0.15); color: #10b981; }
.badge-yellow { background: rgba(245,158,11,0.15); color: #f59e0b; }
.badge-red { background: rgba(239,68,68,0.15); color: #ef4444; }
.badge-blue { background: rgba(59,130,246,0.15); color: #3b82f6; }
.badge-gray { background: rgba(100,116,139,0.15); color: #94a3b8; }

/* ── FK Link ── */
.fk-link { color: var(--accent); text-decoration: none; cursor: pointer; }
.fk-link:hover { text-decoration: underline; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 4px; padding: 7px 14px; border-radius: var(--radius-md);
    font-weight: 600; font-size: 0.85em; cursor: pointer; border: none; transition: all 0.15s; font-family: var(--font); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dim); }
.btn-secondary { background: var(--bg-hover); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: none; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-hover); }
.btn-sm { padding: 4px 10px; font-size: 0.78em; }
.w-full { width: 100%; justify-content: center; }
.action-btn { background: none; border: 1px solid var(--border); color: var(--text-secondary);
    border-radius: 6px; padding: 3px 9px; cursor: pointer; font-size: 0.8em; font-family: var(--font); transition: all 0.15s; }
.action-btn:hover { border-color: var(--accent); color: var(--accent); }
.action-btn.danger:hover { border-color: var(--error); color: var(--error); }
.drill-btn { background: none; border: 1px solid var(--border); color: var(--accent);
    border-radius: 6px; padding: 3px 8px; cursor: pointer; font-size: 0.85em; transition: all 0.15s; margin-left: 4px; }
.drill-btn:hover { background: var(--accent-glow); }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.82em; font-weight: 600; color: var(--text-secondary);
    margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.3px; }
.form-input { width: 100%; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 9px 12px; color: var(--text-primary); font-size: 0.9em;
    font-family: var(--font); outline: none; transition: border-color 0.15s; }
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; min-height: 80px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ── Typeahead ── */
.typeahead-wrap { position: relative; }
.typeahead-drop { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 100;
    background: var(--bg-card); border: 1px solid var(--border-accent); border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg); max-height: 220px; overflow-y: auto; }
.typeahead-item { padding: 9px 14px; cursor: pointer; font-size: 0.88em; color: var(--text-primary); transition: background 0.1s; }
.typeahead-item:hover { background: var(--accent-glow); color: var(--accent); }

/* ── Modals ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex;
    align-items: center; justify-content: center; z-index: 50; backdrop-filter: blur(4px); }
.modal-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
    width: 520px; max-width: calc(100vw - 40px); max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow-lg); animation: modalIn 0.2s ease; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px 16px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-weight: 700; font-size: 1em; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.4em; line-height: 1; }
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 20px 24px; }
.modal-footer { display: flex; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--border); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-grid .col-span-2 { grid-column: 1 / -1; }
.detail-grid label { font-size: 0.76em; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; display: block; margin-bottom: 3px; }
.detail-grid .detail-val { font-size: 0.9em; color: var(--text-primary); word-break: break-word; }

/* ── Auth ── */
.auth-screen { position: fixed; inset: 0; background: var(--bg-root); display: flex;
    align-items: center; justify-content: center; z-index: 100; }
.auth-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px;
    padding: 40px 36px; width: 380px; max-width: calc(100vw - 40px); box-shadow: var(--shadow-lg); }
.auth-icon { font-size: 2.5em; text-align: center; margin-bottom: 12px; }
.auth-title { font-size: 1.3em; font-weight: 700; text-align: center; margin-bottom: 4px; }
.auth-sub { color: var(--text-muted); font-size: 0.88em; text-align: center; margin-bottom: 4px; }
.auth-toggle-row { text-align: center; font-size: 0.84em; color: var(--text-muted); margin-top: 16px; }
.auth-error { color: var(--error); font-size: 0.84em; margin-top: 10px; text-align: center; min-height: 20px; }
.space-y-4 > * + * { margin-top: 16px; }

/* ── User Menu ── */
.user-menu { position: relative; }
.user-btn { background: var(--bg-hover); border: 1px solid var(--border); border-radius: 8px;
    padding: 6px 10px; cursor: pointer; display: flex; align-items: center; gap: 8px;
    font-family: var(--font); font-size: 0.85em; color: var(--text-primary); }
.user-btn:hover { border-color: var(--accent); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-glow);
    color: var(--accent); display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.82em; border: 1px solid var(--border-accent); flex-shrink: 0; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--bg-card);
    border: 1px solid var(--border); border-radius: 10px; min-width: 160px; z-index: 50;
    box-shadow: var(--shadow-lg); display: none; }
.user-menu.open .dropdown-menu { display: block; }
.dropdown-item { display: block; width: 100%; padding: 9px 14px; background: none; border: none;
    color: var(--text-primary); font-size: 0.88em; cursor: pointer; text-align: left; font-family: var(--font); }
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item.danger:hover { background: rgba(239,68,68,0.1); color: var(--error); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Toast ── */
.toast { position: fixed; bottom: 24px; right: 24px; padding: 12px 18px; border-radius: 10px;
    font-size: 0.88em; font-weight: 600; z-index: 200; opacity: 0; transform: translateY(8px);
    transition: opacity 0.25s, transform 0.25s; pointer-events: none; }

/* ── Cards Grid ── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; padding: 4px; }
.visual-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; cursor: pointer; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow-sm); }
.visual-card:hover { border-color: var(--border-accent); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-thumb { height: 120px; background: var(--accent-glow); display: flex; align-items: center;
    justify-content: center; font-size: 2.5em; color: var(--accent); opacity: 0.7; }
.card-body { padding: 14px 16px; }
.card-foot { display: flex; justify-content: space-between; align-items: center;
    padding: 8px 16px; border-top: 1px solid var(--border); gap: 6px; }

/* ── Kanban ── */
.kanban-board { display: flex; gap: 14px; overflow-x: auto; padding: 4px; min-height: 300px; align-items: flex-start; }
.kanban-col { flex: 1; min-width: 250px; max-width: 340px; background: var(--stat-bg);
    border: 1px solid var(--border); border-radius: var(--radius); }
.kanban-col-header { padding: 12px 14px; font-weight: 600; font-size: 0.88em;
    border-bottom: 2px solid var(--border); display: flex; justify-content: space-between; }
.kanban-col-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 100px; }
.kanban-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
    padding: 12px; cursor: pointer; transition: border-color 0.15s; }
.kanban-card:hover { border-color: var(--border-accent); }

/* ── Feed ── */
.feed-list { display: flex; flex-direction: column; gap: 0; padding: 4px; }
.feed-entry { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 20px; margin-bottom: 10px; transition: border-color 0.15s; }
.feed-entry:hover { border-color: var(--border-accent); }

/* ── Messaging ── */
.messaging-wrap { display: flex; flex-direction: column; flex: 1; overflow: hidden; margin: 16px; }
.message-thread { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.message-input-bar { display: flex; gap: 8px; padding: 12px 16px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius); margin-top: 8px; }
.message-input-bar input { flex: 1; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: 20px; padding: 9px 16px; color: var(--text-primary); font-size: 0.9em;
    font-family: var(--font); outline: none; }
.message-input-bar input:focus { border-color: var(--accent); }
.message-input-bar button { background: var(--accent); color: white; border: none; border-radius: 20px;
    padding: 9px 20px; font-weight: 600; cursor: pointer; font-family: var(--font); }

/* ── Dashboard ── */
.dash-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.dash-stat-card { background: var(--bg-card); border: 1px solid var(--border); border-top: 3px solid var(--accent);
    border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow-sm); }
.dash-stat-value { font-size: 2em; font-weight: 700; color: var(--accent); }
.dash-stat-label { font-size: 0.8em; color: var(--text-muted); margin-top: 4px; }
.recent-activity { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.activity-header { padding: 14px 20px; font-weight: 600; font-size: 0.9em; border-bottom: 1px solid var(--border); }
.activity-item { display: flex; align-items: center; gap: 10px; padding: 10px 20px;
    border-bottom: 1px solid var(--border); font-size: 0.87em; }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

/* ── Empty State ── */
.empty-state { padding: 48px 24px; text-align: center; }
.empty-state-icon { font-size: 2.5em; display: block; margin-bottom: 10px; }
.empty-state-title { font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.empty-state-hint { font-size: 0.84em; color: var(--text-muted); }

/* ── Google-style Search App ── */
.g-app { background: var(--bg-root); min-height: 100vh; }
.g-home { min-height: 100vh; display: flex; flex-direction: column; align-items: center;
    justify-content: center; position: relative; }
.g-home-inner { display: flex; flex-direction: column; align-items: center; gap: 24px;
    width: 100%; max-width: 580px; padding: 0 16px; margin-top: -80px; }
.g-home-logo { font-size: 3rem; font-weight: 700; letter-spacing: -1px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dim));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.g-home-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.g-btn { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border);
    border-radius: 4px; padding: 9px 18px; font-size: 0.88em; font-family: var(--font);
    cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.g-btn:hover { background: var(--bg-hover); border-color: var(--border-accent); }
.g-btn-ghost { color: var(--text-secondary); }
.g-home .user-menu { position: absolute; top: 16px; right: 20px; }
.g-search-wrap { display: flex; align-items: center; gap: 10px; width: 100%; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: 24px; padding: 10px 16px;
    box-shadow: var(--shadow-sm); transition: box-shadow 0.2s, border-color 0.2s; }
.g-search-wrap:hover, .g-search-wrap:focus-within { box-shadow: var(--shadow-md); border-color: var(--border-accent); }
.g-search-wrap.compact { border-radius: 24px; padding: 8px 14px; box-shadow: none; }
.g-search-wrap.compact:hover, .g-search-wrap.compact:focus-within { box-shadow: var(--shadow-sm); }
.g-search-icon { color: var(--text-muted); font-size: 1em; flex-shrink: 0; }
.g-input { flex: 1; background: none; border: none; outline: none; font-size: 1rem;
    color: var(--text-primary); font-family: var(--font); min-width: 0; }
.g-input::placeholder { color: var(--text-muted); }
.g-clear-btn { background: none; border: none; color: var(--text-muted); font-size: 1.2em;
    cursor: pointer; padding: 0 2px; line-height: 1; flex-shrink: 0; }
.g-clear-btn:hover { color: var(--text-primary); }
.g-header { display: flex; align-items: center; gap: 16px; padding: 12px 20px;
    border-bottom: 1px solid var(--border); background: var(--bg-card); position: sticky; top: 0; z-index: 10; }
.g-header-logo { width: 36px; height: 36px; border-radius: 50%; background: var(--accent);
    color: #fff; font-weight: 700; font-size: 1.1em; display: flex; align-items: center;
    justify-content: center; flex-shrink: 0; cursor: pointer; user-select: none; }
.g-header .g-search-wrap { max-width: 560px; flex: 1; }
.g-header .user-menu { margin-left: auto; flex-shrink: 0; }
.g-tabs { display: flex; padding: 0 20px; border-bottom: 1px solid var(--border); background: var(--bg-card); }
.g-tab { background: none; border: none; border-bottom: 3px solid transparent; color: var(--text-muted);
    font-family: var(--font); font-size: 0.88em; padding: 12px 16px; cursor: pointer;
    transition: color 0.15s; margin-bottom: -1px; }
.g-tab:hover { color: var(--text-primary); }
.g-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }
.g-main { max-width: 680px; padding: 16px 24px 48px; }
.g-count { font-size: 0.82em; color: var(--text-muted); margin-bottom: 16px; }
.g-results { display: flex; flex-direction: column; gap: 28px; }
.g-result { max-width: 600px; }
.g-result-domain { display: flex; align-items: center; gap: 8px; font-size: 0.82em; color: var(--text-muted); margin-bottom: 4px; }
.g-favicon { width: 18px; height: 18px; border-radius: 4px; background: var(--accent-glow);
    border: 1px solid var(--border); font-size: 0.7em; font-weight: 700; color: var(--accent);
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.g-result-title { font-size: 1.1em; font-weight: 400; color: var(--accent); cursor: pointer; line-height: 1.3; margin-bottom: 3px; display: block; text-decoration: none; }
.g-result-title:hover { text-decoration: underline; }
.g-result-url { font-size: 0.82em; color: #34a853; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-result-snippet { font-size: 0.9em; color: var(--text-secondary); line-height: 1.58; }
.g-result-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.g-result-cat { font-size: 0.78em; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: 12px; padding: 2px 10px; color: var(--text-muted); }
.g-result-tag { font-size: 0.78em; color: var(--text-muted); }
.g-no-results { padding: 24px 0; color: var(--text-secondary); font-size: 0.95em; line-height: 1.7; }
.g-loading { display: flex; gap: 8px; padding: 32px 0; }
.g-loading span { width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
    animation: g-bounce 1.2s ease-in-out infinite; }
.g-loading span:nth-child(2) { animation-delay: 0.15s; }
.g-loading span:nth-child(3) { animation-delay: 0.3s; }
.g-loading span:nth-child(4) { animation-delay: 0.45s; }
@keyframes g-bounce { 0%,80%,100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

/* ── Animations ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ═══════════════════════════════════════════════════════════════════════════
   TOPNAV SHELL — Salesforce Lightning-style horizontal navigation
   Used by: crm, hr_platform, erp, saas_platform (shell=topnav in DNA)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Root layout: full-height column, header → tabbar → main */
.topnav-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-root);
}

/* ── Global Header ── */
.global-header {
    display: flex;
    align-items: center;
    height: 52px;
    flex-shrink: 0;
    background: var(--bg-primary);          /* #032D60 deep navy for CRM */
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 0 16px;
    gap: 12px;
    z-index: 100;
}
.gh-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.gh-launcher {
    font-size: 18px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    letter-spacing: 2px;
    line-height: 1;
}
.gh-launcher:hover { background: rgba(255,255,255,0.12); color: #fff; }
.gh-appname {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.gh-search {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    max-width: 420px;
    margin: 0 auto;
    gap: 8px;
    height: 32px;
    border: 1px solid rgba(255,255,255,0.15);
    transition: background 0.15s, border-color 0.15s;
}
.gh-search:focus-within {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.35);
}
.gh-search-icon { color: rgba(255,255,255,0.6); font-size: 13px; }
.gh-search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.85rem;
}
.gh-search-input::placeholder { color: rgba(255,255,255,0.5); }
.gh-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.gh-icon-btn {
    padding: 6px 8px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 15px;
}
.gh-icon-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
/* Reuse user-menu / avatar styles from sidebar shell — same .user-btn, .avatar, .dropdown-menu */
.global-header .user-btn { color: rgba(255,255,255,0.87); }
.global-header .user-btn:hover { background: rgba(255,255,255,0.1); }
.global-header .avatar {
    background: var(--accent);
    color: #fff;
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
}
.global-header #user-display { color: rgba(255,255,255,0.87); font-size: 0.85rem; }

/* ── Object Tab Bar ── */
.obj-tabbar {
    display: flex;
    align-items: stretch;
    height: 40px;
    flex-shrink: 0;
    background: var(--bg-primary);
    border-bottom: 2px solid var(--border);
    padding: 0 16px;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}
.obj-tabbar::-webkit-scrollbar { display: none; }
.obj-tab {
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.12s, border-color 0.12s;
    cursor: pointer;
}
.obj-tab:hover { color: #fff; border-bottom-color: rgba(255,255,255,0.4); }
.obj-tab.active {
    color: #fff;
    border-bottom-color: var(--accent);
    font-weight: 600;
}
.obj-tab-spacer { flex: 1; }
.obj-tab-util { color: rgba(255,255,255,0.4); font-size: 0.75rem; }

/* ── Main Content Area ── */
.tn-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-root);
}
/* Toolbar: view title + action buttons */
.tn-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 8px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}
.tn-toolbar-left { display: flex; align-items: center; gap: 10px; }
.tn-view-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
/* Stats strip */
.tn-stats {
    display: flex;
    gap: 1px;
    background: var(--border);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.tn-stats .stat-card {
    flex: 1;
    background: var(--stat-bg);
    padding: 10px 20px;
}
/* Content cards fill remaining space */
.tn-main > .card,
.tn-main > .cards-grid,
.tn-main > .kanban-board,
.tn-main > .feed-list,
.tn-main > .dash-stats,
.tn-main > .recent-activity,
#data-card.tn-main > *,
.tn-main > .p-6 {
    flex: 1;
    overflow-y: auto;
    margin: 16px;
}
/* JS sets #data-card as child of .tn-main — make it fill */
.tn-main #data-card { flex: 1; overflow-y: auto; margin: 16px; }

/* Object tab switching — JS sets .active on .obj-tab, mirrors .nav-link behaviour */
.obj-tab[data-model] { cursor: pointer; }

/* ── Game Shell (replaces sidebar shell for game/designer layouts) ──────── */
.game-shell {
    display: flex; flex-direction: column; height: 100vh; overflow: hidden;
    background: var(--bg-root);
}
.game-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; height: 56px; flex-shrink: 0;
    background: var(--bg-primary); border-bottom: 1px solid var(--border);
}
.game-topbar-left { display: flex; align-items: center; gap: 12px; }
.game-topbar-icon { font-size: 1.5em; }
.game-topbar-title {
    font-size: 1.1em; font-weight: 700; color: var(--text-primary);
    letter-spacing: -0.3px;
}
.game-topbar-right { display: flex; align-items: center; gap: 12px; }
.game-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

/* ── Designer Layout ─────────────────────────────────────────────────────── */
.designer-layout {
    display: flex; flex: 1; overflow: hidden; margin: 16px; gap: 16px;
}
.designer-sidebar {
    width: 320px; flex-shrink: 0; overflow-y: auto;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.designer-component-list { padding: 0; }
.designer-section { border-bottom: 1px solid var(--border); }
.designer-section:last-child { border-bottom: none; }
.designer-section-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; font-weight: 600; font-size: 0.88em;
    cursor: pointer; user-select: none; color: var(--text-primary);
}
.designer-section-header:hover { background: var(--bg-hover); }
.designer-section-count {
    font-size: 0.78em; color: var(--text-muted); font-weight: 400;
}
.designer-section.collapsed .designer-section-body { display: none; }
.designer-section-body { padding: 8px 16px 16px; }
.designer-field-group { margin-bottom: 14px; }
.designer-field-group:last-child { margin-bottom: 0; }
.designer-field-label {
    font-size: 0.75em; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px;
}
.designer-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.designer-chip {
    padding: 6px 12px; border-radius: var(--radius-full, 9999px);
    background: var(--bg-hover); border: 1px solid var(--border);
    font-size: 0.82em; cursor: pointer; transition: all 0.15s;
    font-family: inherit; color: var(--text-primary);
}
.designer-chip:hover { border-color: var(--accent); color: var(--accent); }
.designer-chip.selected {
    background: var(--accent); color: #fff; border-color: var(--accent);
}
.designer-canvas {
    flex: 1; display: flex; flex-direction: column; gap: 16px; overflow-y: auto;
}
.designer-preview {
    flex-shrink: 0; min-height: 320px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative;
}
.designer-preview-grid {
    display: flex; flex-wrap: wrap; gap: 20px; padding: 24px;
    justify-content: center; align-items: flex-start; width: 100%;
}
.designer-preview-slot {
    background: var(--bg-input, var(--bg-hover)); border: 2px dashed var(--border);
    border-radius: var(--radius-md); padding: 16px; text-align: center;
    min-width: 140px; transition: all 0.2s;
}
.designer-preview-slot.filled {
    border-style: solid; border-color: var(--accent);
    background: var(--accent-glow);
}
.designer-preview-slot-label {
    font-size: 0.72em; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.3px; margin-bottom: 4px;
}
.designer-preview-slot-value {
    font-weight: 600; font-size: 0.9em; color: var(--text-primary);
}
.designer-saved {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 16px;
}
.designer-saved-header {
    font-weight: 600; font-size: 0.9em; margin-bottom: 12px;
    padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.designer-saved-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.designer-saved-card {
    background: var(--bg-hover); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 12px; cursor: pointer;
    transition: all 0.2s;
}
.designer-saved-card:hover {
    border-color: var(--accent); transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}
.designer-saved-card-name { font-weight: 600; font-size: 0.88em; margin-bottom: 4px; }
.designer-saved-card-meta { font-size: 0.76em; color: var(--text-muted); }

/* ── Game Layout ─────────────────────────────────────────────────────────── */
.game-layout {
    display: flex; flex-direction: column; flex: 1; overflow: hidden;
    margin: 16px; gap: 12px;
}
.game-header {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 12px 20px; flex-shrink: 0;
}
.game-score { font-size: 1.2em; font-weight: 700; color: var(--accent); }
.game-level { font-size: 0.9em; color: var(--text-secondary); }
.game-status { font-size: 0.88em; color: var(--text-muted); }
.game-main { display: flex; flex: 1; gap: 16px; overflow: hidden; }
.game-board {
    flex: 1; overflow-y: auto; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px;
}
.game-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.game-card {
    background: var(--bg-hover); border: 2px solid var(--border);
    border-radius: var(--radius-md); padding: 16px; text-align: center;
    cursor: pointer; transition: all 0.2s;
}
.game-card:hover {
    border-color: var(--accent); transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}
.game-card-icon { font-size: 2em; margin-bottom: 8px; }
.game-card-title { font-weight: 600; font-size: 0.88em; }
.game-card-rarity {
    font-size: 0.74em; color: var(--accent); margin-top: 6px;
    text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
}
.game-card-meta { font-size: 0.76em; color: var(--text-muted); margin-top: 4px; }
.game-info {
    width: 260px; flex-shrink: 0; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    overflow-y: auto; padding: 16px;
}
.game-info-header {
    font-weight: 600; font-size: 0.9em; margin-bottom: 12px;
    padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.game-challenge {
    padding: 10px 12px; border: 1px solid var(--border);
    border-radius: var(--radius-md); margin-bottom: 8px;
    font-size: 0.85em; cursor: pointer; transition: all 0.15s;
}
.game-challenge:hover { border-color: var(--accent); background: var(--bg-hover); }
.game-challenge-title { font-weight: 600; }
.game-challenge-meta { font-size: 0.76em; color: var(--text-muted); margin-top: 4px; }

/* Rarity colors */
.rarity-common { border-color: #94a3b8; }
.rarity-uncommon { border-color: #10b981; }
.rarity-rare { border-color: #3b82f6; }
.rarity-epic { border-color: #a855f7; }
.rarity-legendary { border-color: #f59e0b; }

/* ── Hazard At-a-Glance (AreaMap) ── */
.hazard-glance { display: flex; flex-direction: column; gap: 16px; padding: 8px 0; }

.hazard-alert {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 18px; border-radius: var(--radius);
    border-left: 4px solid; animation: fadeIn 0.3s ease-out;
}
.hazard-alert-high {
    background: rgba(239, 68, 68, 0.08); border-color: #ef4444; color: #fca5a5;
}
.hazard-alert-moderate {
    background: rgba(245, 158, 11, 0.08); border-color: #f59e0b; color: #fcd34d;
}
.hazard-alert-icon { font-size: 1.3em; flex-shrink: 0; margin-top: 1px; }
.hazard-alert-body { display: flex; flex-direction: column; gap: 2px; }
.hazard-alert-body strong { font-size: 0.9em; font-weight: 600; color: inherit; }
.hazard-alert-body span { font-size: 0.82em; color: var(--text-secondary); line-height: 1.4; }

.hazard-cards { display: flex; flex-direction: column; gap: 16px; }

.hazard-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.hazard-card:hover {
    border-color: var(--accent); box-shadow: 0 0 20px rgba(168, 85, 247, 0.1);
}

.hazard-card-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.hazard-card-address { font-size: 1.05em; font-weight: 600; color: var(--text-primary); }
.hazard-card-city { font-size: 0.85em; color: var(--text-secondary); margin-top: 2px; }
.hazard-card-coords { font-size: 0.75em; color: var(--text-muted); font-family: monospace; white-space: nowrap; margin-top: 2px; }

.hazard-gauges {
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 16px;
}
.hazard-gauge { display: flex; flex-direction: column; gap: 6px; }
.hazard-gauge-label { font-size: 0.78em; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.hazard-gauge-value { font-size: 0.95em; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.hazard-gauge-bar {
    height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden;
}
.hazard-gauge-fill {
    height: 100%; border-radius: 3px; transition: width 0.6s ease-out;
}

.hazard-details {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px;
}
.hazard-detail-block {
    background: rgba(255,255,255,0.02); border-radius: var(--radius-sm);
    padding: 10px 12px; border: 1px solid rgba(255,255,255,0.04);
}
.hazard-detail-title {
    font-size: 0.75em; font-weight: 600; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px;
}
.hazard-detail-text {
    font-size: 0.82em; color: var(--text-secondary); line-height: 1.5;
}

.hazard-card-footer {
    display: flex; align-items: center; gap: 8px;
    padding-top: 12px; border-top: 1px solid var(--border);
}
.hazard-badge {
    font-size: 0.7em; font-weight: 600; padding: 3px 8px;
    border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: 0.04em;
}

@media (max-width: 768px) {
    .hazard-gauges, .hazard-details { grid-template-columns: 1fr; }
}

/* ── View Action Bar ── */
.view-action-bar { display: flex; align-items: center; gap: 12px; padding: 10px 0 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.view-action-bar .btn-outline { border: 1px solid var(--accent); color: var(--accent); background: transparent; padding: 8px 18px; border-radius: var(--radius-md); font-weight: 600; font-size: 0.85em; cursor: pointer; transition: all 0.15s; }
.view-action-bar .btn-outline:hover { background: var(--accent); color: #fff; }
.view-action-hint { font-size: 0.78em; color: var(--text-muted); }

/* ── Sidebar Group Labels ── */
.nav-group-label {
    font-size: 0.65em; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--text-muted); padding: 12px 16px 4px;
}

/* ── Rate Comparison Panel ── */
.rate-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rate-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 14px; text-align: center; transition: border-color 0.2s; position: relative;
}
.rate-card:hover { border-color: var(--accent); }
.rate-best { border-color: #10b981; box-shadow: 0 0 12px rgba(16, 185, 129, 0.15); }
.rate-best-badge {
    position: absolute; top: -1px; right: 12px;
    background: #10b981; color: #fff; font-size: 0.6em; font-weight: 700; letter-spacing: 0.05em;
    padding: 3px 10px; border-radius: 0 0 6px 6px;
}
.rate-vendor { font-size: 0.9em; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.rate-rating { font-size: 0.7em; color: var(--text-muted); margin-bottom: 8px; }
.rate-price { font-size: 1.4em; font-weight: 700; color: var(--accent); }
.rate-period { font-size: 0.5em; font-weight: 400; color: var(--text-secondary); }
.rate-annual { font-size: 0.78em; color: var(--text-secondary); margin-bottom: 8px; }
.rate-coverage { font-size: 0.72em; color: var(--text-muted); line-height: 1.4; }
.rate-deductible { font-size: 0.7em; color: var(--text-muted); margin-top: 4px; }
.rate-description {
    font-size: 0.72em; color: var(--text-secondary); line-height: 1.5;
    margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); text-align: left;
}
.rate-savings {
    font-size: 0.7em; font-weight: 600; color: #10b981; margin-top: 6px;
    padding: 4px 8px; background: rgba(16,185,129,0.08); border-radius: 4px;
}
.rate-inputs {
    margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); text-align: left;
}
.rate-section-label {
    font-size: 0.68em; font-weight: 700; color: var(--accent); text-transform: uppercase;
    letter-spacing: 0.06em; margin: 10px 0 6px; padding-top: 8px; border-top: 1px solid var(--border);
}
.rate-section-label:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.rate-input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rate-input-group { margin-bottom: 6px; }
.rate-input-group label {
    display: block; font-size: 0.65em; color: var(--text-muted); margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.04em;
}
.rate-input {
    width: 100%; padding: 6px 8px; font-size: 0.78em; border: 1px solid var(--border);
    border-radius: 4px; background: var(--bg-input, var(--bg-card)); color: var(--text-primary);
    box-sizing: border-box; font-family: var(--font);
}
.rate-input:focus { outline: none; border-color: var(--accent); }
select.rate-input { cursor: pointer; }
.rate-quote-btn {
    width: 100%; margin-top: 8px; font-size: 0.78em; padding: 7px 0; transition: all 0.2s;
}
.rate-quoted { opacity: 0.85; }

/* ── Bundle Cards ── */
.bundle-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; padding: 8px 0; }
.bundle-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 20px; transition: border-color 0.2s;
}
.bundle-card:hover { border-color: var(--accent); }
.bundle-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.bundle-name { font-size: 1em; font-weight: 600; color: var(--text-primary); }
.bundle-discount {
    font-size: 0.75em; font-weight: 700; padding: 3px 10px; border-radius: 20px;
}
.bundle-lines { margin-bottom: 14px; }
.bundle-line {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 0.82em;
}
.bundle-line:last-child { border-bottom: none; }
.bundle-line-type { color: var(--text-muted); text-transform: capitalize; min-width: 80px; }
.bundle-line-vendor { color: var(--text-primary); font-weight: 500; flex: 1; text-align: center; }
.bundle-line-price { color: var(--text-secondary); min-width: 70px; text-align: right; }
.bundle-pricing { text-align: center; padding: 12px 0; border-top: 1px solid var(--border); }
.bundle-base { font-size: 0.78em; color: var(--text-muted); margin-bottom: 4px; }
.bundle-base s { color: var(--text-muted); }
.bundle-save { font-size: 0.78em; font-weight: 600; color: #10b981; margin-bottom: 8px; }
.bundle-net { font-size: 1.6em; font-weight: 700; color: var(--accent); }
.bundle-annual { font-size: 0.82em; color: var(--text-secondary); margin-bottom: 8px; }
.bundle-description {
    font-size: 0.75em; color: var(--text-secondary); line-height: 1.5;
    padding: 10px 0; border-top: 1px solid var(--border);
}
.bundle-inputs { padding-top: 10px; border-top: 1px solid var(--border); }
.bundle-cross-badge {
    font-size: 0.6em; font-weight: 700; color: #ec4899; text-transform: uppercase;
    letter-spacing: 0.06em; margin-top: 2px;
}
.bundle-platform {
    display: block; font-size: 0.82em; color: var(--text-muted); font-weight: 400;
}
.bundle-line-note {
    font-size: 0.72em; color: var(--text-muted); padding: 2px 0 6px 80px;
    font-style: italic; line-height: 1.3;
}
.bundle-carriers-count {
    font-size: 0.72em; color: var(--text-muted); text-align: center;
    padding: 4px 0; text-transform: uppercase; letter-spacing: 0.04em;
}

/* ── Prospect Pipeline ── */
.prospect-pipeline { display: flex; flex-direction: column; gap: 12px; }
.prospect-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-left: 4px solid var(--text-muted); border-radius: var(--radius);
    padding: 16px; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s;
}
.prospect-card:hover { box-shadow: 0 0 16px rgba(168,85,247,0.1); }
.prospect-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.prospect-name { font-size: 1em; font-weight: 600; color: var(--text-primary); }
.prospect-address { font-size: 0.82em; color: var(--text-secondary); margin-top: 2px; }
.prospect-contact { font-size: 0.78em; color: var(--text-muted); margin-top: 2px; }
.prospect-source { font-size: 0.7em; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; }
.prospect-reason {
    font-size: 0.82em; color: var(--text-secondary); line-height: 1.4;
    padding: 8px 10px; background: rgba(255,255,255,0.02); border-radius: var(--radius-sm);
    margin-bottom: 10px; border-left: 2px solid var(--text-muted);
}
.viability-badge {
    font-size: 0.7em; font-weight: 600; padding: 3px 10px;
    border-radius: var(--radius-full); display: inline-block;
}
.prospect-card-body { margin-bottom: 10px; }
.carrier-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.carrier-pill {
    font-size: 0.75em; padding: 3px 10px; border-radius: var(--radius-full);
    background: rgba(168,85,247,0.1); color: #c4b5fd; font-weight: 500;
}
.property-thumbs { display: flex; gap: 8px; margin-top: 10px; }
.property-thumb {
    width: 80px; height: 60px; object-fit: cover; border-radius: var(--radius-sm);
    border: 1px solid var(--border); opacity: 0.85; transition: opacity 0.2s;
}
.property-thumb:hover { opacity: 1; }
.prospect-card-footer {
    display: flex; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border);
}

/* ── Prospect DB Search Results ── */
.prospect-db-result {
    padding: 10px; border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.prospect-db-result:hover { background: var(--bg-hover); }
.prospect-db-result:last-child { border-bottom: none; }

/* ── App Health ── */
.health-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.health-metric {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 12px; background: rgba(255,255,255,0.02);
    border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.04);
}
.health-metric-label { font-size: 0.78em; color: var(--text-muted); }
.health-metric-value { font-size: 0.85em; font-weight: 600; color: var(--text-primary); }

/* ── Role Visibility ── */
.role-customer .agent-only { display: none !important; }
.role-customer .admin-only { display: none !important; }
.role-agent .customer-only { display: none !important; }
.role-agent:not(.role-admin) .admin-only { display: none !important; }

/* ── Auth Tabs ── */
.auth-tabs {
    display: flex; gap: 4px; margin-bottom: 24px; background: var(--bg-root); border-radius: 10px; padding: 4px;
}
.auth-tab {
    flex: 1; padding: 12px 16px; text-align: center; cursor: pointer;
    font-size: 0.9em; font-weight: 600; color: var(--text-muted);
    background: transparent; border: none; border-radius: 8px;
    transition: all 0.2s;
}
.auth-tab:hover { color: var(--text-secondary); background: rgba(255,255,255,0.05); }
.auth-tab.active { color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.auth-tab[data-role="agent"].active { background: #3b82f6; }
.auth-tab[data-role="customer"].active { background: #10b981; }

/* ── Search Page ── */
.search-page { padding: 0 4px; }
.search-page-hero { text-align: center; padding: 24px 0 16px; }
.search-page-icon { font-size: 2.2em; margin-bottom: 4px; }
.search-page-title { font-size: 1.2em; font-weight: 700; color: var(--text-primary); }

.search-tabs { display: flex; gap: 4px; background: var(--bg-root); border-radius: 10px; padding: 4px; margin-bottom: 20px; }
.search-tab { flex: 1; padding: 10px 16px; text-align: center; cursor: pointer; font-size: 0.88em; font-weight: 600;
    color: var(--text-muted); background: transparent; border: none; border-radius: 8px; transition: all 0.2s; }
.search-tab:hover { color: var(--text-secondary); background: rgba(255,255,255,0.04); }
.search-tab.active { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }

.search-box { display: flex; gap: 10px; margin-bottom: 12px; }
.search-box-input { flex: 1; background: var(--bg-root); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 12px 16px; font-size: 0.95em; color: var(--text-primary); font-family: var(--font); outline: none; transition: border 0.2s; }
.search-box-input:focus { border-color: var(--accent); }
.search-box-input::placeholder { color: var(--text-muted); }
.search-box .btn { padding: 12px 24px; font-size: 0.9em; }

.search-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.search-filter-chip { display: flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 20px;
    background: var(--bg-root); border: 1px solid var(--border); font-size: 0.8em; color: var(--text-secondary);
    cursor: pointer; transition: all 0.15s; user-select: none; }
.search-filter-chip:hover { border-color: var(--accent); }
.search-filter-chip input { accent-color: var(--accent); }

.search-results-area { min-height: 80px; }
.search-empty { text-align: center; padding: 32px 0; color: var(--text-muted); font-size: 0.9em; }
.search-loading { text-align: center; padding: 32px 0; color: var(--accent); font-size: 0.9em; }
.search-result-count { font-size: 0.82em; color: var(--text-muted); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

.search-result-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-md);
    background: var(--bg-root); border: 1px solid var(--border); margin-bottom: 8px; cursor: pointer; transition: all 0.15s; }
.search-result-card:hover { border-color: var(--accent); background: var(--bg-hover); }
.search-result-badge { padding: 3px 10px; border-radius: 12px; font-size: 0.7em; font-weight: 700; color: #fff; white-space: nowrap; }
.search-result-info { flex: 1; min-width: 0; }
.search-result-title { font-weight: 600; font-size: 0.9em; color: var(--text-primary); }
.search-result-sub { font-size: 0.78em; color: var(--text-muted); margin-top: 2px; }
.search-result-id { font-size: 0.75em; color: var(--text-muted); font-family: monospace; }

/* ── DOI License Lookup Results ── */
.license-lookup-panel { background: var(--bg-root); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; }
.license-lookup-desc { font-size: 0.85em; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.5; }
.license-lookup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.license-lookup-field label { display: block; font-size: 0.78em; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }

.doi-result-card { background: var(--bg-root); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 12px; transition: border 0.15s; }
.doi-result-card:hover { border-color: var(--accent); }
.doi-result-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.doi-result-name { font-weight: 700; font-size: 1.05em; color: var(--text-primary); }
.doi-result-agency { font-size: 0.82em; color: var(--text-secondary); margin-top: 2px; }
.doi-result-status { padding: 3px 12px; border-radius: 12px; font-size: 0.7em; font-weight: 700; color: #fff; white-space: nowrap; }
.doi-result-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 16px; margin-bottom: 14px; }
.doi-detail { display: flex; flex-direction: column; gap: 2px; }
.doi-detail-label { font-size: 0.68em; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.doi-detail span:last-child { font-size: 0.88em; color: var(--text-primary); }
.doi-result-loa { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.doi-loa-pill { padding: 3px 10px; border-radius: 12px; font-size: 0.72em; font-weight: 600; }
.doi-result-contact { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.78em; color: var(--text-muted); padding-top: 10px; border-top: 1px solid var(--border); margin-bottom: 10px; }

/* License detail sections */
.doi-licenses-section { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.doi-section-label { font-size: 0.72em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 6px; }
.doi-licenses-grid { display: flex; flex-direction: column; gap: 4px; }
.doi-license-row { display: flex; align-items: flex-start; gap: 8px; font-size: 0.8em; padding: 6px 8px; border-radius: 6px; background: rgba(255,255,255,0.02); }
.doi-license-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.doi-license-type { color: var(--text-primary); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doi-license-desc { font-size: 0.82em; color: var(--text-muted); line-height: 1.3; white-space: normal; }
.doi-license-status { font-size: 0.7em; font-weight: 700; padding: 2px 8px; border-radius: 8px; text-transform: uppercase; white-space: nowrap; }
.doi-license-status.valid { background: rgba(16,185,129,0.15); color: #10b981; }
.doi-license-status.invalid { background: rgba(239,68,68,0.15); color: #ef4444; }
.doi-license-date { font-size: 0.85em; color: var(--text-muted); white-space: nowrap; }
.doi-cms-badge { font-size: 0.65em; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: rgba(59,130,246,0.15); color: #3b82f6; text-transform: uppercase; letter-spacing: 0.05em; cursor: help; white-space: nowrap; }

@media (max-width: 768px) {
    .license-lookup-grid { grid-template-columns: 1fr; }
    .doi-result-details { grid-template-columns: repeat(2, 1fr); }
}

/* ── Rates Panel (Main Content Mode) ── */
.rate-panel-main { grid-template-columns: repeat(3, 1fr); gap: 16px; }
.rate-panel-main .rate-card { padding: 20px; }
.rate-panel-main .rate-vendor { font-size: 1em; }
.rate-panel-main .rate-price { font-size: 1.6em; }

/* ── Why Bundle Section ── */
.why-bundle-section {
    margin-top: 24px; padding: 20px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius);
}
.why-bundle-title {
    font-size: 1em; font-weight: 600; color: var(--text-primary); margin-bottom: 14px;
}
.why-bundle-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
.why-bundle-item {
    font-size: 0.82em; color: var(--text-secondary); line-height: 1.6;
    padding: 12px; background: rgba(255,255,255,0.02); border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
}
.why-bundle-item strong { color: var(--text-primary); }

/* ── Agency Profile ── */
.agency-setup { max-width: 700px; }
.agency-setup-title {
    font-size: 1.1em; font-weight: 600; color: var(--text-primary); margin-bottom: 16px;
}
.agency-form-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.agency-dashboard { display: flex; flex-direction: column; gap: 20px; }
.agency-top-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.agency-card, .license-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
}
.agency-card-header { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.agency-card-icon { font-size: 1.8em; }
.agency-card-name { font-size: 1.1em; font-weight: 600; color: var(--text-primary); }
.agency-card-address { font-size: 0.82em; color: var(--text-secondary); margin-top: 2px; }
.agency-card-details { display: flex; flex-direction: column; gap: 8px; }
.agency-detail { display: flex; justify-content: space-between; font-size: 0.85em; }
.agency-detail-label { color: var(--text-muted); font-size: 0.9em; }

/* ── License Card ── */
.license-card-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px;
}
.license-card-title { font-size: 1em; font-weight: 600; color: var(--text-primary); }
.license-status {
    font-size: 0.7em; font-weight: 700; padding: 3px 10px;
    border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: 0.04em;
}
.license-details {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px;
}
.license-detail { display: flex; flex-direction: column; gap: 2px; }
.license-detail-label { font-size: 0.7em; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.license-detail-value { font-size: 0.88em; color: var(--text-primary); font-weight: 500; }
.license-loa { margin-top: 10px; }
.license-loa-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.license-loa-pill {
    font-size: 0.72em; font-weight: 600; padding: 3px 10px;
    border-radius: var(--radius-full);
}
.license-expiry-warning {
    font-size: 0.78em; font-weight: 600; padding: 8px 12px;
    border-radius: var(--radius-sm); margin-bottom: 12px;
}
.license-expiry-soon { background: rgba(217,119,6,0.1); color: #d97706; }
.license-expiry-expired { background: rgba(220,38,38,0.1); color: #dc2626; }

/* ── DOI Search Panel ── */
.doi-search-panel {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
}
.doi-search-title {
    font-size: 1em; font-weight: 600; color: var(--text-primary); margin-bottom: 14px;
}
.doi-search-form {
    display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px;
}
.doi-search-form .rate-input-group { flex: 1; min-width: 140px; }
.doi-results-list { display: flex; flex-direction: column; gap: 10px; }
.doi-result-card {
    padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.02); transition: border-color 0.2s;
}
.doi-result-card:hover { border-color: var(--accent); }
.doi-result-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.doi-result-name { font-size: 0.92em; font-weight: 600; color: var(--text-primary); }
.doi-result-agency { font-size: 0.78em; color: var(--text-muted); }
.doi-result-details {
    display: flex; gap: 14px; font-size: 0.78em; color: var(--text-secondary); margin-bottom: 8px;
}
.doi-result-loa { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }

/* ── Button Sizes ── */
.btn-sm { font-size: 0.78em; padding: 6px 14px; }

@media (max-width: 768px) {
    .rate-panel, .rate-panel-main { grid-template-columns: 1fr; }
    .health-metrics { grid-template-columns: 1fr; }
    .bundle-container { grid-template-columns: 1fr; }
    .agency-top-row { grid-template-columns: 1fr; }
    .agency-form-grid { grid-template-columns: 1fr; }
    .why-bundle-grid { grid-template-columns: 1fr; }
    .doi-search-form { flex-direction: column; }
}

/* ══════════════════════════════════════════
   RBAC / Roles & Permissions Page
   ══════════════════════════════════════════ */
.rbac-page { padding: 0; }
.rbac-tabs {
    display: flex; gap: 4px; margin-bottom: 20px;
    background: var(--bg-card); border-radius: 10px; padding: 4px;
    border: 1px solid var(--border);
}
.rbac-tab {
    flex: 1; padding: 10px 16px; border: none; background: transparent;
    color: var(--text-muted); font-weight: 600; font-size: 0.85rem;
    border-radius: 8px; cursor: pointer; transition: all 0.2s;
}
.rbac-tab.active {
    background: var(--accent); color: #fff;
}
.rbac-tab:hover:not(.active) { background: var(--bg-hover); color: var(--text); }

.rbac-panel.hidden { display: none; }

/* Roles grid */
.rbac-roles-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px;
}
.rbac-role-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    padding: 20px; transition: border-color 0.2s;
}
.rbac-role-card:hover { border-color: var(--accent); }
.rbac-role-card.system { border-left: 3px solid var(--accent); }
.rbac-role-card.custom { border-left: 3px solid #10b981; }
.rbac-role-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.rbac-role-header h3 { margin: 0; font-size: 1rem; color: var(--text); }
.rbac-role-desc { color: var(--text-muted); font-size: 0.82rem; margin: 0 0 12px; line-height: 1.4; }
.rbac-role-actions { display: flex; align-items: center; justify-content: space-between; }
.rbac-users-count { font-size: 0.75rem; color: var(--text-muted); }

/* Badges */
.rbac-badge {
    font-size: 0.7rem; padding: 2px 8px; border-radius: 10px; font-weight: 600; text-transform: uppercase;
}
.rbac-badge.system { background: rgba(168,85,247,0.15); color: #a855f7; }
.rbac-badge.custom { background: rgba(16,185,129,0.15); color: #10b981; }
.rbac-badge.default { background: rgba(59,130,246,0.15); color: #3b82f6; }
.rbac-badge.admin { background: rgba(168,85,247,0.15); color: #a855f7; }
.rbac-badge.agent { background: rgba(59,130,246,0.15); color: #3b82f6; }
.rbac-badge.customer { background: rgba(16,185,129,0.15); color: #10b981; }

/* Users table */
.rbac-table { width: 100%; border-collapse: collapse; }
.rbac-table th {
    text-align: left; padding: 10px 12px; font-size: 0.75rem; text-transform: uppercase;
    color: var(--text-muted); border-bottom: 1px solid var(--border); letter-spacing: 0.5px;
}
.rbac-table td {
    padding: 12px; border-bottom: 1px solid var(--border); font-size: 0.85rem; color: var(--text);
}
.rbac-table tr:hover td { background: var(--bg-hover); }
.rbac-role-pill {
    display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.72rem;
    background: var(--bg-hover); color: var(--accent); border: 1px solid var(--border);
    margin: 2px 4px 2px 0; font-weight: 500;
}

/* Permissions grid */
.rbac-perms-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px;
}
.rbac-perm-group {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 14px;
}
.rbac-perm-group h4 {
    margin: 0 0 8px; font-size: 0.82rem; color: var(--text); text-transform: capitalize; font-weight: 600;
}
.rbac-perm-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.rbac-perm-pill {
    font-size: 0.68rem; padding: 2px 7px; border-radius: 8px; font-weight: 600; text-transform: uppercase;
}
.rbac-perm-pill.read { background: rgba(59,130,246,0.15); color: #3b82f6; }
.rbac-perm-pill.create { background: rgba(16,185,129,0.15); color: #10b981; }
.rbac-perm-pill.update { background: rgba(245,158,11,0.15); color: #f59e0b; }
.rbac-perm-pill.delete { background: rgba(239,68,68,0.15); color: #ef4444; }
.rbac-perm-pill.export { background: rgba(139,92,246,0.15); color: #8b5cf6; }
.rbac-perm-pill.lookup { background: rgba(6,182,212,0.15); color: #06b6d4; }
.rbac-perm-pill.generate { background: rgba(236,72,153,0.15); color: #ec4899; }
.rbac-perm-pill.use { background: rgba(245,158,11,0.15); color: #f59e0b; }
.rbac-perm-pill.configure { background: rgba(239,68,68,0.15); color: #ef4444; }

/* Small buttons */
.btn-sm {
    padding: 4px 10px; font-size: 0.72rem; border-radius: 6px; border: 1px solid var(--border);
    background: var(--bg-hover); color: var(--text); cursor: pointer; font-weight: 500; transition: all 0.15s;
}
.btn-sm:hover { border-color: var(--accent); color: var(--accent); }

/* Modal */
.rbac-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex;
    align-items: center; justify-content: center; z-index: 9999; backdrop-filter: blur(4px);
}
.rbac-modal.hidden { display: none; }
.rbac-modal-content {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
    max-width: 600px; width: 90%; max-height: 80vh; overflow-y: auto; padding: 24px;
}
.rbac-modal-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
}
.rbac-modal-header h3 { margin: 0; font-size: 1.1rem; color: var(--text); }
.rbac-modal-close {
    background: none; border: none; font-size: 1.5rem; color: var(--text-muted); cursor: pointer;
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
}
.rbac-modal-close:hover { background: var(--bg-hover); color: var(--error); }
.rbac-modal-body { }
.rbac-perm-row {
    display: flex; align-items: center; gap: 12px; padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.rbac-perm-resource {
    min-width: 120px; font-weight: 600; font-size: 0.82rem; color: var(--text); text-transform: capitalize;
}
.rbac-perm-acts { display: flex; flex-wrap: wrap; gap: 4px; }

.rbac-entitle-section { margin-bottom: 16px; }
.rbac-entitle-section h4 { margin: 0 0 8px; font-size: 0.85rem; color: var(--text-muted); }
.rbac-entitle-role {
    padding: 8px 12px; background: var(--bg-hover); border-radius: 8px; margin-bottom: 6px;
}
.rbac-entitle-perms { display: flex; flex-wrap: wrap; gap: 4px; }

/* Wide modal variant for permission editing */
.rbac-modal-wide { max-width: 800px; }

/* Permission edit checkbox grid */
.rbac-perm-edit-group {
    display: flex; align-items: flex-start; gap: 16px; padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.rbac-perm-edit-resource {
    min-width: 130px; font-weight: 600; font-size: 0.82rem; color: var(--text);
    text-transform: capitalize; padding-top: 4px;
}
.rbac-perm-edit-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.rbac-check-label {
    display: flex; align-items: center; gap: 5px; cursor: pointer;
    padding: 4px 8px; border-radius: 6px; transition: background 0.15s;
}
.rbac-check-label:hover { background: var(--bg-hover); }
.rbac-check-label input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; }

/* Danger button variant */
.btn-sm.danger { border-color: rgba(239,68,68,0.3); color: #ef4444; }
.btn-sm.danger:hover { border-color: #ef4444; background: rgba(239,68,68,0.1); }
