/* Shared styling for the GLE Media attendance app, in brand colors:
   purple #3b2761, yellow #efb305, black #141a17, white. */

:root {
  --gle-purple: #3b2761;
  --gle-yellow: #efb305;
  --gle-black: #141a17;
  --gle-white: #ffffff;
  --gle-purple-tint: #f6f3fa;
  --gle-border: #ddd6e6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--gle-purple-tint);
  color: var(--gle-black);
}

header.gle-header {
  background: var(--gle-purple);
  color: var(--gle-white);
  padding: 18px 28px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

header.gle-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

header.gle-header .subtitle {
  font-size: 13px;
  opacity: 0.85;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.panel {
  background: var(--gle-white);
  border: 1px solid var(--gle-border);
  border-radius: 10px;
  padding: 20px;
}

button {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

button.primary {
  background: var(--gle-yellow);
  color: var(--gle-black);
}

button.secondary {
  background: var(--gle-purple);
  color: var(--gle-white);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button:not(:disabled):hover { opacity: 0.88; }

input, select {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--gle-border);
  border-radius: 6px;
  width: 100%;
}

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gle-purple);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: block;
  margin-bottom: 4px;
}

.field { margin-bottom: 14px; }

.video-box {
  position: relative;
  background: var(--gle-black);
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.video-box video, .video-box canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
}

.status-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--gle-purple-tint);
  color: var(--gle-purple);
}

.status-pill.ok { background: #e4f7ea; color: #1e7a3e; }
.status-pill.warn { background: #fdf1d6; color: #8a5a00; }
.status-pill.err { background: #fbe4e4; color: #a12525; }

/* Lets a too-wide table scroll sideways within its own box on a narrow screen,
   instead of either breaking the page's own width or squeezing every column
   unreadably thin. Shared here since both records.html and myrecords.html use it —
   records.html used to define this locally instead, which meant myrecords.html's
   own table-scroll divs did nothing at all. */
.table-scroll { overflow-x: auto; }

/* records.html's data tables (monthly deductions, sign-in/out log, leave balances,
   staff list) are genuinely wide — more columns than any phone screen fits — and
   .table-scroll above makes that scrollable, but a plain scrollable box gives no
   visual sign there's more to the right; it just looks like the table got cut off.
   This hint only shows under the same width records.html's own layout starts
   getting tight at, so it stays invisible on a normal desktop admin view. */
.table-scroll-hint { display: none; }
@media (max-width: 820px) {
  .table-scroll-hint {
    display: block;
    font-size: 12px;
    color: var(--gle-purple);
    margin: 0 0 6px;
  }
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--gle-border); }
th { color: var(--gle-purple); font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; }

a.nav-link { color: var(--gle-white); text-decoration: none; font-size: 13px; opacity: 0.9; }
a.nav-link:hover { text-decoration: underline; }

/* Two-panel registration layout (camera | form) — stacks to one column on narrow
   screens instead of squeezing both panels down to an unusable width. */
.reg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

/* Paired fields within a panel (role/department, shift start/end) — same idea. */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 820px) {
  .reg-grid { grid-template-columns: 1fr; }
  .wrap { padding: 16px; }
  header.gle-header { flex-wrap: wrap; padding: 14px 16px; }
}

@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
  .panel { padding: 14px; }
}

/* Prominent post-action confirmation (registration save, kiosk sign-in/out) —
   deliberately louder than the small inline status-pill so it can't be missed. */
.confirm-banner {
  display: none;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
  background: #e4f7ea;
  border: 1px solid #1e7a3e;
}
.confirm-banner.show { display: block; }
.confirm-banner.err { background: #fbe4e4; border-color: #a12525; }
.confirm-banner .headline { font-size: 18px; font-weight: 800; color: var(--gle-black); }
.confirm-banner .detail { font-size: 13px; color: #444; margin-top: 2px; }
