.transfer-panels { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px; }
.transfer-panels section { min-width:0; padding:16px; border:1px solid var(--border); border-radius:8px; display:flex; flex-direction:column; align-items:flex-start; gap:12px; }
.transfer-panels input { width:100%; padding:10px; color:var(--fg); background:var(--bg); border:1px solid var(--border); border-radius:6px; }
.transfer-panels p { color:var(--fg2); overflow-wrap:anywhere; }
#remoteFileEntries { width:100%; }
#remoteFileEntries > * { padding:8px; margin-bottom:4px; }
#remoteFileEntries { max-height:45vh; overflow:auto; overflow-wrap:anywhere; }
#remoteFileEntries > * { display:block; }
@media(max-width:650px) { .transfer-panels { grid-template-columns:1fr; } }
:root {
  --bg: #0b0f19;
  --bg2: #111827;
  --bg3: #1e293b;
  --fg: #f9fafb;
  --fg2: #9ca3af;
  --accent: #3b82f6;
  --accent2: #2563eb;
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(59, 130, 246, 0.4);
  --radius: 8px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.15), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
}

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 230px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 12px 0 20px 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  height: 100vh;
  z-index: 10;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.sidebar-logo {
  padding: 0 16px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.sidebar-logo h1 {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
}

.sidebar-logo small {
  color: var(--fg2);
  font-size: 10.5px;
}

.sidebar-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  color: #636882;
  padding: 10px 16px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 7px 16px;
  color: var(--fg2);
  cursor: pointer;
  transition: all 0.15s;
  border-left: 3px solid transparent;
  font-size: 13px;
  gap: 9px;
  user-select: none;
}

.nav-item:hover { background: var(--bg3); color: var(--fg); }
.nav-item.active { color: var(--accent); border-left-color: var(--accent); background: var(--bg3); font-weight: 500; }

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.main { margin-left: 230px; flex: 1; padding: 24px; min-width: 0; }

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

.header h2 { font-size: 22px; font-weight: 600; }

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

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.stat-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.stat-card .label { color: var(--fg2); font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.stat-card .value { font-size: 28px; font-weight: 700; margin-top: 4px; letter-spacing: -0.5px; }
.stat-card .value.green { color: var(--green); }
.stat-card .value.red { color: var(--red); }
.stat-card .value.blue { color: var(--accent); }

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

.search-input {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  color: var(--fg);
  font-size: 13px;
  width: 280px;
  outline: none;
  transition: border-color 0.15s, outline 0.15s;
}

.search-input:focus { border-color: var(--accent); outline: 2px solid var(--border-focus); }

select.filter-select {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--fg);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s, outline 0.15s;
}
select.filter-select:focus { border-color: var(--accent); outline: 2px solid var(--border-focus); }

.btn {
  padding: 7px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary { background: var(--accent); color: white; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent2); }
.btn-warning { background: #d97706; color: white; border-color: rgba(217, 119, 6, 0.4); }
.btn-warning:hover { background: #b45309; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { opacity: 0.9; }
.btn-ghost { background: rgba(255, 255, 255, 0.03); color: var(--fg2); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.06); color: var(--fg); }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }

.device-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg2);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.device-table th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 650;
  color: var(--fg2);
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}

.device-table td {
  padding: 11px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.device-table tr:hover td { background: rgba(59, 130, 246, 0.04); }
.device-table tr:last-child td { border-bottom: none; }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.status-dot.online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.offline { background: var(--fg2); }

.tag {
  display: inline-block;
  background: var(--bg3);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--fg2);
  margin-right: 4px;
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(11, 15, 25, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: var(--bg2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal h3 { margin-bottom: 16px; font-size: 18px; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; color: var(--fg2); margin-bottom: 4px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--fg);
  font-size: 14px;
  outline: none;
}
.form-group textarea { resize: vertical; min-height: 60px; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); }

.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.modal-actions .btn { max-width: 100%; overflow-wrap: anywhere; }
#deviceModal .modal { max-width: 850px; }
#remoteTerminalModal input { min-width: 0; }
#remoteTerminalModal .modal > div:first-child { flex-wrap: wrap; gap: 12px; }

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

.detail-item { }
.detail-item .label { font-size: 11px; color: var(--fg2); text-transform: uppercase; }
.detail-item .value { font-size: 14px; margin-top: 2px; }

.remote-container {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remote-container canvas, .remote-container img {
  max-width: 100%;
  max-height: 70vh;
}

.remote-container canvas { cursor: default; outline: none; user-select: none; }
.remote-container:fullscreen { border-radius: 0; width: 100vw; height: 100vh; }
.remote-container:fullscreen canvas { max-width: 100vw; max-height: 100vh; }

.remote-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.remote-stats { color: var(--fg2); font-size: 12px; margin-left: auto; }

.connection-status {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.connection-status.connected { background: rgba(52,211,153,0.15); color: var(--green); }
.connection-status.connecting { background: rgba(251,191,36,0.15); color: var(--yellow); }
.connection-status.disconnected { background: rgba(239,68,68,0.15); color: var(--red); }

.page { display: none; }
.page.active { display: block; }

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

.login-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  width: 360px;
}

.login-box h1 { text-align: center; margin-bottom: 8px; color: var(--accent); }
.login-box p { text-align: center; color: var(--fg2); margin-bottom: 24px; font-size: 14px; }
.login-box .btn { width: 100%; justify-content: center; padding: 10px; }

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

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

.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 14px;
  z-index: 200;
  animation: slideIn 0.2s ease;
}

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

.os-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  background: var(--bg3);
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

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

.chart-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.chart-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg2);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 220px;
}

