/* eMind Cockpit - oncall-alerting Dark Theme */

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

:root {
    --bg-dark: #1a1a2e;
    --bg-card: #16213e;
    --border: #2a3f5f;
    --accent: #4fc3f7;
    --text-primary: #eee;
    --text-secondary: #888;
    --text-muted: #666;
    --ok: #4caf50;
    --warning: #ffc107;
    --error: #ff5252;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Layout */
.app-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: 220px;
    background: linear-gradient(180deg, #16213e 0%, #1a1a2e 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    min-height: 60px;
}

.logo-text h1 { font-size: 1rem; font-weight: 600; color: var(--accent); }
.logo-text .subtitle { font-size: 0.65rem; color: var(--text-muted); }

.nav-list {
    flex: 1;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-item:hover { background: rgba(79, 195, 247, 0.1); color: var(--accent); }
.nav-item.active { background: rgba(79, 195, 247, 0.15); color: var(--accent); font-weight: 600; }

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

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.user-avatar { width: 32px; height: 32px; border-radius: 50%; }
.user-name { font-size: 0.85rem; font-weight: 600; }
.user-role { font-size: 0.7rem; color: var(--text-muted); text-transform: capitalize; }

.logout-btn {
    display: block;
    text-align: center;
    padding: 6px;
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.logout-btn:hover { background: rgba(255, 82, 82, 0.15); color: var(--error); }

/* Main Content */
.main-content {
    margin-left: 220px;
    flex: 1;
    padding: 25px;
    min-height: 100vh;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-header h1 { font-size: 1.5rem; }
.page-header p { color: var(--text-secondary); font-size: 0.9rem; }

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 20px;
}

/* Summary Cards */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.summary-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    border: 1px solid var(--border);
}

.summary-card .value { font-size: 2rem; font-weight: 700; color: var(--accent); }
.summary-card .label { color: var(--text-secondary); font-size: 0.8rem; text-transform: uppercase; margin-top: 5px; }

/* Status Colors */
.status-ok { color: var(--ok); }
.status-warning { color: var(--warning); }
.status-critical { color: var(--error); }

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.ok { background: rgba(76, 175, 80, 0.2); color: var(--ok); }
.badge.warning { background: rgba(255, 193, 7, 0.2); color: var(--warning); }
.badge.critical { background: rgba(255, 82, 82, 0.2); color: var(--error); }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-secondary); font-size: 0.8rem; text-transform: uppercase; font-weight: 600; }

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary { background: var(--accent); color: var(--bg-dark); }
.btn-primary:hover { background: #81d4fa; }
.btn-secondary { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.btn-secondary:hover { background: rgba(255,255,255,0.15); }
.btn-danger { background: rgba(255, 82, 82, 0.2); color: var(--error); }
.btn-danger:hover { background: rgba(255, 82, 82, 0.3); }
.btn-small { padding: 4px 10px; font-size: 0.75rem; border-radius: 6px; }

/* Forms */
input, select {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 0.85rem;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Filters (from eproxy) */
.filters-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

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

.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; }
.filter-actions { display: flex; align-items: flex-end; }

/* Results */
.results-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.data-table { width: 100%; }
.data-table th { background: rgba(0,0,0,0.2); }

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 400px;
}

.toast.show { transform: translateX(0); }
.toast.removing { transform: translateX(120%); }
.toast.success { background: rgba(76, 175, 80, 0.9); color: white; }
.toast.error { background: rgba(255, 82, 82, 0.9); color: white; }
.toast.warning { background: rgba(255, 193, 7, 0.9); color: #333; }
.toast.info { background: rgba(79, 195, 247, 0.9); color: #333; }
.toast-icon { font-size: 1.1rem; }

/* Confirm Dialog */
.confirm-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    max-width: 420px;
    width: 90%;
}

.confirm-box h3 { margin-bottom: 12px; color: var(--text-primary); }
.confirm-box p { color: var(--text-secondary); margin-bottom: 20px; font-size: 0.9rem; }

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
}
