﻿:root {
    --hh-navy: #003763;
    --hh-blue: #1ba9e8;
    --hh-ink: #12375a;
    --hh-muted: #6e7f92;
    --hh-line: #d8dde5;
    --hh-border: #d8dde5;
    --hh-bg: #f4f5f9;
    --hh-card: #ffffff;
    --hh-soft: #eef2f6;
    --hh-text: #12375a;
    --hh-success-bg: #ddf4e6;
    --hh-success: #18a957;
    --hh-shadow: 0 2px 8px rgba(12, 32, 56, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--hh-bg);
    color: var(--hh-ink);
    font-size: 14px;
    letter-spacing: 0;
}
a { color: var(--hh-ink); text-decoration: none; }
a:hover { color: var(--hh-blue); }
button, input, select, textarea { font: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 216px 1fr; }
.side-menu {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: #fff;
    border-right: 1px solid #e6e9ef;
    padding: 10px 8px 24px;
    box-shadow: 2px 0 10px rgba(12, 32, 56, .04);
    z-index: 30;
}
.side-menu-head { position: relative; }
.brand-lockup {
    display: flex;
    align-items: flex-start;
    min-height: 66px;
    padding: 0 14px 10px 16px;
}
.brand-logo-img {
    display: block;
    width: 154px;
    max-width: 100%;
    height: auto;
}
.menu-collapse {
    position: absolute;
    right: -18px;
    top: 15px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--hh-navy);
    color: #fff;
    border: 4px solid #f4f5f9;
    box-shadow: 0 2px 8px rgba(12, 32, 56, .2);
}
.menu-collapse svg { width: 14px; height: 14px; }

