/* Shared palette and surface treatment from the pallet accounting application. */
:root {
    color-scheme: light;
    --ink: #351b0d;
    --muted: #866b5b;
    --amber: #c9600d;
    --amber-dark: #8f3f08;
    --cream: #fff8ec;
    --paper: rgba(255, 255, 255, .82);
    --line: rgba(112, 63, 28, .14);
    --success: #28764d;
    --danger: #b32d38;
    --shadow: 0 16px 42px rgba(96, 48, 16, .13);
    font: 15px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--ink);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #efe3d0; }
body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(rgba(255, 249, 239, .87), rgba(255, 249, 239, .9)),
        repeating-linear-gradient(90deg, #a56b3f 0 78px, #7e4a27 78px 82px, #bf8658 82px 158px);
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
a, button { color: inherit; }

header {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 4vw;
    background: rgba(255, 249, 239, .72);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    font-size: 19px;
    font-weight: 850;
    text-decoration: none;
    letter-spacing: -.025em;
}
.brand-label { border-left: 1px solid var(--line); padding-left: 12px; color: var(--muted); font-size: 14px; font-weight: 550; }
.app-emblem {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 19px;
    background: linear-gradient(145deg, #f7b547, #c95d0a);
    color: white;
    font-size: 27px;
    font-weight: 900;
    box-shadow: 0 10px 25px #b65a1933;
}
.brand .app-emblem { width: 42px; height: 42px; border-radius: 14px; font-size: 23px; }
#session { display: flex; align-items: center; gap: 14px; }
#role-label { color: var(--muted); font-size: 13px; }
main { max-width: 1440px; margin: auto; padding: 32px 4vw 64px; }
h1 { font-size: 34px; line-height: 1.15; letter-spacing: -.04em; margin: 6px 0 12px; font-weight: 800; }
h2 { font-size: 22px; margin: 0; letter-spacing: -.025em; }
h3 { font-size: 16px; margin: 24px 0 12px; }
.eyebrow { margin: 0 0 4px; color: var(--amber); font-size: 11px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.panel {
    background: var(--paper);
    border: 1px solid rgba(255, 255, 255, .88);
    border-radius: 21px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}
.login { max-width: 410px; margin: 7vh auto; padding: 34px; border-radius: 30px; }
.login .eyebrow { margin-top: 22px; }
.login form { margin-top: 26px; }
.login form > button { width: 100%; }
.page-title, .section-title, .actions, .pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.actions { justify-content: flex-end; }
button {
    min-height: 48px;
    padding: 11px 18px;
    border: 0;
    border-radius: 14px;
    color: white;
    background: linear-gradient(120deg, #e25f08, #a83e03);
    box-shadow: 0 10px 22px #b3471533;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
}
button:disabled { opacity: .48; cursor: not-allowed; }
button:active:not(:disabled) { transform: translateY(1px); }
.quiet { background: #fff4de; color: var(--amber-dark); box-shadow: none; }
label { display: block; margin-bottom: 16px; font-size: 12px; font-weight: 800; letter-spacing: .02em; }
input, select, textarea {
    display: block;
    width: 100%;
    min-height: 50px;
    margin-top: 7px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--ink);
    background: rgba(255, 255, 255, .9);
    font-weight: 400;
    letter-spacing: 0;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #d17a35; box-shadow: 0 0 0 3px #d17a3522; }
button:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid #d17a35; outline-offset: 3px; }

.priorities { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 22px; }
.priorities:empty { display: none; }
.priority-card { padding: 20px; }
.priority-card button { display: block; min-height: 0; margin-top: 12px; padding: 0; text-align: left; font-size: 17px; background: transparent; }
.priority-card p:last-child { line-height: 1.5; margin-bottom: 0; }
.filters { display: flex; gap: 24px; margin: 24px 0; padding: 20px 22px; }
.filters label { margin: 0; min-width: 200px; }
.filters label:first-child { flex: 1; }
.layout { display: grid; grid-template-columns: minmax(350px, 1.1fr) minmax(360px, 1fr); align-items: start; gap: 24px; }
.list-panel .section-title { padding: 22px; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { color: var(--muted); background: #f5e7d3; font-size: 11px; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; }
td, th { padding: 15px 20px; border-top: 1px solid var(--line); }
td { font-size: 13px; }
td:first-child { min-width: 180px; }
tr.selected td { background: #fff1d7; }
.company-button { min-height: 0; padding: 0; border: 0; border-radius: 0; color: var(--ink); background: none; box-shadow: none; text-align: left; font-size: 14px; font-weight: 800; }
.badge { display: inline-block; padding: 5px 9px; border-radius: 9px; color: var(--amber-dark); background: #fff0c9; font-size: 11px; font-weight: 700; white-space: nowrap; }
.review { border: 1px solid #e4a45c; background: #fff0d8; color: #8c4105; }
.pagination { padding: 20px; }
.detail { padding: 26px; min-height: 300px; }
.empty { margin: 70px 16px; color: var(--muted); text-align: center; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.wide { grid-column: 1 / -1; }
.recommendation { margin: 20px 0; padding: 16px; border: 1px solid #f0d59e; border-radius: 16px; background: #fff3d6; }
.recommendation p { margin: 6px 0; font-size: 13px; line-height: 1.5; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.timeline p { margin: 5px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.contact-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
.contact-row div { min-width: 0; }
.contact-row small { display: block; color: var(--muted); }
details { padding: 16px 0; margin: 12px 0; border-top: 1px solid var(--line); }
summary { color: var(--amber-dark); font-size: 13px; font-weight: 800; cursor: pointer; }
details[open] > form { margin-top: 18px; }
.separator { border: 0; border-top: 1px solid var(--line); margin: 25px 0; }
.workspace-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 24px; }
.workspace-nav a { color: var(--amber-dark); font-size: 13px; font-weight: 700; }
.access-panel { padding: 26px; max-width: 900px; margin: 0 auto; }
.operations-panel { padding: 26px; }
.operations-summary { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 14px; margin-top: 22px; }
.operation-card { min-height: 150px; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: #fffaf1; }
.operation-card.success { border-color: #83b99c; background: #f2fbf5; }
.operation-card.attention { border-color: #e4a45c; background: #fff7e7; }
.operation-card.danger { border-color: #df8d94; background: #fff3f3; }
.operation-card .eyebrow { margin-bottom: 10px; }
.operation-value { display: block; font-size: 21px; line-height: 1.2; }
.operation-card p:last-child { margin-bottom: 0; }
.operations-alert { margin-top: 20px; padding: 16px 18px; border: 1px solid #df8d94; border-radius: 16px; color: #7e1f27; background: #fff3f3; }
.operations-alert ul { margin: 8px 0 0; padding-left: 20px; }
.operations-ok { margin-top: 20px; padding: 13px 16px; border-radius: 14px; color: var(--success); background: #eef9f2; font-weight: 750; }
.discovery-panel { padding: 26px; }
.discovery-panel > .filters { margin-left: -6px; margin-right: -6px; box-shadow: none; background: #fff8ec99; }
.discovery-cards { display: grid; gap: 16px; }
.discovery-card { min-width: 0; padding: 22px 24px; border: 1px solid var(--line); border-radius: 20px; background: #fffaf2; }
.discovery-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.candidate-name { min-width: 0; overflow-wrap: anywhere; }
.candidate-name strong { display: block; margin-bottom: 4px; font-size: 17px; }
.discovery-card-summary { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; }
.score-value { color: var(--amber-dark); font-size: 17px; font-weight: 850; white-space: nowrap; }
.score-muted { color: var(--muted); font-size: 12px; }
.discovery-reasons { margin: 12px 0 16px; color: var(--muted); font-size: 12px; }
.discovery-brief { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.discovery-brief-item { min-width: 0; padding: 12px 14px; border-radius: 12px; background: #fff3df; overflow-wrap: anywhere; }
.discovery-brief-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 750; }
.discovery-brief-value { display: block; font-size: 13px; line-height: 1.4; }
.discovery-source { display: inline-block; margin-top: 6px; color: var(--amber-dark); font-size: 12px; font-weight: 750; }
.candidate-action { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.candidate-action button { flex: 0 0 auto; min-height: 40px; padding: 8px 14px; }
.candidate-action select { width: min(100%, 360px); }
.access-user { padding: 20px 0; border-top: 1px solid var(--line); }
.access-user h2 { margin-bottom: 6px; }
.lead-filters { margin: 20px 0 4px; padding: 14px 16px; }
.lead-filters label { max-width: 300px; }
.lead-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0 14px; }
.application-choices { border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 12px 0 20px; }
.application-choices legend { font-size: 13px; font-weight: 700; }
.check-label { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.check-label input { width: 20px; min-height: 20px; margin: 0; }
#issued-key { padding: 20px; margin: 24px 0; background: #fff3d6; border: 1px solid #f0d59e; border-radius: 16px; }
#issued-key input { font-family: monospace; margin-bottom: 12px; }

dialog { width: min(500px, 94vw); padding: 28px; border: 1px solid rgba(255, 255, 255, .88); border-radius: 26px; color: var(--ink); background: #fff8ec; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(53, 27, 13, .45); backdrop-filter: blur(4px); }
dialog .section-title { margin-bottom: 24px; }
#notice { position: fixed; z-index: 5; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: 90vw; padding: 13px 22px; border-radius: 14px; color: white; background: #351b0df0; box-shadow: var(--shadow); }

@media (max-width: 950px) {
    .operations-summary { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
    .layout { grid-template-columns: 1fr; }
    .page-title { align-items: flex-start; }
    h1 { font-size: 28px; }
    .actions { flex-wrap: wrap; }
    .discovery-card-header { flex-wrap: wrap; }
}
@media (max-width: 700px) {
    .priorities { grid-template-columns: 1fr; }
}
@media (max-width: 550px) {
    main { padding: 24px 16px 48px; }
    header { min-height: 72px; padding: 12px 16px; }
    .brand-label { display: none; }
    #session { gap: 8px; }
    #role-label { font-size: 11px; }
    .page-title, .filters { display: block; }
    .actions { justify-content: flex-start; margin-top: 14px; }
    .filters label { margin: 0 0 12px; min-width: 0; }
    .filters label:last-child { margin: 0; }
    .form-grid { grid-template-columns: 1fr; }
    .detail { padding: 20px; }
    .login { padding: 28px; }
    .section-title { gap: 8px; }
    .contact-row { flex-wrap: wrap; }
    .discovery-panel { padding: 20px; }
    .discovery-card { padding: 18px; }
    .discovery-brief { grid-template-columns: 1fr; }
    .operations-panel { padding: 20px; }
    .operations-summary { grid-template-columns: 1fr; }
}
