/* icapture-go — one hand-written stylesheet, no framework.
 *
 * Tuned for visual parity with the Rails app (Bootstrap 5.3 look): orange iCapture
 * sidebar with a blue active bar and grey section headers, a grey tenant-pill header with
 * a "Sair" button, Bootstrap-blue primary buttons, bordered inputs, segmented Todos/Definir
 * cron controls. The markup uses the same class names as the Rails ERB. */

:root {
  --bg: #f2f3f5;
  --card: #ffffff;
  --light: #f8f9fa; /* Bootstrap bg-light — the breadcrumb bar and content panel */
  --ink: #212529;
  --muted: #6c757d;
  --line: #dee2e6;
  --line-soft: #e9ecef;
  --primary: #0d6efd;
  --primary-hover: #0b5ed7;
  --primary-soft: #e7f1ff;
  --success: #198754;
  --success-hover: #157347;
  --danger: #dc3545;
  --danger-soft: #f8d7da;
  --warning: #b26a00;
  --orange: #ff6600; /* the iCapture brand orange, flat — exactly what Rails paints */
  --gray-dark: #6c757d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container-xxl { max-width: 1400px; margin: 0 auto; padding: 0 16px; }
.app-row { display: flex; gap: 20px; align-items: flex-start; padding: 18px 0; }
#sidebar.col-2 { flex: 0 0 232px; position: sticky; top: 18px; }
/* #content is a bare column (Rails): the breadcrumb bar, the flash and the content panel
   are SEPARATE blocks, not one card. */
#content.col-lg-10 { flex: 1 1 auto; min-width: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; }

/* ---------------------------------------------------------------- sidebar */
.sidebar-card { overflow: hidden; }
/* Flat brand orange, not a gradient — Rails' .logo-container paints a solid #ff6600. */
.sidebar-header {
  padding: 12px 18px;
  background: var(--orange);
  border-bottom: none;
}
/* Rails centres the mark + wordmark in the header (its .logo is a centred flex row). */
.sidebar-logo { display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 20px; font-weight: 700; color: #fff; }
.sidebar-logo:hover { text-decoration: none; color: #fff; }
.sidebar-nav { padding: 10px 0 8px; }
.nav-section { padding: 5px 0; }
/* Sidebar typography is Rails' .nav-header / .nav-link, measured off the live app: both
   are 16px (the headings are NOT small caps — just uppercase, semibold, half-opacity ink),
   and links are regular weight, active included. */
.nav-section-title {
  padding: 16px 16px 4px; font-size: 16px; line-height: 1.5;
  text-transform: uppercase; color: rgba(33, 37, 41, .5); font-weight: 600;
}
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-item a, .nav-item span { display: block; padding: 6px 16px; font-size: 16px; line-height: 1.5; color: var(--primary); font-weight: 400; }
.nav-item a:hover { background: var(--primary-soft); text-decoration: none; }
.nav-item.active a { background: var(--primary); color: #fff; font-weight: 400; }
.nav-item.active a:hover { background: var(--primary-hover); }
.nav-item.disabled span { color: #adb5bd; cursor: default; font-weight: 400; }
.sidebar-footer { padding: 10px 18px; border-top: 1px solid var(--line-soft); text-align: center; color: var(--muted); font-size: 12px; background: #fafbfc; }
.sidebar-demo { margin-top: 12px; }
.sidebar-demo a {
  display: block; text-align: center; padding: 10px; border-radius: 8px;
  background: var(--success); color: #fff; font-weight: 600;
}
.sidebar-demo a:hover { background: var(--success-hover); text-decoration: none; }

/* ---------------------------------------------------------------- header / breadcrumb */
/* Its own bar, detached from the content panel (Rails' header: bg-light, rounded, mb-4). */
.app-navbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: var(--light); border-radius: 6px; margin-bottom: 24px;
}
.navbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tenant-name {
  background: var(--line-soft); color: var(--muted); font-weight: 600;
  padding: 6px 12px; border-radius: 7px; white-space: nowrap;
}
.tenant-name:hover { text-decoration: none; background: #e0e3e7; }
.crumb-sep { color: #adb5bd; }
.crumb { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.env-badge {
  font-size: 10px; text-transform: uppercase; padding: 2px 7px; border-radius: 5px;
  background: #fff3cd; color: var(--warning); font-weight: 700;
}
.env-badge.env-qa { background: var(--danger-soft); color: var(--danger); }
.navbar-right { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.logged-in-as { color: var(--muted); }
.logout-form { margin: 0; }
.logout.link-button {
  background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 6px 14px;
  color: var(--ink); cursor: pointer; font: inherit; font-weight: 500;
}
.logout.link-button:hover { background: var(--line-soft); text-decoration: none; }

/* ---------------------------------------------------------------- content */
/* The content panel — the bordered box the screens render into (Rails' #content-view). */
#content-view {
  background: var(--light); border: 1px solid var(--line); border-radius: 6px;
  padding: 24px; margin-bottom: 24px;
}
.index-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.index-header h1 { font-size: 22px; margin: 0; font-weight: 600; }
.header-actions { display: flex; gap: 8px; }
.placeholder-note { padding: 18px 20px; }
.placeholder-note code { background: var(--line-soft); padding: 1px 5px; border-radius: 4px; }
.locked-account { padding: 40px; text-align: center; }

/* ---------------------------------------------------------------- badges */
.badge { display: inline-block; background: var(--primary); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
/* Favorita: Rails' .badge-favorite = .text-bg-secondary .fw-normal, i.e. gray, not accent. */
.badge.fav { background: var(--gray-dark); font-weight: 400; }

/* ---------------------------------------------------------------- flash */
/* Sits between the breadcrumb bar and the content panel, so it carries its own gap. */
.flash:not(:empty) { margin-bottom: 16px; }
.alert { padding: 11px 15px; border-radius: 8px; margin-bottom: 10px; border: 1px solid transparent; }
.alert-success { background: #d1e7dd; color: #0f5132; border-color: #badbcc; }
.alert-danger  { background: #f8d7da; color: #842029; border-color: #f5c2c7; }
.alert-warning { background: #fff3cd; color: #664d03; border-color: #ffecb5; }
.alert-info    { background: #cfe2ff; color: #084298; border-color: #b6d4fe; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 8px 16px; border-radius: 7px; border: 1px solid transparent;
  font-weight: 600; cursor: pointer; font-size: 14px; line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-primary:disabled { background: #9ec2fb; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--line-soft); }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-google { background: none; border: none; padding: 0; }

/* ---------------------------------------------------------------- search box */
.search-box { display: flex; gap: 8px; margin-bottom: 16px; }
.search-box input[type=search] { flex: 0 1 300px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; }
.search-box .btn-secondary { background: var(--primary); color: #fff; border-color: var(--primary); }
.search-box .btn-secondary:hover { background: var(--primary-hover); }

/* Pages-index toolbar: Inserir Página + date-range filter + search (Rails' index row). */
.index-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.index-toolbar .btn-new { white-space: nowrap; }
.index-filter { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.date-fields { display: flex; align-items: center; gap: 10px; }
.date-field { display: inline-flex; align-items: stretch; }
.date-field input { width: 132px; border: 1px solid var(--line); border-right: none; border-radius: 6px 0 0 6px; padding: 8px 10px; font-size: 14px; }
.date-ico { display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 0 6px 6px 0; background: #f2f4f7; color: var(--gray-dark); }
.icon-btn { display: inline-flex; align-items: center; padding: 8px 12px; }
.toolbar-search { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.toolbar-search input { width: 260px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; font-size: 14px; }
.index-filter input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
@media (max-width: 991px) { .date-fields { display: none; } }

/* ---------------------------------------------------------------- tables */
.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.table th, .table td { padding: 10px 13px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table thead th { background: #f2f4f7; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; }
/* A sortable header link (Rails' link-underline-dotted): reads as clickable via a dotted
   underline, turns primary on hover; the active column also carries a ▲/▼ glyph. Plain
   headers are not <a>, so they stay unadorned. */
.table thead th a { color: var(--muted); text-decoration: underline dotted; text-decoration-color: var(--line); text-underline-offset: 3px; cursor: pointer; }
.table thead th a:hover { color: var(--primary); text-decoration-color: currentColor; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f6f9ff; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .col-edit { width: 40px; text-align: center; }
.edit-link {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border: 1px solid var(--primary); border-radius: 6px; color: var(--primary);
}
.edit-link:hover { background: var(--primary); color: #fff; text-decoration: none; }
.table .empty { text-align: center; color: var(--muted); padding: 26px; }
.page-name { font-weight: 600; }
.page-sub { font-size: 12px; color: var(--muted); }
.page-sub a { color: var(--primary); }

/* ------------------------------------------------- pages index rows (Rails' table-index) */
.table th.min-width, .table td.min-width { width: 1%; white-space: nowrap; }
.table .group-head th { border-bottom: none; padding-bottom: 2px; text-align: center; }
.th-sep { margin: 0 8px; color: #adb5bd; }
/* Total: the blue captures-count box that links to the page's captures. */
.count-box {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 46px; padding: 7px 6px; border-radius: 7px;
  background: var(--primary); color: #fff; line-height: 1.1;
}
.count-box:hover { background: var(--primary-hover); text-decoration: none; color: #fff; }
.count-box hr { width: 100%; margin: 5px 0; border: none; border-top: 1px solid rgba(255,255,255,.45); }
.count-box small { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* URL: / Script: / Última: … definition rows under a title */
.subtitle { display: flex; gap: 5px; margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.subtitle dt { font-weight: 600; }
.subtitle dd { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.table td.title { max-width: 460px; }
.table td.thumbnail img { display: block; max-width: 170px; max-height: 74px; border: 1px solid var(--line); border-radius: 4px; }
.btn-edit {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border: 1px solid var(--primary); border-radius: 6px; color: var(--primary);
}
.btn-edit:hover { background: var(--primary); color: #fff; text-decoration: none; }

/* ------------------------------------------------- captures index (Rails' captures/_index) */
/* Rails' .btn-secondary-action: a bordered blue action link (Diferença, Banners, Download). */
.btn-secondary-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 14px; border: 1px solid var(--primary); border-radius: 6px;
  color: var(--primary); font-weight: 500; white-space: nowrap;
}
.btn-secondary-action:hover { background: var(--primary); color: #fff; text-decoration: none; }
.btn-secondary-action.icon-only { width: 38px; padding: 6px 0; }
/* The zoom cell: a small filled primary button (Rails' .btn.btn-sm.btn-primary). */
.btn-zoom { padding: 7px 11px; }
.table-captures td.thumbnail img { display: block; max-width: 210px; max-height: 96px; border: 1px solid var(--line); border-radius: 4px; }
.cron-cell { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--muted); }
.info-table th { width: 170px; color: var(--muted); font-weight: 600; }
.capture-thumb { width: 120px; height: 90px; object-fit: cover; border: 1px solid var(--line); border-radius: 5px; background: #fafbfc; }
.banner-url { max-width: 560px; word-break: break-all; font-size: 12px; }
.banner-thumb { max-height: 40px; border: 1px solid var(--line); }

.pagination { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 18px 0 4px; color: var(--muted); }
.pagination a { display: inline-flex; align-items: center; padding: 6px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--primary); }
.pagination a:hover { background: var(--line-soft); text-decoration: none; }

/* ---------------------------------------------------------------- forms */
.record-form { max-width: 720px; }
.record-form .field { margin-bottom: 16px; }
.record-form label { display: block; font-size: 14px; color: var(--ink); font-weight: 600; margin-bottom: 5px; }
.record-form input[type=text], .record-form input[type=email], .record-form input[type=password],
.record-form input[type=number], .record-form input[type=search], .record-form textarea, .record-form select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; font-size: 14px; font-family: inherit; background: #fff;
}
.record-form input:focus, .record-form textarea:focus, .record-form select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.record-form textarea { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; min-height: 220px; }
/* The Ace host for a code field (Rails: 400px, rounded border). Ace paints its own
   background, so this only needs the frame. */
.code-editor { height: 400px; width: 100%; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.code-fallback { width: 100%; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
.record-form .field.has-error input, .record-form .field.has-error textarea { border-color: var(--danger); }
.field-error { display: block; color: var(--danger); font-size: 12.5px; margin-top: 4px; }
.record-form fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 6px 0 16px; }
.record-form fieldset legend { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 0 6px; font-weight: 700; }
.record-form .actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.record-form .actions .btn-danger { margin-left: auto; }
.field-inline { display: flex; gap: 24px; margin-bottom: 16px; }
.field-inline label { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-weight: 600; margin: 0; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 16px; height: 16px; }

/* ---------------------------------------------------------------- cron builder */
.cron-builder { border: none !important; padding: 0 !important; margin: 0 !important; }
.cron-field { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; }
.cron-field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cron-field-head strong { font-size: 15px; }
/* Segmented Todos | Definir toggle (radios styled as connected buttons). */
.cron-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.cron-toggle label { margin: 0; padding: 5px 16px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--muted); background: #fff; }
.cron-toggle label + label { border-left: 1px solid var(--line); }
.cron-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cron-toggle label:has(input:checked) { background: var(--gray-dark); color: #fff; }
/* The value cells appear only in Definir mode (pure CSS, reactive to the radio). */
.cron-field:has(.cron-toggle input[value="*"]:checked) .cron-options { display: none; }
/* Cells sit in explicit rows (Rails splits Hour 01-12/13-23,00 and Day 01-16/17-31), each
   row a JOINED segmented group like Rails' .btn-group: no gaps, adjacent borders collapsed
   onto each other, and only the row's outer corners rounded. */
.cron-options { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 12px; }
.cron-row { display: flex; flex-wrap: nowrap; }
/* Two classes deep on purpose: `.record-form label` (0,1,1) would otherwise win and make
   these 14px/600 with a stray margin. Metrics match Rails' cells exactly: 32x30, 12px/550,
   5px padding. */
.cron-row .cron-opt {
  position: relative; margin: 0; display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box; width: 32px; padding: 5px; border: 1px solid var(--line); border-radius: 0;
  font-size: 12px; font-weight: 550; line-height: 1.5; cursor: pointer; color: var(--ink);
  background: #fff; user-select: none;
}
.cron-row .cron-opt + .cron-opt { margin-left: -1px; } /* collapse the shared border */
.cron-row .cron-opt:first-child { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.cron-row .cron-opt:last-child { border-top-right-radius: 6px; border-bottom-right-radius: 6px; }
/* Weekday (Dom…Sáb) and Month (Jan…Dez) cells are wider — Rails' 42px. */
.cron-field[data-field="weekday"] .cron-row .cron-opt,
.cron-field[data-field="month"] .cron-row .cron-opt { width: 42px; }
.cron-row .cron-opt input { position: absolute; width: 1px; height: 1px; opacity: 0; }
/* Lift the hovered/selected cell so its border wins over the collapsed neighbour. */
.cron-row .cron-opt:hover { border-color: var(--gray-dark); z-index: 1; }
/* Selected cells fill secondary gray (#6c757d), like Rails' btn-outline-secondary:checked. */
.cron-row .cron-opt:has(input:checked) { background: var(--gray-dark); color: #fff; border-color: var(--gray-dark); z-index: 2; }

/* ---------------------------------------------------------------- login */
/* Metrics measured off the live Rails login: 360px card, #ff6600 header, bg-light body,
   #e2e3e5 footer, 58px floating-label fields, 48px/20px submit. */
.login-body { background: #fff; }
.centered-content { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-card { width: 360px; max-width: 100%; background: #fff; border: 1px solid rgba(0,0,0,.176); border-radius: 6px; padding: 0; overflow: hidden; }
.login-header { background: var(--orange); padding: 8px 16px; }
/* min-height 45 + the header's 16px of padding = the 61px header Rails renders (its .logo
   carries navbar-brand's own vertical padding on top of the 30px line box). */
.login-logo { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 45px; font-size: 20px; font-weight: 700; color: #fff; }
.login-body-card { background: var(--light); padding: 24px; }

.login-form { display: flex; flex-direction: column; gap: 16px; }
/* Floating label (Bootstrap .form-floating): the placeholder stays invisible until the
   label has floated up, so the two never overlap. */
.form-floating { position: relative; }
.form-floating > input {
  width: 100%; height: 58px; padding: 26px 12px 10px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink);
}
.form-floating > input:focus { outline: none; border-color: #86b7fe; box-shadow: 0 0 0 .25rem rgba(13,110,253,.25); }
.form-floating > input::placeholder { color: transparent; }
.form-floating > label {
  position: absolute; top: 0; left: 0; padding: 16px 12px; color: var(--muted);
  pointer-events: none; transform-origin: 0 0; transition: transform .1s ease-in-out, opacity .1s ease-in-out;
}
.form-floating > input:focus ~ label,
.form-floating > input:not(:placeholder-shown) ~ label { transform: scale(.85) translateY(-9px) translateX(2px); }

.login-row { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.login-row .remember { display: inline-flex; align-items: center; gap: 7px; margin: 0; color: var(--ink); font-weight: 600; }
.btn-block { width: 100%; }
.btn-lg { padding: 8px 16px; font-size: 20px; font-weight: 400; border-radius: 8px; min-height: 48px; }

.login-or { display: flex; align-items: center; gap: 1em; margin: 14px 0; color: var(--muted); font-size: 14px; }
.login-or hr { flex: 1 1 auto; border: none; border-top: 1px solid var(--line); margin: 0; }

.login-providers { display: flex; flex-direction: column; align-items: center; gap: 10px; }
/* Rails' provider button: a bordered pill whose left block is filled secondary grey. */
/* 16px/1.5 (not .btn's 14px/1.2): a 24px line box + 8px padding each side + the 1px border
   is Rails' 42px-tall, 213px-wide button. */
/* gap: 0 — .btn sets a 6px gap, which would leave a white strip between the grey mark and
   the label; Rails' two divs are flush. */
.btn-provider { padding: 0; gap: 0; background: none; border: 1px solid var(--gray-dark); border-radius: 6px; color: var(--ink); font-size: 16px; line-height: 1.5; font-weight: 400; align-items: stretch; overflow: hidden; }
.btn-provider:hover { background: none; }
.btn-provider .provider-mark { display: flex; align-items: center; padding: 8px 16px; background: var(--gray-dark); color: var(--light); }
.btn-provider .provider-label { display: flex; align-items: center; justify-content: center; padding: 8px 16px; }
.btn-provider:hover .provider-label { background: var(--line-soft); }

.login-footer { background: #e2e3e5; padding: 4px; text-align: center; font-size: 12px; }
.login-footer a { color: var(--muted); }
.login-footer a:hover { text-decoration: none; }

.dev-form { display: flex; gap: 8px; margin-top: 16px; }
.dev-form input { flex: 1; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; }
.login-links { display: flex; justify-content: center; margin-top: 14px; font-size: 14px; }

/* ---------------------------------------------------------------- tabs (Rails tabs.scss)
   On a tabbed screen the tabs sit ABOVE the panel, not inside it: #content-view stops
   being the card and the .tab-content below the tabs becomes it. The active tab's bottom
   border takes the panel colour so the two merge. */
#content-view:has(.nav-tabs) { background: none; border: none; padding: 0; margin: 0; }
.nav-tabs { display: flex; gap: 3px; list-style: none; margin: 0 0 0 24px; padding: 0; border-bottom: none; }
.nav-tabs .nav-item { margin-bottom: -1px; }
.nav-tabs .nav-link { display: block; padding: 9px 18px; color: var(--primary); border: 1px solid transparent; border-bottom-color: var(--line); border-top-left-radius: 7px; border-top-right-radius: 7px; }
.nav-tabs .nav-link:hover { text-decoration: none; background: #f2f4f7; }
.nav-tabs .nav-link.active { color: var(--ink); background: var(--light); border-color: var(--line) var(--line) var(--light); font-weight: 600; }
.nav-tabs .nav-link.disabled { color: var(--gray-dark); opacity: .55; cursor: default; }
.nav-tabs .nav-link.disabled:hover { background: none; }
/* Only a .tab-content that FOLLOWS tabs is the card — the new-page form wraps its content
   in one too, but there #content-view is still the card and this must not double up. */
.nav-tabs + .tab-content {
  background: var(--light); border: 1px solid var(--line); border-radius: 6px;
  padding: 24px; margin: 0 0 24px;
}

/* Diffy html_simple output for the versions screen (ported from Rails' diff.scss). */
.diff { overflow: auto; }
.diff ul { background: #fff; overflow: auto; font-size: 13px; list-style: none; margin: 0; padding: 0; display: table; width: 100%; }
.diff del, .diff ins { display: block; text-decoration: none; }
.diff li { padding: 0; display: table-row; margin: 0; height: 1em; }
.diff li.ins { background: #dfd; color: #080; }
.diff li.del { background: #fee; color: #b00; }
.diff li:hover { background: #ffc; }
.diff del, .diff ins, .diff span { white-space: pre-wrap; font-family: monospace; }
.compare-badges { display: flex; gap: 12px; margin-bottom: 16px; }
.compare-badges > * { flex: 1; }
.badge-difference { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 7px; background: var(--primary-soft); color: var(--primary); border: 1px solid #b6d4fe; font-size: 13px; }
.badge-difference.center { justify-content: center; }
.badge-difference.end { justify-content: flex-end; }
.badge-difference .vr { width: 1px; height: 16px; background: currentColor; opacity: .4; }
#thesame { display: none; }
.capture-compare img { max-width: 100%; border: 1px solid #ccc; }
.side-by-side { display: flex; gap: 12px; }
.side-by-side .col { flex: 1; min-width: 0; }
.side-by-side img { width: 100%; }
#overlays { position: relative; }
.difference-overlay { position: absolute; top: 0; left: 0; opacity: .75; }
.difference-overlay.invisible { visibility: hidden; }
#image-diff img { max-width: 100%; border: 1px solid #ccc; }
.capture-single { max-width: 100%; border: 1px solid #ccc; }
#capture-progress { display: flex; align-items: center; gap: 8px; }

/* ------------------------------------------------- capture lightbox (lightbox.js) */
/* A full-viewport dialog: a white bar (nav / title / actions) over a scrollable image
   stage, on a dimmed backdrop. Hidden until lightbox.js adds .open. */
.lightbox { position: fixed; inset: 0; z-index: 1050; display: none; flex-direction: column; padding: 20px; background: rgba(0, 0, 0, .6); }
.lightbox.open { display: flex; }
body.lightbox-open { overflow: hidden; }

.lightbox-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; row-gap: 8px; padding: 11px 15px; background: var(--card); border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0; }
.lightbox-nav { display: flex; align-items: center; gap: 8px; }
.lightbox-counter { min-width: 46px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lightbox-title { flex: 1; min-width: 0; text-align: center; }
.lightbox-heading { font-weight: 600; color: var(--ink); }
.lightbox-url { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; vertical-align: bottom; }
.lightbox-actions { display: flex; align-items: center; gap: 10px; }

.lightbox-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.lightbox-icon:hover { background: var(--light); }
.lightbox-icon:disabled { opacity: .4; cursor: default; }
.lightbox-download { display: inline-flex; align-items: center; gap: 7px; }

.lightbox-stage { flex: 1; overflow: auto; text-align: center; background: var(--card); border-radius: 0 0 10px 10px; }
.lightbox-img { display: block; max-width: 100%; margin: 0 auto; }
