/* =========================================================
   Ponto no Trampo — design system
   ========================================================= */
:root {
  /* dark (padrão) */
  --bg: #07080a;
  --bg-glow-1: rgba(61, 220, 154, .10);
  --bg-glow-2: rgba(56, 189, 248, .08);
  --surface: #0f1116;
  --surface-2: #15181f;
  --surface-3: #1c2029;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .12);
  --text: #f4f6fa;
  --text-2: #a6b0c0;
  --text-3: #6a7484;
  --brand: #3ddc9a;
  --brand-2: #22c58a;
  --brand-ink: #05231a;
  --brand-soft: rgba(61, 220, 154, .12);
  --info: #58b6f8;
  --info-soft: rgba(88, 182, 248, .12);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, .12);
  --warn: #f5c04a;
  --warn-soft: rgba(245, 192, 74, .13);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 28px -14px rgba(0, 0, 0, .7);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .85);
  --top-hi: inset 0 1px 0 rgba(255, 255, 255, .045);
  --r-sm: 9px;
  --r: 13px;
  --r-lg: 18px;
  --r-xl: 24px;
  --ease: cubic-bezier(.32, .72, 0, 1);
}

:root[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-glow-1: rgba(34, 197, 138, .10);
  --bg-glow-2: rgba(56, 189, 248, .10);
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --surface-3: #eaeef4;
  --line: rgba(12, 20, 33, .09);
  --line-strong: rgba(12, 20, 33, .16);
  --text: #0d1219;
  --text-2: #55616f;
  --text-3: #8b95a3;
  --brand: #0f9d70;
  --brand-2: #0b8a61;
  --brand-ink: #ffffff;
  --brand-soft: rgba(15, 157, 112, .10);
  --info: #0b76c4;
  --info-soft: rgba(11, 118, 196, .10);
  --danger: #d93a3a;
  --danger-soft: rgba(217, 58, 58, .09);
  --warn: #a06a06;
  --warn-soft: rgba(214, 149, 12, .14);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 12px 26px -16px rgba(15, 23, 42, .22);
  --shadow-lg: 0 26px 60px -24px rgba(15, 23, 42, .3);
  --top-hi: inset 0 1px 0 rgba(255, 255, 255, .9);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 460px at 82% -8%, var(--bg-glow-2), transparent 62%),
    radial-gradient(820px 460px at -8% 104%, var(--bg-glow-1), transparent 60%);
}
.hidden { display: none !important; }
.ic { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1 { font-size: 21px; font-weight: 680; letter-spacing: -.022em; }
h2 { font-size: 15px; font-weight: 640; letter-spacing: -.012em; display: flex; align-items: center; gap: 8px; }
.head-ic { color: var(--text-3); }
.card-head h2 { display: flex; align-items: center; gap: 8px; }   /* alinha ícone com o texto */
.muted { color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.muted-xs { color: var(--text-3); font-size: 12px; }
code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .92em; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
.num { font-variant-numeric: tabular-nums; }
::selection { background: var(--brand); color: var(--brand-ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------- controles */
.control, input[type="text"], input[type="password"], input[type="date"],
input[type="time"], input[type="number"], input[type="search"],
input[type="datetime-local"], select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
  min-height: 42px;
  color-scheme: dark;
}
:root[data-theme="light"] .control,
:root[data-theme="light"] input, :root[data-theme="light"] select { color-scheme: light; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a7484' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
  padding-right: 34px; cursor: pointer;
}
.control:hover { border-color: var(--line-strong); }
.control:focus { border-color: var(--brand); box-shadow: 0 0 0 3.5px var(--brand-soft); }
input::placeholder { color: var(--text-3); }
.control-sm { min-height: 36px; padding: 7px 10px; font-size: 13.5px; width: auto; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 12.5px; font-weight: 560; color: var(--text-2); }
.field-hint { font-size: 12px; color: var(--text-3); line-height: 1.45; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input-ic { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; }
.input-wrap .input-ic ~ input { padding-left: 38px; }
.input-btn {
  position: absolute; right: 6px; display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: 0; border-radius: 7px;
  background: transparent; color: var(--text-3); cursor: pointer; transition: color .15s, background .15s;
}
.input-btn:hover { color: var(--text); background: var(--surface-3); }
.input-wrap:has(.input-btn) input { padding-right: 42px; }
.trio, .duo { display: grid; gap: 12px; }
.trio { grid-template-columns: repeat(3, 1fr); }
.duo { grid-template-columns: repeat(2, 1fr); }
.trio .field, .duo .field { margin-bottom: 0; }

/* ---------------------------------------------- botões */
.btn {
  --btn-bg: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 580; font-size: 14px;
  color: var(--text); background: var(--btn-bg);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 16px; min-height: 42px;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform .12s var(--ease), filter .16s, background .16s, border-color .16s, opacity .16s;
  box-shadow: var(--top-hi);
}
.btn:hover { border-color: var(--line-strong); }
.btn:active { transform: translateY(1px) scale(.995); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  color: var(--brand-ink); border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 18px -8px rgba(61, 220, 154, .5);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-danger {
  background: linear-gradient(180deg, #f2564f, #d93a3a); color: #fff; border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 6px 18px -8px rgba(217, 58, 58, .5);
}
.btn-quiet { background: transparent; }
.btn-quiet:hover { background: var(--surface-2); }
.btn-lg { min-height: 48px; font-size: 15px; border-radius: var(--r); }
.btn-sm { min-height: 34px; padding: 6px 11px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.loading { pointer-events: none; opacity: .8; }
.btn.loading .btn-label { visibility: hidden; }
.btn.loading::after {
  content: ""; position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .6s linear infinite;
}
.btn { position: relative; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: transparent; border: 1px solid var(--line); color: var(--text-2);
  cursor: pointer; transition: color .15s, background .15s, border-color .15s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--line-strong); }
.icon-btn-sm { width: 30px; height: 30px; border-color: transparent; }

/* ---------------------------------------------- alertas / tags */
.alert {
  display: flex; align-items: center; gap: 9px;
  font-size: 13.5px; padding: 11px 13px; border-radius: var(--r-sm); margin-bottom: 14px;
  border: 1px solid transparent;
}
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: rgba(255, 107, 107, .22); }
.tag {
  font-size: 11.5px; font-weight: 620; letter-spacing: .01em;
  padding: 3px 9px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2);
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.pill.green { background: var(--brand-soft); color: var(--brand); }
.pill.red { background: var(--danger-soft); color: var(--danger); }
.pill.amber { background: var(--warn-soft); color: var(--warn); }
.pill.blue { background: var(--info-soft); color: var(--info); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.live .dot { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
.delta { font-variant-numeric: tabular-nums; font-weight: 620; }
.delta.pos { color: var(--brand); }
.delta.neg { color: var(--danger); }
.delta.zero { color: var(--text-3); }

/* ---------------------------------------------- login */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-aside { position: relative; overflow: hidden; display: flex; align-items: center; padding: 56px; border-right: 1px solid var(--line); }
.auth-aside-inner { position: relative; z-index: 1; max-width: 420px; }
.auth-aside-title { font-size: 32px; line-height: 1.18; letter-spacing: -.03em; font-weight: 680; margin: 26px 0 28px; }
.auth-perks { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.auth-perks li { display: flex; align-items: center; gap: 11px; color: var(--text-2); font-size: 14px; }
.auth-perks .ic { color: var(--brand); }
.aurora { position: absolute; inset: 0; filter: blur(70px); opacity: .5; }
.aurora span { position: absolute; display: block; border-radius: 50%; }
.aurora span:nth-child(1) { width: 380px; height: 380px; background: var(--brand); top: -60px; left: -40px; opacity: .30; animation: float1 16s ease-in-out infinite; }
.aurora span:nth-child(2) { width: 320px; height: 320px; background: var(--info); bottom: -50px; left: 32%; opacity: .26; animation: float2 20s ease-in-out infinite; }
.aurora span:nth-child(3) { width: 260px; height: 260px; background: #8b7cf6; top: 38%; right: -60px; opacity: .20; animation: float1 24s ease-in-out infinite reverse; }
@keyframes float1 { 50% { transform: translate3d(28px, 38px, 0) scale(1.1); } }
@keyframes float2 { 50% { transform: translate3d(-34px, -26px, 0) scale(1.08); } }

.auth-main { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px; }
.auth-card { width: 100%; max-width: 384px; animation: rise .5s var(--ease) both; }
.auth-card h1 { font-size: 25px; margin-bottom: 5px; }
.auth-card > .muted { margin-bottom: 26px; }
.auth-card form { margin-top: 4px; }
.auth-card-mark { margin-bottom: 20px; }
.auth-note {
  display: flex; gap: 9px; align-items: flex-start;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--text-3); line-height: 1.5;
}
.auth-note .ic { color: var(--text-3); margin-top: 2px; }
.auth-theme { position: absolute; top: 22px; right: 22px; color: var(--text-2); }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 15px;
  color: var(--brand-ink);
  background: linear-gradient(150deg, var(--brand), var(--brand-2) 65%, #21b8b0);
  box-shadow: 0 10px 26px -10px rgba(61, 220, 154, .55), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.brand-mark-sm { width: 44px; height: 44px; border-radius: 13px; }
.brand-mark-xs { width: 32px; height: 32px; border-radius: 10px; box-shadow: 0 6px 16px -8px rgba(61, 220, 154, .5), inset 0 1px 0 rgba(255, 255, 255, .3); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* ---------------------------------------------- topbar */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 18px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-titles { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.topbar-titles strong { font-size: 14.5px; font-weight: 640; letter-spacing: -.012em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.segmented {
  display: flex; gap: 2px; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px;
  margin: 0 auto;
}
.tab-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 13.5px; font-weight: 560;
  color: var(--text-2); background: transparent; border: 0; border-radius: 8px;
  padding: 7px 13px; cursor: pointer; white-space: nowrap;
  transition: color .16s, background .16s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm), var(--top-hi); }
.tab-btn.active .ic { color: var(--brand); }

.user-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 9px 4px 4px; font: inherit;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  color: var(--text); cursor: pointer; transition: background .15s, border-color .15s;
}
.user-btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.user-name { font-size: 13px; font-weight: 600; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.user-chevron { color: var(--text-3); transition: transform .2s var(--ease); }
.user-btn[aria-expanded="true"] .user-chevron { transform: rotate(180deg); }
.avatar {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 11.5px; font-weight: 700; letter-spacing: .01em; color: #fff;
  background: linear-gradient(145deg, var(--av-1, #3ddc9a), var(--av-2, #22c58a));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.avatar-sm { width: 26px; height: 26px; font-size: 10.5px; }

.menu-wrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  min-width: 218px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
  box-shadow: var(--shadow-lg); animation: rise .16s var(--ease) both;
}
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  font: inherit; font-size: 13.5px; text-align: left;
  padding: 9px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); cursor: pointer; transition: background .14s, color .14s;
}
.menu-item:hover { background: var(--surface-2); }
.menu-item .ic { color: var(--text-3); }
.menu-item.danger:hover { color: var(--danger); background: var(--danger-soft); }
.menu-item.danger:hover .ic { color: var(--danger); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 2px; }

/* ---------------------------------------------- layout */
.content { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 22px 18px 40px; }
.pane { display: flex; flex-direction: column; gap: 14px; animation: fade .3s var(--ease) both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.pane-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 2px; }
.pane-head-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.card {
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; box-shadow: var(--shadow), var(--top-hi);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head + .muted { margin-top: -6px; margin-bottom: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ---------------------------------------------- ponto: relógio + anel */
.punch-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 14px; align-items: start; }
.clock-card { display: grid; grid-template-columns: 1fr auto; gap: 26px; align-items: center; padding: 26px; }
.clock-date { text-transform: capitalize; font-size: 13.5px; }
.clock-time {
  font-size: clamp(44px, 6.4vw, 62px); font-weight: 700; letter-spacing: -.035em;
  font-variant-numeric: tabular-nums; line-height: 1.05; margin: 2px 0 12px;
}
.status-line { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-2); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.status-line.working .status-dot { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); animation: pulse 2s ease-in-out infinite; }
.status-line.working .status-text { color: var(--brand); font-weight: 560; }
.status-line.left .status-dot { background: var(--info); box-shadow: 0 0 0 4px var(--info-soft); }
.punch-cta { margin: 20px 0 16px; }
.btn-punch { min-height: 56px; padding: 0 30px; font-size: 15.5px; font-weight: 620; border-radius: var(--r); width: 100%; max-width: 330px; }
.btn-in {
  background: linear-gradient(180deg, var(--brand), var(--brand-2)); color: var(--brand-ink); border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 10px 30px -12px rgba(61, 220, 154, .65);
}
.btn-out {
  background: linear-gradient(180deg, #ff7a7a, #e14b4b); color: #fff; border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 10px 30px -12px rgba(225, 75, 75, .6);
}
.btn-in:hover, .btn-out:hover { filter: brightness(1.05); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-static {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-2);
  padding: 5px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.chip-static .ic { color: var(--text-3); }

.ring-side { display: flex; justify-content: center; }
.ring { position: relative; width: 196px; height: 196px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 13; stroke-linecap: round; }
.ring-track { stroke: var(--surface-3); }
.ring-bar {
  stroke: url(#none); stroke: var(--brand);
  stroke-dasharray: 540.4; stroke-dashoffset: 540.4;
  transition: stroke-dashoffset .8s var(--ease), stroke .3s;
  filter: drop-shadow(0 0 8px var(--brand-soft));
}
.ring.over .ring-bar { stroke: var(--info); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.ring-value { font-size: 32px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ring-label { font-size: 12px; color: var(--text-3); }
.ring-badge {
  margin-top: 7px; font-size: 11.5px; font-weight: 620; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2);
}
.ring-badge.pos { background: var(--brand-soft); color: var(--brand); }
.ring-badge.neg { background: var(--warn-soft); color: var(--warn); }

/* ---------------------------------------------- pronto para bater / avisos */
.ready-box { margin-top: 14px; display: flex; flex-direction: column; gap: 7px; width: 100%; max-width: 420px; }
.ready-row {
  display: flex; align-items: center; gap: 9px;
  font-size: 12.5px; padding: 9px 12px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); text-align: left;
}
.ready-row.ok { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.ready-row.bad { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.ready-row.wait { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.ready-row .ic { flex: none; }
.note {
  display: flex; gap: 9px; align-items: flex-start;
  font-size: 12.5px; line-height: 1.5; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 12px;
}
.note .ic { color: var(--text-3); margin-top: 2px; flex: none; }
.note.ok { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.note.ok .ic { color: var(--brand); }
.note.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.note.warn .ic { color: var(--warn); }

/* barra de instalação (PWA) */
.install-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--r);
  background: linear-gradient(100deg, var(--brand-soft), var(--info-soft));
  border: 1px solid var(--line);
}
.install-ic {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm);
}
.install-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.install-text strong { font-size: 13.5px; font-weight: 600; }
.install-bar .icon-btn { margin-left: auto; }
.install-bar .btn + .icon-btn { margin-left: 0; }

/* escolha de modo (cartões de rádio) */
.radio-cards { display: flex; flex-direction: column; gap: 9px; }
.radio-card { display: flex; cursor: pointer; }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-body {
  display: flex; flex-direction: column; gap: 2px; width: 100%;
  padding: 12px 14px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line);
  transition: border-color .16s, background .16s;
}
.radio-body strong { font-size: 13.5px; font-weight: 600; }
.radio-card:hover .radio-body { border-color: var(--line-strong); }
.radio-card input:checked + .radio-body { border-color: var(--brand); background: var(--brand-soft); }
.radio-card input:checked + .radio-body strong { color: var(--brand); }
.radio-card input:focus-visible + .radio-body { box-shadow: 0 0 0 3px var(--brand-soft); }

/* credenciais geradas */
.cred-box { display: flex; flex-direction: column; gap: 1px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; margin-top: 4px; }
.cred-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; }
.cred-row + .cred-row { border-top: 1px solid var(--line); }
.cred-row strong { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13px; font-weight: 600; word-break: break-all; text-align: right; }

/* ---------------------------------------------- calendário de folgas */
.modal-wide { max-width: 470px; }
.rot180 { transform: rotate(180deg); }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cal-head strong { font-size: 14px; font-weight: 620; text-transform: capitalize; }
.cal-grid-head, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-grid-head {
  margin-bottom: 5px; font-size: 10.5px; font-weight: 600; color: var(--text-3);
  text-align: center; text-transform: uppercase; letter-spacing: .04em;
}
.cal-day {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1; border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 560; font-variant-numeric: tabular-nums;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2);
  cursor: pointer; transition: background .14s, border-color .14s, color .14s, transform .1s;
}
.cal-day:hover { border-color: var(--line-strong); }
.cal-day:active { transform: scale(.94); }
.cal-day.vazio { background: transparent; border-color: transparent; cursor: default; }
.cal-day.fixa { background: var(--surface-3); color: var(--text-3); }   /* folga da escala semanal */
.cal-day.folga { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); font-weight: 700; }
.cal-day.hoje { box-shadow: inset 0 0 0 2px var(--brand); color: var(--brand); }
.modal-foot-split { justify-content: space-between; }
.foot-actions { display: flex; gap: 8px; }

/* ---------------------------------------------- lembretes / alertas */
.remind-list { display: flex; flex-direction: column; gap: 8px; }
.remind-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line);
  transition: border-color .16s;
}
.remind-item:hover { border-color: var(--line-strong); }
.remind-item.off { opacity: .55; }
.remind-time {
  font-size: 15.5px; font-weight: 700; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; color: var(--brand); flex: none; min-width: 48px;
}
.remind-item.off .remind-time { color: var(--text-3); }
.remind-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.remind-info strong { font-size: 13.5px; font-weight: 600; }
.remind-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.remind-acts { display: flex; gap: 4px; flex: none; }

.weekdays { display: flex; gap: 5px; flex-wrap: wrap; }
.weekdays label { position: relative; cursor: pointer; }
.weekdays input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.weekdays span {
  display: flex; align-items: center; justify-content: center;
  min-width: 42px; padding: 7px 4px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 600; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--line);
  transition: background .15s, border-color .15s, color .15s;
}
.weekdays label:hover span { border-color: var(--line-strong); }
.weekdays input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.weekdays input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-soft); }

.check-row {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  padding: 11px 12px; margin-bottom: 10px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line);
}
.check-row:hover { border-color: var(--line-strong); }
.check-row input { width: 17px; height: 17px; margin-top: 1px; flex: none; accent-color: var(--brand); cursor: pointer; }
.check-row > span { display: flex; flex-direction: column; gap: 2px; }
.check-row strong { font-size: 13.5px; font-weight: 600; }

.sub-head {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid var(--line);
}

/* ---------------------------------------------- timeline */
.timeline { display: flex; flex-direction: column; }
.tl-row { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px; padding: 9px 0; position: relative; }
.tl-row + .tl-row::before {
  content: ""; position: absolute; left: 10px; top: -14px; height: 22px;
  border-left: 2px dotted var(--line-strong);
}
.tl-mark {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--text-2);
}
.tl-mark.in { background: var(--brand-soft); color: var(--brand); }
.tl-mark.out { background: var(--danger-soft); color: var(--danger); }
.tl-label { font-size: 13.5px; font-weight: 560; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.tl-time { font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 600; }
.tl-sub { font-size: 12px; color: var(--text-3); }

/* ---------------------------------------------- stats */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 15px 16px; box-shadow: var(--shadow-sm), var(--top-hi);
  display: flex; flex-direction: column; gap: 3px;
  transition: border-color .18s, transform .18s var(--ease);
}
.stat:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.stat-top { display: flex; align-items: center; gap: 7px; color: var(--text-3); font-size: 11.5px; font-weight: 580; text-transform: uppercase; letter-spacing: .055em; }
.stat-top .ic { color: var(--text-3); }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.028em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-value.brand { color: var(--brand); }
.stat-foot { font-size: 12px; color: var(--text-3); }

/* ---------------------------------------------- tabelas */
.table-scroll { overflow-x: auto; margin: 0 -20px -20px; padding: 0 20px 4px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.8px; }
.table th {
  position: sticky; top: 0;
  text-align: left; white-space: nowrap;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); padding: 0 10px 9px;
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .14s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .right, .table th.right { text-align: right; }
.progress-col { width: 92px; }
.cell-user { display: flex; align-items: center; gap: 9px; min-width: 0; }
.cell-user strong { font-weight: 580; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { font-size: 11.5px; color: var(--text-3); }
.mini-bar { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.mini-bar span { display: block; height: 100%; border-radius: 3px; background: var(--brand); transition: width .6s var(--ease); }
.mini-bar.over span { background: var(--info); }
.punch-inline { display: inline-flex; align-items: center; gap: 5px; margin-right: 4px; font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--text-2); }
.punch-inline b { font-weight: 620; color: var(--text-3); font-size: 10.5px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.mini-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: 12.5px; font-weight: 540;
  padding: 5px 9px; border-radius: 7px;
  background: transparent; border: 1px solid var(--line); color: var(--text-2);
  cursor: pointer; transition: all .14s; white-space: nowrap;
}
.mini-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--line-strong); }
.mini-btn.danger:hover { color: var(--danger); border-color: rgba(255, 107, 107, .35); background: var(--danger-soft); }
.mini-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 5px; margin-left: 2px;
  background: transparent; border: 0; color: var(--text-3); cursor: pointer; transition: all .14s;
}
.mini-x:hover { color: var(--danger); background: var(--danger-soft); }

.empty { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 34px 16px; text-align: center; }
.empty .ic { color: var(--text-3); opacity: .6; }
.empty p { color: var(--text-3); font-size: 13.5px; max-width: 320px; }
td.empty-cell { padding: 0; }
.skeleton { height: 13px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------- filtros / chips */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip-group { display: flex; gap: 5px; flex-wrap: wrap; }
.chip {
  font: inherit; font-size: 12.5px; font-weight: 540;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.active { background: var(--brand-soft); border-color: transparent; color: var(--brand); font-weight: 600; }
.filter-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; align-items: end; }
.filter-bar .field { margin-bottom: 0; }
.field-actions { justify-content: flex-end; }
.filter-bar + .chip-group { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.search-wrap { max-width: 320px; flex: 1; }
.search-wrap input { min-height: 38px; }

/* ---------------------------------------------- gráfico */
.chart { display: flex; align-items: flex-end; gap: 5px; height: 168px; padding-top: 22px; position: relative; }
.chart-target { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line-strong); }
.chart-target span { position: absolute; right: 0; top: -17px; font-size: 10.5px; color: var(--text-3); background: var(--surface); padding: 0 4px; }
.bar-wrap { flex: 1; min-width: 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar {
  width: 100%; max-width: 40px; min-height: 3px; border-radius: 5px 5px 3px 3px;
  background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--brand) 55%, transparent));
  transition: height .6s var(--ease), filter .15s; cursor: default;
}
.bar-wrap:hover .bar { filter: brightness(1.18); }
.bar.over { background: linear-gradient(180deg, var(--info), color-mix(in srgb, var(--info) 55%, transparent)); }
.bar.empty-bar { background: var(--surface-3); }
.bar-label { font-size: 10px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------------------------------------- configurações */
/* colunas tipo "masonry": os cartões se encaixam sem deixar vãos irregulares */
.settings-grid { columns: 3 320px; column-gap: 14px; }
.settings-grid > .card { break-inside: avoid; margin-bottom: 14px; }
@media (max-width: 720px) { .settings-grid { columns: 1; } }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.slider { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line); transition: background .2s, border-color .2s; pointer-events: none; }
.slider::before {
  content: ""; position: absolute; left: 3px; top: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-3); transition: transform .22s var(--ease), background .2s;
}
.switch input:checked + .slider { background: var(--brand); border-color: transparent; }
.switch input:checked + .slider::before { transform: translateX(18px); background: var(--brand-ink); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---------------------------------------------- modais */
.backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(3, 5, 8, .62); backdrop-filter: blur(5px);
  animation: fadeIn .18s ease both;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 430px; max-height: 90dvh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-xl);
  padding: 22px; box-shadow: var(--shadow-lg);
  animation: pop .24s var(--ease) both;
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.modal-sm { max-width: 372px; text-align: center; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.modal-head h2 { font-size: 17px; }
.modal-sm h2 { font-size: 17.5px; margin-bottom: 7px; }
.modal-foot { display: flex; gap: 9px; justify-content: flex-end; margin-top: 18px; }
.modal-sm .modal-foot { margin-top: 20px; }
.modal-icon {
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 14px;
  background: var(--info-soft); color: var(--info);
}
.modal-icon.danger { background: var(--danger-soft); color: var(--danger); }

/* ---------------------------------------------- toasts */
#toasts {
  position: fixed; z-index: 200; bottom: 22px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; width: min(94vw, 430px); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 15px; border-radius: var(--r);
  background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 540;
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
  animation: toastIn .28s var(--ease) both; transition: opacity .3s, transform .3s;
}
.toast .ic { flex: none; }
.toast.ok { border-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.toast.ok .ic { color: var(--brand); }
.toast.err { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.toast.err .ic { color: var(--danger); }
.toast.info .ic { color: var(--info); }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }

/* ---------------------------------------------- responsivo */
@media (max-width: 1000px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .punch-grid { grid-template-columns: 1fr; }
  .clock-card { grid-template-columns: 1fr; gap: 20px; }
  .ring-side { order: -1; }
  .btn-punch { max-width: none; }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .topbar { padding: 9px 13px; gap: 10px; }
  .topbar-titles span { display: none; }
  .user-name { max-width: 84px; }
  .user-role { display: none; }
  .content { padding: 16px 13px calc(84px + env(safe-area-inset-bottom)); }
  .card { padding: 16px; border-radius: var(--r); }
  .table-scroll { margin: 0 -16px -16px; padding: 0 16px 4px; }
  h1 { font-size: 19px; }
  .clock-card { padding: 20px; text-align: center; }
  .clock-side { display: flex; flex-direction: column; align-items: center; }
  .status-line { justify-content: center; }
  .chips { justify-content: center; }
  .ring { width: 172px; height: 172px; }
  .trio, .duo { grid-template-columns: 1fr; }
  .pane-head { align-items: flex-start; }
  .pane-head-actions { width: 100%; }
  .pane-head-actions .btn { flex: 1; }
  .search-wrap { max-width: none; }

  /* nav inferior */
  .segmented {
    position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; top: auto;
    margin: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border: 0; border-top: 1px solid var(--line); border-radius: 0;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(18px) saturate(1.4);
    justify-content: space-around; gap: 2px;
  }
  .tab-btn { flex-direction: column; gap: 3px; font-size: 10px; font-weight: 560; padding: 6px 8px; border-radius: 10px; flex: 1; }
  .tab-btn.active { background: var(--brand-soft); box-shadow: none; color: var(--brand); }
  #toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
