/* Global CSS - MAF Production System
 * ControlTech Cape (Pty) Ltd
 * Updated with Authentication System Styles
 */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #6b7280;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0891b2;
    --light: #f9fafb;
    --dark: #111827;
    --body-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #374151;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --card-border-radius: 0.75rem;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --header-height: 80px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--body-bg);
    color: var(--text-color);
    line-height: 1.6;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== NAVIGATION STYLES ===== */
.navbar {
    background: linear-gradient(135deg, var(--dark) 0%, #1f2937 100%);
    min-height: var(--header-height);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white;
    display: flex;
    align-items: center;
}

.navbar-brand img {
    height: 40px;
    margin-right: 12px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 0.5rem;
    transition: all 0.3s;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white !important;
}

.nav-tabs {
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
}

.nav-tabs .nav-link {
    color: var(--text-muted) !important;
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 600;
    background: transparent;
    border-radius: 0;
    position: relative;
}

.nav-tabs .nav-link.active {
    color: var(--primary) !important;
    background: transparent;
    border: none;
}

.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}

/* ===== USER MENU STYLES ===== */
.user-avatar {
    font-size: 1.5rem;
}

.user-info {
    text-align: left;
    line-height: 1.2;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
}

.dropdown-menu {
    border-radius: 0.5rem;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--primary);
    color: white;
}

.dropdown-item.text-danger:hover {
    background-color: var(--danger);
    color: white;
}

.dropdown-header {
    padding: 0.75rem 1rem 0.5rem;
    font-size: 0.875rem;
}

/* Mobile responsive user menu */
@media (max-width: 768px) {
    .user-info {
        display: block !important;
    }
    
    .user-name {
        max-width: 100px;
    }
}

/* ===== LOGIN PAGE STYLES ===== */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 400px;
    width: 100%;
    padding: 0;
    border: 0px solid rgba(255, 255, 255, 0.2);
}

.login-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem;
    border-radius: 1rem 1rem 0 0;
    text-align: center;
}

.login-body {
    padding: 2rem;
}

.company-logo {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-tagline {
    opacity: 0.9;
    font-size: 0.9rem;
}

.form-floating {
    margin-bottom: 1.5rem;
}

.form-floating input {
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.form-floating input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.1);
}

.login-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    width: 100%;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

.system-info {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--primary-dark);
}

.loading-spinner {
    display: none;
}

.login-footer {
    text-align: center;
    padding: 1rem 2rem 2rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* ===== ACCESS DENIED PAGE STYLES ===== */
.access-denied-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 50%, #7f1d1d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.access-denied-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    width: 100%;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.access-denied-header {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    padding: 2rem;
    border-radius: 1rem 1rem 0 0;
}

.access-denied-body {
    padding: 2rem;
}

.access-denied-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.access-denied-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.access-denied-subtitle {
    opacity: 0.9;
    font-size: 1rem;
}

.user-info-box {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1.5rem 0;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 576px) {
    .action-buttons {
        flex-direction: row;
        justify-content: center;
    }
}

.btn-back {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
    color: white;
    text-decoration: none;
}

.btn-logout {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-logout:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(107, 114, 128, 0.3);
    color: white;
    text-decoration: none;
}

/* ===== CARD STYLES ===== */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, var(--light) 0%, #f3f4f6 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem;
    font-weight: 600;
    color: var(--dark);
}

