/* ==========================================
   METAVOX LICENSE SERVER - NEXTCLOUD STYLE
   ========================================== */

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

:root {
    /* Warm, modern color palette */
    --bg-primary: #FDFBF7;
    --bg-secondary: #F7F4EE;
    --bg-tertiary: #EFEAE0;
    --bg-elevated: #FFFFFF;

    --text-primary: #1A1714;
    --text-secondary: #5C564D;
    --text-tertiary: #8A8279;
    --text-inverse: #FDFBF7;

    --accent-primary: #E85D3B;
    --accent-primary-hover: #D14E2D;
    --accent-secondary: #2D6A4F;
    --accent-tertiary: #7B68EE;
    --accent-warm: #F4A261;

    --border-light: rgba(26, 23, 20, 0.08);
    --border-medium: rgba(26, 23, 20, 0.12);

    --shadow-sm: 0 1px 2px rgba(26, 23, 20, 0.04);
    --shadow-md: 0 4px 12px rgba(26, 23, 20, 0.08);
    --shadow-lg: 0 12px 32px rgba(26, 23, 20, 0.12);
    --shadow-xl: 0 24px 48px rgba(26, 23, 20, 0.16);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    --sidebar-width: 260px;
    --header-height: 64px;

    /* Status colors */
    --success-color: #10b981;
    --success-light: #d1fae5;
    --danger-color: #ef4444;
    --danger-light: #fee2e2;
    --warning-color: #f59e0b;
    --warning-light: #fef3c7;
    --info-color: #3b82f6;
    --info-light: #dbeafe;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
}

.hidden {
    display: none !important;
}

/* ==========================================
   LOGIN SCREEN
   ========================================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header .logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-warm) 100%);
    border-radius: var(--radius-lg);
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.login-header .logo svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.login-header .logo-text {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.login-subtitle {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* Legacy container support */
.container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.login-box h1 {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    text-align: center;
    letter-spacing: -0.02em;
}

.login-box h2 {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-tertiary);
    margin-bottom: 32px;
    text-align: center;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-elevated);
    transition: all var(--transition-fast);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-tertiary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(232, 93, 59, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    width: auto;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-warm) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #34d399 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #f87171 100%);
    color: white;
}

.btn-sm,
.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

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

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* Messages */
.error-message {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--danger-light);
    border-radius: var(--radius-md);
    display: none;
}

.error-message.show {
    display: block;
}

.success-message {
    color: var(--success-color);
    font-size: 0.85rem;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--success-light);
    border-radius: var(--radius-md);
}

.hint {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 6px;
}

/* ==========================================
   MFA SCREENS
   ========================================== */

#mfa-setup-screen .login-box,
#mfa-backup-screen .login-box {
    max-width: 500px;
}

#mfa-qr-container {
    text-align: center;
    margin: 24px 0;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

#mfa-qr-code {
    max-width: 200px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: white;
    padding: 10px;
}

#mfa-secret-display {
    font-family: 'Monaco', 'Courier New', monospace;
    letter-spacing: 2px;
    font-size: 14px;
    background: var(--bg-tertiary);
}

#backup-codes-container {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--radius-lg);
    margin: 24px 0;
    border: 1px solid var(--border-light);
}

#backup-codes-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.backup-code {
    background: var(--bg-elevated);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    text-align: center;
}

.backup-code code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 1px;
}

#mfa-token-group {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

#mfa-token,
#mfa-verify-token {
    font-family: 'Monaco', 'Courier New', monospace;
    letter-spacing: 4px;
    font-size: 1.25rem;
    text-align: center;
}

/* ==========================================
   APP LAYOUT - SIDEBAR + MAIN
   ========================================== */

.app-container {
    display: flex;
    min-height: 100vh;
    background: var(--bg-primary);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-elevated);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-warm) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.sidebar-header .logo svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.sidebar-header .logo-text {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    padding: 8px 12px;
    margin-bottom: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    text-decoration: none;
    position: relative;
    font-size: 0.9rem;
    font-weight: 500;
}

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

.nav-item.active {
    background: linear-gradient(135deg, rgba(232, 93, 59, 0.1) 0%, rgba(244, 162, 97, 0.1) 100%);
    color: var(--accent-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    width: 20px;
    height: 20px;
    opacity: 0.8;
    flex-shrink: 0;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-label {
    flex: 1;
}

.nav-badge {
    background: var(--accent-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-light);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.user-profile:hover {
    background: var(--bg-secondary);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-secondary) 0%, #52B788 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

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

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-status {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    background: var(--bg-primary);
}

/* Header */
.header {
    height: var(--header-height);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    cursor: pointer;
    display: none; /* Hidden by default on desktop */
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.mobile-menu-btn svg {
    width: 20px;
    height: 20px;
}

.page-title {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.search-container {
    position: relative;
    width: 320px;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 44px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    outline: none;
    font-family: inherit;
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(232, 93, 59, 0.1);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-action {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
}

.header-action:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.header-action svg {
    width: 20px;
    height: 20px;
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
}

/* Legacy main-content padding for non-sidebar layout */
main.main-content {
    padding: 0;
    margin-left: var(--sidebar-width);
}

/* Tab Content */
.tab-content {
    display: none;
    min-width: 0;
}

.tab-content.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.tab-header h2 {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    min-width: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ==========================================
   DASHBOARD
   ========================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    max-width: 1400px;
}

/* Welcome Card */
.welcome-card {
    grid-column: span 8;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-warm) 100%);
    border-radius: var(--radius-lg);
    border: none;
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.welcome-content {
    padding: 32px;
    position: relative;
    z-index: 1;
}

.welcome-greeting {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 8px;
}

.welcome-title {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 2rem;
    font-weight: 600;
    color: white;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.welcome-subtitle {
    font-size: 1rem;
    color: rgba(255,255,255,0.9);
    max-width: 400px;
    line-height: 1.6;
}

.welcome-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-white {
    background: white;
    color: var(--accent-primary);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-white:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
}

.btn-ghost {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    border: none;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.3);
}

/* Quick Stats Grid (side of welcome card) */
.quick-stats {
    grid-column: span 4;
    display: grid;
    gap: 16px;
}

/* ==========================================
   CARDS
   ========================================== */

.card {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all var(--transition-base);
}

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

.card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    margin: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.card-header h3 {
    padding: 0;
    border: none;
    margin: 0;
}

.card-content {
    padding: 20px 24px;
}

.card-action {
    font-size: 0.85rem;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.card-action:hover {
    color: var(--accent-primary-hover);
}

/* ==========================================
   STAT CARDS
   ========================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-base);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.customers { background: rgba(232, 93, 59, 0.1); color: var(--accent-primary); }
.stat-icon.licenses { background: rgba(45, 106, 79, 0.1); color: var(--accent-secondary); }
.stat-icon.storage { background: rgba(123, 104, 238, 0.1); color: var(--accent-tertiary); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--warning-color); }

.stat-info {
    flex: 1;
}

.stat-card h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
    padding: 0;
    border: none;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Colored stat variants */
.stat-card.success { border-left: 4px solid var(--success-color); }
.stat-card.warning { border-left: 4px solid var(--warning-color); }
.stat-card.danger { border-left: 4px solid var(--danger-color); }
.stat-card.info { border-left: 4px solid var(--info-color); }

/* ==========================================
   TABLES
   ========================================== */

.table-container {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: var(--bg-secondary);
    padding: 14px 16px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-light);
    text-align: left;
}

td {
    padding: 14px 16px;
    font-size: 0.9rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--bg-secondary);
}

td.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-tertiary);
}

.table-compact th,
.table-compact td {
    padding: 10px 12px;
    font-size: 0.85rem;
}

/* Clickable rows */
.clickable-row {
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.clickable-row:hover {
    background: rgba(232, 93, 59, 0.05) !important;
}

/* Sortable headers */
th.sortable {
    cursor: pointer;
    user-select: none;
}

th.sortable:hover {
    background: var(--bg-tertiary);
}

th .sort-icon {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    margin-left: 4px;
}

/* ==========================================
   BADGES
   ========================================== */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: var(--success-light);
    color: var(--success-color);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger-color);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning-color);
}

