/* =====================================================================
   AirSome — Modern Dark VR Theme
   ===================================================================== */

/* --- CSS Variables -------------------------------------------------- */
:root {
  --bg-base:        #0b0e17;
  --bg-surface:     #131929;
  --bg-elevated:    #1a2238;
  --bg-sidebar:     #0d1120;
  --bg-sidebar-hover: #1a2035;

  --accent:         #7c3aed;
  --accent-hover:   #6d28d9;
  --accent-light:   rgba(124, 58, 237, 0.15);
  --cyan:           #22d3ee;
  --cyan-light:     rgba(34, 211, 238, 0.12);

  --success:        #10b981;
  --success-light:  rgba(16, 185, 129, 0.15);
  --warning:        #f59e0b;
  --warning-light:  rgba(245, 158, 11, 0.15);
  --danger:         #ef4444;
  --danger-light:   rgba(239, 68, 68, 0.15);

  --text-primary:   #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;

  --border:         #1e2d3d;
  --border-light:   #253347;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --sidebar-width: 260px;
  --topbar-height: 60px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.7);
}


/* --- Reset & Base --------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] { -moz-appearance: textfield; }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }


/* --- Mobile Top Bar ------------------------------------------------ */
#mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  align-items: center;
  padding: 0 16px;
  z-index: 200;
  gap: 12px;
}

#hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
#hamburger:hover { background: var(--bg-sidebar-hover); }
#hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

#mobile-logo {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#mobile-logout {
  display: none;
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
#mobile-logout:hover { background: var(--danger); color: #fff; }


/* --- Sidebar Overlay (mobile only) --------------------------------- */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 150;
  backdrop-filter: blur(2px);
}
#sidebar-overlay.visible { display: block; }


/* --- App Shell ----------------------------------------------------- */
#con {
  min-height: 100%;
  position: relative;
}

#app-layout {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
}


/* --- Sidebar ------------------------------------------------------- */
#sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: none;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Sidebar header: logo + brand */
#sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}

#sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.logo-icon {
  font-size: 24px;
  color: var(--accent);
  line-height: 1;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Sidebar nav */
#sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

#sidebar-nav .nav-section {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 16px 18px 6px;
}

#sidebar-nav .nav-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 0;
}

#sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  padding: 10px 18px;
  cursor: pointer;
  border-left: 3px solid transparent;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-right: 8px;
}

#sidebar-nav .nav-item.depth-1 {
  padding-left: 32px;
  font-size: 13px;
  color: var(--text-muted);
}
#sidebar-nav .nav-item.depth-2 {
  padding-left: 44px;
  font-size: 12px;
  color: var(--text-muted);
}

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

#sidebar-nav .nav-item.active {
  background: var(--accent-light);
  color: #fff;
  border-left-color: var(--accent);
  font-weight: 600;
}

#sidebar-nav .nav-item.no-click { cursor: default; }
#sidebar-nav .nav-item.no-click:hover {
  background: transparent;
  color: var(--text-secondary);
}

/* Sidebar footer: logout */
#sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

#sidebar-logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
}
#sidebar-logout-btn:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}


/* --- Content Area -------------------------------------------------- */
#content {
  flex: 1;
  min-width: 0;
  background: var(--bg-base);
  padding-bottom: 40px;
}

#footer { display: none; }   /* replaced by sidebar logout */

#container {
  width: 100%;
  min-height: 100%;
  position: relative;
}


/* --- Overlay (modal backdrop) -------------------------------------- */
#overlay {
  position: fixed;
  display: none;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  z-index: 50;
  cursor: pointer;
}


/* --- Breadcrumb ---------------------------------------------------- */
#BreadcrumbBar {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.bc-link {
  color: var(--cyan);
  cursor: pointer;
  font-weight: 500;
}
.bc-link:hover { text-decoration: underline; }

.bc-sep { color: var(--text-muted); margin: 0 2px; }

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


/* --- List Chrome --------------------------------------------------- */
#ListContainer {
  background: var(--bg-surface);
  margin: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.list-heading-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}

.list-heading-container .heading {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}

.list-heading-container .addButton {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
  white-space: nowrap;
}
.list-heading-container .addButton:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.list-heading-container .addButton:active { transform: translateY(0); }

.list-content-container {
  padding: 0;
  overflow-x: auto;
}


/* --- Tables -------------------------------------------------------- */
.green_table, #PDF_Files {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}

.green_table th, #PDF_Files th {
  padding: 12px 16px;
  text-align: left;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.green_table td, #PDF_Files td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

.green_table tr:last-child td, #PDF_Files tr:last-child td {
  border-bottom: none;
}

.green_table tr:nth-child(odd), #PDF_Files tr:nth-child(odd) {
  background: var(--bg-surface);
}
.green_table tr:nth-child(even), #PDF_Files tr:nth-child(even) {
  background: rgba(26, 34, 56, 0.5);
}