/* ===== STATUS INDICATORS ===== */
.status-indicator {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-indicator i {
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
}

.status-indicator.connected {
    background-color: rgba(5, 150, 105, 0.1);
    color: var(--success);
}

.status-indicator.disconnected {
    background-color: rgba(220, 38, 38, 0.1);
    color: var(--danger);
}

.status-indicator.running {
    background-color: rgba(5, 150, 105, 0.1);
    color: var(--success);
}

.status-indicator.stopped {
    background-color: rgba(156, 163, 175, 0.2);
    color: var(--secondary);
}

/* Connection Status */
.connection-status {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.connection-status.online {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.connection-status.offline {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.connection-status.testing {
    background: rgba(217, 119, 6, 0.1);
    color: var(--warning);
    border: 1px solid var(--warning);
    animation: statusPulse 1.5s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.connection-status:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Live Indicators */
.live-indicator {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
}

/* ===== PRODUCTION SUMMARY ===== */
.production-summary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--card-border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.production-summary::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(50%, -50%);
}

.production-summary h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.production-summary p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* ===== METRICS ===== */
.metric-card {
    text-align: center;
    padding: 1.5rem;
    height: 100%;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.metric-label {
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

.metric-change {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.metric-change.positive {
    color: var(--success);
}

.metric-change.negative {
    color: var(--danger);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: var(--card-shadow);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===== LINE SECTIONS ===== */
.line-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--card-border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.line-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.line-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

.line-rate {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
}

/* Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.status-item {
    background: var(--light);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.status-item:hover {
    background: white;
    box-shadow: var(--card-shadow);
}

.status-item-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.status-item-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
}

.status-item.offline .status-item-value {
    color: var(--secondary);
}

.status-item.warning .status-item-value {
    color: var(--warning);
}

.status-item.danger .status-item-value {
    color: var(--danger);
}

.status-item.success .status-item-value {
    color: var(--success);
}

/* ===== STAFF MEMBERS LIST ===== */
.staff-members-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--light);
}

.staff-member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.staff-member-item:last-child {
    border-bottom: none;
}

.staff-member-item:hover {
    background: white;
}

.staff-member-info {
    flex-grow: 1;
}

.staff-member-name {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.staff-member-position {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.staff-member-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
}

.staff-member-status.present {
    background: var(--success);
    color: white;
}

.staff-member-status.absent {
    background: var(--danger);
    color: white;
}

/* ===== TRANSLATION RULES ===== */
.translation-rule {
    background: var(--light);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.translation-rule:hover {
    box-shadow: var(--card-shadow);
}

/* Topic Configuration */
.topic-config {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.topic-config.disabled {
    opacity: 0.6;
    background: #f8f9fa;
}

/* ===== SHIFT PERFORMANCE ===== */
.shift-performance {
    background: linear-gradient(135deg, var(--success) 0%, #047857 100%);
    color: white;
    border-radius: var(--card-border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
}

.shift-timer {
    text-align: center;
    margin-bottom: 2rem;
}

.shift-timer h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.shift-timer p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* Progress Bars */
.progress {
    height: 12px;
    border-radius: 6px;
    margin-bottom: 1rem;
    background-color: rgba(255, 255, 255, 0.2);
}

.progress-bar {
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.9) 0%, white 100%);
}

/* ===== LEADERBOARD ===== */
.leaderboard {
    background: var(--card-bg);
    border-radius: var(--card-border-radius);
    overflow: hidden;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.leaderboard-item:hover {
    background: var(--light);
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-rank {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 1rem;
    color: white;
}

.leaderboard-rank.first {
    background: #fbbf24;
}

.leaderboard-rank.second {
    background: #9ca3af;
}

.leaderboard-rank.third {
    background: #cd7c2f;
}

.leaderboard-rank.other {
    background: var(--secondary);
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-name {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.leaderboard-detail {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.leaderboard-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

/* ===== INPUT SECTIONS ===== */
.input-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--card-border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* ===== CODE AND LOGS ===== */
.code-preview {
    background: #1e1e1e;
    color: #e5e5e5;
    border-radius: 0.5rem;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    max-height: 300px;
    overflow-y: auto;
}

.activity-log {
    background: #1e1e1e;
    color: #e5e5e5;
    border-radius: 0.5rem;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    max-height: 400px;
    overflow-y: auto;
}

.log-entry {
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.log-timestamp {
    color: #6b7280;
    font-size: 0.75rem;
}

.log-level {
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

.log-level.error {
    background: var(--danger);
    color: white;
}

.log-level.warning {
    background: var(--warning);
    color: white;
}

.log-level.info {
    background: var(--info);
    color: white;
}

.log-level.debug {
    background: var(--secondary);
    color: white;
}

/* ===== SPECIAL PANELS ===== */
.table-creator {
    background: linear-gradient(135deg, var(--info) 0%, #0e7490 100%);
    color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.test-panel {
    background: linear-gradient(135deg, var(--success) 0%, #047857 100%);
    color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

/* ===== FORM HELPERS ===== */
.formula-helper {
    background: rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-top: 0.5rem;
}

.formula-helper code {
    background: rgba(37, 99, 235, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* ===== ALERTS ===== */
.alert {
    border-radius: 0.75rem;
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.alert-warning {
    background: rgba(217, 119, 6, 0.1);
    color: #92400e;
    border-left: 4px solid var(--warning);
}

.alert-danger {
    background: rgba(220, 38, 38, 0.1);
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.alert-success {
    background: rgba(5, 150, 105, 0.1);
    color: #065f46;
    border-left: 4px solid var(--success);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--dark);
    color: rgba(255, 255, 255, 0.8);
    padding: 2rem 0;
    margin-top: 4rem;
}

/* ===== WHATSAPP NOTIFICATIONS SPECIFIC STYLES ===== */

/* Notification Cards */
.notification-card {
    transition: all 0.3s ease;
    border-left: 4px solid #e9ecef;
}

.notification-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.notification-card.priority-critical {
    border-left-color: #dc3545;
}

.notification-card.priority-high {
    border-left-color: #fd7e14;
}

.notification-card.priority-medium {
    border-left-color: #ffc107;
}

.notification-card.priority-low {
    border-left-color: #20c997;
}

/* Badges and Labels */
.escalation-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.condition-badge {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

/* Stats Cards */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.stats-card .card-body {
    position: relative;
    overflow: hidden;
}

.stats-card .stats-icon {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    opacity: 0.3;
}

/* Template Cards */
.template-card {
    transition: all 0.2s ease;
}

.template-card:hover {
    border-color: #0d6efd;
}

.template-status {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

/* User Avatar Enhanced */
.user-avatar.circular {
    width: 32px;
    height: 32px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 50%;
}

/* Escalation Flow */
.escalation-flow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.escalation-level {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 0.5rem;
    min-width: 100px;
    text-align: center;
    position: relative;
}

.escalation-arrow {
    color: #6c757d;
    font-size: 1.2rem;
}

/* Custom Form Floating */
.form-floating-custom {
    position: relative;
}

.form-floating-custom .form-control {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

.form-floating-custom label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 1rem 0.75rem;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
}

/* Recipient Pills */
.recipient-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 1rem;
    padding: 0.25rem 0.75rem;
    margin: 0.125rem;
    font-size: 0.875rem;
}

.recipient-pill .remove-recipient {
    background: none;
    border: none;
    color: #6c757d;
    padding: 0;
    margin-left: 0.25rem;
    cursor: pointer;
}

.recipient-pill .remove-recipient:hover {
    color: #dc3545;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .production-summary h1 {
        font-size: 2rem;
    }
    
    .production-summary p {
        font-size: 1rem;
    }
    
    .metric-value {
        font-size: 2rem;
    }
    
    .status-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .navbar-brand img {
        height: 32px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .connection-status {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .login-container {
        padding: 1rem;
    }
    
    .access-denied-container {
        padding: 1rem;
    }
}

/* ===== STATUS ENHANCEMENTS ===== */

/* Stale connection warning indicator */
.connection-status.stale::after {
    content: '⚠';
    position: absolute;
    top: -5px;
    right: -5px;
    background: orange;
    color: white;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Tooltip styles for detailed status information */
.status-tooltip {
    position: relative;
    cursor: help;
}

.status-tooltip:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    opacity: 0;
    animation: tooltipFadeIn 0.2s forwards;
    pointer-events: none;
}

.status-tooltip:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #333;
    z-index: 1000;
    margin-bottom: 2px;
    opacity: 0;
    animation: tooltipFadeIn 0.2s forwards;
    pointer-events: none;
}

@keyframes tooltipFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-5px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Status freshness indicators */
.status-fresh {
    border-left: 3px solid #10b981;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.05) 0%, transparent 100%);
}

.status-stale {
    border-left: 3px solid #f59e0b;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.05) 0%, transparent 100%);
}

.status-error {
    border-left: 3px solid #ef4444;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.05) 0%, transparent 100%);
}

/* Special styling for config changed state */
.connection-status.config-changed {
    border-style: dashed;
    animation: configChangedBlink 2s infinite;
}

@keyframes configChangedBlink {
    0%, 50% { opacity: 1; }
    25%, 75% { opacity: 0.7; }
}

/* Status indicator improvements */
.status-indicator.running::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    animation: statusPulse 2s infinite;
}

.status-indicator.stopped::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #6b7280;
    border-radius: 50%;
}

/* Enhanced connection status variants */
.connection-status.online.fresh {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.connection-status.offline.recent {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
}

/* Status history indicator (for future enhancement) */
.status-history-indicator {
    position: absolute;
    bottom: -2px;
    right: 2px;
    width: 4px;
    height: 4px;
    background: #6b7280;
    border-radius: 50%;
    opacity: 0.6;
}




