/* Employee portal: shares the main site's palette and type. */
:root {
  --ink-950: #0a1320;
  --ink-900: #0f1b2a;
  --ink-800: #172638;
  --ink-700: #22344a;
  --ink-300: #a3b0c2;
  --paper: #fbf9f6;
  --paper-2: #f3eee7;
  --line: #e5ded3;
  --copper-300: #e7a86b;
  --copper-400: #d98d4a;
  --copper-500: #c2733a;
  --copper-600: #a35c2b;
  --text: #1b2533;
  --muted: #5b6676;
  --danger: #b03a26;
  --ok: #1f7a4d;
  --white: #fff;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 10px 30px -12px rgba(15, 27, 42, .22);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--paper); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }
a { color: var(--copper-600); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--paper-2); padding: 2px 6px; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--copper-400); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spacer { flex: 1; }

.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--copper-600); margin-bottom: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .7em 1.2em; border-radius: 999px; border: 1.5px solid transparent;
  font: inherit; font-weight: 700; font-size: .92rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.btn svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn--sm { padding: .45em .9em; font-size: .82rem; }
.btn--block { width: 100%; }
.btn--copper { background: var(--copper-500); color: var(--white); }
.btn--copper:hover { background: var(--copper-600); }
.btn--quiet { background: var(--white); color: var(--ink-800); border-color: var(--line); }
.btn--quiet:hover { border-color: #cbbfae; background: var(--paper); }
.btn--danger-quiet { background: transparent; color: var(--danger); border-color: #ecc9c1; }
.btn--danger-quiet:hover { background: #fbeeea; }

.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--white); cursor: pointer; color: var(--ink-800); }
.icon-btn:hover { background: var(--paper); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Forms ---------- */
.stack { display: grid; gap: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: grid; gap: 6px; font-size: .82rem; font-weight: 700; color: var(--ink-700); }
label .muted { font-weight: 500; }
input, select, textarea {
  font: inherit; font-size: 1rem; font-weight: 500; color: var(--text); width: 100%;
  padding: 11px 13px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper);
}
input[type="color"] { padding: 4px; height: 46px; cursor: pointer; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--copper-400); background: var(--white); box-shadow: 0 0 0 4px rgba(217, 141, 74, .18); }
select:disabled { opacity: .6; }
.form-error { color: var(--danger); font-weight: 600; font-size: .9rem; min-height: 1em; }
.form-error:empty { display: none; }