.chart-container-sm {
  height: 200px;
  max-width: 300px;
  margin: 0 auto;
}

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

/* Verification & Branch Asset Styles */
.user-profile {
  padding: 12px 16px;
  margin: 0 12px 12px;
  background: var(--bg3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 12px;
}
.user-profile .user-name { font-weight: 600; color: var(--fg); }
.user-profile .user-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 4px;
}
.user-badge.admin { background: rgba(79,140,255,0.2); color: var(--accent); }
.user-badge.it_support { background: rgba(6,182,212,0.2); color: #22d3ee; }
.user-badge.ga_pusat { background: rgba(245,158,11,0.2); color: #fbbf24; }
.user-badge.adh { background: rgba(52,211,153,0.2); color: var(--green); }
.user-badge.spv { background: rgba(168,85,247,0.2); color: #c084fc; }
.user-badge.user { background: rgba(148,163,184,0.2); color: #cbd5e1; }
.user-badge.viewer { background: rgba(160,163,177,0.2); color: var(--fg2); }

.role-matrix-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 10px; }
.role-matrix-table th, .role-matrix-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.role-matrix-table th { background: var(--bg3); font-weight: 600; color: var(--fg); }
.role-matrix-table tr:hover { background: rgba(255,255,255,0.02); }
.perm-check { color: #34d399; font-weight: 700; }
.perm-cross { color: #64748b; font-weight: 400; }

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.badge-status.verified { background: rgba(52,211,153,0.18); color: #34d399; }
.badge-status.unverified { background: rgba(251,191,36,0.18); color: #fbbf24; }
.badge-status.discrepancy { background: rgba(239,68,68,0.18); color: #ef4444; }
.badge-status.missing-pic { background:rgba(239,68,68,.16); color:#f87171; border:1px solid rgba(239,68,68,.3); }
.badge-status.missing-user { background:rgba(251,191,36,.14); color:#fbbf24; border:1px solid rgba(251,191,36,.28); }

.badge-cond {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}
.badge-cond.good { background: rgba(52,211,153,0.15); color: #34d399; }
.badge-cond.fair { background: rgba(251,191,36,0.15); color: #fbbf24; }
.badge-cond.damaged { background: rgba(239,68,68,0.15); color: #ef4444; }

.badge { display:inline-flex;align-items:center;padding:3px 8px;border-radius:999px;font-size:11px;font-weight:600;white-space:nowrap; }
.badge-green { background:rgba(52,211,153,.15);color:#34d399; }
.badge-gray { background:rgba(160,163,177,.15);color:#c4c7d1; }

.tab-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.tab-btn {
  background: transparent;
  border: none;
  color: var(--fg2);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.2s;
}
.tab-btn:hover { color: var(--fg); background: var(--bg3); }
.tab-btn.active { color: #fff; background: var(--accent); }

.btn-verify {
  background: rgba(52,211,153,0.15);
  color: #34d399;
  border: 1px solid rgba(52,211,153,0.3);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
}
.btn-verify:hover { background: #34d399; color: #111; }

.btn-sm-action {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--fg);
}
.btn-sm-action:hover { border-color: var(--accent); }

.branch-header-banner {
  background: linear-gradient(135deg, #1e2436 0%, #151824 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.branch-header-banner h3 { font-size: 18px; color: #fff; margin-bottom: 4px; }
.branch-header-banner p { font-size: 13px; color: var(--fg2); }
.branch-header-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.branch-stats-grid { margin-bottom:20px; }
.branch-assets-toolbar { align-items:stretch; }
.branch-assets-toolbar .search-input { min-width:230px; flex:1 1 260px; }
.branch-assets-toolbar .filter-select { flex:0 1 210px; min-width:145px; }
.branch-assets-container { min-width:0; }

.asset-record-list { display:flex; flex-direction:column; gap:12px; }
.asset-record {
  background:linear-gradient(145deg, rgba(31,35,51,.98), rgba(25,28,41,.98));
  border:1px solid var(--border);
  border-radius:12px;
  overflow:hidden;
  transition:border-color .2s, transform .2s, box-shadow .2s;
}
.asset-record:hover { border-color:rgba(79,140,255,.45); transform:translateY(-1px); box-shadow:0 10px 28px rgba(0,0,0,.16); }
.asset-record.needs-verification { border-left:4px solid #fbbf24; }
.asset-record.needs-pic { border-left:4px solid #ef4444; }
.asset-record-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; padding:16px 18px 13px; }
.asset-record-identity { display:flex; align-items:flex-start; gap:12px; min-width:0; }
.asset-record-icon { width:38px; height:38px; flex:0 0 38px; display:grid; place-items:center; border-radius:10px; background:rgba(79,140,255,.12); border:1px solid rgba(79,140,255,.2); font-size:18px; }
.asset-record-title { color:var(--fg); font-size:15px; line-height:1.35; font-weight:650; overflow-wrap:anywhere; }
.asset-record-subtitle { display:flex; flex-wrap:wrap; align-items:center; gap:7px; margin-top:6px; color:var(--fg2); font-size:11px; }
.asset-source { padding-left:7px; border-left:1px solid var(--border); }
.asset-record-badges { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; flex:0 0 auto; }
.asset-record-details { display:grid; grid-template-columns:minmax(190px,1.35fr) repeat(3,minmax(140px,1fr)); border-top:1px solid rgba(55,59,79,.65); border-bottom:1px solid rgba(55,59,79,.65); }
.asset-detail { min-width:0; padding:13px 16px; border-right:1px solid rgba(55,59,79,.65); }
.asset-detail:last-child { border-right:0; }
.asset-detail > span:first-child { display:block; margin-bottom:5px; color:var(--fg2); font-size:10px; font-weight:650; letter-spacing:.55px; text-transform:uppercase; }
.asset-detail strong { display:block; color:var(--fg); font-size:12px; line-height:1.45; font-weight:600; overflow-wrap:anywhere; }
.asset-detail small, .asset-verifier > span:last-child { display:block; margin-top:3px; color:var(--fg2); font-size:11px; line-height:1.4; overflow-wrap:anywhere; }
.asset-recommendation-slot:empty { display:none; }
.asset-record-advice { display:flex; align-items:flex-start; gap:10px; margin:12px 16px 0; padding:9px 11px; line-height:1.45; }
.asset-record-advice strong { flex:0 0 auto; color:#fbbf24; font-size:11px; }
.asset-record-advice span { min-width:0; }
.asset-record-footer { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:12px 16px; }
.asset-responsibility { color:var(--fg2); font-size:11px; line-height:1.4; }
.asset-record-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; flex:0 0 auto; }
.btn-delete-asset { color:var(--red); border-color:rgba(239,68,68,.25); }
.btn-delete-asset:hover { border-color:var(--red); background:rgba(239,68,68,.1); }
.log-filter-bar { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; align-items:end; margin:12px 0; padding:12px; background:var(--bg3); border:1px solid var(--border); border-radius:10px; }
.log-filter-bar select, .log-filter-bar input { width:100%; min-width:0; }
.log-filter-bar label { display:flex; flex-direction:column; gap:4px; color:var(--fg2); font-size:10px; text-transform:uppercase; letter-spacing:.4px; }
.log-filter-bar label input { min-width:125px; color-scheme:dark; }

@media (max-width: 1180px) {
  .branch-header-banner { align-items:flex-start; gap:14px; }
  .asset-record-details { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .asset-detail:nth-child(2) { border-right:0; }
  .asset-detail:nth-child(-n+2) { border-bottom:1px solid rgba(55,59,79,.65); }
  .log-filter-bar { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

@media (max-width: 820px) {
  .branch-header-banner, .asset-record-head, .asset-record-footer { flex-direction:column; align-items:stretch; }
  .branch-header-actions, .asset-record-badges, .asset-record-actions { justify-content:flex-start; }
  .branch-header-actions .btn { flex:1 1 150px; justify-content:center; }
  .tab-nav { overflow-x:auto; padding-bottom:10px; }
  .tab-btn { white-space:nowrap; }
  .asset-record-details { grid-template-columns:1fr; }
  .asset-detail { border-right:0; border-bottom:1px solid rgba(55,59,79,.65); }
  .asset-detail:last-child { border-bottom:0; }
  .asset-record-advice { flex-direction:column; gap:4px; }
  .log-filter-bar { grid-template-columns:1fr; }
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.timeline-item {
  background: var(--bg3);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 12px;
}
.timeline-item.verified { border-left-color: var(--green); }
.timeline-item.discrepancy { border-left-color: var(--red); }
.timeline-meta { color: var(--fg2); font-size: 11px; margin-bottom: 4px; }

/* Ownership and handover notices */
.asset-advice { margin:10px 0; padding:10px; border-left:3px solid #e6a23c; background:rgba(230,162,60,.08); color:var(--fg2); font-size:12px; line-height:1.6; }
.switch-entry { padding:14px 0; border-bottom:1px solid var(--border); }
.switch-entry p { margin:6px 0; font-size:12px; }
.handover-modal { max-width:620px; }
.handover-heading { display:flex; align-items:center; gap:12px; margin-bottom:18px; }
.handover-heading h3 { margin:0 0 3px; }
.handover-heading p { color:var(--fg2); font-size:12px; margin:0; }
.handover-icon { width:42px; height:42px; display:grid; place-items:center; border-radius:12px; background:rgba(79,140,255,.14); color:var(--accent); font-size:23px; }
.handover-owner-row { display:grid; grid-template-columns:1fr auto 1.2fr; align-items:end; gap:14px; padding:14px; margin-bottom:16px; border:1px solid var(--border); border-radius:10px; background:var(--bg3); }
.handover-owner-row span,.handover-owner-row label { display:block; color:var(--fg2); font-size:10px; font-weight:650; text-transform:uppercase; letter-spacing:.5px; margin-bottom:6px; }
.handover-owner-row strong { display:block; min-height:38px; padding:10px 0; font-size:13px; }
.handover-owner-row select { width:100%; }
.handover-arrow { align-self:center; color:var(--accent); font-size:20px; }
.optional-label { color:var(--fg2); font-size:10px; font-weight:400; text-transform:none; }
.handover-modal .form-group small { display:block; margin-top:5px; color:var(--fg2); font-size:10px; }
.handover-notice { padding:10px 12px; border-radius:8px; background:rgba(79,140,255,.08); color:var(--fg2); font-size:11px; line-height:1.5; }
.form-error { margin-top:10px; color:var(--red); font-size:12px; }
@media (max-width:620px) { .handover-owner-row { grid-template-columns:1fr; } .handover-arrow { transform:rotate(90deg); justify-self:center; } }
.app-dialog { width: min(480px, calc(100vw - 32px)); box-sizing: border-box; max-height: calc(100dvh - 32px); overflow: auto; padding: 24px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg2); color: var(--fg); box-shadow: 0 24px 80px #0008; }
.app-dialog { margin: auto; }
.app-dialog::backdrop { background: #0009; backdrop-filter: blur(3px); }
.app-dialog h3 { margin: 0 0 16px; }
.app-dialog p { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--fg2); line-height: 1.6; margin-bottom: 20px; }
.app-dialog input { box-sizing: border-box; width: 100%; margin-top: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--fg); background: var(--bg); }
.app-dialog .modal-actions { margin-top: 24px; gap: 10px; }
.app-dialog :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.app-dialog [hidden] { display: none; }

/* Endpoint Policy Modal Enhancement */
.endpoint-overview-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 12px;
}
.endpoint-apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin: 10px 0 14px;
}
.endpoint-app-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.endpoint-app-card.detected {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.05) 0%, var(--bg2) 100%);
}
.endpoint-app-card .app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.endpoint-app-card .app-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
}
.endpoint-app-card .app-meta {
  font-size: 11px;
  color: var(--fg2);
  line-height: 1.4;
  word-break: break-word;
}
.endpoint-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.4;
  margin: 10px 0;
}
.endpoint-callout.warning {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fbbf24;
}
.endpoint-callout.danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}
.endpoint-callout.info {
  background: rgba(79, 140, 255, 0.1);
  border: 1px solid rgba(79, 140, 255, 0.25);
  color: #93c5fd;
}
.endpoint-policy-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 14px;
}
.endpoint-policy-box h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 6px;
}
.endpoint-policy-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 12px;
}
@media (max-width: 640px) {
  .endpoint-policy-form-row { grid-template-columns: 1fr; }
}
/* Enhanced Modern UI Classes (shadcn/ui & Tremor) */
.badge-status.online {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.badge-status.offline {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.devices-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.devices-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.nav-item {
  margin: 1px 10px;
  border-radius: 6px;
  padding: 8px 12px;
}
.nav-item.active {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent);
  border-left: 3px solid var(--accent);
  font-weight: 600;
}