/* CSS DESIGN SYSTEM: NEXCO INCIDENT COMMAND SYSTEM */

:root {
  --bg-primary: #07070a;
  --bg-secondary: #101017;
  --bg-tertiary: #171725;
  --bg-glass: rgba(18, 18, 29, 0.65);
  --border-glass: rgba(255, 255, 255, 0.07);
  --border-glass-hover: rgba(255, 255, 255, 0.15);
  
  --text-primary: #f4f4f7;
  --text-secondary: #a0a0b0;
  --text-muted: #6e6e80;
  
  --color-indigo: #6366f1;
  --color-indigo-hover: #4f46e5;
  --color-emerald: #10b981;
  --color-rose: #ef4444;
  --color-amber: #f59e0b;
  --color-slate: #64748b;
  
  --shadow-premium: 0 10px 30px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  height: 100vh;
}

body.dark-mode {
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.06) 0px, transparent 50%);
}

/* SKELETONS / UTILITIES */
.hidden {
  display: none !important;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--color-indigo);
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

.spinner-small {
  width: 16px;
  height: 16px;
  border-width: 2px;
  margin: 0 8px 0 0;
  display: inline-block;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* M365 SSO AUTHENTICATION OVERLAY */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 3, 5, 0.85);
  backdrop-filter: blur(20px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-card {
  width: 440px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 40px;
  box-shadow: var(--shadow-premium);
  position: relative;
}

.auth-logo {
  display: flex;
  align-items: center;
  margin-bottom: 25px;
}

.auth-title-container {
  margin-left: 15px;
}

.auth-title-container h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.auth-title-container h2 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 15px;
}

.profile-selection h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.profile-item {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.profile-item:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  margin-right: 15px;
}

.bg-avatar-1 { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.bg-avatar-2 { background: linear-gradient(135deg, #3b82f6, #6366f1); }
.bg-avatar-3 { background: linear-gradient(135deg, #10b981, #059669); }
.bg-avatar-custom { background: linear-gradient(135deg, #8b5cf6, #d946ef); }

.profile-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.profile-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-role {
  font-size: 12px;
  color: var(--text-muted);
}

.profile-arrow {
  color: var(--text-muted);
  font-size: 14px;
  transition: var(--transition-smooth);
}

.profile-item:hover .profile-arrow {
  color: var(--color-indigo);
  transform: translateX(4px);
}

.custom-login-toggle {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--color-indigo);
  cursor: pointer;
  text-decoration: underline;
}

.custom-login-form {
  margin-top: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
}

.custom-login-form input {
  width: 100%;
  padding: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  color: var(--text-primary);
  margin-bottom: 10px;
  font-family: var(--font-family);
}

.custom-login-form input:focus {
  border-color: var(--color-indigo);
  outline: none;
}

.auth-loading {
  text-align: center;
  margin-top: 20px;
}

.auth-loading p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 10px;
}

.auth-footer {
  margin-top: 30px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

/* APP MAIN LAYOUT GRID */
.app-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  position: relative;
}

/* SIDEBAR STYLES */
.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  height: 100vh;
  z-index: 100;
}

.brand {
  padding: 24px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-logo {
  color: var(--color-indigo);
  margin-right: 12px;
}

.brand-text {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.user-badge {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.01);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  background: var(--color-indigo);
  margin-right: 12px;
}

.user-details {
  flex-grow: 1;
  overflow: hidden;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

.logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.logout-btn:hover {
  color: var(--color-rose);
  background: rgba(239, 68, 68, 0.1);
}

.sidebar-section {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 700;
}

.small-text-btn {
  background: none;
  border: none;
  color: var(--color-indigo);
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.filter-tree {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.tenant-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.site-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: var(--transition-smooth);
  user-select: none;
}

.checkbox-label:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.checkbox-label input {
  margin-right: 8px;
  accent-color: var(--color-indigo);
}

.checkbox-label.active {
  color: var(--text-primary);
  font-weight: 500;
}

.sidebar-footer {
  padding: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

.small-text {
  font-size: 10px;
  color: var(--text-muted);
}

/* CONTENT WRAPPER */
.content-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  padding: 30px;
  padding-bottom: 90px; /* Space for simulator drawer */
}

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

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

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.header-search-bar input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 13px;
  transition: var(--transition-smooth);
}

.header-search-bar input:focus {
  outline: none;
  border-color: var(--color-indigo);
  background: var(--bg-tertiary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}

.header-status {
  display: flex;
  align-items: center;
}

.sse-status {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
}

.status-beacon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  background-color: var(--color-slate);
}

.sse-status.connected .status-beacon {
  background-color: var(--color-emerald);
  box-shadow: 0 0 8px var(--color-emerald);
}

.sse-status.disconnected .status-beacon {
  background-color: var(--color-rose);
  box-shadow: 0 0 8px var(--color-rose);
}

.status-text {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.blinking {
  animation: blink 1.5s infinite;
}

@keyframes blink {
  50% { opacity: 0.3; }
}

/* METRICS CARDS */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 25px;
}

.metric-card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-premium);
  transition: var(--transition-smooth);
}

.metric-card:hover {
  border-color: var(--border-glass-hover);
  transform: translateY(-2px);
}

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

.metric-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-val {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.bg-down { background: rgba(239, 68, 68, 0.1); color: var(--color-rose); }
.bg-alert { background: rgba(245, 158, 11, 0.1); color: var(--color-amber); }
.bg-mttr { background: rgba(99, 102, 241, 0.1); color: var(--color-indigo); }
.bg-total { background: rgba(100, 116, 139, 0.1); color: var(--color-slate); }

.pulsing-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
  animation: pulse-glow-keyframes 2s infinite;
}

@keyframes pulse-glow-keyframes {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 0; }
  100% { transform: scale(1); opacity: 0.8; }
}

/* DATA PANEL (INCIDENTS TABLE) */
.data-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  box-shadow: var(--shadow-premium);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.panel-header {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tabs {
  display: flex;
  gap: 8px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.tab-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  color: #fff;
  font-weight: 700;
}

.panel-actions {
  display: flex;
  gap: 10px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--color-indigo);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-indigo-hover);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-glass);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-glass-hover);
}