.alert { padding: 12px 16px; border-radius: 10px; font-weight: 600; font-size: .92rem; margin-bottom: 16px; border: 1px solid; }
.alert--ok { background: #ebf6ef; color: var(--ok); border-color: #c4e3d1; }
.alert--error { background: #fbeeea; color: var(--danger); border-color: #efcbc2; }
.alert--link { background: #fdf6ef; color: var(--ink-800); border-color: #ecd6c0; }
.linkbox { display: block; margin-top: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; padding: 8px 10px; background: var(--white); }
.tag--pending { margin-top: 4px; background: #eef2f7; color: var(--ink-700); font-size: .7rem; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--white); }
.brand__mark { width: 36px; height: 36px; color: #e9edf3; flex-shrink: 0; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.brand__sub { font-size: .62rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--copper-300); margin-top: 4px; }

/* ---------- Auth pages ---------- */
.auth__wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1fr) minmax(360px, 1.1fr); }
.auth__side {
  background: radial-gradient(800px 500px at 0% 100%, rgba(194, 115, 58, .28), transparent 60%), var(--ink-900);
  color: #d3dbe5; padding: 40px clamp(24px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.auth__pitch { max-width: 420px; }
.auth__pitch .eyebrow { color: var(--copper-300); }
.auth__pitch h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.8rem, 3.2vw, 2.6rem); color: var(--white); margin: 6px 0 14px; letter-spacing: -.01em; }
.auth__pitch p { color: var(--ink-300); font-size: 1rem; }
.auth__foot { font-size: .8rem; color: #7d8ba0; }
.auth__panel { display: grid; place-items: center; padding: 40px 20px; }
.auth__card { width: 100%; max-width: 400px; display: grid; gap: 16px; }
.auth__card h1 { font-family: var(--font-display); font-weight: 600; font-size: 2rem; color: var(--ink-900); }
.auth__card .alert { margin: 0; }

/* ---------- App shell ---------- */
.appbar { background: var(--ink-900); color: var(--white); position: sticky; top: 0; z-index: 20; }
.appbar__inner { max-width: 1320px; margin: 0 auto; padding: 0 20px; min-height: 64px; display: flex; align-items: center; gap: 28px; }
.appnav { display: flex; gap: 4px; flex: 1; }
.appnav a { display: inline-flex; align-items: center; white-space: nowrap; color: #c8d1dc; text-decoration: none; font-weight: 600; font-size: .92rem; padding: 8px 14px; border-radius: 999px; }
.appnav a:hover { color: var(--white); background: rgba(255, 255, 255, .06); }
.appnav a[aria-current="page"] { color: var(--white); background: rgba(255, 255, 255, .1); }
.appbar__user { display: flex; align-items: center; gap: 10px; }
.appbar__name { font-weight: 600; font-size: .9rem; }
.appbar .btn--quiet { background: transparent; color: #c8d1dc; border-color: var(--ink-700); }
.appbar .btn--quiet:hover { color: var(--white); border-color: #3a4f69; }

.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .75rem; font-weight: 700; color: var(--white); background: var(--ink-700); flex-shrink: 0; }

.app { max-width: 1320px; margin: 0 auto; padding: 28px 20px 60px; }
.app--narrow { max-width: 640px; }
.app__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.app__title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.8rem, 3vw, 2.3rem); color: var(--ink-900); letter-spacing: -.01em; }
.app__head .muted { margin-top: 6px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.panel { padding: 20px; }
.side { display: grid; gap: 18px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel__head h2 { font-size: 1rem; color: var(--ink-900); }

/* ---------- Calendar ---------- */
.cal { padding: 18px; }
.cal__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cal__nav { display: flex; align-items: center; gap: 8px; }
.cal__month { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; color: var(--ink-900); margin-left: 8px; }
.cal__dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-bottom: 8px; }
.cal__grid { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; user-select: none; -webkit-user-select: none; }
.cal__grid[aria-busy="true"] { opacity: .6; }
.cal__row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal__row + .cal__row { border-top: 1px solid var(--line); }
.cal__hint { margin-top: 10px; font-size: .8rem; color: var(--muted); }

.day { min-height: 112px; padding: 6px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; background: var(--white); transition: background-color .12s ease; min-width: 0; }
.day + .day { border-left: 1px solid var(--line); }
.day:hover { background: #fdfaf6; }
.day--weekend { background: #fcfbf9; }
.day--out { background: var(--paper); }
.day--out .day__num { color: #a9b1bc; }
.day--selected { background: #fdf3ea; box-shadow: inset 0 0 0 2px var(--copper-400); }
.day--drag { background: #fbe7d5 !important; }
.day__num {
  align-self: flex-start; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 999px; border: 0; background: transparent;
  font: inherit; font-weight: 700; font-size: .85rem; color: var(--ink-800); cursor: pointer;
}
.day__num:hover { background: var(--paper-2); }
.day--today .day__num { background: var(--ink-900); color: var(--white); }
.day__chips { display: grid; gap: 3px; min-width: 0; }
.chip {
  --c: var(--ink-700);
  display: block; min-width: 0; width: 100%;
  padding: 3px 7px; border: 0; border-left: 3px solid var(--c); border-radius: 4px;
  background: color-mix(in srgb, var(--c) 14%, white); color: var(--ink-900);
  font: inherit; font-size: .74rem; text-align: left; cursor: pointer; line-height: 1.3;
}
.chip:hover { background: color-mix(in srgb, var(--c) 24%, white); }
.chip--mine { background: color-mix(in srgb, var(--c) 26%, white); }
.chip__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.more { border: 0; background: none; padding: 2px 4px; font: inherit; font-size: .74rem; font-weight: 700; color: var(--copper-600); text-align: left; cursor: pointer; }
.day__dots { display: none; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.list__item { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.list__item + .list__item { border-top: 1px solid var(--line); }
.list__text { flex: 1; min-width: 0; display: grid; }
.list__text strong { font-size: .92rem; color: var(--ink-900); }
.list__text span { font-size: .82rem; color: var(--muted); }
.list__empty { color: var(--muted); font-size: .9rem; padding: 6px 0; }
.swatch { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--ink-700); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .88rem; }
.legend li { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Modal ---------- */
.modal { border: 0; padding: 0; border-radius: var(--radius-lg); width: min(480px, calc(100vw - 24px)); box-shadow: 0 30px 80px -20px rgba(10, 19, 32, .5); color: var(--text); }
.modal::backdrop { background: rgba(10, 19, 32, .55); backdrop-filter: blur(2px); }
.modal__body { padding: 22px; display: grid; gap: 16px; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal__head h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; color: var(--ink-900); }
.modal__foot { display: flex; align-items: center; gap: 10px; padding-top: 4px; }
.view__range { font-size: 1.15rem; font-weight: 700; color: var(--ink-900); }

/* ---------- Admin table ---------- */
.layout--admin { grid-template-columns: minmax(0, 1fr) 340px; }
.table-wrap { overflow: visible; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 14px 16px; border-bottom: 1px solid var(--line); }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-inactive td { opacity: .55; }
.table tr.is-inactive td.table__actions { opacity: 1; }
.table__actions { text-align: right; position: relative; }
.person { display: inline-flex; align-items: center; gap: 12px; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--paper-2); font-size: .78rem; font-weight: 700; color: var(--ink-700); }
.tag--admin { background: #fbe9d9; color: var(--copper-600); }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--muted); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #b8c0cb; }
.status--on { color: var(--ok); }
.status--on::before { background: #2fa36b; }
.manage summary { list-style: none; }
.manage summary::-webkit-details-marker { display: none; }
.manage__panel {
  position: absolute; right: 16px; top: calc(100% - 8px); z-index: 5; width: 320px; text-align: left;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
}
.manage__danger { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Quote requests ---------- */
.app--medium { max-width: 920px; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--copper-500); color: var(--white); font-size: .72rem; font-weight: 700; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--paper-2); border-radius: 999px; }
.tabs a { text-decoration: none; color: var(--ink-700); font-weight: 600; font-size: .88rem; padding: 7px 14px; border-radius: 999px; }
.tabs a[aria-current="page"] { background: var(--white); color: var(--ink-900); box-shadow: 0 1px 3px rgba(15, 27, 42, .12); }
.tabs__n { color: var(--muted); font-weight: 500; }
.quotes { display: grid; gap: 16px; }
.quote { padding: 20px 22px; display: grid; gap: 14px; }
.quote--handled { background: #fdfcfa; }
.quote__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.quote__head h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; color: var(--ink-900); }
.quote__head .muted { margin-top: 4px; }
.quote__head .muted .tag { font-size: .74rem; padding: 2px 8px; }
.quote__contact { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 28px; }
.quote__contact li { display: grid; }
.quote__contact span { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.quote__contact a { font-weight: 700; color: var(--ink-900); text-decoration: none; overflow-wrap: anywhere; }
.quote__contact a:hover { color: var(--copper-600); text-decoration: underline; }
.quote__msg { white-space: pre-wrap; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.quote__files { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; }
.quote__thumb { display: block; width: 120px; height: 120px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.quote__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s ease; }
.quote__thumb:hover img { transform: scale(1.05); }
.quote__filechip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); font-weight: 600; font-size: .88rem; text-decoration: none; color: var(--ink-800); }
.quote__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; }
.quote__actions { display: flex; gap: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .layout, .layout--admin { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .appbar__inner { flex-wrap: wrap; gap: 8px 16px; padding: 10px 16px; }
  .appbar__name { display: none; }
  .appnav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .appbar__user { margin-left: auto; }
  .app { padding: 20px 16px 48px; }
  .auth__wrap { grid-template-columns: 1fr; }
  .auth__side { padding: 24px 16px; gap: 20px; }
  .auth__pitch { display: none; }
  .auth__foot { display: none; }
  .row2 { grid-template-columns: 1fr; }
  .manage__panel { position: static; width: auto; margin-top: 10px; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table td { padding: 4px 0; border: 0; }
  .table__actions { text-align: left; }
  .table td:nth-child(2), .table td:nth-child(3), .table td:nth-child(4) { display: inline-block; margin: 6px 10px 2px 0; }
  .table td:first-child { padding-bottom: 2px; }
}

@media (max-width: 640px) {
  .cal { padding: 12px; }
  .cal__month { font-size: 1.15rem; margin-left: 4px; }
  .cal__hint { display: none; }
  .day { min-height: 58px; padding: 4px 2px; align-items: center; }
  .day__num { align-self: center; font-size: .8rem; min-width: 26px; height: 26px; }
  .day__chips { display: none; }
  .day__dots { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; }
  .day__dots span { width: 7px; height: 7px; border-radius: 50%; }
}
