/* ============================================================
   app-ui.css — Shared design system for the whole platform.
   Loaded once from includes/head.html, so pages do not import it.

   Accents use --brand-accent (set in layouts/base.html), not
   --text-color1: that one is the organisation's primary_color, chosen
   as a sidebar fill, and for JFC it is a pale cream that disappears
   as text on a white card.
   ============================================================ */

/* ── Inputs & Labels ─────────────────────────────────────── */
.org-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  font-family: 'Poppins', sans-serif;
}
.org-input {
  display: block;
  width: 100%;
  padding: 0.55rem 0.85rem;
  font-size: 0.858rem;
  color: #1e293b;
  background: #fff;
  border: 1px solid #dde3ed;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  font-family: 'Poppins', sans-serif;
  line-height: 1.5;
}
.org-input:focus { border-color: var(--brand-accent); box-shadow: 0 0 0 3px rgba(66,82,226,0.07); }
.org-input::placeholder { color: #b8c2d4; }

/* ── Section Card ─────────────────────────────────────────── */
.org-section { background: #fff; border: 1px solid #e8edf5; border-radius: 10px; margin-bottom: 1.5rem; overflow: hidden; }
.org-section__header { display: flex; align-items: center; gap: 0.7rem; padding: 0.95rem 1.6rem; background: #fafbfd; border-bottom: 1px solid #eef1f7; flex-wrap: wrap; }
.org-section__bar { width: 3px; height: 18px; background: var(--brand-accent); border-radius: 2px; flex-shrink: 0; }
.org-section__title { font-size: 0.78rem; font-weight: 700; font-family: 'Poppins', sans-serif; color: #1e293b; letter-spacing: 0.09em; text-transform: uppercase; margin: 0; flex: 1; }
.org-section__body { padding: 1.5rem; }

/* ── Page Header ──────────────────────────────────────────── */
.org-page-header { display: flex; align-items: center; gap: 1rem; padding: 0.5rem 0 1.5rem; margin-bottom: 1.75rem; border-bottom: 1px solid #eef1f7; }
.org-page-header__back { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid #dde3ed; background: #fff; color: var(--brand-accent); text-decoration: none; transition: background 0.15s, border-color 0.15s; flex-shrink: 0; }
.org-page-header__back:hover { background: #f1f5f9; border-color: var(--brand-accent); }
.org-page-header__back .material-symbols-outlined { font-size: 1.25rem; }
.org-page-header__crumb { font-size: 0.68rem; font-family: 'Poppins', sans-serif; color: #94a3b8; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 0.1rem; }
.org-page-header__title { font-size: 1.2rem; font-weight: 700; color: var(--brand-accent); font-family: 'Poppins', sans-serif; letter-spacing: 0.04em; text-transform: uppercase; margin: 0; }

/* ── Table ────────────────────────────────────────────────── */
.cty-table { width: 100%; border-collapse: collapse; }
.cty-table thead tr { background: #fafbfd; border-bottom: 1px solid #eef1f7; }
.cty-table th { font-size: 0.68rem; font-weight: 700; font-family: 'Poppins', sans-serif; color: #94a3b8; letter-spacing: 0.09em; text-transform: uppercase; padding: 0.75rem 1.25rem; text-align: left; }
.cty-table td { font-size: 0.82rem; font-family: 'Poppins', sans-serif; color: #334155; padding: 0.75rem 1.25rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.cty-table tbody tr:last-child td { border-bottom: none; }
.cty-table tbody tr:hover { background: #fafbfd; }
.cty-id-badge { font-size: 0.68rem; background: #f1f5f9; color: #64748b; border-radius: 4px; padding: 2px 7px; font-family: 'Courier New', monospace; letter-spacing: 0.04em; }
.cty-name { font-weight: 600; color: #1e293b; }
.cty-tag { display: inline-flex; align-items: center; gap: 0.25rem; background: #f0f4ff; color: var(--brand-accent); border-radius: 20px; padding: 2px 10px; font-size: 0.72rem; font-family: 'Poppins', sans-serif; font-weight: 500; }
.cty-score-yes { background: #dcfce7; color: #166534; border-radius: 20px; padding: 2px 10px; font-size: 0.72rem; font-family: 'Poppins', sans-serif; font-weight: 500; }
.cty-score-no { background: #f1f5f9; color: #64748b; border-radius: 20px; padding: 2px 10px; font-size: 0.72rem; font-family: 'Poppins', sans-serif; font-weight: 500; }

/* ── Action Buttons ───────────────────────────────────────── */
.cty-action-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; border: 1px solid #e8edf5; background: #fff; cursor: pointer; transition: background 0.14s, border-color 0.14s; text-decoration: none; }
.cty-action-btn:hover { background: #f1f5f9; border-color: var(--brand-accent); }
.cty-action-btn .material-symbols-outlined { font-size: 0.95rem; color: #64748b; }
.cty-action-btn.danger:hover { background: #fef2f2; border-color: #ef4444; }
.cty-action-btn.danger .material-symbols-outlined { color: #ef4444; }

/* ── Status Indicators (user list) ───────────────────────── */
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status-dot.active { background: #22c55e; }
.status-dot.inactive { background: #ef4444; }
.status-legend { display: flex; align-items: center; gap: 1.25rem; padding: 0.6rem 1.6rem 0.75rem; font-family: 'Poppins', sans-serif; font-size: 0.72rem; color: #64748b; }
.status-legend span { display: flex; align-items: center; gap: 0.4rem; }
.badge-super { background: #dcfce7; color: #166534; border-radius: 20px; padding: 2px 10px; font-size: 0.7rem; font-family: 'Poppins', sans-serif; font-weight: 600; }
.badge-no { background: #f1f5f9; color: #94a3b8; border-radius: 20px; padding: 2px 10px; font-size: 0.7rem; font-family: 'Poppins', sans-serif; font-weight: 500; }
.badge-active { background: #dcfce7; color: #166534; border-radius: 20px; padding: 2px 10px; font-size: 0.7rem; font-family: 'Poppins', sans-serif; font-weight: 600; display: inline-flex; align-items: center; gap: 0.25rem; }
.badge-inactive { background: #fef2f2; color: #991b1b; border-radius: 20px; padding: 2px 10px; font-size: 0.7rem; font-family: 'Poppins', sans-serif; font-weight: 600; display: inline-flex; align-items: center; gap: 0.25rem; }

/* ── Related Records (user delete panel) ─────────────────── */
.related-records { background: #f8fafc; border: 1px solid #e8edf5; border-radius: 8px; padding: 0.85rem 1rem; margin-bottom: 1rem; }
.related-records__title { font-size: 0.68rem; font-weight: 700; font-family: 'Poppins', sans-serif; color: #94a3b8; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.5rem; }
.related-records ul { margin: 0; padding-left: 1.1rem; font-size: 0.78rem; font-family: 'Poppins', sans-serif; color: #334155; }
.related-records li { margin-bottom: 0.2rem; }

/* ── Header Buttons ───────────────────────────────────────── */
.header-btn { display: inline-flex; align-items: center; gap: 0.3rem; font-family: 'Poppins', sans-serif; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.05em; padding: 0.45rem 1rem; border-radius: 6px; text-decoration: none; white-space: nowrap; border: none; cursor: pointer; }
.header-btn-primary { background: var(--brand-accent); color: var(--text-on-brand, #fff); }
.header-btn-primary:hover { opacity: 0.9; color: var(--text-on-brand, #fff); }
.header-btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #dde3ed; }
.header-btn-secondary:hover { background: #e8edf5; color: #334155; }

/* ── Slide Panel ──────────────────────────────────────────── */
.cty-panel-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,0.35); z-index: 1040; }
.cty-panel-overlay.open { display: block; }
.cty-panel { position: fixed; top: 0; right: -440px; width: 420px; max-width: 95vw; height: 100%; background: #fff; z-index: 1050; box-shadow: -8px 0 30px rgba(0,0,0,0.12); display: flex; flex-direction: column; transition: right 0.28s cubic-bezier(0.4,0,0.2,1); overflow-y: auto; }
.cty-panel.open { right: 0; }
.cty-panel__head { display: flex; align-items: center; gap: 0.75rem; padding: 1.1rem 1.5rem; background: #fafbfd; border-bottom: 1px solid #eef1f7; flex-shrink: 0; }
.cty-panel__head-bar { width: 3px; height: 18px; background: var(--brand-accent); border-radius: 2px; flex-shrink: 0; }
.cty-panel__title { font-size: 0.82rem; font-weight: 700; font-family: 'Poppins', sans-serif; color: #1e293b; letter-spacing: 0.07em; text-transform: uppercase; margin: 0; flex: 1; }
.cty-panel__close { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; border: 1px solid #dde3ed; background: #fff; cursor: pointer; transition: background 0.14s; flex-shrink: 0; }
.cty-panel__close:hover { background: #f1f5f9; }
.cty-panel__close .material-symbols-outlined { font-size: 1rem; color: #64748b; }
.cty-panel__body { padding: 1.5rem; flex: 1; }
.cty-panel__footer { padding: 1rem 1.5rem; border-top: 1px solid #eef1f7; display: flex; justify-content: flex-end; gap: 0.5rem; flex-shrink: 0; }

/* ── Panel Buttons ────────────────────────────────────────── */
.btn-cty-cancel { font-family: 'Poppins', sans-serif; font-size: 0.8rem; font-weight: 500; color: #64748b; background: #f1f5f9; border: 1px solid #dde3ed; border-radius: 6px; padding: 0.42rem 1rem; cursor: pointer; transition: background 0.14s; }
.btn-cty-cancel:hover { background: #e2e8f0; }
.btn-cty-submit { font-family: 'Poppins', sans-serif; font-size: 0.8rem; font-weight: 600; color: var(--text-on-brand, #fff); background: var(--brand-accent); border: none; border-radius: 6px; padding: 0.42rem 1.1rem; cursor: pointer; transition: opacity 0.14s; display: flex; align-items: center; gap: 0.3rem; }
.btn-cty-submit:hover { opacity: 0.87; }
.btn-cty-submit .material-symbols-outlined { font-size: 0.9rem; }
.btn-cty-new { font-family: 'Poppins', sans-serif; font-size: 0.78rem; font-weight: 600; color: var(--text-on-brand, #fff); background: var(--brand-accent); border: none; border-radius: 6px; padding: 0.38rem 1rem; cursor: pointer; display: inline-flex; align-items: center; gap: 0.3rem; transition: opacity 0.14s; text-decoration: none; }
.btn-cty-new:hover { opacity: 0.87; color: var(--text-on-brand, #fff); }
.btn-cty-new .material-symbols-outlined { font-size: 0.9rem; }

/* ── Delete Confirm Box ───────────────────────────────────── */
.cty-delete-confirm { background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 1rem; }
.cty-delete-confirm p { font-size: 0.78rem; color: #991b1b; font-family: 'Poppins', sans-serif; margin-bottom: 0.65rem; }
.cty-delete-confirm p:last-child { margin-bottom: 0; }
.cty-delete-name { font-weight: 700; color: #7f1d1d; }

/* ── Search Bar ───────────────────────────────────────────── */
.cty-search-wrap { position: relative; }
.cty-search-wrap .material-symbols-outlined { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); font-size: 1rem; color: #94a3b8; pointer-events: none; }
/* The room for that icon belongs to the wrapper that positions it.
   It used to be set on #table-search alone, so any other search box using this
   wrapper - the notifications page has three - drew the icon straight over its
   own placeholder text. */
.cty-search-wrap input,
.cty-search-wrap .org-input { padding-left: 2.2rem; }
#table-search { max-width: 280px; }

/* ── Sortable Column Headers ──────────────────────────────── */
.cty-table th.sortable { cursor: pointer; user-select: none; transition: color 0.13s; }
.cty-table th.sortable:hover { color: var(--brand-accent); }
.sort-icon { display: inline-block; font-size: 0.62rem; margin-left: 0.35rem; opacity: 0.5; vertical-align: middle; }
.cty-table th.sort-asc .sort-icon,
.cty-table th.sort-desc .sort-icon { opacity: 1; color: var(--brand-accent); }

/* ── Pagination Bar ───────────────────────────────────────── */
.pg-bar { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1.25rem; border-top: 1px solid #f1f5f9; background: #fafbfd; }
.pg-info { font-size: 0.72rem; font-family: 'Poppins', sans-serif; color: #94a3b8; }
.pg-controls { display: flex; align-items: center; gap: 0.3rem; }
.pg-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 5px; border: 1px solid #e8edf5; background: #fff; border-radius: 5px; font-size: 0.72rem; font-family: 'Poppins', sans-serif; color: #64748b; cursor: pointer; transition: all 0.13s; }
.pg-btn:hover:not([disabled]) { background: #f1f5f9; border-color: var(--brand-accent); color: var(--brand-accent); }
.pg-btn.active { background: var(--brand-accent); border-color: var(--brand-accent); color: var(--text-on-brand, #fff); }
.pg-btn[disabled] { opacity: 0.35; cursor: not-allowed; }

/* ── Account Activation page ─────────────────────────────── */
.act-form-field select,
.act-form-field input[type="date"],
.act-form-field input[type="time"],
.act-form-field input[type="text"] {
  display: block; width: 100%; padding: 0.55rem 0.85rem; font-size: 0.858rem;
  color: #1e293b; background: #fff; border: 1px solid #dde3ed; border-radius: 6px;
  outline: none; transition: border-color 0.18s ease, box-shadow 0.18s ease;
  font-family: 'Poppins', sans-serif; line-height: 1.5;
  -webkit-appearance: none; appearance: none;
}
.act-form-field select:focus,
.act-form-field input:focus { border-color: var(--brand-accent); box-shadow: 0 0 0 3px rgba(66,82,226,0.07); }
.act-checkbox-wrap { display: flex; align-items: center; gap: 0.5rem; padding-bottom: 0.55rem; }
.act-checkbox-wrap input[type="checkbox"] { accent-color: var(--brand-accent); width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; }
.act-checkbox-wrap label { font-size: 0.82rem; font-family: 'Poppins', sans-serif; color: #334155; cursor: pointer; margin: 0; }
.act-save-btn { display: inline-flex; align-items: center; gap: 0.35rem; font-family: 'Poppins', sans-serif; font-size: 0.8rem; font-weight: 600; color: var(--text-on-brand, #fff); background: var(--brand-accent); border: none; border-radius: 6px; padding: 0.55rem 1.35rem; cursor: pointer; transition: opacity 0.14s; white-space: nowrap; }
.act-save-btn:hover { opacity: 0.87; }
.act-save-btn .material-symbols-outlined { font-size: 1rem; }
.act-action-btn { font-family: 'Poppins', sans-serif; font-size: 0.72rem; font-weight: 600; color: #fff; border: none; border-radius: 5px; padding: 4px 11px; cursor: pointer; display: inline-flex; align-items: center; gap: 0.25rem; }
.act-action-btn .material-symbols-outlined { font-size: 0.85rem; }
.act-action-btn.activate { background: #22c55e; }
.act-action-btn.deactivate { background: #ef4444; }

/* ── Page footer (includes/footer.html) ──────────────────── */
.app-footer { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap; margin-top: 1rem; padding: 1.25rem 0; border-top: 1px solid #eef1f7; font-family: 'Poppins', sans-serif; font-size: 0.74rem; color: #94a3b8; }
/* The version chip: the same neutral pill as .badge-no. */
.app-footer__version { display: inline-flex; align-items: center; gap: 0.25rem; background: #f1f5f9; color: #64748b; border: 1px solid transparent; border-radius: 20px; padding: 2px 10px; font-size: 0.7rem; font-weight: 500; text-decoration: none; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.app-footer__version:hover { background: #fff; border-color: #dde3ed; color: #1e293b; }
.app-footer__version .material-icons-round { font-size: 0.85rem; }

/* ── Auth card (password reset; matches the sign-in card) ── */
/* Logged-out pages: no sidebar or header, just the card over the sign-in
   background. Form fields and buttons are the usual .org-label, .org-input
   and .act-save-btn. */
/* Colour last: a colour in any layer but the last voids the whole
   `background` declaration (the reset pages showed white). */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; background: linear-gradient(rgba(10, 30, 50, 0.32), rgba(10, 30, 50, 0.32)), url('../img/login_bg.jpg') center / cover no-repeat #2c5c8a; font-family: 'Poppins', sans-serif; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 20px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25); padding: 2.5rem 2rem 2rem; }
.auth-card--wide { max-width: 880px; }
.auth-logo { display: block; width: 14rem; max-width: 55%; height: auto; margin: 0 auto 1.5rem; filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.25)); }
.auth-title { font-family: 'Poppins', sans-serif; font-size: 1.15rem; font-weight: 700; color: #1e293b; text-align: center; margin: 0 0 0.35rem; }
.auth-desc { font-size: 0.8rem; color: #64748b; text-align: center; line-height: 1.6; margin: 0 0 1.5rem; }
.auth-desc a { color: var(--brand-accent); font-weight: 600; }
.auth-field { margin-bottom: 1rem; }
.auth-submit { width: 100%; justify-content: center; height: 44px; margin-top: 0.25rem; }
.auth-submit:disabled { opacity: 0.6; cursor: wait; }
.auth-back { display: block; margin-top: 1.25rem; text-align: center; font-size: 0.78rem; font-weight: 500; color: #64748b; text-decoration: none; }
.auth-back:hover { color: var(--brand-accent); }
/* Who the reset is for: read-only, so it reads as a summary, not a field. */
.auth-identity { background: #f8fafc; border: 1px solid #e8edf5; border-radius: 8px; padding: 0.7rem 1rem; margin-bottom: 1rem; font-size: 0.8rem; color: #1e293b; }
.auth-identity div + div { margin-top: 0.2rem; }
.auth-identity span:first-child { display: inline-block; min-width: 5.5rem; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #94a3b8; }
/* Password rules. Each item's colour is set inline by the page script as
   the password is typed, so only the resting colour lives here. */
.auth-rules { list-style: none; margin: 0 0 1rem; padding: 0.7rem 1rem; background: #f8fafc; border: 1px solid #e8edf5; border-radius: 8px; font-size: 0.74rem; line-height: 1.5; color: #7a8ca3; }
.auth-rules li + li { margin-top: 0.2rem; }
.auth-notice { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 0.78rem; line-height: 1.55; }
/* The page scripts reset each message's className to "reset-message" and add
   error/success, so the name is fixed. Same tones as .badge-inactive/-active. */
.auth-card .reset-message { display: none; margin-bottom: 1rem; padding: 0.6rem 0.9rem; border-radius: 8px; font-size: 0.78rem; line-height: 1.5; }
.auth-card .reset-message.error { display: block; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.auth-card .reset-message.success { display: block; background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2.5rem; }
.auth-grid__form { border-left: 1px solid #eef1f7; padding-left: 2.5rem; }
/* Beside a form the intro reads top-down, so it is left-aligned. */
.auth-grid .auth-logo { margin-left: 0; }
.auth-grid .auth-title, .auth-grid .auth-desc { text-align: left; }
@media (max-width: 700px) {
  .auth-grid { grid-template-columns: 1fr; }
  .auth-grid__form { border-left: none; padding-left: 0; border-top: 1px solid #eef1f7; padding-top: 1.5rem; margin-top: 0.5rem; }
}
@media (max-width: 576px) { .auth-card { padding: 2rem 1.25rem 1.5rem; border-radius: 16px; } }