.btn-danger {
  background: var(--color-rose);
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-success {
  background: var(--color-emerald);
  color: #fff;
}

.btn-success:hover {
  background: #059669;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-lg {
  padding: 12px 20px;
  font-size: 14px;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 10px;
  border-radius: 4px;
}

/* INCIDENT TABLE */
.table-container {
  overflow-x: auto;
  flex-grow: 1;
}

.incident-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.incident-table th {
  padding: 14px 24px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.incident-table td {
  padding: 16px 24px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

.incident-table tbody tr {
  cursor: pointer;
  transition: var(--transition-smooth);
}

.incident-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.015);
}

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

/* ROW BADGES & STATUSES */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-down {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-rose);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-up {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-emerald);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-id-text {
  font-family: monospace;
  font-weight: 700;
  color: var(--text-primary);
}

.cell-tenant {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.cell-site-name {
  font-weight: 600;
  color: var(--text-primary);
}

.cell-olt-label {
  font-size: 11px;
  color: var(--color-indigo);
  font-family: monospace;
}

.cell-message {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

.duration-text {
  font-weight: 600;
  color: var(--text-primary);
}

.duration-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.escalation-pill {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-amber);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.escalation-high {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-rose);
  animation: glow-critical 2s infinite;
}

@keyframes glow-critical {
  50% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.3); }
}

.claim-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
}

.claim-pill-claimed {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-primary);
  font-weight: 500;
}

.claim-pill-unclaimed {
  background: rgba(245, 158, 11, 0.08);
  color: var(--color-amber);
  border: 1px dashed rgba(245, 158, 11, 0.3);
  font-weight: 600;
}

/* RIGHT DRAWER DETAILS PANEL */
.details-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-glass);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.details-drawer.hidden {
  transform: translateX(100%);
  display: flex !important; /* Keep it compiled in layout but offscreen */
}

.drawer-header {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-title-area {
  display: flex;
  flex-direction: column;
}

.drawer-alert-id {
  font-size: 20px;
  font-weight: 700;
  font-family: monospace;
  color: var(--text-primary);
}

.drawer-olt-name {
  font-size: 13px;
  color: var(--text-secondary);
}

.close-drawer-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.close-drawer-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.drawer-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.drawer-status-strip {
  padding: 12px 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.drawer-status-strip.down {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-rose);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.drawer-status-strip.up {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-emerald);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.status-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.down .status-indicator-dot {
  background-color: var(--color-rose);
  box-shadow: 0 0 10px var(--color-rose);
  animation: pulse 1.5s infinite;
}

.up .status-indicator-dot {
  background-color: var(--color-emerald);
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.4; }
  100% { transform: scale(1); opacity: 1; }
}

.drawer-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 16px;
}