.badge-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.badge-primary {
    background: rgba(232, 93, 59, 0.1);
    color: var(--accent-primary);
}

.badge-info {
    background: var(--info-light);
    color: var(--info-color);
}

/* ==========================================
   FILTERS
   ========================================== */

.filters {
    margin-bottom: 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.filters label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.filters select {
    padding: 8px 12px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background: var(--bg-elevated);
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
}

.filters select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Table filters (card header) */
.card-header-with-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.table-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-filters input[type="text"] {
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    background: var(--bg-elevated);
    min-width: 180px;
    font-family: inherit;
}

.table-filters input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(232, 93, 59, 0.1);
}

.table-filters select {
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    background: var(--bg-elevated);
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
}

/* ==========================================
   MODALS
   ========================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(26, 23, 20, 0.5);
    z-index: 999;
    backdrop-filter: blur(4px);
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-light);
}

.modal-header {
    padding: 24px 24px 0;
}

.modal-header h2 {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

/* ==========================================
   INFO BOX / KEY DISPLAY
   ========================================== */

.info-box {
    background: rgba(232, 93, 59, 0.05);
    border-left: 4px solid var(--accent-primary);
    padding: 16px 20px;
    margin: 16px 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.info-box strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.info-box p {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.key-display {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--radius-md);
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    margin: 16px 0;
    word-break: break-all;
    border: 1px solid var(--border-light);
}

.copy-btn {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

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

/* ==========================================
   ACTIONS
   ========================================== */

.actions {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.actions .btn {
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

/* Table action buttons - even smaller */
td .actions .btn,
td.actions .btn,
.table-container .actions .btn {
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* ==========================================
   SUPPORT TICKETS
   ========================================== */

.tickets-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ticket-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.ticket-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ticket-header h3 {
    margin: 0;
    padding: 0;
    border: none;
    font-size: 1rem;
    font-weight: 600;
}

.ticket-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.ticket-status.status-open {
    background: var(--info-light);
    color: var(--info-color);
}

.ticket-status.status-in_progress {
    background: var(--warning-light);
    color: var(--warning-color);
}

.ticket-status.status-waiting_customer {
    background: rgba(123, 104, 238, 0.1);
    color: var(--accent-tertiary);
}

.ticket-status.status-closed {
    background: var(--success-light);
    color: var(--success-color);
}

.ticket-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px 16px;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

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

.priority {
    font-weight: 500;
}

.priority-low { color: var(--text-tertiary); }
.priority-normal { color: var(--info-color); }
.priority-high { color: var(--warning-color); }
.priority-urgent { color: var(--danger-color); font-weight: 600; }

.tickets-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.tickets-empty h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* Ticket Detail */
.ticket-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.ticket-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.ticket-actions select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background: var(--bg-elevated);
    font-family: inherit;
}

.ticket-messages {
    max-height: 400px;
    overflow-y: auto;
}

.message {
    padding: 16px;
    margin-bottom: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.message-customer {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.2);
}

.message-admin {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.2);
}

.message.internal {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

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

.message-type {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
}

.internal-badge {
    background: var(--danger-light);
    color: var(--danger-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
}

.message-date {
    color: var(--text-tertiary);
    margin-left: auto;
    font-size: 0.8rem;
}

.message-body {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.reply-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.reply-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 12px;
    font-family: inherit;
}

.reply-form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(232, 93, 59, 0.1);
}

.reply-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.reply-actions label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

/* ==========================================
   CHARTS
   ========================================== */

.charts-container {
    margin-top: 30px;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.chart-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-base);
}

.chart-card:hover {
    box-shadow: var(--shadow-md);
}

.chart-card h4 {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.chart-card canvas {
    max-height: 300px;
}

.chart-wrapper {
    position: relative;
    height: 250px;
}

/* ==========================================
   PERFORMANCE TESTING
   ========================================== */

.performance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 24px;
}

.test-list {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.test-list::-webkit-scrollbar {
    width: 8px;
}

.test-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.test-list::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 4px;
}

.test-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

.test-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    margin-bottom: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.test-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-medium);
    transform: translateX(4px);
}

.test-item:last-child {
    margin-bottom: 0;
}

.test-item.completed { border-left: 4px solid var(--success-color); }
.test-item.failed { border-left: 4px solid var(--danger-color); }
.test-item.running {
    border-left: 4px solid var(--info-color);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

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

.test-info strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.test-info small {
    display: block;
    color: var(--text-tertiary);
    font-size: 0.8rem;
    line-height: 1.5;
}

.test-list .info,
.test-list .loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* Test Status */
.test-status {
    display: flex;
    gap: 32px;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 20px;
}

.test-status span {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

.test-status strong {
    color: var(--text-primary);
    font-weight: 600;
    margin-left: 8px;
}

/* Output Container */
.output-container {
    padding: 20px 24px;
}

.output-container pre {
    background: #1f2937;
    color: #f3f4f6;
    padding: 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    max-height: 500px;
}

/* Results */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.result-card {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-warm) 100%);
    color: white;
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-fast);
}

.result-card:hover {
    transform: translateY(-4px);
}