.green_table tr:hover td, #PDF_Files tr:hover td {
  background: var(--bg-elevated);
}

/* attributeSet rows (legacy) */
.green_table tr.attributeSetChild td { background: rgba(34, 211, 238, 0.07); }
.green_table tr.attributeSet td { background: rgba(124, 58, 237, 0.15); }

/* Inline buttons inside table cells */
.green_table tr td button, #PDF_Files tr td button {
  margin: 0 2px;
}


/* --- Buttons ------------------------------------------------------- */
button {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
}

/* Generic small action button (Edit) */
.green_table td button:not(.delete-btn):not(.modal-save-btn):not(.modal-cancel-btn):not(.addButton),
#PDF_Files td button:not(.delete-btn) {
  display: inline-flex;
  align-items: center;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  margin: 2px;
  min-height: 32px;
}
.green_table td button:not(.delete-btn):hover,
#PDF_Files td button:not(.delete-btn):hover {
  background: var(--border-light);
  border-color: var(--text-muted);
}

.delete-btn {
  display: inline-flex;
  align-items: center;
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  margin: 2px;
  min-height: 32px;
  font-family: inherit;
}
.delete-btn:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}


/* --- Status Badges ------------------------------------------------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.status-headset-active {
  background: var(--success-light);
  color: var(--success);
}
.status-headset-active::before { background: var(--success); }

.status-headset-inactive {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
}
.status-headset-inactive::before { background: var(--text-muted); }

.status-headset-maintenance {
  background: var(--warning-light);
  color: var(--warning);
}
.status-headset-maintenance::before { background: var(--warning); }

.status-headset-lost {
  background: var(--danger-light);
  color: var(--danger);
}
.status-headset-lost::before { background: var(--danger); }

.status-headset-setup {
  background: var(--cyan-light);
  color: var(--cyan);
}
.status-headset-setup::before { background: var(--cyan); }

.status-headset-presentation,
.status-presentation {
  background: var(--accent-light);
  color: var(--accent);
}
.status-headset-presentation::before,
.status-presentation::before { background: var(--accent); }

.status-setup {
  background: var(--cyan-light);
  color: var(--cyan);
}
.status-setup::before { background: var(--cyan); }

/* Ticket statuses */
.status-ticket-open        { background: var(--danger-light); color: var(--danger); }
.status-ticket-in-progress { background: var(--warning-light); color: var(--warning); }
.status-ticket-closed      { background: var(--success-light); color: var(--success); }


/* --- Ticket & Pool Badges ------------------------------------------ */
.ticket-balance-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--cyan-light);
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ticket-balance-badge::before {
  content: '🎟';
  font-size: 11px;
}

.pool-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}


/* --- Pool Banner --------------------------------------------------- */
.pool-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 24px;
  background: rgba(245, 158, 11, 0.07);
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.pool-banner button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
}
.pool-banner button:hover {
  background: var(--warning);
  color: #000;
}


/* --- Level Badges -------------------------------------------------- */
.level-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.level-0 {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}
.level-1 {
  background: var(--success-light);
  color: var(--success);
}
.level-2 {
  background: var(--cyan-light);
  color: var(--cyan);
}


/* --- Tab Bar ------------------------------------------------------- */
.tab-bar {
  display: inline-flex;
  margin-left: 16px;
  gap: 4px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.15s;
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}

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


/* --- Modal --------------------------------------------------------- */
.modal-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 100;
}

.modal-heading {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 16px;
  padding: 18px 22px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  letter-spacing: 0.3px;
}

.modal-form {
  padding: 20px 22px 8px;
}

.modal-field-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 14px;
  gap: 12px;
}

.modal-label {
  width: 130px;
  flex-shrink: 0;
  padding-top: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.modal-input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  box-sizing: border-box;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 38px;
}

.modal-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.modal-input[readonly] {
  opacity: 0.5;
  cursor: default;
}

textarea.modal-input { resize: vertical; min-height: 72px; }

select[multiple].modal-input {
  background-image: none;
  padding-right: 12px;
  min-height: 100px;
  cursor: default;
}

select.modal-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  -webkit-appearance: none;
  appearance: none;
  padding-right: 36px;
}

.modal-btn-row {
  display: flex;
  justify-content: flex-end;
  padding: 14px 22px 20px;
  gap: 10px;
}

.modal-save-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  min-height: 40px;
  transition: background 0.15s, transform 0.1s;
}
.modal-save-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.modal-save-btn:active { transform: translateY(0); }

.modal-cancel-btn {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  min-height: 40px;
}
.modal-cancel-btn:hover {
  background: var(--border-light);
  color: var(--text-primary);
}