.drawer-card h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 700;
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

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

.meta-item-full {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.border-top {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 14px;
}

.metadata-grid label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.metadata-grid span {
  font-size: 13px;
  color: var(--text-primary);
}

.metadata-grid p.meta-message {
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.15);
  padding: 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  line-height: 1.4;
}

.code-badge {
  font-family: monospace;
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-indigo) !important;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px !important;
  font-weight: 600;
  align-self: flex-start;
}

.timestamp-span {
  font-size: 12px !important;
  color: var(--text-secondary) !important;
}

.huge-duration {
  font-size: 20px !important;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

/* Alert Warning Banner */
.alert-warning-banner {
  padding: 10px 12px;
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-amber);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 12px;
}

.claim-badge-container {
  display: flex;
  align-items: center;
}

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

.claimed-owner-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.claimed-timestamp {
  font-size: 11px;
  color: var(--text-muted);
}

/* Resolution Form Control */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.form-control {
  width: 100%;
  padding: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 13px;
}

.form-control:focus {
  border-color: var(--color-indigo);
  outline: none;
}

/* Comment Section Styles */
.comment-input-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.comment-input-box textarea {
  width: 100%;
  padding: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 13px;
  resize: vertical;
}

.comment-input-box textarea:focus {
  border-color: var(--color-indigo);
  outline: none;
}

.comments-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
}

.comment-item {
  display: flex;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.comment-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.comment-bubble {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

.comment-user {
  font-weight: 600;
  color: var(--text-primary);
}

.comment-time {
  color: var(--text-muted);
}

.comment-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  white-space: pre-line;
}

.empty-feed {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px 0;
}

.bg-avatar-system {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border-glass);
}

/* Audit Logs */
.audit-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  padding-left: 15px;
}

.audit-timeline::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 4px;
  width: 1px;
  height: calc(100% - 10px);
  background-color: var(--border-glass);
}

.audit-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.audit-item::before {
  content: '';
  position: absolute;
  left: -15px;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  border: 2px solid var(--color-indigo);
}

.audit-action {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.audit-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* EVENT SIMULATOR DRAWER PANEL */
.simulator-drawer {
  position: fixed;
  bottom: 0;
  left: 280px; /* Aligns with sidebar width */
  width: calc(100% - 280px);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-glass);
  box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.5);
  z-index: 900;
  transition: var(--transition-smooth);
}

.simulator-drawer.collapsed {
  height: 48px;
}

.simulator-drawer:not(.collapsed) {
  height: 480px;
}

.simulator-header {
  height: 48px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.01);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  user-select: none;
}

.simulator-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.simulator-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-primary);
}

.sim-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-indigo);
  box-shadow: 0 0 6px var(--color-indigo);
  animation: blink 1s infinite;
}

.simulator-toggle-icon {
  font-size: 11px;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.simulator-drawer:not(.collapsed) .simulator-toggle-icon {
  transform: rotate(180deg);
}

.simulator-body {
  padding: 24px;
  height: calc(480px - 48px);
  overflow-y: auto;
}

.sim-row {
  display: flex;
  gap: 30px;
}

.sim-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sim-col h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.border-left {
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  padding-left: 30px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.sim-form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sim-form-group label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.sim-form-group input, .sim-form-group select {
  padding: 8px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 12px;
}

.sim-form-group input:focus, .sim-form-group select:focus {
  border-color: var(--color-indigo);
  outline: none;
}

/* SKELETON LOADER TREE */
.skeleton-tree {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0;
}

.skeleton-line {
  height: 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.skeleton-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: loading-sweep 1.5s infinite;
}

@keyframes loading-sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* RESPONSIVENESS */
@media (max-width: 1200px) {
  .metrics-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* THREE-LEVEL HIERARCHY TREE STYLES */
.site-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: var(--transition-smooth);
  font-weight: 600;
  user-select: none;
}

.site-header:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.site-toggle-icon {
  font-size: 9px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  display: inline-block;
  width: 10px;
  text-align: center;
}

.site-group.collapsed .site-toggle-icon {
  transform: rotate(-90deg);
}

.site-group.collapsed .olt-list {
  display: none;
}

.olt-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 14px;
  margin-bottom: 4px;
}

/* MONTHLY REPORT Date Range Toolbar styles */
.panel-toolbar {
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.01);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.date-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.date-filter-group strong {
  color: var(--text-primary);
  font-weight: 600;
}

.date-input {
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--border-glass) !important;
  border-radius: 4px !important;
  padding: 4px 8px !important;
  color: var(--text-primary) !important;
  font-family: var(--font-family);
  font-size: 12px !important;
  color-scheme: dark; /* Force native calendar dropdown to match dark mode */
}