.nav-section { margin-top: 8px; }
.nav-section-title {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px 6px 0;
    color: var(--hh-blue);
    font-size: 12px;
    font-weight: 600;
}
.nav-section-title::before {
    content: "";
    width: 7px;
    height: 7px;
    border: solid var(--hh-blue);
    border-width: 0 1px 1px 0;
    transform: rotate(45deg);
    margin-top: -3px;
}
.nav-list { display: grid; gap: 2px; }
.nav-item { display: grid; gap: 1px; }
.nav-link {
    min-height: 31px;
    display: grid;
    grid-template-columns: 24px 1fr 12px;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 6px 16px;
    border-radius: 6px;
    color: #244c72;
    font-size: 13px;
}
.nav-link:hover, .nav-link.active { background: #f0f1f4; color: var(--hh-navy); }
.nav-link.active { font-weight: 700; }
.nav-link.parent-active { background: #f0f1f4; color: var(--hh-navy); }
.nav-link.disabled {
    color: #7b8da1;
    cursor: default;
}
.nav-link.disabled:hover { background: transparent; color: #7b8da1; }
.nav-children {
    display: grid;
    gap: 1px;
    padding: 2px 0 6px 46px;
}
.nav-child-link {
    min-height: 24px;
    display: flex;
    align-items: center;
    border-radius: 5px;
    padding: 3px 8px;
    color: #315575;
    font-size: 12px;
}
.nav-child-link:hover, .nav-child-link.active {
    color: var(--hh-navy);
    font-weight: 700;
}
.nav-child-link.disabled {
    color: #7b8da1;
    cursor: default;
    font-weight: 400;
}
.nav-icon {
    width: 17px;
    height: 17px;
    color: #315d83;
}
.nav-caret { color: #6b87a3; font-size: 16px; line-height: 1; }

.app-main { min-width: 0; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    margin: 6px 8px 0 24px;
    height: 62px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 18px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 12px rgba(12, 32, 56, .18);
    padding: 0 28px;
}
.search-shell { display: flex; align-items: center; gap: 12px; color: #7d8590; }
.search-shell svg { width: 22px; height: 22px; color: #12456f; }
.search-shell input {
    width: 100%;
    border: 0;
    outline: 0;
    font-size: 15px;
    color: var(--hh-ink);
}
.top-actions { display: flex; align-items: center; gap: 18px; color: var(--hh-navy); }
.top-actions a { color: var(--hh-navy); }
.top-icon { width: 22px; height: 22px; position: relative; display: grid; place-items: center; }
.notification-dot {
    position: absolute;
    top: -8px;
    right: -9px;
    min-width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #ff402f;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 0 4px;
}
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #b7c8e8, #ffe1bf);
    border: 2px solid #dfe5ef;
    position: relative;
}
.avatar::after {
    content: "";
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #8de36f;
    border: 2px solid #fff;
}
.flag-pill {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: block;
    overflow: hidden;
    border: 1px solid #d6dce5;
    background:
        linear-gradient(#1f4f8f 0 46%, transparent 46%),
        repeating-linear-gradient(0deg, #fff 0 8%, #d91f2f 8% 16%);
}

main { padding: 28px 8px 48px 24px; }
.page-wrap { max-width: none; margin: 0; }
.stack { display: grid; gap: 24px; }
.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.panel {
    background: var(--hh-card);
    border: 1px solid #e8ebf1;
    border-radius: 6px;
    box-shadow: var(--hh-shadow);
    padding: 24px;
}
.page-card {
    background: var(--hh-card);
    border-radius: 6px;
    box-shadow: var(--hh-shadow);
    border: 1px solid #e8ebf1;
    overflow: hidden;
}
.page-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    position: relative;
    padding: 22px 24px 16px;
}
.page-card-title {
    display: grid;
    gap: 4px;
}
.page-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-left: auto;
}
h1, h2, h3 { margin: 0; color: #002f5f; font-weight: 600; }
h1 { font-size: 18px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { line-height: 1.55; }
.muted { color: var(--hh-muted); }

label {
    display: grid;
    gap: 7px;
    color: #294e72;
    font-weight: 600;
}
input, select, textarea {
    width: 100%;
    padding: 10px 14px;
    min-height: 40px;
    border: 1px solid #c8cdd4;
    border-radius: 5px;
    background: #fff;
    color: #244c72;
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid rgba(27, 169, 232, .18);
    border-color: #5a9cca;
}
input[type="checkbox"], input[type="radio"] {
    width: 18px;
    min-height: 18px;
    accent-color: var(--hh-navy);
}
button, .btn-primary, .btn-icon, .btn-link-button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 5px;
    background: var(--hh-navy);
    color: #fff;
    padding: 9px 18px;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0, 55, 99, .25);
    cursor: pointer;
}
button:hover, .btn-primary:hover, .btn-icon:hover, .btn-link-button:hover { background: #002b4d; color: #fff; }
.btn-icon { width: 42px; padding: 0; }
.btn-subtle {
    background: #edf1f5;
    color: var(--hh-navy);
    box-shadow: none;
}
.btn-subtle:hover { background: #dfe6ee; color: var(--hh-navy); }

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    color: #254e75;
}
thead th {
    color: #002f5f;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0;
    font-weight: 800;
    background: #fff;
}
th, td {
    border-bottom: 1px solid #cfd3d9;
    padding: 13px 20px;
    text-align: left;
    vertical-align: middle;
}
tbody tr:nth-child(even) { background: #f7f7f8; }
tbody tr:hover { background: #f0f5fa; }
.table-shell { overflow-x: auto; }

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--hh-success-bg);
    color: var(--hh-success);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}
.status-badge.inactive, .status-badge.draft, .status-badge.pending {
    background: #eef1f5;
    color: #65758a;
}
.action-cell form { display: inline-flex; margin: 0; }
.action-cell a, .action-cell button {
    width: 42px;
    height: 32px;
    min-height: 32px;
    display: inline-grid;
    place-items: center;
    border-radius: 5px;
    background: var(--hh-navy);
    color: #fff;
    padding: 0;
    box-shadow: 0 2px 5px rgba(0, 55, 99, .25);
}
.action-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.action-group form { margin: 0; }
.action-group .btn-icon {
    width: 42px;
    min-height: 32px;
    height: 32px;
    padding: 0;
}

.metric-grid { display: grid; gap: 24px; grid-template-columns: repeat(4, minmax(180px, 1fr)); }
.metric-card {
    min-height: 120px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: start;
    background: #fff;
    border-radius: 6px;
    box-shadow: var(--hh-shadow);
    border: 1px solid #e8ebf1;
    padding: 24px;
}
.metric-card-link {
    color: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.metric-card-link:hover {
    color: inherit;
    border-color: #b8d8eb;
    box-shadow: 0 4px 14px rgba(12, 32, 56, .16);
    transform: translateY(-1px);
}
.metric-label { color: #244c72; font-size: 15px; }
.metric-value { margin-top: 16px; color: var(--hh-navy); font-size: 24px; font-weight: 500; }
.metric-icon {
    width: 43px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    background: #dfe7ef;
    color: var(--hh-navy);
}

.detail-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    padding: 0 24px 24px;
}
.detail-item {
    display: grid;
    gap: 6px;
    color: #244c72;
}
.detail-label {
    color: var(--hh-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}
.detail-value {
    color: var(--hh-navy);
    font-size: 16px;
    font-weight: 600;
}
.form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}
.padded-block { padding: 0 24px 24px; }
.padded-block.with-top { padding-top: 18px; }
.padded-actions { padding: 20px 24px 24px; }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 10px; }
.plain-list li { line-height: 1.5; color: var(--hh-ink); }
.section-copy { margin: 6px 0 0; }
.span-full { grid-column: 1 / -1; }
.drawer-fieldset {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 12px;
    border: 1px solid #d8dde5;
    border-radius: 5px;
}
.drawer-fieldset legend {
    padding: 0 4px;
    color: #294e72;
    font-weight: 700;
}
.checkbox-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}
.section-form {
    padding: 18px 24px 24px;
    border-top: 1px solid #e8ebf1;
}
.compact-stack {
    display: grid;
    gap: 10px;
}
.mini-form {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(140px, 1fr) auto;
    align-items: end;
}
.mini-form.single-action {
    grid-template-columns: auto;
    justify-items: start;
}
.mini-form.wide-note {
    grid-template-columns: minmax(140px, 1fr) minmax(160px, 1fr) auto;
}
.mini-form input, .mini-form select {
    min-height: 34px;
    padding: 7px 10px;
}
.mini-form button, .mini-form .btn-primary {
    min-height: 34px;
    padding: 7px 12px;
}
.step-list {
    display: grid;
    gap: 8px;
}
.step-row {
    display: grid;
    gap: 7px;
    padding: 8px;
    border: 1px solid #e8ebf1;
    border-radius: 5px;
    background: #fbfcfe;
}
.step-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.step-title {
    color: #244c72;
    font-size: 12px;
    font-weight: 700;
}
.step-form {
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(100px, 1fr) minmax(118px, 1fr) minmax(120px, 1fr) auto;
    align-items: end;
}
.step-form input, .step-form select {
    min-height: 32px;
    padding: 6px 8px;
    font-size: 12px;
}
.step-form button {
    min-height: 32px;
    padding: 6px 10px;
}
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tag {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    border-radius: 4px;
    background: #eef2f6;
    color: #315575;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 700;
}
.timeline-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: #315575;
    font-size: 12px;
}
.timeline-list li {
    display: grid;
    gap: 2px;
}
.summary-list {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: #315575;
}
.table-note {
    display: block;
    color: var(--hh-muted);
    font-size: 12px;
    margin-top: 4px;
}
.drawer-body-grid {
    margin-top: 18px;
}
.tool-form {
    padding: 18px;
    border: 1px solid #e8ebf1;
    border-radius: 6px;
    background: #fbfcfe;
}
.table-section {
    display: grid;
    gap: 0;
}
.table-section + .table-section {
    margin-top: 24px;
}
.empty-row {
    color: var(--hh-muted);
    font-style: italic;
}
.link-back {
    color: var(--hh-navy);
    font-weight: 700;
}
.two-column-layout {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr);
}
.subsection {
    display: grid;
    gap: 14px;
    padding: 0 24px 24px;
}
.subsection + .subsection {
    border-top: 1px solid #e8ebf1;
    padding-top: 20px;
}

.filter-bar {
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr) minmax(220px, 1fr) minmax(220px, 1fr);
    gap: 26px;
    align-items: center;
    padding: 0 24px 22px;
}
.filter-bar.padded-top { padding-top: 18px; }
.filter-bar.wide {
    grid-template-columns: repeat(4, minmax(180px, 1fr)) auto;
    padding-top: 8px;
}
.inline-row-form {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(160px, 1fr) auto;
    gap: 8px;
}
.inline-row-form.wide-note {
    grid-template-columns: minmax(130px, 1fr) minmax(160px, 1.2fr) auto;
}
details.create-drawer {
    padding: 0 24px 18px;
    border-bottom: 1px solid #e8ebf1;
}
details.create-drawer.header-action {
    padding: 0;
    border-bottom: 0;
}
details.create-drawer.table-action-drawer {
    padding: 0;
    border-bottom: 0;
}
details.create-drawer summary {
    width: fit-content;
    margin-left: auto;
    list-style: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    border-radius: 5px;
    background: var(--hh-navy);
    color: #fff;
    padding: 9px 18px;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0, 55, 99, .25);
    cursor: pointer;
}
details.create-drawer summary::before { content: "+"; font-size: 18px; line-height: 1; }
details.create-drawer summary::-webkit-details-marker { display: none; }
details.create-drawer summary .summary-icon { display: none; }
details.create-drawer.table-action-drawer summary {
    width: 42px;
    min-height: 32px;
    padding: 0;
}
details.create-drawer.table-action-drawer summary::before { content: none; }
details.create-drawer.table-action-drawer summary svg { width: 17px; height: 17px; }
details.create-drawer.header-action .create-drawer-form {
    margin-top: 18px;
    min-width: min(720px, calc(100vw - 320px));
    position: absolute;
    right: 24px;
    z-index: 15;
    padding: 18px;
    border: 1px solid #e8ebf1;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(12, 32, 56, .16);
}
.create-drawer-form {
    margin-top: 18px;
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) auto;
    align-items: end;
}
.radio-row { display: flex; align-items: center; gap: 18px; white-space: nowrap; }
.radio-row label { display: flex; grid-template-columns: none; align-items: center; gap: 8px; font-weight: 500; }
.radio-row input { width: 18px; min-height: 18px; accent-color: var(--hh-navy); }
.search-inline { display: grid; grid-template-columns: 1fr 36px; }
.search-inline input { border-radius: 5px 0 0 5px; }
.search-inline button { border-radius: 0 5px 5px 0; width: 36px; padding: 0; box-shadow: none; }
.drawer-notes { margin-top: 18px; display: grid; gap: 10px; }
.drawer-notes article { border: 1px solid var(--hh-border); border-radius: 6px; padding: 12px; background: #fbfcfd; }
.drawer-notes strong { display: block; color: var(--hh-navy); font-size: .78rem; text-transform: uppercase; letter-spacing: 0; }
.drawer-notes span { display: block; margin-top: 3px; color: var(--hh-muted); font-size: .84rem; }
.drawer-notes p { margin: 8px 0 0; color: var(--hh-text); }

.error {
    border-color: #f0b4a6;
    background: #fff5f2;
    color: #7f1d1d;
}
.flash { margin-bottom: 20px; }

@media (max-width: 1050px) {
    .app-shell { grid-template-columns: 1fr; }
    .side-menu { position: relative; height: auto; }
    .nav-list { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
    .topbar { margin: 0; border-radius: 0; }
    main { padding: 20px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
    .filter-bar { grid-template-columns: 1fr; }
    .two-column-layout { grid-template-columns: 1fr; }
    .mini-form.wide-note { grid-template-columns: 1fr; }
    details.create-drawer.header-action .create-drawer-form {
        min-width: 0;
        width: calc(100vw - 40px);
        right: 0;
    }
}
@media (max-width: 640px) {
    .topbar { grid-template-columns: 1fr; height: auto; padding: 14px; }
    .top-actions { justify-content: flex-end; }
    .metric-grid { grid-template-columns: 1fr; }
    th, td { padding: 11px 12px; }
}
