/* ===== CSS VARIABLES ===== */
:root {
    --hostq-blue: #0100a9;
    --hostq-light-blue: #f0f0ff;
    --text-dark: #1e293b;
    --text-medium: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --bg-white: #ffffff;
    --bg-gray: #f8fafc;
    --bg-hover: #f1f5f9;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-gray);
    color: var(--text-dark);
    line-height: 1.5;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4338ca 0%, #6366f1 50%, #818cf8 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.25);
    position: relative;
}

/* ===== LANGUAGE SWITCHER (login card) ===== */
.login-card .lang-switcher {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 4px;
}

.login-card .lang-btn {
    width: 32px;
    height: 24px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-white);
    color: var(--text-medium);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
    font-family: 'Segoe UI', sans-serif;
    letter-spacing: 0.5px;
}

.login-card .lang-btn:hover {
    background: var(--bg-hover);
    border-color: #cbd5e1;
    color: var(--hostq-blue);
}

.login-card .lang-btn.active {
    background: var(--hostq-blue);
    border-color: var(--hostq-blue);
    color: white;
}

/* ===== LANGUAGE SWITCHER (bottom bar — copied from VisualQ i18n.css) ===== */
.bottom-bar .lang-switcher {
    display: flex;
    gap: 1px;
    padding: 2px;
    background: var(--border-color, #e2e8f0);
    border-radius: 4px;
}

.bottom-bar .lang-btn {
    padding: 2px 8px;
    border: none;
    background: transparent;
    color: var(--text-medium, #64748b);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.15s;
    text-align: center;
    line-height: 1;
    width: auto;
    height: auto;
}

.bottom-bar .lang-btn:hover {
    background: var(--bg-gray, #f1f5f9);
    color: var(--text-dark, #334155);
}

.bottom-bar .lang-btn.active {
    background: var(--hostq-blue, #0100a9);
    color: white;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.logo-cube {
    width: 72px;
    height: 72px;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 15px;
    color: var(--text-medium);
    text-align: center;
    margin-bottom: 36px;
}

.login-form .form-group {
    margin-bottom: 24px;
}

.login-form label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-medium);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 18px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.2s;
    background: #f1f5f9;
    color: var(--text-dark);
}

.input-wrapper input::placeholder {
    color: var(--text-light);
}

.input-wrapper input:focus {
    outline: none;
    background: #e8ecf1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: var(--text-medium);
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

.form-error {
    color: var(--danger);
    font-size: 13px;
    margin-bottom: 16px;
    min-height: 20px;
    text-align: center;
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: var(--hostq-blue);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    background: #0000cc;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(1,0,169,0.35);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading .spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== FORGOT PASSWORD LINK ===== */
.forgot-password-link {
    text-align: right;
    margin: -4px 0 8px;
}
.forgot-password-link a {
    font-size: 12px;
    color: var(--hostq-blue);
    text-decoration: none;
    font-weight: 500;
}
.forgot-password-link a:hover {
    text-decoration: underline;
}

/* ===== MAGIC LINK / CODE LOGIN ===== */
.login-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    gap: 12px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.login-divider span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-magic-link {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-magic-link:hover {
    background: var(--bg-hover);
    border-color: #cbd5e1;
    color: var(--hostq-blue);
}

.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
    cursor: pointer;
    transition: color 0.15s;
    margin-top: 12px;
}

.btn-back:hover {
    color: var(--hostq-blue);
}

.code-sent-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 24px;
}

.code-sent-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.code-sent-email {
    font-size: 13px;
    color: var(--text-medium);
}

.code-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
}

.btn-resend {
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--hostq-blue);
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.15s;
}

.btn-resend:hover:not(:disabled) {
    background: var(--hostq-light-blue);
}

.btn-resend:disabled {
    color: var(--text-light);
    cursor: not-allowed;
}

.btn-resend #resendTimer {
    font-weight: 500;
    color: var(--text-light);
}

/* Shake animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15%, 45%, 75% { transform: translateX(-6px); }
    30%, 60%, 90% { transform: translateX(6px); }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

.login-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
}

.login-version {
    text-align: center;
    margin-top: 20px;
    font-size: 11px;
    color: var(--text-light);
}

/* ===== ADMIN LAYOUT ===== */
.app {
    display: flex;
    min-height: 100vh;
}

/* ===== NAV RAIL ===== */
.nav-rail {
    width: 52px;
    background: white;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
}

.nav-top {
    padding: 12px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.app-name-label,
.app-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--hostq-blue);
    letter-spacing: 0.5px;
}

.nav-items {
    flex: 1;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.nav-item {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-medium);
    transition: all 0.15s;
    gap: 2px;
}

.nav-item svg {
    width: 18px;
    height: 18px;
}

.nav-label {
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-dark);
}