.date-input:focus {
  border-color: var(--color-indigo) !important;
  outline: none;
}

.quick-date-buttons {
  display: flex;
  gap: 4px;
  margin-left: 10px;
}

.text-danger {
  color: var(--color-rose) !important;
}

.text-danger:hover {
  background: rgba(239, 68, 68, 0.1) !important;
}

.report-actions {
  display: flex;
  align-items: center;
}

/* POLL LOG CONSOLE STYLES */
.sim-console-container {
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sim-console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sim-console-log {
  background: #040407 !important;
  border: 1px solid rgba(255, 255, 255, 0.04) !important;
  border-radius: 6px !important;
  padding: 12px !important;
  font-family: monospace !important;
  font-size: 11px !important;
  color: #10b981 !important;
  max-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
}

.console-line {
  line-height: 1.4;
  border-bottom: 1px dashed rgba(16, 185, 129, 0.08);
  padding-bottom: 2px;
  text-align: left;
}

/* --- MOBILE COMPATIBILITY SYSTEM & GLASS RESPONSIVENESS --- */

.mobile-menu-toggle {
  display: none;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.mobile-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-glass-hover);
}

.mobile-menu-toggle:active {
  transform: scale(0.95);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 3, 5, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

@media (max-width: 768px) {
  /* Toggle visibility of menu button */
  .mobile-menu-toggle {
    display: inline-flex;
    margin-right: 12px;
  }

  /* Grid layout shifts to single-column */
  .app-layout {
    grid-template-columns: 1fr;
  }

  /* Slide-out mobile navigation drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: -290px; /* Hidden offscreen by default */
    width: 280px;
    height: 100vh;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.8);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
  }

  /* When mobile navigation is active */
  body.sidebar-active .sidebar {
    left: 0;
  }

  body.sidebar-active .sidebar-overlay {
    display: block;
    opacity: 1;
  }

  /* Content view compression */
  .content-wrapper {
    padding: 15px;
    padding-bottom: 120px; /* Space for simulator */
  }

  .app-header {
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
  }

  .header-search-bar {
    width: 100%;
    order: 2; /* Move search below header line */
  }

  .header-status {
    width: auto;
    order: 1;
  }

  /* Metric layout scales down */
  .metrics-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
  }

  .metric-card {
    padding: 15px;
  }

  .metric-val {
    font-size: 20px;
  }

  /* Toolbar wrappers */
  .panel-toolbar {
    padding: 15px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .date-filter-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
  }

  .quick-date-buttons {
    margin-left: 0;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }

  .quick-date-buttons .btn {
    flex: 1;
    min-width: 80px;
    text-align: center;
  }

  .report-actions {
    width: 100%;
  }

  .report-actions .btn {
    width: 100%;
  }

  /* Expandable panels and drawer */
  .details-drawer {
    width: 100vw !important;
    max-width: 100% !important;
    border-left: none;
  }

  /* Login card sizing */
  .auth-card {
    width: 90vw;
    padding: 25px 20px;
  }

  /* Network configurator full-screen */
  #admin-modal .auth-card {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    padding: 20px !important;
  }

  /* Responsive simulator drawer alignment */
  .simulator-drawer {
    z-index: 1001; /* Ensure sits above content but below navigation overlay */
  }

  .sim-row {
    flex-direction: column;
    gap: 20px;
  }

  .sim-col.border-left {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
  }
}

@media (max-width: 480px) {
  /* Metrics row stacks fully */
  .metrics-row {
    grid-template-columns: 1fr;
  }

  .app-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  /* Scroll indicators for responsive tables */
  .table-container {
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
    -webkit-overflow-scrolling: touch;
  }

  .incident-table th, .incident-table td {
    padding: 10px 14px;
    font-size: 12px;
  }

  .date-filter-group input {
    width: 100%;
  }
}
