/* ================================================
   ArgusOS — Component Styles
   Panels, desk cards, chat, health, tasks, login, admin
   ================================================ */

/* ===== Panel (shared) ===== */
.panel {
  position: relative; background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--density-pad);
}
.panel::before, .panel::after {
  content: ""; position: absolute; width: 10px; height: 10px;
  border-color: var(--border-strong); border-style: solid; opacity: .6;
}
.panel::before { top: -1px; left: -1px; border-width: 1.5px 0 0 1.5px; border-radius: 4px 0 0 0; }
.panel::after { bottom: -1px; right: -1px; border-width: 0 1.5px 1.5px 0; border-radius: 0 0 4px 0; }

/* ===== Floor Card View (Kaarten) ===== */
.floor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--density-gap); }
.desk {
  background: var(--bg-desk); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--density-pad);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; position: relative; overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.desk:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.desk-surface { position: absolute; left: 0; right: 0; bottom: 0; height: 36%; background: linear-gradient(180deg, transparent, rgba(9,175,150,0.05)); border-top: 1px solid var(--border); }
.avatar-wrap { position: relative; width: 76px; height: 76px; flex: none; z-index: 1; }
.avatar-wrap img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg-elevated); display: block; }
.status-ring { position: absolute; inset: -4px; border-radius: 50%; border: 2px solid transparent; }
.status-ring.working { border-color: var(--teal); box-shadow: 0 0 10px -1px var(--teal-glow); animation: pulse-ring 1.8s ease-in-out infinite; }
.status-ring.idle { border-color: var(--text-dim); }
.status-ring.blocked { border-color: var(--err); box-shadow: 0 0 10px -1px rgba(239,91,91,0.5); }
.status-ring.offline { border-color: var(--text-dim); opacity: .4; }
.status-dot { position: absolute; bottom: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--bg-desk); z-index: 2; }
.status-dot.working { background: var(--teal); }
.status-dot.idle { background: var(--text-dim); }
.status-dot.blocked { background: var(--err); }
.status-dot.offline { background: #2a3a38; }
.desk-name { font-weight: 600; font-size: 14px; z-index: 1; }
.desk-role { font-size: 11px; color: var(--text-muted); z-index: 1; }
.desk-task { font-family: var(--mono); font-size: 10.5px; color: var(--text-dim); z-index: 1; min-height: 14px; display: flex; align-items: center; gap: 5px; justify-content: center; }
.typing-dots { display: inline-flex; gap: 2px; }
.typing-dots span { width: 3px; height: 3px; border-radius: 50%; background: var(--teal); animation: tdot 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }

/* Access lock overlay (team-role gating) */
.lock-overlay {
  position: absolute; inset: 0; background: rgba(5,9,11,0.72); backdrop-filter: blur(1.5px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border-radius: inherit; z-index: 5; color: var(--text-dim); font-family: var(--mono); font-size: 9.5px; text-align: center; padding: 8px;
}
.lock-overlay svg { width: 18px; height: 18px; opacity: .6; }

/* ===== Chat ===== */
.chat-shell { display: grid; grid-template-columns: 260px 1fr; gap: var(--density-gap); height: calc(100vh - 210px); min-height: 420px; }
.chat-list { overflow: auto; padding: 6px; }
.chat-contact {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm);
  cursor: pointer; margin-bottom: 2px; border: 1px solid transparent; position: relative;
}
.chat-contact:hover { background: rgba(255,255,255,0.03); }
.chat-contact.active { background: var(--teal-soft); border-color: var(--border-strong); }
.chat-contact.locked { opacity: .4; cursor: not-allowed; }
.chat-contact img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.chat-contact-meta { flex: 1; min-width: 0; }
.chat-contact-name { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.chat-contact-preview { font-size: 10.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

.chat-window { display: flex; flex-direction: column; overflow: hidden; }
.chat-window-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.chat-window-head img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.chat-window-head .name { font-weight: 600; font-size: 14px; }
.chat-window-head .role { font-size: 11px; color: var(--text-muted); }
.chat-messages { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 6px; }
.msg { display: flex; gap: 10px; max-width: 74%; }
.msg img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none; margin-top: 2px; }
.msg-bubble { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px 12px 12px 3px; padding: 9px 13px; font-size: 12.8px; line-height: 1.5; }
.msg-time { font-size: 9.5px; color: var(--text-dim); margin-top: 4px; font-family: var(--mono); }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .msg-bubble { background: var(--teal-soft); border-color: var(--border-strong); border-radius: 12px 12px 3px 12px; }
.msg.me .msg-time { text-align: right; }
.chat-input { display: flex; align-items: center; gap: 10px; margin-top: 14px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 24px; padding: 8px 8px 8px 16px; }
.chat-input input { flex: 1; background: transparent; border: none; outline: none; color: var(--text); font-size: 12.8px; font-family: var(--sans); }
.chat-input input::placeholder { color: var(--text-dim); }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-panel); color: var(--text-muted); display: flex; align-items: center; justify-content: center; flex: none; }
.icon-btn.send { background: var(--teal); color: #04211c; border-color: var(--teal); }
.icon-btn svg { width: 15px; height: 15px; }

/* ===== Health ===== */
.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--density-gap); margin-bottom: 22px; }
.summary-card .val { font-family: var(--mono); font-size: 22px; font-weight: 600; color: var(--teal); }
.summary-card .val.err { color: var(--err); }
.summary-card .lbl { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: var(--density-gap); }
.health-card { position: relative; }
.health-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.health-card-head img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.health-card-head .name { font-weight: 600; font-size: 13.5px; }
.health-card-head .role { font-size: 10.5px; color: var(--text-muted); }
.health-card-head .badge { margin-left: auto; }
.badge { font-family: var(--mono); font-size: 9.5px; padding: 3px 8px; border-radius: 20px; border: 1px solid var(--border-strong); text-transform: uppercase; letter-spacing: .04em; }
.badge.ok { color: var(--teal); background: var(--teal-soft); }
.badge.warn { color: var(--warn); background: rgba(232,179,74,0.1); border-color: rgba(232,179,74,0.35); }
.badge.err { color: var(--err); background: rgba(239,91,91,0.1); border-color: rgba(239,91,91,0.35); }
.metric-row { margin-bottom: 12px; }
.metric-row-label { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-muted); margin-bottom: 5px; font-family: var(--mono); }
.bar-track { height: 6px; border-radius: 6px; background: var(--bg-elevated); overflow: hidden; display: flex; }
.bar-fill { height: 100%; background: var(--teal); }
.bar-fill.split-fail { background: var(--err); }
.task-line { display: flex; align-items: center; justify-content: space-between; font-size: 11px; padding: 6px 0; border-top: 1px dashed var(--border); }
.task-line:first-of-type { border-top: none; }
.task-line .src { font-family: var(--mono); font-size: 9px; color: var(--text-dim); background: var(--bg-elevated); padding: 1px 6px; border-radius: 4px; }