.nav-item.active {
    background: var(--hostq-blue);
    color: white;
}

.menu-bottom {
    padding: 8px 0 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border-top: 1px solid var(--border-color);
}

.menu-user, .hub-link {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-medium);
    transition: all 0.15s;
    gap: 2px;
    text-decoration: none;
}

.menu-user svg, .hub-link svg {
    width: 18px;
    height: 18px;
}

.menu-user:hover, .hub-link:hover {
    background: var(--bg-hover);
    color: var(--text-dark);
}

.menu-user.active {
    background: var(--hostq-blue);
    color: white;
}

.menu-logo {
    width: 32px;
    height: 32px;
    margin-top: 4px;
}

/* ===== APP SWITCHER ===== */
.app-switcher-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-medium);
    position: relative;
    gap: 2px;
}

.app-switcher-btn > svg {
    width: 16px;
    height: 16px;
}

.switcher-label {
    font-size: 7px;
    font-weight: 600;
    text-transform: uppercase;
}

.app-switcher-btn:hover {
    background: var(--bg-hover);
    border-color: #cbd5e1;
    color: var(--hostq-blue);
}

.app-switcher-btn.active {
    background: var(--hostq-blue);
    border-color: var(--hostq-blue);
    color: white;
}

.app-panel { position: absolute; bottom: 40px; left: -4px; width: 290px; background: white; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.04); opacity: 0; visibility: hidden; transform: scale(0.92) translateY(8px); transform-origin: bottom left; transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1); z-index: 1000; pointer-events: none; overflow: hidden; max-height: calc(100vh - 100px); display: flex; flex-direction: column; }
.app-panel.open { opacity: 1; visibility: visible; transform: scale(1) translateY(0); pointer-events: auto; }
.ap-search { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid #f1f5f9; }
.ap-search-icon { width: 16px; height: 16px; stroke: #94a3b8; flex-shrink: 0; }
.ap-search-input { flex: 1; border: none; outline: none; font-size: 13px; font-family: inherit; color: var(--text-dark); background: transparent; min-width: 0; }
.ap-search-input::placeholder { color: #cbd5e1; }
.ap-search-clear { width: 20px; height: 20px; border: none; background: #f1f5f9; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; transition: all 0.15s; flex-shrink: 0; }
.ap-search-clear svg { width: 12px; height: 12px; stroke: var(--text-medium); }
.ap-search-clear:hover { background: #fee2e2; }
.ap-search-clear:hover svg { stroke: #dc2626; }
.ap-groups { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 0; scrollbar-width: thin; scrollbar-color: var(--border-color) transparent; }
.ap-groups::-webkit-scrollbar { width: 4px; }
.ap-groups::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
.ap-group { padding: 2px 0; }
.ap-group + .ap-group { border-top: 1px solid #f1f5f9; }
.ap-group-label { padding: 8px 14px 4px; font-size: 10px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.8px; }
.ap-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px 8px; }
.ap-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px 4px 8px; border-radius: 10px; cursor: pointer; transition: all 0.15s; text-decoration: none; position: relative; }
.ap-item:hover { background: #f8fafc; }
.ap-item.current { background: #eef2ff; }
.ap-item.ap-hidden { display: none; }
.ap-icon { width: 36px; height: 36px; min-width: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; transition: all 0.15s; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.ap-item:hover .ap-icon { transform: scale(1.08); box-shadow: 0 3px 8px rgba(0,0,0,0.12); }
.ap-item.current .ap-icon { box-shadow: 0 2px 8px rgba(1,0,169,0.3); }
.ap-info { text-align: center; min-width: 0; }
.ap-name { font-size: 10px; font-weight: 600; color: var(--text-dark); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56px; }
.ap-item.current .ap-name { color: var(--hostq-blue); }
.ap-desc { font-size: 8px; color: var(--text-light); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56px; }
.ap-item:hover .ap-desc { color: var(--text-medium); }
.ap-item.current .ap-desc { color: #6366f1; }
.ap-item.current::after { content: ''; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; background: var(--hostq-blue); border-radius: 50%; box-shadow: 0 0 0 2px rgba(1,0,169,0.15); }
.ap-empty { padding: 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-light); font-size: 13px; }

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: 52px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 32px;
}

.header {
    padding: 20px 24px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-medium);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: var(--bg-gray);
    border-radius: 20px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: var(--hostq-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

.content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 52px;
    right: 0;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: var(--bg-gray, #f8fafc);
    border-top: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-light);
    z-index: 10;
}

.bottom-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bottom-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* ===== DASHBOARD STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.blue { background: #eff6ff; color: var(--info); }
.stat-icon.green { background: #f0fdf4; color: var(--success); }
.stat-icon.orange { background: #fffbeb; color: var(--warning); }
.stat-icon.red { background: #fef2f2; color: var(--danger); }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
}

.stat-label {
    font-size: 13px;
    color: var(--text-medium);
}

.dashboard-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.card-body {
    padding: 20px;
}

.activity-stats {
    display: flex;
    gap: 32px;
}

.activity-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.activity-value {
    font-size: 32px;
    font-weight: 700;
}

.activity-value.green { color: var(--success); }
.activity-value.red { color: var(--danger); }
.activity-value.blue { color: #0100a9; }
.activity-value.orange { color: #f59e0b; }

.activity-label {
    font-size: 13px;
    color: var(--text-medium);
}

.role-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.role-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.role-name {
    width: 80px;
    font-size: 13px;
    color: var(--text-medium);
}

.role-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg-gray);
    border-radius: 4px;
    overflow: hidden;
}

.role-bar-fill {
    height: 100%;
    background: var(--hostq-blue);
    border-radius: 4px;
    transition: width 0.3s;
}

.role-count {
    width: 30px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    text-align: right;
}

/* ===== TOOLBAR ===== */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--hostq-blue);
    color: white;
}

.btn-primary:hover {
    background: #0000cc;
}

.btn-secondary {
    background: var(--bg-gray);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-danger {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.btn-danger:hover {
    background: #fee2e2;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-light);
}

.search-box input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 13px;
    background: var(--bg-gray);
}

.search-box input:focus {
    outline: none;
    border-color: var(--hostq-blue);
    background: white;
}

select {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

/* ===== DATA TABLE ===== */
.table-container {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-gray);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--bg-gray);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-cell-avatar {
    width: 32px;
    height: 32px;
    background: var(--hostq-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.user-cell-info {
    display: flex;
    flex-direction: column;
}

.user-cell-name {
    font-weight: 600;
}

.user-cell-username {
    font-size: 11px;
    color: var(--text-light);
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.badge-admin { background: #fef3c7; color: #b45309; }
.badge-operations { background: #dbeafe; color: #1e40af; }
.badge-sales { background: #dcfce7; color: #166534; }
.badge-viewer { background: #f1f5f9; color: #64748b; }

.badge-active { background: #dcfce7; color: #166534; }
.badge-locked { background: #fee2e2; color: #dc2626; }
.badge-info { background: #dbeafe; color: #1e40af; }

.badge-source-foxpro { background: #fef3c7; color: #92400e; }
.badge-source-hostq { background: #ede9fe; color: #5b21b6; }
.badge-source-system { background: #e0e7ff; color: #3730a3; }
.badge-source-manual { background: #f1f5f9; color: #64748b; }

.actions-cell {
    display: flex;
    gap: 6px;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.2s;
}

.modal-overlay.open .modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-gray);
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-medium);
}

.modal-close:hover {
    background: var(--bg-hover);
}

#userForm {
    padding: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

#userForm .form-group {
    margin-bottom: 0;
}

#userForm label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 6px;
}

#userForm input,
#userForm select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
}

#userForm input:focus,
#userForm select:focus {
    outline: none;
    border-color: var(--hostq-blue);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* ===== AUTH POPOVER ===== */
.bb-auth-popover {
    position: fixed;
    width: 240px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.05);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: all 0.15s ease;
    pointer-events: none;
    padding: 16px;
    left: 60px;
    bottom: 100px;
}

.bb-auth-popover.open {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    pointer-events: auto;
}

.bb-auth-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bb-auth-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--hostq-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}

.bb-auth-info {
    flex: 1;
}

.bb-auth-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.bb-auth-role {
    font-size: 11px;
    color: var(--text-light);
    text-transform: capitalize;
}

.bb-auth-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 0;
}

.bb-auth-action {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px;
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    margin-bottom: 6px;
}

.bb-auth-action:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: var(--hostq-blue);
}

.bb-auth-logout {
    width: 100%;
    padding: 9px;
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.15s;
}

.bb-auth-logout:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--danger);
}

/* ===== USERS LAYOUT (Sidebar + Profile) ===== */
.users-layout {
    display: flex;
    gap: 0;
    height: calc(100vh - 130px);
    margin: -24px;
}

.user-sidebar {
    width: 200px;
    min-width: 48px;
    max-width: 400px;
    background: white;
    border-right: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}
.sidebar-resize-handle {
    position: absolute;
    top: 0;
    right: -3px;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    z-index: 10;
    background: transparent;
    transition: background 0.15s;
}
.sidebar-resize-handle:hover,
.sidebar-resize-handle.dragging {
    background: var(--hostq-blue);
    opacity: 0.3;
}
.sidebar-resize-handle::after {
    content: '';
    position: absolute;
    top: 0;
    right: 3px;
    width: 1px;
    height: 100%;
    background: var(--border-color);
}
.user-sidebar.collapsed { width: 48px; min-width: 48px; }
.user-sidebar.collapsed .sidebar-user-info,
.user-sidebar.collapsed .sidebar-search input,
.user-sidebar.collapsed .sidebar-filters,
.user-sidebar.collapsed .sidebar-count,
.user-sidebar.collapsed .sidebar-add-btn,
.user-sidebar.collapsed .cs-info { display: none; }
.user-sidebar.collapsed .sidebar-header { justify-content: center; padding: 6px; }
.user-sidebar.collapsed .sidebar-user { justify-content: center; padding: 6px 0; }
.user-sidebar.collapsed .contact-sidebar-item { justify-content: center; padding: 6px 0; }
.user-sidebar.collapsed .sidebar-collapse-btn { margin: 0 auto; }
.sidebar-collapse-btn {
    width: 22px; height: 22px; border: 1px solid var(--border-color); border-radius: 6px;
    background: var(--bg-gray); display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-light); transition: all 0.15s; flex-shrink: 0;
}
.sidebar-collapse-btn:hover { background: var(--bg-hover); color: var(--hostq-blue); border-color: var(--hostq-blue); }
.sidebar-collapse-btn svg { transition: transform 0.2s; }

.sidebar-header {
    padding: 10px;
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-search {
    position: relative;
    flex: 1;
}

.sidebar-search svg {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-light);
}

.sidebar-search input {
    width: 100%;
    padding: 7px 8px 7px 28px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 12px;
    background: var(--bg-gray);
}

.sidebar-search input:focus {
    outline: none;
    border-color: var(--hostq-blue);
    background: white;
}

.sidebar-add-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-medium);
    transition: all 0.15s;
    flex-shrink: 0;
}

.sidebar-add-btn:hover {
    background: var(--hostq-blue);
    border-color: var(--hostq-blue);
    color: white;
}

.sidebar-add-btn svg {
    width: 14px;
    height: 14px;
}

.sidebar-filters {
    display: flex;
    gap: 2px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-color);
}

.filter-btn {
    flex: 1;
    padding: 4px 0;
    border: none;
    background: none;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filter-btn:hover {
    background: var(--bg-hover);
    color: var(--text-medium);
}

.filter-btn.active {
    background: var(--hostq-blue);
    color: white;
}

.sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.12s;
    text-decoration: none;
    color: inherit;
}

.sidebar-user:hover {
    background: var(--bg-hover);
}

.sidebar-user.active {
    background: #eef2ff;
    box-shadow: inset 3px 0 0 var(--hostq-blue);
}

.sidebar-all-item {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
    padding-bottom: 10px;
    border-radius: 8px 8px 0 0;
}

.sidebar-all-avatar {
    background: var(--bg-gray) !important;
    color: var(--text-medium) !important;
    border: 1px solid var(--border-color);
}

.sidebar-all-avatar svg {
    width: 14px;
    height: 14px;
}

.sidebar-all-item.active .sidebar-all-avatar {
    background: var(--hostq-blue) !important;
    color: white !important;
    border-color: var(--hostq-blue) !important;
}

.sidebar-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-user-info {
    min-width: 0;
    flex: 1;
}

.sidebar-user-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-meta {
    display: flex;
    gap: 4px;
    align-items: center;
}

.sidebar-role {
    font-size: 9px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
    text-transform: uppercase;
}

.sidebar-role-admin { background: #fef3c7; color: #b45309; }
.sidebar-role-operations { background: #dbeafe; color: #1e40af; }
.sidebar-role-sales { background: #dcfce7; color: #166534; }
.sidebar-role-viewer { background: #f1f5f9; color: #64748b; }

.sidebar-locked {
    font-size: 9px;
    font-weight: 600;
    color: var(--danger);
}

.sidebar-count {
    padding: 8px 12px;
    font-size: 11px;
    color: var(--text-light);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

/* ===== BACK TO ALL LINK ===== */
.back-to-all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--hostq-blue);
    text-decoration: none;
    margin-bottom: 12px;
    padding: 4px 8px 4px 2px;
    border-radius: 6px;
    transition: all 0.15s;
}

.back-to-all:hover {
    background: var(--hostq-light-blue);
}

.back-to-all svg {
    width: 16px;
    height: 16px;
}

/* ===== TABLE ROW CLICK ===== */
.user-table-row:hover td {
    background: var(--hostq-light-blue) !important;
}

/* ===== USER CONTENT AREA ===== */
.user-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.user-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-light);
}

.user-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.user-empty h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.user-empty p {
    font-size: 13px;
}

/* ===== USER PROFILE ===== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 16px;
}

.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.profile-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-username {
    font-size: 13px;
    color: var(--text-medium);
    font-weight: 500;
}

.profile-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-light);
}

.profile-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ===== PROFILE GRID (3 cards) ===== */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.profile-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.profile-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.profile-card-title svg {
    width: 16px;
    height: 16px;
    color: var(--hostq-blue);
}

.profile-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.profile-field + .profile-field {
    border-top: 1px solid #f1f5f9;
}

.field-label {
    font-size: 12px;
    color: var(--text-light);
}

.field-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark);
    text-align: right;
}

/* ===== NOTES ===== */
.notes-container { margin-top: 8px; }
.notes-display { display: flex; align-items: flex-start; gap: 8px; }
.notes-text { flex: 1; font-size: 13px; color: var(--text-medium); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.notes-text.empty { color: var(--text-light); font-style: italic; }
.notes-edit-btn { width: 28px; height: 28px; border: none; background: #f1f5f9; border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: all 0.15s; padding: 0; }
.notes-edit-btn svg { width: 14px; height: 14px; stroke: #64748b; }
.notes-edit-btn:hover { background: var(--hostq-blue); }
.notes-edit-btn:hover svg { stroke: white; }
.notes-editor textarea { width: 100%; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; font-family: inherit; color: var(--text-dark); resize: vertical; box-sizing: border-box; }
.notes-editor textarea:focus { border-color: var(--hostq-blue); outline: none; box-shadow: 0 0 0 3px rgba(1,0,169,0.1); }
.notes-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

/* ===== PROFILE SECTIONS ===== */
.profile-section {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 16px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 14px;
}

.section-title svg {
    width: 18px;
    height: 18px;
    color: var(--hostq-blue);
}

/* ===== APP ACCESS GRID ===== */
.app-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.access-app {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.15s;
}

.access-granted {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.access-denied {
    background: #fafafa;
    border-color: #f1f1f1;
    opacity: 0.5;
}

.access-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    background: #f1f5f9;
    color: var(--text-medium);
}

.access-granted .access-icon {
    background: #dcfce7;
    color: #166534;
}

.access-name {
    flex: 1;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dark);
}

.access-denied .access-name {
    color: var(--text-light);
}

.access-status svg {
    width: 14px;
    height: 14px;
}

.access-granted .access-status svg {
    color: var(--success);
}

.access-denied .access-status svg {
    color: var(--text-light);
}

/* ===== ACTIVITY LIST ===== */
.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.activity-row + .activity-row {
    border-top: 1px solid #f8fafc;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-dot-green { background: var(--success); }
.activity-dot-red { background: var(--danger); }
.activity-dot-blue { background: var(--info); }

.activity-info {
    flex: 1;
    min-width: 0;
}

.activity-action {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark);
    display: block;
}

.activity-detail {
    font-size: 11px;
    color: var(--text-light);
}

.activity-time {
    font-size: 11px;
    color: var(--text-light);
    flex-shrink: 0;
}

.activity-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast {
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    animation: slideIn 0.2s ease;
    transition: opacity 0.3s;
}

.toast-success {
    background: #166534;
    color: white;
}

.toast-error {
    background: #dc2626;
    color: white;
}

@keyframes slideIn {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== RESET PASSWORD MODAL ===== */
.reset-pw-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-gray);
    border-radius: 10px;
    margin-bottom: 20px;
}

.reset-pw-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--hostq-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.reset-pw-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.reset-pw-username {
    font-size: 12px;
    color: var(--text-medium);
}

.reset-pw-hint {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 6px;
    padding-left: 2px;
}

.reset-pw-hint.error {
    color: var(--danger);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ===== PROFILE PAGE ===== */
.profile-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 24px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 32px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 24px;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4338ca, #6366f1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-header-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.profile-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: white;
    color: var(--text-medium);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    font-family: inherit;
}

.btn-logout:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--danger);
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.profile-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.profile-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.profile-field {
    margin-bottom: 16px;
}

.profile-field:last-of-type {
    margin-bottom: 0;
}

.profile-field label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.profile-value {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 500;
}

.profile-actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.btn-profile-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--hostq-blue);
    color: white;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-profile-action:hover {
    background: #0100c8;
    box-shadow: 0 4px 12px rgba(1,0,169,0.3);
}

.profile-footer {
    text-align: center;
    color: var(--text-light);
    font-size: 12px;
}

@media (max-width: 640px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    .btn-logout {
        margin-top: 8px;
    }
}

/* ===== CONTACTS MODULE ===== */
.contact-tag { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 4px; background: #f1f5f9; color: #64748b; font-weight: 600; margin: 1px; }
.btn-icon { background: none; border: none; cursor: pointer; padding: 4px; border-radius: 6px; color: var(--text-light); transition: all 0.15s; display: inline-flex; align-items: center; }
.btn-icon:hover { background: #f1f5f9; color: var(--hostq-blue); }
.btn-icon.btn-danger:hover { background: #fef2f2; color: #ef4444; }

/* Contact sidebar list items */
.contact-sidebar-item {
    display: flex; align-items: center; gap: 8px; padding: 7px 10px;
    border-radius: 8px; cursor: pointer; transition: all 0.12s;
    text-decoration: none; color: var(--text-dark); border: none; background: none; width: 100%; text-align: left;
}
.contact-sidebar-item:hover { background: var(--bg-hover, #f1f5f9); }
.contact-sidebar-item.active { background: var(--hostq-blue); color: white; }
.contact-sidebar-item .cs-avatar {
    width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 10px; flex-shrink: 0; color: white;
}
.contact-sidebar-item .cs-info { min-width: 0; flex: 1; }
.contact-sidebar-item .cs-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-sidebar-item .cs-company { font-size: 10px; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-sidebar-item.active .cs-company { color: rgba(255,255,255,0.7); }

/* Contact form (same styling as user form) */
#contactForm { padding: 24px; }
#contactForm .form-group { margin-bottom: 0; }
#contactForm label { display: block; font-size: 12px; font-weight: 600; color: var(--text-medium); margin-bottom: 6px; }
#contactForm input, #contactForm select, #contactForm textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 10px; font-size: 14px;
    font-family: inherit; background: white;
}
#contactForm input:focus, #contactForm select:focus, #contactForm textarea:focus { outline: none; border-color: var(--hostq-blue); }
#contactForm .form-row { margin-bottom: 16px; }
#contactForm .form-group:not(.form-row .form-group) { margin-bottom: 16px; }
