/* OpenUAT — shared styles */
:root {
  --brand: #0f766e;
  --brand-ink: #ffffff;   /* text on brand-colored buttons/headers */
  --brand-link: #0f766e;  /* brand shade readable as text on white */
  --brand-dark: #115e59;
  --brand-soft: #e6f4f2;
  --ink: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f6f8fb;
  --card: #ffffff;
  --green: #15803d; --green-bg: #dcfce7;
  --red: #b91c1c;   --red-bg: #fee2e2;
  --amber: #b45309; --amber-bg: #fef3c7;
  --blue: #1d4ed8;  --blue-bg: #dbeafe;
  --gray: #475569;  --gray-bg: #f1f5f9;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15,23,42,0.06), 0 1px 3px rgba(15,23,42,0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.55; color: var(--text); background: var(--bg); }
a { color: var(--brand-link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0 0 8px; }
h1 { font-size: 26px; } h2 { font-size: 19px; } h3 { font-size: 15.5px; } h4 { font-size: 13.5px; }
p { margin: 0 0 10px; }
small, .ou-muted { color: var(--muted); }
code { background: var(--gray-bg); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }

/* ── Top bar ─────────────────────────────────────── */
.ou-bar { display: flex; align-items: center; gap: 18px; padding: 0 24px; height: 58px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.ou-logo { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 18px; font-weight: 600; letter-spacing: -0.2px; text-decoration: none !important; }
.ou-logo b { color: var(--brand); font-weight: 800; }
.ou-cust-logo { display: block; max-width: 180px; object-fit: contain; }
.ou-powered { font-size: 11px; font-weight: 500; color: var(--muted); padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--line); white-space: nowrap; }
.ou-powered b { color: var(--muted); font-weight: 700; }
.ou-ws { font-weight: 600; color: var(--ink); padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; }
.ou-ws:hover { background: var(--gray-bg); text-decoration: none; }
.ou-caret { color: var(--muted); font-size: 10px; }
.ou-nav { display: flex; gap: 4px; }
.ou-nav a { color: var(--text); padding: 7px 12px; border-radius: 8px; font-weight: 500; }
.ou-nav a:hover { background: var(--gray-bg); text-decoration: none; }
.ou-nav a.active { background: var(--brand-soft); color: var(--brand-link); }
.ou-bar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ou-user { display: flex; align-items: center; gap: 8px; }
.ou-user-name { display: flex; flex-direction: column; line-height: 1.2; font-size: 13px; color: var(--ink); font-weight: 500; }
.ou-user-name small { font-size: 11px; font-weight: 400; }
.ou-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; flex-shrink: 0; }
.ou-demo-bar { background: #fff7e6; color: #8a5a00; border-bottom: 1px solid #f5d9a8; font-size: 12.5px; padding: 6px 24px; }

/* Colored header option (workspace branding) */
body.ou-brand-header .ou-bar { background: var(--brand); border-bottom-color: transparent; }
body.ou-brand-header .ou-bar, body.ou-brand-header .ou-logo, body.ou-brand-header .ou-ws, body.ou-brand-header .ou-nav a, body.ou-brand-header .ou-user-name, body.ou-brand-header .ou-user-name small, body.ou-brand-header .ou-powered, body.ou-brand-header .ou-powered b, body.ou-brand-header .ou-caret { color: var(--brand-ink); }
body.ou-brand-header .ou-powered { border-left-color: currentColor; opacity: .8; }
body.ou-brand-header .ou-ws { border-color: color-mix(in srgb, var(--brand-ink) 35%, transparent); }
body.ou-brand-header .ou-ws:hover, body.ou-brand-header .ou-nav a:hover { background: color-mix(in srgb, var(--brand-ink) 12%, transparent); }
body.ou-brand-header .ou-nav a.active { background: color-mix(in srgb, var(--brand-ink) 20%, transparent); color: var(--brand-ink); }
body.ou-brand-header .ou-bar .ou-btn-ghost { background: transparent; color: var(--brand-ink); border-color: color-mix(in srgb, var(--brand-ink) 40%, transparent); }
body.ou-brand-header .ou-avatar { background: color-mix(in srgb, var(--brand-ink) 22%, transparent); color: var(--brand-ink); }

/* ── Layout ──────────────────────────────────────── */
#ou-main { max-width: 1120px; margin: 0 auto; padding: 26px 24px 60px; }
.ou-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.ou-page-head p { margin: 2px 0 0; color: var(--muted); }
.ou-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 16px; }
.ou-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.ou-grid { display: grid; gap: 16px; }
.ou-grid-2 { grid-template-columns: 1fr 1fr; }
.ou-grid-3 { grid-template-columns: repeat(3, 1fr); }
.ou-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) { .ou-grid-2, .ou-grid-3 { grid-template-columns: 1fr; } .ou-grid-4 { grid-template-columns: 1fr 1fr; } .ou-ws { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ou-bar { padding: 0 14px; gap: 10px; } .ou-user-name { display: none; } #ou-main { padding: 18px 14px 50px; } }

/* ── Buttons ─────────────────────────────────────── */
.ou-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand); border-radius: 8px; padding: 8px 15px; font-size: 13.5px; font-weight: 600; font-family: inherit; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.ou-btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.ou-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.ou-btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.ou-btn-ghost:hover { background: var(--gray-bg); border-color: #cbd5e1; }
.ou-btn-danger { background: #fff; color: var(--red); border-color: #fecaca; }
.ou-btn-danger:hover { background: var(--red-bg); border-color: #fca5a5; }
.ou-btn-sm { padding: 5px 11px; font-size: 12.5px; }
.ou-btn-lg { padding: 12px 22px; font-size: 15px; }
.ou-btn-pass { background: var(--green); border-color: var(--green); color: #fff; }
.ou-btn-fail { background: var(--red); border-color: var(--red); color: #fff; }
.ou-btn-blocked { background: var(--amber); border-color: var(--amber); color: #fff; }
.ou-btn-pass:hover, .ou-btn-fail:hover, .ou-btn-blocked:hover { filter: brightness(0.92); }
.ou-link-btn { background: none; border: none; color: var(--brand-link); cursor: pointer; font: inherit; padding: 0; }
.ou-link-btn:hover { text-decoration: underline; }
.ou-link-btn.danger { color: var(--red); }

/* ── Forms ───────────────────────────────────────── */
.ou-field { margin-bottom: 13px; }
.ou-field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.ou-field .hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.ou-input, .ou-field input, .ou-field select, .ou-field textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 10px; font: inherit; color: var(--ink); background: #fff; }
.ou-field textarea { min-height: 80px; resize: vertical; }
.ou-input:focus, .ou-field input:focus, .ou-field select:focus, .ou-field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,118,110,0.15); }
.ou-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ou-msg { padding: 9px 12px; border-radius: 8px; font-size: 13px; margin: 8px 0; }
.ou-msg.err { background: var(--red-bg); color: var(--red); }
.ou-msg.ok { background: var(--green-bg); color: var(--green); }
.ou-msg.info { background: var(--blue-bg); color: var(--blue); }
.ou-check { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; }
.ou-field .ou-check input, .ou-check input { width: auto; flex-shrink: 0; margin: 0; }

/* ── Application scoping ─────────────────────────── */
.ou-app-box { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 2px; margin: -4px 0 13px; background: #fbfcfd; }
.ou-app-multi { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 12px; }
.ou-app-multi .ou-check { padding: 4px 0; }
.ou-chip { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-link); white-space: nowrap; }
.ou-scope { display: grid; grid-template-columns: 170px 1fr; gap: 5px 14px; font-size: 13px; margin: 0; }
.ou-scope dt { color: var(--muted); } .ou-scope dd { margin: 0; color: var(--ink); }
@media (max-width: 600px) { .ou-scope { grid-template-columns: 1fr; } .ou-scope dd { margin-bottom: 6px; } }

/* ── Excel / CSV import ──────────────────────────── */
.ou-imp-drop { display: block; border: 2px dashed #cbd5e1; border-radius: 10px; padding: 28px 16px; text-align: center; cursor: pointer; color: var(--text); background: #fbfcfd; }
.ou-imp-drop:hover, .ou-imp-drop.over { border-color: var(--brand); background: var(--brand-soft); }
.ou-imp-drop b { color: var(--brand-link); }
.ou-imp-list { max-height: 330px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px; }
.ou-imp-map td { padding: 7px 8px; }
.ou-imp-sample { font-size: 11.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }

/* ── Badges, stats, tables ───────────────────────── */
.ou-badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.ou-green { background: var(--green-bg); color: var(--green); }
.ou-red { background: var(--red-bg); color: var(--red); }
.ou-amber { background: var(--amber-bg); color: var(--amber); }
.ou-blue { background: var(--blue-bg); color: var(--blue); }
.ou-gray { background: var(--gray-bg); color: var(--gray); }
.ou-stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.ou-stat b { display: block; font-size: 24px; color: var(--ink); line-height: 1.1; }
.ou-stat span { font-size: 12px; color: var(--muted); }
.ou-table { width: 100%; border-collapse: collapse; }
.ou-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.ou-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ou-table tr:last-child td { border-bottom: none; }
.ou-table tr.click { cursor: pointer; }
@media (max-width: 700px) { .hide-sm { display: none; } }
/* Phone header: logo + account buttons on the first row, workspace + pages on the second. */
@media (max-width: 640px) {
  .ou-bar { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 6px 8px; }
  .ou-logo { order: 1; font-size: 16px; min-width: 0; }
  .ou-cust-logo { max-width: 130px; }
  .ou-powered { display: none; }
  .ou-bar-right { order: 2; gap: 6px; }
  .ou-bar-right .ou-btn-sm { padding: 5px 9px; }
  .ou-lbl { display: none; }
  .ou-ws { order: 3; max-width: 46%; padding: 5px 8px; }
  .ou-nav { order: 4; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .ou-nav a { padding: 6px 9px; white-space: nowrap; }
  .ou-sticky-sm-off { position: static !important; }
}
.ou-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ou-table tr.click:hover td { background: #f8fafc; }
.ou-key { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; color: var(--muted); }
.ou-progress { height: 8px; background: var(--gray-bg); border-radius: 999px; overflow: hidden; display: flex; }
.ou-progress i { display: block; height: 100%; }
.ou-progress .p-pass { background: #22c55e; } .ou-progress .p-fail { background: #ef4444; } .ou-progress .p-blocked { background: #f59e0b; }
.ou-empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.ou-empty h3 { color: var(--ink); }

/* ── Tabs ────────────────────────────────────────── */
.ou-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.ou-tabs button { background: none; border: none; border-bottom: 2px solid transparent; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.ou-tabs button:hover { color: var(--ink); }
.ou-tabs button.active { color: var(--brand-link); border-bottom-color: var(--brand); }
.ou-tabs .count { background: var(--gray-bg); color: var(--gray); border-radius: 999px; font-size: 11px; padding: 1px 7px; margin-left: 4px; }

/* ── Test cases ──────────────────────────────────── */
.ou-case { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 12px; }
.ou-case-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ou-case-head h3 { margin: 0; flex: 1; min-width: 200px; }
.ou-case-body { padding: 12px 16px; }
.ou-steps { width: 100%; border-collapse: collapse; font-size: 13px; }
.ou-steps th { text-align: left; font-size: 11px; text-transform: uppercase; color: var(--muted); padding: 4px 8px; }
.ou-steps td { padding: 7px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.ou-steps td:first-child { width: 34px; color: var(--muted); font-weight: 600; }
.ou-step-edit { display: grid; grid-template-columns: 28px 1fr 1fr 28px; gap: 6px; align-items: start; margin-bottom: 6px; }
.ou-step-edit textarea { min-height: 40px !important; }
.ou-result-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px dashed var(--line); font-size: 13px; }
.ou-evidence { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.ou-evidence a img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.ou-evidence a.file { display: inline-block; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }

/* ── Activity feed ───────────────────────────────── */
.ou-feed { list-style: none; margin: 0; padding: 0; }
.ou-feed li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.ou-feed li:last-child { border-bottom: none; }
.ou-feed time { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ── Modal ───────────────────────────────────────── */
.ou-modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,0.5); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 14px; overflow-y: auto; }
.ou-modal { background: #fff; border-radius: 12px; width: 100%; max-width: 620px; padding: 22px 24px; box-shadow: 0 20px 50px rgba(15,23,42,0.3); position: relative; }
.ou-modal.wide { max-width: 820px; }
.ou-modal-x { position: absolute; top: 12px; right: 14px; background: none; border: none; font-size: 22px; color: var(--muted); cursor: pointer; }
.ou-modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ── Toast ───────────────────────────────────────── */
.ou-toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13.5px; opacity: 0; transition: all 0.25s; z-index: 200; }
.ou-toast.show { opacity: 1; transform: translate(-50%, 0); }
.ou-toast.err { background: var(--red); }

/* ── Auth pages ──────────────────────────────────── */
.ou-auth { max-width: 410px; margin: 50px auto; }
.ou-auth .ou-card { padding: 28px 28px 22px; }
.ou-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 14px 0; }
.ou-divider:before, .ou-divider:after { content: ""; flex: 1; height: 1px; background: var(--line); }
.ou-google { width: 100%; background: #fff; color: var(--ink); border: 1px solid #cbd5e1; }
.ou-google:hover { background: var(--gray-bg); border-color: #94a3b8; }

@media print {
  .ou-bar, .ou-demo-bar, .no-print { display: none !important; }
  body { background: #fff; }
  .ou-card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  #ou-main { padding: 0; max-width: none; }
}
