/* Hunting List -- the frame: top bar, page, forms, flashes. The module's
   own pages are styled by hunting/static/hunting/content.css, which reads
   the --role-* colours below. */

:root {
    --role-button: #1f6f5c;
    --role-button-dark: #16503f;
    --text: #1a1d20;
    --border: #dde1e8;
    --bg: #f4f6f8;
    --topbar: #12312a;
    --topbar-text: #ffffff;
    --topbar-muted: #c9d6d2;
    --topbar-hover: rgba(255, 255, 255, 0.08);
    --role-button-text: #ffffff;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: var(--role-button-dark); }
input, select, textarea, button { font: inherit; }
input, select, textarea {
    border: 1px solid #c8ced6;
    border-radius: 6px;
    background: #fff;
    color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--role-button); outline-offset: -1px; border-color: var(--role-button); }
h1, h2 { line-height: 1.2; }

/* ------------------------------------------------------------- navbar
   One slim bar: brand, menus with dropdown panels (title + one-line
   description per item), and the account menu on the right. Colours come
   from the brand (--topbar*, set in layout.html). Below 860px the menus
   fold behind a menu button. */
.navbar { background: var(--topbar); color: var(--topbar-text); position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12); }
.navbar-inner { max-width: 1400px; margin: 0 auto; padding: 0 1.25rem; min-height: 56px; display: flex; align-items: center; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: 0.55rem; color: var(--topbar-text); text-decoration: none; font-weight: 700; font-size: 1rem; letter-spacing: 0.01em; flex: none; min-width: 0; }
.brand-mark { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; opacity: 0.9; }
.brand-logo { height: 32px; max-width: 160px; object-fit: contain; display: block; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-menus { display: flex; align-items: center; gap: 1rem; flex: 1; min-width: 0; }
.nav-main { display: flex; align-items: center; gap: 0.15rem; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; }
.nav-item { position: relative; }
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: 0;
    color: var(--topbar-muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}
.nav-link:hover, .nav-item.open > .nav-link { color: var(--topbar-text); background: var(--topbar-hover); }
.nav-link.current { color: var(--topbar-text); }
.chev { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
.nav-item.open > .nav-link .chev { transform: rotate(180deg); }
.nav-outline { border: 1px solid var(--topbar-muted); color: var(--topbar-text); }
.nav-cta {
    background: var(--role-button);
    color: var(--role-button-text);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.nav-cta:hover { filter: brightness(1.08); }
.nav-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 290px;
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 32, 0.16);
    padding: 0.35rem;
}
.nav-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.nav-panel-right { left: auto; right: 0; min-width: 230px; }
.nav-item.open > .nav-panel { display: block; }
@media (hover: hover) and (min-width: 861px) {
    .nav-main .nav-item:hover > .nav-panel { display: block; }
    .nav-main .nav-item:hover > .nav-link { color: var(--topbar-text); background: var(--topbar-hover); }
}
.menu-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.7rem;
    border-radius: 7px;
    color: var(--text);
    text-decoration: none;
    width: 100%;
    background: none;
    border: 0;
    text-align: left;
    cursor: pointer;
}
.menu-item + .menu-item, .nav-panel form { border-top: 1px solid #f0f2f5; }
.nav-panel form { margin: 0; }
.menu-item:hover, .menu-item:focus-visible { background: #f3f5f8; outline: none; }
.menu-item.active .menu-title { color: var(--role-button-dark); }
.menu-text { display: flex; flex-direction: column; gap: 0.05rem; min-width: 0; }
.menu-title { font-size: 0.9rem; font-weight: 600; }
.menu-desc { font-size: 0.78rem; color: #6b7683; }
.menu-arrow { font-size: 0.8rem; color: #a0a9b4; transition: transform 0.15s, color 0.15s; }
.menu-item:hover .menu-arrow { color: var(--role-button); transform: translate(1px, -1px); }
.menu-note { font-size: 0.78rem; color: #6b7683; padding: 0.5rem 0.7rem 0.4rem; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; padding: 0.5rem; cursor: pointer; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--topbar-text); margin: 4px 0; border-radius: 1px; transition: transform 0.15s, opacity 0.15s; }
.navbar.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.navbar.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.navbar.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
    .navbar-inner { flex-wrap: wrap; gap: 0; padding: 0 1rem; }
    .brand { min-height: 56px; max-width: calc(100% - 52px); }
    .nav-toggle { display: block; }
    .nav-menus { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0.5rem; padding: 0.25rem 0 1rem; }
    .navbar.nav-open .nav-menus { display: flex; }
    .nav-main { flex-direction: column; align-items: stretch; }
    .nav-right { margin-left: 0; flex-direction: column-reverse; align-items: stretch; }
    .nav-link { width: 100%; justify-content: space-between; padding: 0.7rem 0.5rem; font-size: 1rem; }
    .nav-outline { border-color: transparent; }
    .nav-cta { text-align: center; padding: 0.65rem; }
    .nav-panel, .nav-panel-right { position: static; min-width: 0; box-shadow: none; margin: 0.15rem 0 0.5rem; }
}

/* --------------------------------------------------------------- page */
.page { flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; padding: 1.25rem 1.25rem 2rem; }
.footer { text-align: center; color: #8a94a1; font-size: 0.78rem; padding: 0.75rem; }
.table-scroll { overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.table-scroll table thead th { background: #f3f5f8; border-bottom: 1px solid var(--border); font-size: 0.8rem; color: #4b5563; }
.table-scroll table tbody tr + tr td { border-top: 1px solid #eef0f3; }
.hl-card .table-scroll { border: 0; }

.flash-message { padding: 0.6rem 0.9rem; border-radius: 6px; margin: 0 0 1rem; font-size: 0.9rem; border: 1px solid transparent; }
.flash-success { background: #e3f4ea; color: #157f45; border-color: #bfe3cc; }
.flash-error { background: #fbe7e5; color: #b3271e; border-color: #f2c3be; }
.flash-info { background: #e8f0f8; color: #1d4f8a; border-color: #c6d8ec; }

/* -------------------------------------------------------------- login */
.login-card {
    max-width: 360px;
    margin: 3rem auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    box-shadow: 0 1px 3px rgba(11, 37, 69, 0.10);
}
.login-card h1 { margin: 0; font-size: 1.3rem; }
.login-card label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; font-weight: 600; color: #4b5563; }
.login-card input { padding: 0.55rem 0.65rem; }
.login-card button {
    background: var(--role-button);
    color: var(--role-button-text);
    border: 0;
    border-radius: 6px;
    padding: 0.6rem;
    font-weight: 600;
    cursor: pointer;
}
.login-card button:hover { background: var(--role-button-dark); }
.login-note { font-size: 0.84rem; color: #5d6b7d; margin: 0; }

@media (max-width: 640px) {
    .page { padding: 1rem; }
}

/* ------------------------------------------------- connector pages */
.panel {
    max-width: 760px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.4rem;
    margin: 0 auto 1rem;
    box-shadow: 0 1px 3px rgba(11, 37, 69, 0.10);
}
.panel h1 { font-size: 1.3rem; margin: 0 0 0.6rem; }
.panel h2 { font-size: 1.05rem; margin: 1.2rem 0 0.5rem; }
.panel p, .panel li { color: #3c4653; }
.panel ol { padding-left: 1.2rem; }
.panel li { margin-bottom: 0.35rem; }
.copy-row { display: flex; gap: 0.5rem; margin: 0.6rem 0 0.2rem; }
.copy-row input { flex: 1; padding: 0.5rem 0.6rem; font-family: ui-monospace, Consolas, monospace; font-size: 0.9rem; background: #f6f8f9; }
.btn {
    display: inline-block;
    background: var(--role-button);
    color: var(--role-button-text);
    border: 1px solid var(--role-button);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: var(--role-button-dark); border-color: var(--role-button-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--role-button-dark); }
.btn-ghost:hover { background: var(--role-button); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.85rem; }
.consent-actions { display: flex; gap: 0.6rem; margin-top: 1.2rem; }
.consent-actions form { margin: 0; }
.muted { color: #6b7683; font-size: 0.88rem; }
.apps { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.apps th { text-align: left; font-size: 0.8rem; color: #4b5563; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); }
.apps td { padding: 0.5rem; border-bottom: 1px solid #eef0f3; vertical-align: middle; }
.apps form { margin: 0; text-align: right; }

.btn-danger { background: #b3271e; border-color: #b3271e; color: #fff; }
.btn-danger:hover { background: #8a1d17; border-color: #8a1d17; }
.login-logo { display: flex; justify-content: center; padding: 0.9rem; border-radius: 8px; margin: -0.25rem 0 0.25rem; }
.login-logo img { max-height: 56px; max-width: 100%; object-fit: contain; }
.login-for { display: block; font-size: 0.95rem; font-weight: 500; color: #5d6b7d; margin-top: 0.2rem; }

/* ------------------------------------------------------------ settings */
.settings { max-width: 980px; margin: 0 auto; }
.settings-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.settings-head h1 { margin: 0; font-size: 1.4rem; }
.settings-tabs { display: flex; gap: 0.25rem; background: #e9edf1; padding: 0.25rem; border-radius: 8px; flex-wrap: wrap; }
.settings-tabs a { padding: 0.35rem 0.8rem; border-radius: 6px; color: #4b5563; text-decoration: none; font-size: 0.88rem; font-weight: 600; }
.settings-tabs a:hover { color: var(--text); }
.settings-tabs a.active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.panel.wide { max-width: none; }
.panel { scroll-margin-top: 72px; }
.panel h3 { font-size: 0.95rem; margin: 1.3rem 0 0.6rem; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.panel-head h2 { margin: 0 0 0.25rem; }
.panel-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.back { display: inline-block; margin-bottom: 0.75rem; color: #5d6b7d; text-decoration: none; font-size: 0.88rem; }
.form-stack { display: flex; flex-direction: column; gap: 0.75rem; margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem 1rem; align-items: end; }
.field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.82rem; font-weight: 600; color: #4b5563; margin: 0; }
.field small { font-weight: 400; color: #7a8592; }
.field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=password], .field textarea { padding: 0.45rem 0.6rem; width: 100%; }
.field input[type=file] { font-size: 0.85rem; }
.field-end { display: flex; align-items: flex-end; }
.check { display: flex; align-items: center; gap: 0.45rem; font-size: 0.88rem; color: var(--text); }
.colour-pick { display: flex; gap: 0.4rem; align-items: center; }
.colour-pick input[type=color] { width: 42px; height: 36px; padding: 2px; cursor: pointer; flex: none; }
.colour-pick input[type=text] { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; }
.prefix-input { display: flex; align-items: stretch; }
.prefix-input span { padding: 0.45rem 0.5rem; background: #eef1f4; border: 1px solid #c8ced6; border-right: 0; border-radius: 6px 0 0 6px; font-family: ui-monospace, Consolas, monospace; color: #5d6b7d; font-weight: 400; }
.prefix-input input { border-radius: 0 6px 6px 0; flex: 1; min-width: 0; }
.logo-row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; padding: 0.8rem; border: 1px dashed #c8ced6; border-radius: 8px; }
.logo-preview { width: 180px; height: 56px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex: none; }
.logo-preview img { max-height: 36px; max-width: 160px; object-fit: contain; }
.logo-preview span { color: rgba(255, 255, 255, 0.7); font-size: 0.8rem; }
.logo-row .field { flex: 1; min-width: 220px; }
.apps .num { text-align: right; font-variant-numeric: tabular-nums; }
.sub { display: block; font-size: 0.78rem; color: #6b7683; font-weight: 400; }
.pill { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 0.1rem 0.55rem; border-radius: 999px; background: #eceff3; color: #5d6b7d; }
.pill-ok { background: #e3f4ea; color: #157f45; }
.empty { text-align: center; color: #6b7683; padding: 1.5rem; border: 1px dashed var(--border); border-radius: 8px; }
.row-tools { text-align: right; width: 1%; white-space: nowrap; }
.row-edit { position: relative; display: inline-block; text-align: left; }
.row-edit > summary { list-style: none; }
.row-edit > summary::-webkit-details-marker { display: none; }
.row-edit-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 300px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(15, 23, 32, 0.16); padding: 0.9rem; display: flex; flex-direction: column; gap: 0.9rem; white-space: normal; }
.row-edit-body form + form { border-top: 1px solid #eef0f3; padding-top: 0.8rem; }
.new-login { padding: 0.9rem; background: #f6f8fa; border-radius: 8px; }
.danger-zone { border-color: #f2c3be; }
.danger-zone h2 { color: #b3271e; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 0.85em; background: #eef1f4; padding: 0.05rem 0.3rem; border-radius: 4px; }
