/* Integra Apps — styles on top of the sidebar-layout skill.
   The sidebar, navbar and menu look come from sidebar-layout.css (the skill's
   own file, unchanged). This file only adds what the skill leaves to the app:
   the font, the skill's settings, the bottom user row, print, and the portal's
   own pages. Portal classes start with "it-" so they never collide with an
   app's own styles (QGen loads this file next to its own CSS). */

/* ── Font ─────────────────────────────────────────────────────────────────
   Served from this server, not Google Fonts: nothing leaves the network.
   Montserrat as a variable font — one file draws every weight 100–900. The
   browser only downloads latin-ext when a page contains č ć š ž etc.

   font-display: block, and the latin file is preloaded (font_preload() in
   layout.php): each page waits the few milliseconds the cached font takes
   instead of drawing in the stand-in font first. With swap, every click
   drew the sidebar in Segoe UI and then jumped to the wider Montserrat. */
@font-face {
  font-family: 'Montserrat';
  src: url('/assets/fonts/montserrat-latin-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Montserrat';
  src: url('/assets/fonts/montserrat-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* The scrollbar's space is always kept, on every page, so a page that is
   short enough not to scroll (Dashboard, Settings) is exactly as wide as one that
   does. Without it the content jumped 15px going from one to the other.
   (The stable-scrollbar-gutter skill; qgen.css has the same line.) */
html { scrollbar-gutter: stable; overflow-y: scroll; }

:root {
  /* The skill's settings, set to what the live Integra apps actually run
     (checked 2026-09-25): sidebar #16283E in RMA ("midnight"), ERP and Odmori
     alike — the skill's own default #1f235b is older than that. Active row as
     in Odmori, the app the skill was recorded from: a #2A6DF4 bar with the
     label in the normal menu colour. Both the sidebar and main.container read
     --sb-width. */
  --sb-width: 280px;
  --sb-bg: #16283E;
  --sb-active-accent: #2A6DF4;

  --it-accent: #2BC4D4;
  --it-navy: #1F235B;
  --it-page-bg: #f4f4f4;
  --it-font: 'Montserrat', system-ui, sans-serif;
}

.app-sidebar { font-family: var(--it-font); }
.app-sidebar .sb-nav .sb-link.active { color: #C7CCEE; }   /* Odmori's active_text */

/* ── Bottom row: exactly Integra RMA's .sidebar-footer ────────────────────
   The name on the left and a 16px logout icon on the right are peers: same
   font, size (the menu's 16px), weight and colour. A fixed 48px with a faint
   line above, sitting on the sidebar's bottom edge. Hover turns either one
   the accent colour, as RMA does with its own accent. */
.app-sidebar .sb-footer {
  margin-top: auto;
  height: 48px;
  box-sizing: border-box;
  flex-shrink: 0;
  padding: 0 12px;
  border-top: 0.5px solid rgba(255, 255, 255, 0.08);
  font-size: 16px;
  color: var(--sb-text, #c7ccee);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.app-sidebar .sb-footer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-sidebar .sb-footer a,
.app-sidebar .sb-collapse { color: var(--sb-text, #c7ccee); text-decoration: none; font-size: inherit; line-height: 0; flex-shrink: 0; }
.app-sidebar .sb-footer a:hover,
.app-sidebar .sb-collapse:hover { color: var(--sb-active-accent, #2A6DF4); }
.app-sidebar .sb-collapse { padding: 0; border: 0; background: none; cursor: pointer; }

/* ── Collapse ──────────────────────────────────────────────────────────────
   The « button in the footer folds the sidebar to a 64px strip of icons and
   remembers it (tools.js). Expanded, the sidebar is exactly the design above;
   everything below applies only while collapsed. --sb-width drives both the
   sidebar and the content's left margin, so one variable moves both. */
.app-sidebar .sb-brand .sb-logo-mark { display: none; }
@media (min-width: 641px) {
  body.theme-sidebar .app-sidebar { transition: width .18s ease; }
  body.theme-sidebar main.container { transition: margin-left .18s ease; }
}
/* Desktop only: on a phone the menu is a drawer with full labels (below). */
@media (min-width: 641px) {
  html.it-collapsed { --sb-width: 64px; }
  html.it-collapsed .app-sidebar { overflow-x: hidden; }
  html.it-collapsed .app-sidebar .sb-brand { justify-content: center; padding: 8px 0 0; }
  html.it-collapsed .app-sidebar .sb-brand .sb-logo-full { display: none; }
  html.it-collapsed .app-sidebar .sb-brand .sb-logo-mark { display: block; height: 36px; }
  html.it-collapsed .app-sidebar .sb-link { justify-content: center; gap: 0; padding: 0; }
  html.it-collapsed .app-sidebar .sb-link span { display: none; }
  html.it-collapsed .app-sidebar .sb-link:hover { padding-left: 0; }
  html.it-collapsed .app-sidebar .sb-link.active { padding-left: 0; padding-right: 5px; }   /* keeps the icon centred beside the 5px bar */
  html.it-collapsed .app-sidebar .sb-footer { flex-direction: column; justify-content: center; height: auto; padding: 12px 0; gap: 14px; }
  html.it-collapsed .app-sidebar .sb-footer-name { display: none; }
  html.it-collapsed .app-sidebar .sb-collapse svg { transform: rotate(180deg); }
}


@media (min-width: 641px) {
  /* RMA's footer sits on the sidebar's bottom edge; the skill's sidebar has
     12px of padding under it. */
  body.theme-sidebar .app-sidebar { padding-bottom: 0; }
}
/* An app page with its own body padding (QGen) must not push the sticky
   navbar (desktop) or the logo + ☰ strip (phones) down from the top edge. */
body.theme-sidebar { padding-top: 0; }

/* Printing: only the app's content. The skill's desktop rules would otherwise
   still apply on paper (an A4 page is wider than 641px). */
@media print {
  .app-sidebar, .page-bar { display: none !important; }
  body.theme-sidebar main.container { margin: 0 !important; padding: 0 !important; }
}

/* ── Portal pages (Dashboard, Settings) ─────────────────────────────── */
body.it-page {
  margin: 0;
  background: var(--it-page-bg);
  color: #222;
  font-family: var(--it-font);
  font-size: 16px;
}
body.it-page *, body.it-page *::before, body.it-page *::after { box-sizing: border-box; }
.it-content { padding-bottom: 48px; }
.it-page h2 { margin: 0 0 16px; font-size: 17px; font-weight: 600; color: #444; }
.it-sub { margin: 0 0 24px; font-size: 14px; color: #666; }
.it-card { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06); padding: 24px; margin-bottom: 22px; }
.it-empty { text-align: center; padding: 48px 24px; }
.it-empty p { color: #666; margin: 8px 0 22px; }

.it-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.it-tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.it-tile:hover { border-color: var(--it-navy); box-shadow: 0 4px 16px rgba(31, 35, 91, 0.08); }
.it-tile-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #eef0fa;
  color: var(--it-navy);
}
.it-tile-icon svg { width: 26px; height: 26px; }
.it-tile-name { font-size: 17px; font-weight: 700; color: var(--it-navy); }
.it-tile-desc { font-size: 13px; line-height: 1.45; color: #666; }

/* Buttons */
.it-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f5f5f5;
  color: #333;
  font: 600 14px var(--it-font);
  text-decoration: none;
  cursor: pointer;
}
.it-btn:hover { background: #ececec; }
.it-btn-primary { background: var(--it-navy); border-color: var(--it-navy); color: #fff; }
.it-btn-primary:hover { background: var(--it-navy); filter: brightness(1.15); }
.it-btn-danger { background: #fff; border-color: #e5b4ae; color: #c0392b; }
.it-btn-danger:hover { background: #c0392b; border-color: #c0392b; color: #fff; }
.it-btn-small { height: 32px; padding: 0 14px; font-size: 13px; }
/* A text action in a list, as RMA's .btn-link (its Edit in the user list). */
.it-link {
  display: inline-block;
  padding: 0;
  border: none;
  background: none;
  color: var(--sb-active-accent, #2A6DF4);
  font: inherit;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.it-link:hover { text-decoration: underline; }
.it-btn-danger-solid { background: #c0392b; border-color: #c0392b; color: #fff; }
.it-btn-danger-solid:hover { background: #a93226; border-color: #a93226; }
.page-bar .it-btn { height: 38px; }

/* The hidden attribute must win over display rules like .it-btn's inline-flex. */
.it-page [hidden] { display: none !important; }

/* Search box in the title bar */
.it-search {
  width: 260px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  font: 14px var(--it-font);
  color: #222;
}
.it-search:focus { outline: none; border-color: var(--it-navy); }
.it-search::placeholder { color: #999; opacity: 1; }

/* Popup window — the same idea as RMA's edit window: the page dims, a white
   box sits in the middle, a click outside (or Esc) closes it. */
.it-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;              /* above the sidebar (60) and the title bar (40) */
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.4);
}
.it-modal.open { display: flex; }
.it-modal-box {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}
.it-modal-small { max-width: 420px; }
.it-modal-box p { margin: 0; font-size: 14px; line-height: 1.5; color: #444; }
.it-modal-actions { display: flex; align-items: center; gap: 8px; margin-top: 24px; }
.it-modal-actions .it-btn { min-width: 90px; }   /* as RMA's .modal-actions */
.it-modal-actions .it-push { margin-left: auto; }

/* Forms */
.it-form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.it-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: #555; }
.it-field input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font: 15px var(--it-font);
  color: #222;
  background: #fff;
}
.it-field input:focus { outline: none; border-color: var(--it-navy); }
/* Stated explicitly: browsers draw placeholders anywhere from readable to
   invisible. */
.it-field input::placeholder { color: #999; opacity: 1; font-size: 14px; }
.it-hint { font-size: 12px; font-weight: 400; color: #888; }
.it-grid-4 { grid-template-columns: repeat(4, 1fr); }
.it-grid-2 { grid-template-columns: 1fr 1fr; }
.it-span-2 { grid-column: span 2; }
.it-form-row { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; margin-top: 22px; }
.it-form-block { margin-top: 22px; }
.it-self-note { margin: 8px 0 0; }
.it-form-label { font-size: 14px; font-weight: 600; color: #555; margin-bottom: 8px; }
.it-form-actions { display: flex; align-items: center; gap: 12px; margin-top: 26px; }
.it-form-actions .it-spacer { flex: 1; }

/* A single yes/no is a toggle switch */
.it-toggle { position: relative; display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: #555; cursor: pointer; user-select: none; }
.it-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.it-switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; border-radius: 11px; background: #ccc; transition: background 0.15s; }
.it-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}
.it-toggle input:checked + .it-switch { background: var(--it-navy); }
.it-toggle input:checked + .it-switch::after { transform: translateX(18px); }
.it-toggle input:focus-visible + .it-switch { outline: 2px solid var(--it-accent); outline-offset: 2px; }
.it-toggle input:disabled + .it-switch { opacity: 0.45; }
.it-toggle input:disabled ~ .it-toggle-text { color: #999; }

/* Several choices ticked together are checkboxes */
.it-checks { display: flex; flex-wrap: wrap; gap: 10px 26px; }
.it-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: #333; cursor: pointer; }
.it-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--it-navy); }
.it-check input:disabled + span { color: #999; }

/* Tables and labels */
.it-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.it-table th {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #888;
}
.it-table td { padding: 12px; border-bottom: 1px solid #f2f2f2; vertical-align: middle; }
.it-table tr:last-child td { border-bottom: 0; }
.it-table .it-num { color: #888; white-space: nowrap; }
.it-table .it-right { text-align: right; }
.it-badge {
  display: inline-block;
  margin: 1px 4px 1px 0;
  padding: 2px 9px;
  border-radius: 10px;
  background: #eef0fa;
  color: var(--it-navy);
  font-size: 11px;
  font-weight: 600;
}
.it-badge-accent { background: #e2f7f9; color: #0e7d88; }
.it-badge-muted { background: #f0f0f0; color: #999; }
.it-badge-ok { background: #e8f5e9; color: #1b5e20; }

.it-alert { margin-bottom: 20px; padding: 12px 14px; border-radius: 6px; font-size: 14px; }
.it-alert ul { margin: 0; padding-left: 18px; }
.it-alert-ok { background: #e8f5e9; border: 1px solid #a5d6a7; color: #1b5e20; }
.it-alert-err { background: #fdecea; border: 1px solid #f5c6cb; color: #c62828; }

/* Kept for screen readers, hidden from view (never display:none) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── Login ─────────────────────────────────────────────────────────────── */
/* The login page never scrolls, either way: it is exactly the screen you see
   and the card sits in its middle. 100dvh is the height a phone leaves under
   its address bar and toolbar — 100vh counts the space behind them, so the
   page always scrolled a little on a real phone. A screen shorter than the
   card gets the card smaller (login.php), so nothing is out of reach. */
html.it-login-page { height: 100%; overflow: hidden; scrollbar-gutter: auto; overscroll-behavior: none; }
body.it-login {
  box-sizing: border-box;     /* the padding inside the height, or the page scrolls by it */
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--it-page-bg);
  color: #222;
  font-family: var(--it-font);
}
body.it-login *, body.it-login *::before, body.it-login *::after { box-sizing: border-box; }
.auth-card {
  position: relative;
  width: 720px;
  max-width: 100%;
  height: 440px;               /* never cut short: a low window gets the card smaller (login.php) */
  overflow: hidden;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
.auth-form {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 40px 50px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.auth-form-login { right: 0; }
.auth-form-register { left: 0; }
.auth-card:not(.is-register) .auth-form-login,
.auth-card.is-register .auth-form-register { opacity: 1; pointer-events: auto; transition-delay: 0.25s; }
.auth-form h2 { margin: 0 0 18px; text-align: center; font-size: 28px; font-weight: 700; color: var(--it-navy); }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 14px; }
.auth-brand img { height: 32px; width: auto; display: block; }
.auth-brand span { font-size: 22px; font-weight: 700; color: var(--it-accent); letter-spacing: 0.5px; }
.auth-input { position: relative; }
.auth-input input {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: 24px;
  outline: none;
  background: #ececec;
  font: 14px var(--it-font);
  color: #222;
}
.auth-input input::placeholder { color: #777; opacity: 1; }
.auth-input input:focus { background: #e5e5e5; }
.auth-forgot { text-align: center; font-size: 12px; color: #555; text-decoration: none; }
.auth-forgot:hover { color: var(--it-navy); text-decoration: underline; }
.auth-submit {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 24px;
  background: var(--it-navy);
  color: #fff;
  font: 600 15px var(--it-font);
  letter-spacing: 0.5px;
  cursor: pointer;
}
.auth-submit:hover { filter: brightness(1.1); }
.auth-msg { min-height: 16px; text-align: center; font-size: 12px; color: #c0392b; }
.auth-msg.is-ok { color: var(--it-navy); }
.auth-blob {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  width: 50%;
  background: var(--it-accent);
  border-radius: 0 220px 220px 0;
  transition: transform 0.65s cubic-bezier(0.7, 0, 0.3, 1), background-color 0.65s ease, border-radius 0.65s ease;
}
.auth-card.is-register .auth-blob { transform: translateX(100%); background: var(--it-navy); border-radius: 220px 0 0 220px; }
.auth-blob-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  color: #fff;
  transition: opacity 0.35s ease;
}
.auth-card.is-register .auth-blob-login,
.auth-card:not(.is-register) .auth-blob-register { opacity: 0; pointer-events: none; }
/* The question first, small; then the greeting; then the button. */
.auth-blob-content p { margin: 0 0 8px; font-size: 13px; font-weight: 500; opacity: 0.9; }
.auth-blob-content h2 { margin: 0 0 24px; font-size: 26px; font-weight: 700; }
.auth-blob-content button {
  padding: 10px 36px;
  border: 2px solid #fff;
  border-radius: 24px;
  background: transparent;
  color: #fff;
  font: 600 14px var(--it-font);
  letter-spacing: 1px;
  cursor: pointer;
}
.auth-blob-content button:hover { background: rgba(255, 255, 255, 0.15); }

/* Phones: the two halves stack. The panel is a band across the top with a
   curved lower edge, the login form under it; for Register the panel slides
   down to the bottom (curve on top) and the request form shows above it —
   the same curtain, moving up and down instead of sideways. */
@media (max-width: 640px) {
  body.it-login { align-items: flex-start; padding: 16px 10px; }   /* 10px at the sides: the 340px card fits 360px-wide phones too */
  .auth-card {
    /* 340 × 540 on every phone (Rajo, 2026-10-02 — like the desktop's fixed
       720 × 440). The height is measured, not guessed (login-curtain-v2
       skill): the taller form, the login, needs 351px — its logo 48px under
       the band (24px padding + 24px margin) — so the band gets the other
       189px (its own content needs 160). More shows as dead space under
       Login; less squeezes it. Phones narrower than 360px get the card a
       little narrower (max-width: 100%). */
    --card-h: 540px;
    --band-h: 189px;
    width: 340px;
    height: var(--card-h);
    max-height: none;
    margin: auto 0;                   /* centred, yet scrolls whole when the screen is shorter */
  }
  .auth-form { left: 0; right: 0; width: 100%; padding: 24px 28px; gap: 14px; }
  .auth-form > * { flex-shrink: 0; }   /* a card a little short must not squash the Login button */
  .auth-form-login { top: var(--band-h); bottom: 0; }
  .auth-form-register { top: 0; bottom: var(--band-h); }
  .auth-form h2 { margin-bottom: 10px; font-size: 24px; }
  .auth-brand { margin-top: 24px; }   /* with the form's 24px padding: the logo 48px under the band */
  .auth-input input { font-size: 16px; }   /* smaller text makes iPhones zoom in on tap */
  .auth-blob {
    right: 0;
    bottom: auto;
    width: 100%;
    height: var(--band-h);
    border-radius: 0 0 50% 50% / 0 0 64px 64px;
  }
  .auth-card.is-register .auth-blob {
    transform: translateY(calc(var(--card-h) - var(--band-h)));
    border-radius: 50% 50% 0 0 / 64px 64px 0 0;
  }
  .auth-blob-content { padding: 20px 24px 34px; }
  .auth-card.is-register .auth-blob-register { padding: 34px 24px 20px; }
  .auth-blob-content h2 { margin-bottom: 16px; font-size: 24px; }
  .auth-blob-content button { padding: 8px 30px; }
}

/* Settings page */
.it-field select {
  height: 40px;
  padding: 0 32px 0 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font: 15px var(--it-font);
  color: #222;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5l5 5 5-5' stroke='%23555' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat right 12px center;
  appearance: none;
  -webkit-appearance: none;
}
.it-field select:focus { outline: none; border-color: var(--it-navy); }
.it-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.it-sub + .it-route { margin: -14px 0 24px; font-size: 14px; color: #333; }
.it-btn-same { min-width: 128px; }   /* the width of "Change PIN", so Settings' buttons match */

/* Settings → Email: server, port, security, username and password on one
   row; then Save on the left and the test email on the right. */
.it-smtp-grid { grid-template-columns: 1.6fr 0.7fr 1.3fr 1.5fr 1.4fr; }
.it-email-actions { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 24px; margin-top: 26px; }
.it-email-save { display: flex; align-items: center; gap: 24px; min-height: 40px; }
.it-email-test { display: flex; align-items: flex-end; gap: 12px; margin-left: auto; }
.it-email-test .it-field { width: 300px; max-width: 100%; }

/* Settings → Email, Sender by App: one row per sender — the app, its two
   boxes and a remove button — under a row of column names. */
.it-senders { display: flex; flex-direction: column; gap: 12px; }
.it-sender { display: grid; grid-template-columns: 200px 1fr 1fr 40px; align-items: center; gap: 18px; }
.it-sender-head { font-size: 14px; font-weight: 600; color: #555; }
.it-sender-app { font-size: 15px; font-weight: 600; color: #333; }
.it-sender-remove { width: 40px; height: 40px; padding: 0; font-size: 20px; line-height: 1; }
@media (max-width: 900px) {
  .it-smtp-grid { grid-template-columns: repeat(2, 1fr); }
  .it-email-test { margin-left: 0; }
}
@media (max-width: 640px) {
  .it-sender { grid-template-columns: 1fr 40px; gap: 8px 12px; }
  .it-sender > .it-field { grid-column: 1; }
  .it-sender-head { display: none; }
}

/* Tabs under the title bar (Settings), drawn like Integra RMA's .tab-bar: a
   hairline the tabs sit on, the open tab underlined. One weight throughout,
   so the names don't shift when the underline moves. */
.it-tabs { display: flex; gap: 4px; margin: 0 0 22px; border-bottom: 1px solid #e0e0e0; overflow-x: auto; scrollbar-width: none; }
.it-tab { padding: 9px 16px; margin-bottom: -1px; font-size: 14px; font-weight: 600; color: #777; text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; transition: color 0.15s, border-color 0.15s; }
.it-tab:hover { color: #333; }
.it-tab.active { color: var(--it-navy); border-bottom-color: var(--it-navy); }

/* ── Phones (640px and narrower) ─────────────────────────────────────────
   The ☰ title bar and the sidebar as a drawer come from the sidebar-layout
   skill (sidebar-layout.css / .js). These are Integra Apps' own additions:
   the search box in the bar, no « collapse, forms one field per row, popup
   buttons that wrap, and Settings → Users as cards. */
/* Wording that depends on the device: <span class="say-mouse">Click</span>
   <span class="say-touch">Tap</span> — a touch screen has nothing to hover
   or click with. */
.say-touch { display: none; }
@media (hover: none) {
  .say-touch { display: inline; }
  .say-mouse { display: none; }
}
@media (max-width: 640px) {
  .page-bar .it-search { flex: 1 1 140px; width: auto; min-width: 0; font-size: 16px; }   /* 16px: iPhones zoom in on smaller */
  /* Small text links (Edit, Remove, Continue) get a finger-sized area to tap
     without moving anything; checkboxes a taller row and a bigger box. */
  .it-link { padding: 10px 0; margin: -10px 0; }   /* taller to tap; not wider, or it pokes past a card's edge */
  .it-check { min-height: 36px; }
  .it-check input { width: 20px; height: 20px; }
  .app-sidebar .sb-collapse { display: none; }      /* « is a desktop thing */

  /* Forms one field per row; popup buttons wrap rather than run off. */
  .it-form-grid, .it-grid-4, .it-grid-2 { grid-template-columns: 1fr; }
  .it-span-2 { grid-column: auto; }
  .it-field input, .it-field select, .it-field textarea { font-size: 16px; }
  .it-card { padding: 18px 16px; }
  .it-modal-actions { flex-wrap: wrap; }
  .it-email-test { width: 100%; }
  .it-email-test .it-field { flex: 1 1 auto; width: auto; min-width: 0; }
  .it-email-test .it-btn { flex-shrink: 0; white-space: nowrap; }

  /* Settings → Users: each person is a small card instead of a table row —
     name and badges with Edit beside them, then email, apps, and status with
     the last login. */
  .it-table-cards thead { display: none; }
  .it-table-cards, .it-table-cards tbody { display: block; }
  .it-table-cards tr {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px 10px;
    grid-template-areas: "name name edit" "email email email" "apps apps apps" "status last last";
    padding: 14px 0; border-bottom: 1px solid #f0f0f0;
  }
  .it-table-cards tr:first-child { padding-top: 0; }
  .it-table-cards tr:last-child { padding-bottom: 0; border-bottom: 0; }
  .it-table-cards td { display: block; padding: 0; border: 0; }
  .it-table-cards td:nth-child(1) { grid-area: name; font-size: 15px; font-weight: 600; }
  .it-table-cards td:nth-child(2) { grid-area: email; color: #444; overflow-wrap: anywhere; }
  .it-table-cards td:nth-child(3) { grid-area: apps; }
  .it-table-cards td:nth-child(4) { grid-area: status; }
  .it-table-cards td:nth-child(5) { grid-area: last; font-size: 13px; }
  .it-table-cards td:nth-child(5)::before { content: 'Last login '; }
  .it-table-cards td:nth-child(6) { grid-area: edit; }
  .it-table-cards .it-link { font-size: 14px; }
}
