/* KOSHA BEV OS · shared styles · v1 (from EWC OS, teal brand) */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #6b7482;
  --line: #e2e5ea;
  --brand: #0f7a6c;
  --brand-dark: #0b5d52;
  --ok: #1e8a4c;
  --ok-bg: #e5f5ec;
  --warn: #a35b00;
  --warn-bg: #fff2df;
  --bad: #b3261e;
  --bad-bg: #fde8e7;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 960px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 420px; }

/* Top bar */
.topbar {
  background: var(--brand); color: #fff;
  padding: 12px 16px; display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 5;
}
.topbar .title { font-weight: 700; font-size: 17px; flex: 1; }
.topbar a, .topbar button.link { color: #fff; text-decoration: none; font-size: 14px; background: none; border: 0; cursor: pointer; padding: 6px; }
.topbar .who { font-size: 13px; opacity: .9; }

/* Cards & text */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
h1 { font-size: 22px; margin: 4px 0 16px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }

/* Forms */
label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 6px; }
input, select {
  width: 100%; font-size: 16px; padding: 12px; border: 1px solid #c9ced6; border-radius: 10px; background: #fff; color: var(--text);
}
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Buttons */
.btn {
  display: inline-block; font-size: 16px; font-weight: 600; padding: 12px 18px; border-radius: 10px; border: 1px solid transparent;
  background: var(--brand); color: #fff; cursor: pointer; text-align: center; text-decoration: none; min-height: 46px;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.full { width: 100%; margin-top: 16px; }
.btn.secondary { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn.small { font-size: 14px; padding: 8px 12px; min-height: 36px; }

/* Messages */
.msg { padding: 12px; border-radius: 10px; margin: 12px 0; font-size: 15px; display: none; }
.msg.show { display: block; }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.bad { background: var(--bad-bg); color: var(--bad); }
.msg.warn { background: var(--warn-bg); color: var(--warn); }

/* Tiles (home) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-height: 96px;
  text-decoration: none; color: var(--text); display: flex; flex-direction: column; justify-content: space-between;
}
.tile:hover { border-color: var(--brand); }
.tile .t-name { font-weight: 700; }
.tile .t-sub { font-size: 13px; color: var(--muted); }
.tile.soon { opacity: .55; pointer-events: none; }

/* Badges */
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #eef1f5; color: var(--muted); }
.badge.director { background: #e3f3f0; color: var(--brand); }
.badge.office { background: #efe9fb; color: #5b3aa8; }
.badge.supervisor { background: #fff2df; color: #8a4b00; }
.badge.off { background: var(--bad-bg); color: var(--bad); }

/* People list */
.person { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.person:last-child { border-bottom: 0; }
.person:hover { background: #fafbfc; }
.person .p-main { flex: 1; min-width: 0; }
.person .p-name { font-weight: 600; }
.person .p-login { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person.inactive .p-name { color: var(--muted); text-decoration: line-through; }

/* Permission rows */
.perm { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.perm:last-child { border-bottom: 0; }
.perm .pm-main { flex: 1; min-width: 0; }
.perm .pm-name { font-weight: 600; font-size: 15px; }
.perm .pm-desc { font-size: 12px; color: var(--muted); }
.perm select { width: 150px; flex: none; font-size: 14px; padding: 8px; }
.perm .eff { width: 22px; text-align: center; font-weight: 700; flex: none; }
.eff.yes { color: var(--ok); }
.eff.no { color: #b8bec8; }

/* Credential hand-over box */
.cred { background: #fffbea; border: 1px dashed #d9b300; border-radius: 10px; padding: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; }

.hidden { display: none !important; }
.spacer { height: 8px; }
@media (max-width: 520px) {
  .perm { flex-wrap: wrap; }
  .perm select { width: 100%; }
  .row.stack-sm { flex-direction: column; align-items: stretch; }
}