/* ===== Tasks ===== */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--density-gap); }
.board-col-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.board-col-head .count { font-family: var(--mono); background: var(--bg-elevated); border: 1px solid var(--border); padding: 1px 8px; border-radius: 20px; font-size: 10.5px; }
.board-col { min-height: 200px; }
.task-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; }
.task-card-title { font-size: 12.5px; font-weight: 500; line-height: 1.4; margin-bottom: 10px; }
.task-card-meta { display: flex; align-items: center; justify-content: space-between; }
.assignee { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); }
.assignee img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.assignee .initial { width: 20px; height: 20px; border-radius: 50%; background: var(--salmon-soft); color: var(--salmon); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 9px; font-weight: 700; }
.prio { font-family: var(--mono); font-size: 9px; padding: 2px 6px; border-radius: 4px; }
.prio.hoog { background: rgba(239,91,91,0.12); color: var(--err); }
.prio.midden { background: rgba(232,179,74,0.12); color: var(--warn); }
.prio.laag { background: var(--teal-soft); color: var(--teal); }
.task-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.automove { display: flex; gap: 6px; }
.movebtn { font-family: var(--mono); font-size: 10px; color: var(--text-muted); background: transparent; border: 1px solid var(--border); border-radius: 4px; padding: 3px 7px; }
.movebtn:hover { border-color: var(--border-strong); color: var(--teal); }
.autopickup { display: flex; align-items: center; gap: 4px; font-size: 9.5px; color: var(--text-dim); font-family: var(--mono); }
.autopickup .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 5px var(--teal-glow); }
.new-task-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.new-task-bar input, .new-task-bar select { background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius-sm); padding: 9px 12px; font-family: var(--sans); font-size: 12.5px; outline: none; }
.new-task-bar input { flex: 1; min-width: 200px; }
.new-task-bar button { background: var(--teal); color: #04211c; border: none; border-radius: var(--radius-sm); padding: 9px 18px; font-weight: 600; font-size: 12.5px; }

/* ===== Admin (Finn-only) ===== */
.admin-warning {
  display: flex; gap: 10px; align-items: flex-start; background: rgba(232,179,74,0.07); border: 1px solid rgba(232,179,74,0.3);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 20px; font-size: 11.5px; color: var(--text-muted); line-height: 1.6;
}
.admin-warning svg { width: 18px; height: 18px; color: var(--warn); flex: none; margin-top: 1px; }
.admin-warning b { color: var(--warn); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.admin-table th {
  text-align: left; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-dim); padding: 0 10px 10px; border-bottom: 1px solid var(--border);
}
.admin-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-user { display: flex; align-items: center; gap: 10px; }
.admin-user .initial { width: 30px; height: 30px; border-radius: 50%; background: var(--salmon-soft); color: var(--salmon); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11px; font-weight: 700; }
.access-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.access-badge { font-family: var(--mono); font-size: 9.5px; padding: 2px 8px; border-radius: 20px; background: var(--teal-soft); color: var(--teal); border: 1px solid var(--border-strong); }
.edit-btn { font-family: var(--mono); font-size: 10.5px; color: var(--text-muted); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 6px; padding: 5px 11px; }
.edit-btn:hover { border-color: var(--border-strong); color: var(--teal); }
.perm-editor {
  display: none; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin: 0 0 10px;
}
.perm-editor.open { display: block; }
.perm-grid { display: grid; grid-template-columns: 1fr repeat(3, 90px); gap: 8px; align-items: center; font-size: 11px; }
.perm-grid .perm-head { font-family: var(--mono); font-size: 9.5px; color: var(--text-dim); text-transform: uppercase; }
.perm-check { display: flex; justify-content: center; }
.perm-check input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--teal); }
.perm-check.locked { color: var(--text-dim); }
.perm-check.locked svg { width: 13px; height: 13px; }
.add-user-bar { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.add-user-bar input { flex: 1; min-width: 160px; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 12.5px; outline: none; }
.add-user-bar button { background: var(--salmon); color: #2b0e08; border: none; border-radius: var(--radius-sm); padding: 9px 16px; font-weight: 600; font-size: 12.5px; }