.result-card.success {
    background: linear-gradient(135deg, var(--success-color) 0%, #34d399 100%);
}

.result-card.error {
    background: linear-gradient(135deg, var(--danger-color) 0%, #f87171 100%);
}

.result-card h4 {
    margin: 0 0 10px 0;
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-card .big {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.results-summary {
    padding: 24px;
}

.results-summary h4 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin: 24px 0 16px 0;
}

/* ==========================================
   TELEMETRY
   ========================================== */

/* Chart wrapper - replaces inline height styles for responsiveness */
.chart-wrapper {
    position: relative;
    height: 300px;
}

.chart-wrapper-lg {
    height: 350px;
}

.chart-wrapper-sm {
    height: 200px;
}

/* Charts Row - 2-column layout for version charts + stats */
.charts-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

/* Stats grid 2-column layout for telemetry averages */
.telemetry-stats-2col {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Growth Indicators */
.growth-indicators {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.growth-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 150px;
}

.growth-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.growth-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.growth-positive { color: var(--success-color); font-weight: 600; }
.growth-negative { color: var(--danger-color); font-weight: 600; }
.growth-neutral { color: var(--text-tertiary); }

/* Instance Info Grid */
.instance-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-md);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.info-value code {
    font-size: 0.75rem;
    word-break: break-all;
}

/* ==========================================
   INSTANCE DETAIL PANEL
   ========================================== */

.detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 520px;
    height: 100vh;
    background: var(--bg-elevated);
    border-left: 1px solid var(--border-light);
    box-shadow: var(--shadow-xl);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.detail-panel.active {
    transform: translateX(0);
}

.detail-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 23, 20, 0.3);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
}

.detail-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.detail-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.detail-title h3 {
    margin: 0 0 4px 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-title code {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
}

.detail-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.detail-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.detail-stat {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--radius-md);
    text-align: center;
}

.detail-stat .label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.detail-stat .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section h4 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

/* Language Bars */
.language-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.language-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.language-bar .lang {
    width: 32px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.language-bar .bar-container {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.language-bar .bar-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.language-bar .count {
    width: 60px;
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Version Grid */
.version-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.version-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.version-item .label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* Report History */
.report-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.report-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.report-item:hover {
    border-color: var(--accent-primary);
    background: rgba(232, 93, 59, 0.05);
}

.report-item.selected {
    border-color: var(--accent-primary);
    background: rgba(232, 93, 59, 0.1);
}

.report-item .report-date {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    min-width: 90px;
}

.report-item .report-stats {
    flex: 1;
    font-size: 0.85rem;
}

.report-item .report-stats strong {
    color: var(--text-primary);
}

.report-item .report-change {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.report-item .report-change.positive {
    background: var(--success-light);
    color: var(--success-color);
}

.report-item .report-change.negative {
    background: var(--danger-light);
    color: var(--danger-color);
}

/* MetaVox Report History with Diffs */
.report-item.latest {
    border-color: var(--accent-primary);
    background: rgba(232, 93, 59, 0.05);
}

.report-item .report-date {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.report-item .report-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-with-diff {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.stat-with-diff .stat-label {
    color: var(--text-tertiary);
    min-width: 55px;
}

.stat-with-diff strong {
    color: var(--text-primary);
    min-width: 45px;
}

.diff {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.diff.positive {
    background: var(--success-light);
    color: var(--success-color);
}

.diff.negative {
    background: var(--danger-light);
    color: var(--danger-color);
}

.diff.neutral {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.badge-small {
    font-size: 0.65rem;
    padding: 2px 6px;
    background: var(--accent-primary);
    color: white;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Selection hint */
.selection-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 10px;
    font-style: italic;
}

/* Compact report stats (inline) */
.report-stats-compact {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    flex-wrap: wrap;
}

.report-stats-compact span {
    color: var(--text-secondary);
}

.report-stats-compact strong {
    color: var(--text-primary);
}

/* Report item compare state */
.report-item.compare {
    border-color: var(--accent-tertiary);
    background: rgba(123, 104, 238, 0.1);
}

/* Report breakdown section */
.report-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.breakdown-column {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.breakdown-column h5 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.breakdown-column.primary h5 {
    color: var(--accent-primary);
}

.breakdown-column.compare h5 {
    color: var(--accent-tertiary);
}

.breakdown-column h6 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 12px 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.breakdown-summary {
    margin-bottom: 8px;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
}

.breakdown-row:last-child {
    border-bottom: none;
}

.breakdown-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.breakdown-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.breakdown-types {
    max-height: 200px;
    overflow-y: auto;
}

/* Report Filters */
.report-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.report-filters select,
.report-filters input[type="text"] {
    padding: 6px 10px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-family: inherit;
}

.report-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: rgba(232, 93, 59, 0.1);
    color: var(--accent-primary);
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 10px;
    margin-left: 8px;
}

/* Report Pagination */
.report-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.report-pagination span {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* Table Pagination */
.table-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.table-pagination span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Report Breakdown */
.report-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.breakdown-column {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 12px;
}

.breakdown-column.primary {
    border: 2px solid var(--accent-primary);
}

.breakdown-column.compare {
    border: 2px solid var(--warning-color);
}

.breakdown-column h5 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.85rem;
}

.breakdown-row .lang {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.breakdown-row .count {
    color: var(--text-primary);
}

/* Export Dropdown */
.export-dropdown {
    position: relative;
}

.export-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 100;
    min-width: 150px;
    overflow: hidden;
}

.export-menu.hidden {
    display: none;
}

.export-menu button {
    display: block;
    width: 100%;
    padding: 10px 14px;
    text-align: left;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color var(--transition-fast);
    font-family: inherit;
}

.export-menu button:hover {
    background: var(--bg-secondary);
}

/* ==========================================
   NOTIFICATIONS
   ========================================== */

.k6-notification {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    animation: slideIn 0.3s ease;
    max-width: 400px;
    font-weight: 500;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.k6-notification.success {
    background: var(--success-color);
    color: white;
}

.k6-notification.error {
    background: var(--danger-color);
    color: white;
}

.k6-notification.info {
    background: var(--info-color);
    color: white;
}

/* ==========================================
   TEXT UTILITIES
   ========================================== */

.text-muted {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* ==========================================
   SCROLLBAR
   ========================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ==========================================
   NOTIFICATIONS DROPDOWN
   ========================================== */

.notifications-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    overflow: hidden;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.notifications-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.notifications-header .btn-link {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
}

.notifications-header .btn-link:hover {
    text-decoration: underline;
}

.notifications-list {
    max-height: 320px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: var(--bg-secondary);
}

.notification-item.warning .notification-icon {
    color: var(--warning-color);
}

.notification-item.info .notification-icon {
    color: var(--info-color);
}

.notification-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.notification-icon svg {
    width: 100%;
    height: 100%;
}

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

.notification-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.notification-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.notifications-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
    text-align: center;
}

.notifications-footer a {
    color: var(--accent-primary);
    font-size: 0.85rem;
    text-decoration: none;
}

.notifications-footer a:hover {
    text-decoration: underline;
}

.loading-small {
    padding: 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

/* ==========================================
   SEARCH RESULTS
   ========================================== */

.search-container {
    position: relative;
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    max-height: 400px;
    overflow-y: auto;
}

.search-section {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.search-section:last-child {
    border-bottom: none;
}

.search-section-title {
    padding: 8px 16px 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.search-result-item:hover {
    background: var(--bg-secondary);
}

.search-result-item svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.search-result-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.search-empty,
.search-loading {
    padding: 24px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* Row highlighting for search */
tr.highlighted {
    animation: highlightRow 2s ease;
}

@keyframes highlightRow {
    0%, 100% { background: transparent; }
    20%, 80% { background: rgba(232, 93, 59, 0.15); }
}

/* ==========================================
   SETTINGS MODAL
   ========================================== */

.settings-modal {
    max-width: 480px;
}

.settings-section {
    margin-bottom: 24px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h4 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item.clickable {
    cursor: pointer;
    transition: all var(--transition-fast);
}

.setting-item.clickable:hover {
    background: var(--bg-tertiary);
}

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

.setting-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.setting-item svg {
    color: var(--text-tertiary);
}

.setting-item.danger svg {
    color: var(--danger-color);
}

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.setting-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.setting-item.danger .setting-label {
    color: var(--danger-color);
}

.setting-value {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.setting-value.status-active {
    color: var(--success-color);
    font-weight: 500;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .welcome-card {
        grid-column: span 6;
    }

    .quick-stats {
        grid-column: span 6;
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Old mobile styles removed - see IMPROVED MOBILE RESPONSIVE section below */

/* ==========================================
   LEGACY SUPPORT (OLD TAB LAYOUT)
   ========================================== */

/* Header for non-sidebar layout */
header {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    max-width: 1600px;
    margin: 0 auto;
}

.header-content h1 {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Tabs Navigation */
.tabs {
    display: flex;
    padding: 0 32px;
    gap: 4px;
    background: var(--bg-secondary);
    overflow-x: auto;
}

.tab-btn {
    padding: 14px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
    white-space: nowrap;
    position: relative;
    font-family: inherit;
}

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

.tab-btn.active {
    color: var(--accent-primary);
    background: var(--bg-elevated);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 3px 3px 0 0;
}

/* Main Content for non-sidebar */
main.main-content {
    padding: 32px;
    max-width: 1600px;
    margin: 0 auto;
}

/* Hide sidebar elements when using tab layout */
#admin-screen:not(.app-container) .sidebar {
    display: none;
}

#admin-screen:not(.app-container) main.main-content {
    margin-left: 0;
}

/* Login form button should be full width */
.login-form .btn-primary,
.login-card .btn-primary {
    width: 100%;
}

/* SSO Login */
.sso-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.25rem 0;
    color: var(--text-tertiary);
}

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

.sso-divider span {
    padding: 0 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-keycloak {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1.5px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-keycloak:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* ==========================================
   PLATFORM OVERVIEW
   ========================================== */

.platform-overview-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 16px;
    margin-bottom: 24px;
    align-items: stretch;
}

.platform-totals-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

.platform-chart-row {
    margin-bottom: 24px;
}

.platform-chart-card {
    padding: 20px 24px;
    min-width: 0;
}

.platform-chart-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.platform-stat {
    display: flex;
    align-items: center;
    gap: 16px;
}

.platform-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #f59e0b 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.platform-stat-icon svg {
    width: 24px;
    height: 24px;
}

.platform-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    line-height: 1;
}

.platform-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
}

.platform-stat-growth {
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 6px;
}

.growth-positive {
    color: #16a34a;
}

.growth-negative {
    color: #dc2626;
}

/* App adoption card */
.platform-adoption-card {
    padding: 20px 24px;
}

.platform-adoption-card h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.adoption-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.adoption-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.adoption-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    width: 48px;
    flex-shrink: 0;
}

.adoption-bar-container {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.adoption-bar {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0;
}

.adoption-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    width: 32px;
    text-align: right;
    flex-shrink: 0;
}

/* App history row (chart + today card) */
.app-history-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: stretch;
}

.app-history-chart-card {
    min-width: 0;
}

/* Today card */
.platform-today-card {
    padding: 20px 24px;
}

.platform-today-card h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.today-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.today-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.today-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Weekly User Growth Card */
.platform-weekly-growth-card {
    padding: 20px 24px;
}

.platform-weekly-growth-card h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.weekly-growth-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.weekly-growth-stat {
    display: flex;
    flex-direction: column;
}

.weekly-growth-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.weekly-growth-indicator {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 4px;
}

.weekly-growth-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.weekly-growth-chart-container {
    height: 60px;
    width: 100%;
}

/* Platform details row (NC versions, PHP versions, new instances) */
.platform-details {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 16px;
    margin-top: 16px;
    margin-bottom: 24px;
}

.platform-versions-card,
.platform-new-instances-card {
    padding: 20px 24px;
    align-self: stretch;
}

.platform-versions-card h4,
.platform-new-instances-card h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.new-badge {
    font-size: 0.7rem;
    font-weight: 500;
    background: #fef3c7;
    color: #d97706;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
}

.version-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.version-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
}

.version-item:last-child {
    border-bottom: none;
}

.version-name {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.version-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 10px;
}

.version-loading {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* New instances list */
.new-instances-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
}

.new-instance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.new-instance-item:last-child {
    border-bottom: none;
}

.new-instance-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.new-instance-hash {
    font-size: 0.8rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: var(--text-primary);
}

.new-instance-apps {
    display: flex;
    gap: 4px;
}

.app-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: capitalize;
}

.app-badge-intravox {
    background: #e0f2fe;
    color: #0284c7;
}

.app-badge-metavox {
    background: #f0fdf4;
    color: #16a34a;
}

.app-badge-introvox {
    background: #fef3c7;
    color: #d97706;
}

.app-badge-formvox {
    background: #ede9fe;
    color: #7c3aed;
}

.app-badge-roomvox {
    background: #fce7f3;
    color: #db2777;
}

.new-instance-meta {
    display: flex;
    gap: 12px;
    align-items: center;
}

.new-instance-users {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.new-instance-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* App card growth indicator */
.app-growth {
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    margin-left: 4px;
}

/* Country Distribution */
.country-distribution-row {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 16px;
    margin-top: 16px;
    margin-bottom: 24px;
}

.country-map-card,
.country-list-card {
    padding: 20px 24px;
}

.country-map-card h4,
.country-list-card h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.country-list {
    max-height: 240px;
    overflow-y: auto;
}

.country-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid var(--border-light);
}

.country-row:last-child {
    border-bottom: none;
}

.country-code {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Fira Code', monospace;
    width: 24px;
    flex-shrink: 0;
}

.country-name {
    font-size: 0.8rem;
    color: var(--text-primary);
    min-width: 80px;
    flex-shrink: 0;
}

.country-bar-container {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.country-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-warm));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.country-instances {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 28px;
    text-align: right;
    flex-shrink: 0;
}

.country-users {
    font-size: 0.7rem;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: right;
    flex-shrink: 0;
}

.country-list-empty {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    text-align: center;
    padding: 40px 0;
}

.country-show-all {
    display: block;
    width: 100%;
    padding: 8px 0;
    margin-top: 4px;
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
}

.country-show-all:hover {
    text-decoration: underline;
}

/* Map legend */
.map-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    justify-content: flex-end;
}

.map-legend-gradient {
    width: 120px;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #fde4d4, #E85D3B);
}

.map-legend-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.map-legend-suffix {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

/* Hide jsvectormap default legend */
.jvm-legend {
    display: none !important;
}

/* jsvectormap zoom buttons */
.jvm-zoom-btn {
    position: absolute !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 6px !important;
    background-color: var(--bg-primary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 10 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: background 0.15s, border-color 0.15s;
    line-height: 1 !important;
    padding: 0 !important;
}

.jvm-zoom-btn:hover {
    background-color: var(--bg-secondary) !important;
    border-color: var(--accent-primary) !important;
}

.jvm-zoomin {
    top: 8px !important;
    left: 8px !important;
}

.jvm-zoomout {
    top: 42px !important;
    left: 8px !important;
}

/* jsvectormap tooltip */
.jvm-tooltip {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-family: inherit !important;
    font-size: 0.8rem !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    z-index: 99999 !important;
    pointer-events: none !important;
}

.jvm-tooltip.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Server Configuration Overview */
.server-config-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.config-card {
    padding: 16px 20px;
}

.config-card h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.config-list-empty {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    text-align: center;
    padding: 16px 0;
}

.config-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}

.config-name {
    font-size: 0.8rem;
    color: var(--text-primary);
    min-width: 60px;
    flex-shrink: 0;
}

.config-bar-container {
    flex: 1;
    height: 5px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.config-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-warm));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.config-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 20px;
    text-align: right;
    flex-shrink: 0;
}

.config-pct {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    min-width: 28px;
    text-align: right;
    flex-shrink: 0;
}

/* Docker stats */
.docker-stats {
    padding: 8px 0;
}

.docker-bar-track {
    height: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.docker-bar-fill.docker-yes {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 8px;
}

.docker-labels {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.docker-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.docker-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.docker-yes-dot {
    background: var(--accent-primary);
}

.docker-no-dot {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
}

/* Responsive */
@media (max-width: 1200px) {
    .platform-overview-row {
        grid-template-columns: 1fr 1fr;
    }

    .platform-details {
        grid-template-columns: 1fr 1fr;
    }

    .country-distribution-row {
        grid-template-columns: 1fr 280px;
    }

    .server-config-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .platform-overview-row {
        grid-template-columns: 1fr;
    }

    .platform-details {
        grid-template-columns: 1fr;
    }

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

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

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

    .country-list {
        max-height: 200px;
    }
}

/* ==========================================
   APP TELEMETRY OVERVIEW
   ========================================== */

.section-header {
    margin: 24px 0 16px 0;
}

.section-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.telemetry-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.app-telemetry-card {
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    text-align: center;
    padding: 24px 16px;
}

.app-telemetry-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.app-telemetry-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.app-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-icon svg {
    width: 24px;
    height: 24px;
}

.app-icon.intravox {
    background: #e0f2fe;
    color: #0284c7;
}

.app-icon.metavox {
    background: #f0fdf4;
    color: #16a34a;
}

.app-icon.introvox {
    background: #fef3c7;
    color: #d97706;
}

.app-icon.formvox {
    background: #ede9fe;
    color: #7c3aed;
}

.app-icon.roomvox {
    background: #fce7f3;
    color: #db2777;
}

.app-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}

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

.app-stat .stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.app-stat .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: lowercase;
}

.view-link {
    font-size: 0.875rem;
    color: var(--accent-primary);
    font-weight: 500;
}

@media (max-width: 1200px) {
    .telemetry-overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .telemetry-overview-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   DASHBOARD BOTTOM SECTION
   ========================================== */

.dashboard-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

/* Recent Activity */
.activity-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: var(--bg-secondary);
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon svg {
    width: 18px;
    height: 18px;
}

.activity-icon.info {
    background: var(--info-light);
    color: var(--info-color);
}

.activity-icon.warning {
    background: var(--warning-light);
    color: var(--warning-color);
}

.activity-icon.success {
    background: var(--success-light);
    color: var(--success-color);
}

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

.activity-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.activity-subtitle {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.activity-list .empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
}

.activity-list .empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.activity-list .empty-state p {
    margin: 0;
}

/* Expiring Licenses Preview */
.expiring-preview-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.expiring-preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

.expiring-preview-item:last-child {
    border-bottom: none;
}

.expiring-preview-item:hover {
    background: var(--bg-secondary);
}

.expiring-info {
    min-width: 0;
}

.expiring-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.expiring-key {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: monospace;
}

.expiring-date {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--warning-color);
    white-space: nowrap;
}

@media (max-width: 900px) {
    .dashboard-bottom {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   TOGGLE SWITCH
   ========================================== */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: var(--transition-fast);
    border-radius: 24px;
    border: 1px solid var(--border-medium);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: var(--transition-fast);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(232, 93, 59, 0.2);
}

/* ==========================================
   COLLAPSIBLE SIDEBAR
   ========================================== */

:root {
    --sidebar-collapsed-width: 80px;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: absolute;
    top: 50%;
    right: -16px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: var(--accent-primary);
    border: 2px solid var(--bg-elevated);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 101;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-fast);
    padding: 0;
}

.sidebar-toggle:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-50%) scale(1.1);
}

.sidebar-toggle svg {
    width: 16px;
    height: 16px;
    color: white;
    transition: transform var(--transition-base);
}

/* Collapsed Sidebar State */
.sidebar {
    transition: width var(--transition-base);
    position: relative;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .user-info {
    opacity: 0;
    visibility: hidden;
    width: 0;
    overflow: hidden;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.sidebar.collapsed .sidebar-header {
    padding: 20px 0;
    justify-content: center;
}

.sidebar.collapsed .sidebar-logo {
    margin: 0 auto;
}

.sidebar.collapsed .sidebar-nav {
    padding: 0 8px;
}

.sidebar.collapsed .nav-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar.collapsed .nav-item {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 56px;
    height: 48px;
    padding: 0;
    margin: 4px auto;
    border-radius: var(--radius-md);
    gap: 0;
}

.sidebar.collapsed .nav-item:hover {
    background: var(--bg-secondary);
}

.sidebar.collapsed .nav-item.active {
    background: linear-gradient(135deg, rgba(232, 93, 59, 0.15) 0%, rgba(244, 162, 97, 0.15) 100%);
}

.sidebar.collapsed .nav-item.active::before {
    display: none;
}

.sidebar.collapsed .nav-icon {
    margin: 0 auto;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-footer {
    padding: 16px 12px;
}

.sidebar.collapsed .user-profile {
    justify-content: center;
}

.sidebar.collapsed .user-avatar {
    margin: 0 auto;
}

.sidebar.collapsed .btn-icon {
    display: none;
}

.sidebar.collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

/* Main content transition */
.main-content {
    transition: margin-left var(--transition-base);
}

.app-container.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Tooltip for collapsed state */
.sidebar.collapsed .nav-item {
    position: relative;
}

.sidebar.collapsed .nav-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-primary);
    color: var(--text-inverse);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all var(--transition-fast);
    z-index: 1000;
}

.sidebar.collapsed .nav-item:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ==========================================
   IMPROVED MOBILE RESPONSIVE
   ========================================== */

/* Tablet - 992px and below */
@media (max-width: 992px) {
    /* Prevent horizontal scroll to sidebar */
    html, body {
        overflow-x: hidden;
    }

    /* Body scroll lock when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }

    .app-container {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-base), width var(--transition-base);
        width: var(--sidebar-width) !important;
        position: fixed;
        left: 0;
        top: 0;
        height: 100dvh;
        height: 100vh; /* Fallback */
        max-height: -webkit-fill-available;
        z-index: 100;
    }

    .sidebar-nav {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        width: var(--sidebar-width) !important;
    }

    .sidebar.collapsed .sidebar-logo-text,
    .sidebar.collapsed .nav-label,
    .sidebar.collapsed .nav-badge,
    .sidebar.collapsed .nav-section-title,
    .sidebar.collapsed .user-info {
        opacity: 1;
        visibility: visible;
        width: auto;
    }

    .sidebar.collapsed .sidebar-header {
        padding: 20px 24px;
        justify-content: flex-start;
    }

    .sidebar.collapsed .nav-item {
        justify-content: flex-start;
        padding: 10px 12px;
    }

    .sidebar.collapsed .sidebar-footer {
        padding: 16px 20px;
    }

    .sidebar.collapsed .user-profile {
        justify-content: flex-start;
    }

    .sidebar.collapsed .btn-icon {
        display: flex;
    }

    .sidebar-toggle {
        display: none;
    }

    .main-content,
    .app-container.sidebar-collapsed .main-content {
        margin-left: 0 !important;
    }

    .mobile-menu-btn {
        display: flex !important;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
        opacity: 0;
        transition: opacity var(--transition-base);
        pointer-events: none;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    /* Main content not interactive when sidebar open */
    body.sidebar-open .main-content {
        pointer-events: none;
    }
}

/* Mobile - 768px and below */
@media (max-width: 768px) {
    .content-area {
        padding: 16px;
    }

    .header {
        padding: 0 16px;
        height: 56px;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .search-container {
        display: none;
    }

    .header-actions {
        gap: 4px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Fix welcome card on mobile */
    .welcome-card {
        grid-column: span 1;
        background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-warm) 100%) !important;
        min-height: auto;
    }

    .welcome-card .welcome-content {
        padding: 24px;
    }

    .welcome-card .welcome-greeting,
    .welcome-card .welcome-title,
    .welcome-card .welcome-subtitle {
        color: white !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .welcome-card .welcome-greeting {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }

    .welcome-card .welcome-title {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }

    .welcome-card .welcome-subtitle {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .quick-stats {
        grid-column: span 1;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .dashboard-bottom {
        grid-template-columns: 1fr;
    }

    .tab-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .tab-header h2 {
        font-size: 1.15rem;
        word-break: break-word;
    }

    .tab-header .btn {
        width: 100%;
        justify-content: center;
    }

    .growth-indicators {
        flex-direction: column;
        gap: 12px;
    }

    .growth-card {
        min-width: unset;
    }

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

    .chart-wrapper-lg {
        height: 280px;
    }

    .chart-wrapper {
        height: 250px;
    }

    .table-filters {
        flex-wrap: wrap;
        gap: 8px;
    }

    .table-filters input[type="text"],
    .table-filters select {
        min-width: unset;
        flex: 1 1 100%;
    }

    .telemetry-stats-2col {
        grid-template-columns: 1fr;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-container table {
        min-width: 500px;
    }

    .card {
        padding: 16px;
    }

    .card h3 {
        padding: 16px;
        font-size: 0.9rem;
    }

    .stat-card.small {
        padding: 12px;
        gap: 10px;
    }

    .stat-card.small .stat-value {
        font-size: 1.25rem;
    }

    .stat-card.small .stat-label {
        font-size: 0.7rem;
    }

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

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

    .detail-panel {
        width: 100%;
        max-width: 100%;
    }

    .detail-stats {
        grid-template-columns: 1fr 1fr;
    }

    /* Modal improvements for mobile */
    .modal {
        width: calc(100% - 32px);
        max-width: none;
        max-height: calc(100vh - 32px);
        margin: 16px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-header,
    .modal-footer {
        padding: 16px;
    }

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

    /* All Instances filter card mobile */
    .filter-card {
        padding: 12px;
    }

    .filter-row {
        gap: 10px;
    }

    .filter-group {
        flex: 1 1 calc(50% - 5px);
        min-width: 0;
    }

    .filter-group select,
    .filter-group input {
        min-width: unset;
        width: 100%;
    }

    .filter-group.search-group {
        flex: 1 1 100%;
    }

    .filter-group.search-group input {
        min-width: unset;
    }

    .chip-group {
        flex-wrap: wrap;
    }

    .chip {
        padding: 5px 10px;
        font-size: 12px;
    }

    .filter-row.quick-filters {
        gap: 6px;
        flex-wrap: wrap;
    }

    /* Sort bar visible on tablet/mobile */
    .sort-bar {
        display: flex;
    }

    /* Table responsive on tablet */
    .table-responsive {
        margin: 0 -16px;
        padding: 0 16px;
    }

    /* Pagination mobile */
    .table-pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .table-pagination span {
        order: -1;
        flex: 1 1 100%;
        text-align: center;
    }

    .table-pagination .btn {
        flex: 1;
        text-align: center;
    }

    .header-actions {
        flex-wrap: wrap;
    }

    .header-actions .btn {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* Small Mobile - 480px and below */
@media (max-width: 480px) {
    .login-card,
    .login-box {
        padding: 24px 20px;
        margin: 16px;
    }

    .login-header .logo-text {
        font-size: 1.5rem;
    }

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

    .quick-stats {
        grid-template-columns: 1fr;
    }

    .detail-stats {
        grid-template-columns: 1fr;
    }

    #backup-codes-list {
        grid-template-columns: 1fr;
    }

    .backup-codes-actions {
        flex-direction: column;
    }

    .backup-codes-actions .btn {
        width: 100%;
    }

    .welcome-card {
        padding: 20px;
    }

    .welcome-title {
        font-size: 1.5rem;
    }

    .welcome-actions {
        flex-direction: column;
        gap: 8px;
    }

    .welcome-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .header-content h1 {
        font-size: 1rem;
    }

    .tab-header h2 {
        font-size: 1rem;
    }

    .chart-wrapper-lg {
        height: 220px;
    }

    .chart-wrapper {
        height: 200px;
    }

    .chart-wrapper-sm {
        height: 160px;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-card {
        padding: 12px;
        gap: 10px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
    }

    .card-header-with-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .card-header-with-filters h3 {
        padding: 0;
        border: none;
    }

    .table-container table {
        min-width: 400px;
    }

    /* Hide less important columns on small screens */
    .table-responsive .hide-mobile {
        display: none;
    }

    /* On small mobile, table fits without horizontal scroll */
    .table-responsive table {
        min-width: unset;
        width: 100%;
    }

    .instance-info-grid {
        grid-template-columns: 1fr;
    }

    .filter-group {
        flex: 1 1 100%;
    }
}

/* Hide mobile menu button on desktop */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
}

/* Dashboard Filter Styles */
.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-right: 12px;
}

.filter-badge.hidden {
    display: none;
}

.filter-badge .filter-label {
    white-space: nowrap;
}

.filter-badge .filter-clear {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.filter-badge .filter-clear:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Clickable rows */
.country-row.clickable,
.config-row.clickable {
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.country-row.clickable:hover,
.config-row.clickable:hover {
    background: var(--hover-bg);
    transform: translateX(2px);
}

.country-row.clickable.active,
.config-row.clickable.active {
    background: rgba(var(--primary-rgb), 0.1);
    border-left: 3px solid var(--primary-color);
    padding-left: calc(var(--space-sm) - 3px);
}

.country-row.clickable.active .country-bar,
.config-row.clickable.active .config-bar {
    background: var(--primary-color);
}

/* Filter badge - enhanced styling */
.filter-badge .filter-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-badge .filter-text {
    white-space: nowrap;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Docker clickable styling */
.docker-bar-fill.clickable {
    cursor: pointer;
    transition: opacity 0.15s;
}

.docker-bar-fill.clickable:hover {
    opacity: 0.8;
}

.docker-bar-fill.clickable.active {
    box-shadow: 0 0 0 2px var(--primary-color);
}

.docker-label.clickable {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s;
}

.docker-label.clickable:hover {
    background: var(--hover-bg);
}

.docker-label.clickable.active {
    background: rgba(var(--primary-rgb), 0.1);
    font-weight: 600;
}

/* Filter badge positioning in dashboard */
#dashboard-filter-badge {
    margin: 16px 24px;
    display: inline-flex;
    animation: slideIn 0.2s ease-out;
}

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

/* ==========================================
   ALL INSTANCES PAGE
   ========================================== */

/* Card header with View All link */
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-header-row h4 {
    margin: 0;
}

.view-all-link {
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.view-all-link:hover {
    text-decoration: underline;
}

/* Filter card */
.filter-card {
    padding: 16px 20px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filter-row.quick-filters {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    align-items: center;
}

.quick-filter-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

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

.filter-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.filter-group select,
.filter-group input {
    min-width: 120px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    background: var(--card-bg);
}

.filter-group.search-group input {
    min-width: 180px;
}

/* Table responsive wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Sort bar above table */
.sort-bar {
    display: none;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.sort-bar select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    background: var(--card-bg);
    flex: 1;
}

/* Chip buttons */
.chip-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.chip {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--card-bg);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.chip:hover {
    background: var(--hover-bg);
}

.chip.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.chip.small {
    padding: 4px 10px;
    font-size: 12px;
}

/* App-specific chip colors */
.chip.app-intravox.active { background: #3b82f6; border-color: #3b82f6; }
.chip.app-metavox.active { background: #f59e0b; border-color: #f59e0b; }
.chip.app-introvox.active { background: #10b981; border-color: #10b981; }
.chip.app-formvox.active { background: #8b5cf6; border-color: #8b5cf6; }
.chip.app-roomvox.active { background: #ec4899; border-color: #ec4899; }

/* App badges in table */
.badge-intravox { background: #3b82f6; color: white; }
.badge-metavox { background: #f59e0b; color: white; }
.badge-introvox { background: #10b981; color: white; }
.badge-formvox { background: #8b5cf6; color: white; }
.badge-roomvox { background: #ec4899; color: white; }

.apps-cell {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.apps-cell .badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Clickable table rows */
.clickable-row {
    cursor: pointer;
    transition: background 0.15s;
}

.clickable-row:hover {
    background: var(--hover-bg);
}

/* Instance hash styling */
.instance-hash {
    font-size: 12px;
    background: var(--code-bg, #f3f4f6);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Stats row with 4 columns */
.stats-row.four-cols {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 1200px) {
    .stats-row.four-cols {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .stats-row.four-cols {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* New Instances Per Day Chart */
.new-instances-chart-card {
    padding: 20px 24px;
    margin-bottom: 16px;
}

.new-instances-chart-card h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.new-instances-chart-container {
    height: 120px;
    width: 100%;
}

/* ==========================================
   INSTANCE DETAIL PAGE
   ========================================== */

.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 16px;
}

.instance-detail-header {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.instance-hash-display {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.instance-hash-display code {
    font-size: 14px;
    background: var(--code-bg, #f3f4f6);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: monospace;
}

.instance-apps-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.instance-apps-badges .badge {
    padding: 4px 12px;
    font-size: 13px;
}

.instance-timestamps {
    display: flex;
    gap: 24px;
    font-size: 13px;
    color: var(--text-muted);
}

.instance-timestamps strong {
    color: var(--text-color);
}

/* Instance detail grid */
.instance-detail-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .instance-detail-grid {
        grid-template-columns: 1fr;
    }
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-item .label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item .value {
    font-size: 14px;
    font-weight: 500;
}

/* App cards */
#instance-app-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.app-card {
    border-left: 4px solid var(--border-color);
}

.app-card.intravox { border-left-color: #3b82f6; }
.app-card.metavox { border-left-color: #f59e0b; }
.app-card.introvox { border-left-color: #10b981; }
.app-card.formvox { border-left-color: #8b5cf6; }
.app-card.roomvox { border-left-color: #ec4899; }

.app-card h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.app-metrics {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.app-metrics .metric {
    display: flex;
    flex-direction: column;
}

.app-metrics .metric .value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
}

.app-metrics .metric .label {
    font-size: 12px;
    color: var(--text-muted);
}

.lang-breakdown,
.type-breakdown,
.wizard-stats {
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.lang-breakdown h5,
.type-breakdown h5,
.wizard-stats h5 {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.lang-bar,
.type-bar {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
}

.detail-panel .stats-grid {
    display: flex;
    gap: 16px;
    font-size: 13px;
}

.languages {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Activity chart */
.chart-container {
    height: 300px;
    position: relative;
}

/* Table header with count */
.table-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */

.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 420px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--text-secondary);
    animation: toastIn 0.3s ease-out;
    pointer-events: auto;
    max-width: 100%;
    word-break: break-word;
}

.toast.toast-out {
    animation: toastOut 0.2s ease-in forwards;
}

.toast-success { border-left-color: var(--success-color); }
.toast-error { border-left-color: var(--danger-color); }
.toast-warning { border-left-color: var(--warning-color); }
.toast-info { border-left-color: var(--info-color); }

.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.toast-success .toast-icon { color: var(--success-color); }
.toast-error .toast-icon { color: var(--danger-color); }
.toast-warning .toast-icon { color: var(--warning-color); }
.toast-info .toast-icon { color: var(--info-color); }

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 2px;
    line-height: 1;
    font-size: 18px;
}

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

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

/* ==========================================
   LOADING SPINNER
   ========================================== */

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-medium);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.loading-spinner.lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 16px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 16px;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.empty-state svg {
    width: 40px;
    height: 40px;
    opacity: 0.4;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   CONFIRM MODAL
   ========================================== */

.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease-out;
}

.confirm-dialog {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 420px;
    width: 90%;
    box-shadow: var(--shadow-xl);
}

.confirm-dialog h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.confirm-dialog p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================
   HEALTH STATUS DOTS
   ========================================== */

.health-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.health-dot.healthy { background: var(--success-color); }
.health-dot.warning { background: var(--warning-color); }
.health-dot.critical { background: var(--danger-color); }

/* ==========================================
   DARK MODE
   ========================================== */

[data-theme="dark"] {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #1a1a2e;
    --bg-elevated: #222244;

    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --text-inverse: #1a1a2e;

    --accent-primary: #f97316;
    --accent-primary-hover: #ea580c;
    --accent-secondary: #34d399;
    --accent-tertiary: #818cf8;
    --accent-warm: #fbbf24;

    --border-light: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.12);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.5);

    --success-color: #22c55e;
    --success-light: #14532d;
    --danger-color: #ef4444;
    --danger-light: #7f1d1d;
    --warning-color: #eab308;
    --warning-light: #713f12;
    --info-color: #3b82f6;
    --info-light: #1e3a5f;
}

[data-theme="dark"] .card,
[data-theme="dark"] .filter-card,
[data-theme="dark"] .modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
}

[data-theme="dark"] .sidebar {
    background: #0f0f23;
    border-right-color: var(--border-light);
}

[data-theme="dark"] .header {
    background: rgba(26, 26, 46, 0.95);
    border-bottom-color: var(--border-light);
}

[data-theme="dark"] table thead th {
    background: var(--bg-secondary);
}

[data-theme="dark"] table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .login-card {
    background: var(--bg-elevated);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--bg-secondary);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

[data-theme="dark"] .btn-secondary {
    background: var(--bg-secondary);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

[data-theme="dark"] .toast {
    background: var(--bg-elevated);
    border-color: var(--border-light);
}

[data-theme="dark"] .confirm-dialog {
    background: var(--bg-elevated);
}

[data-theme="dark"] code {
    background: var(--bg-secondary);
}

/* ==========================================
   CONSISTENT STATUS COLORS
   ========================================== */

/* Badge status colors - unified */
.badge-active, .badge-success, .status-open { background: var(--success-light, #dcfce7); color: var(--success-color, #16a34a); }
.badge-trial, .badge-warning, .status-in_progress, .status-waiting_customer { background: var(--warning-light, #fef3c7); color: var(--warning-color, #d97706); }
.badge-expired, .badge-danger, .badge-suspended { background: var(--danger-light, #fee2e2); color: var(--danger-color, #dc2626); }
.badge-inactive, .status-closed { background: var(--neutral-light, #f3f4f6); color: var(--text-secondary, #6b7280); }

/* Priority colors - unified */
.priority-urgent { color: #dc2626; font-weight: 600; }
.priority-high { color: #ea580c; font-weight: 600; }
.priority-normal { color: #2563eb; }
.priority-low { color: #6b7280; }

/* License usage indicator */
.usage-bar { display: inline-block; width: 60px; height: 6px; background: var(--border-light, #e5e7eb); border-radius: 3px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.usage-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.usage-bar-fill.usage-ok { background: var(--success-color, #16a34a); }
.usage-bar-fill.usage-warn { background: var(--warning-color, #d97706); }
.usage-bar-fill.usage-danger { background: var(--danger-color, #dc2626); }

/* Audit table */
.audit-table { width: 100%; border-collapse: collapse; }
.audit-table th, .audit-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border-light, #e5e7eb); }
.audit-table th { font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); }
.audit-table tr:hover { background: var(--table-hover, #f9fafb); }

/* Dashboard section title */
.dashboard-section { margin-top: 24px; }
.section-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 12px; padding-left: 4px; }

/* Bulk Actions Bar */
.bulk-actions-bar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--primary-light, #eef2ff); border-radius: 8px; margin-bottom: 8px; }
.bulk-actions-bar span { font-size: 0.85rem; font-weight: 600; color: var(--primary-color); margin-right: 8px; }