/* --- Login Screen -------------------------------------------------- */
#loginElm {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--bg-base);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.login-brand {
  padding: 36px 32px 24px;
  text-align: center;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.login-logo {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.login-logo-icon {
  font-size: 40px;
  margin-bottom: 8px;
  display: block;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.login-form {
  padding: 28px 32px 32px;
}

.login-field {
  margin-bottom: 18px;
}

.login-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 7px;
}

.login-field input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.login-field input::placeholder {
  color: var(--text-muted);
}

.login-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--accent) 0%, #6d28d9 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  cursor: pointer;
  margin-top: 8px;
  letter-spacing: 0.5px;
  transition: opacity 0.15s, transform 0.1s;
  min-height: 48px;
}
.login-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.login-btn:active { transform: translateY(0); }


/* --- Operator Section ---------------------------------------------- */
#OperatorSection {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  margin: 24px;
  box-shadow: var(--shadow-md);
}


/* --- Alarm Box (error dialogs) ------------------------------------- */
.alarm-box {
  display: block;
  background: rgba(0,0,0,0.7);
  position: fixed;
  inset: 0;
  z-index: 300;
  backdrop-filter: blur(3px);
}

.alarm-box .box {
  margin: auto;
  min-width: 280px;
  max-width: 520px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  z-index: 301;
  margin-top: 200px;
  border-radius: var(--radius-lg);
  padding: 28px 24px 24px;
  box-shadow: var(--shadow-lg);
}

.alarm-box .box .image {
  background-image: url("./src/error-flat.png");
  background-size: 60px 60px;
  background-repeat: no-repeat;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid var(--danger);
  margin: auto;
  display: block;
  top: -42px;
  position: relative;
}

.alarm-box .box .heading {
  font-weight: 700;
  font-size: 20px;
  margin-top: -30px;
  text-align: center;
  color: var(--text-primary);
}

.alarm-box .box .text {
  font-size: 14px;
  margin: auto;
  text-align: center;
  color: var(--text-secondary);
  width: 100%;
  display: block;
  margin-top: 14px;
  padding: 8px;
}

.alarm-box .box .dismiss-button {
  line-height: 40px;
  height: 40px;
  width: 140px;
  margin: 16px auto 0;
  text-align: center;
  border-radius: var(--radius-sm);
  background: var(--danger);
  cursor: pointer;
  transition: background 0.15s;
}
.alarm-box .box .dismiss-button:hover { background: #dc2626; }

.alarm-box .box .dismiss-button .dismiss {
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
}


/* --- Context Menu -------------------------------------------------- */
#context_menu {
  position: absolute;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 200;
  overflow: hidden;
}
#context_menu .context_menu_item {
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: 13px;
  white-space: nowrap;
}
#context_menu .context_menu_seperator {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
#context_menu .context_menu_item:not(.inactive):hover {
  color: var(--text-primary);
  background: var(--accent-light);
  cursor: pointer;
}
#context_menu .inactive { color: var(--text-muted); cursor: default; }


/* --- Legacy containers (kept for compatibility) -------------------- */
.flex-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-flow: row wrap;
}

.flex-item {
  display: block;
  position: fixed;
  top: 50%;
  left: 50%;
  margin-left: -465px;
  margin-top: -194px;
  z-index: 5;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.center { margin: auto; display: block; }

#newContext { overflow: auto; }


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

/* Tablet & Mobile */
@media (max-width: 900px) {
  #ListContainer { margin: 12px; }
  #OperatorSection { margin: 12px; }
  .list-heading-container { padding: 14px 16px; }
  .list-content-container { padding: 0; }
  #BreadcrumbBar { padding: 10px 16px; }

  .green_table th, #PDF_Files th { padding: 10px 12px; }
  .green_table td, #PDF_Files td { padding: 10px 12px; }
}

@media (max-width: 768px) {
  /* Show mobile topbar, hide desktop sidebar header logout */
  #mobile-topbar { display: flex; }

  #sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: 280px;
    z-index: 160;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Override the display:flex set by showSidebar() */
  }

  /* When sidebar is open on mobile */
  #sidebar.mobile-open {
    transform: translateX(0);
  }

  #content {
    padding-top: var(--topbar-height);
    margin-left: 0 !important;
  }

  /* Make tables horizontally scrollable on mobile */
  .list-content-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Larger touch targets */
  .green_table td button, #PDF_Files td button {
    min-height: 36px;
    padding: 6px 12px;
  }

  .modal-box {
    width: 95vw;
    max-height: 85vh;
  }

  .modal-field-row {
    flex-direction: column;
    gap: 4px;
  }

  .modal-label {
    width: 100%;
    padding-top: 0;
  }

  .list-heading-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .list-heading-container .addButton {
    width: 100%;
    justify-content: center;
  }

  /* Hide some table columns on very small screens via class if needed */
  .hide-mobile { display: none !important; }
}

@media (max-width: 480px) {
  #ListContainer { margin: 8px; border-radius: var(--radius-md); }
  .login-card { border-radius: var(--radius-md); }
  .login-brand { padding: 24px 20px 18px; }
  .login-form { padding: 20px 20px 24px; }
  .login-logo { font-size: 24px; }
}
