@font-face {
  font-family: "Archivo";
  src: url("../assets/fonts/archivo-var.woff2") format("woff2-variations"), url("../assets/fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
:root {
  --asphalt: #1d1e20; --asphalt-2: #2a2c2f; --concrete: #eeede9; --line: #dcdbd6;
  --white: #fff; --yellow: #f5b50a; --laterite: #a4512f; --steel: #6b6c70; --ok: #2f6b4f;
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --side: 248px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--asphalt); background: var(--concrete); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.muted { color: var(--steel); }
h1, h2 { margin: 0; font-weight: 800; font-variation-settings: "wdth" 118; letter-spacing: -.01em; line-height: 1.1; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.3rem; }

/* buttons */
.abtn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 42px; padding: 0 1rem; border-radius: 4px; font-weight: 700; font-variation-settings: "wdth" 108; background: var(--asphalt); color: var(--white); transition: background .2s, color .2s, opacity .2s; text-decoration: none; white-space: nowrap; }
.abtn:hover { background: #000; }
.abtn--yellow { background: var(--yellow); color: var(--asphalt); }
.abtn--yellow:hover { background: #e0a300; }
.abtn--ghost { background: transparent; color: var(--asphalt); box-shadow: inset 0 0 0 1.5px var(--line); }
.abtn--ghost:hover { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--asphalt); }
.abtn--danger { background: transparent; color: var(--laterite); box-shadow: inset 0 0 0 1.5px currentColor; }
.abtn--danger:hover { background: var(--laterite); color: var(--white); }
.abtn--full { width: 100%; min-height: 50px; }
.abtn.is-busy { opacity: .6; pointer-events: none; }
.abtn svg { width: 18px; height: 18px; }
.iconbtn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
.iconbtn:hover { background: var(--concrete); }
.iconbtn svg { width: 20px; height: 20px; }

/* fields */
.fld { display: grid; gap: .35rem; margin-bottom: 1rem; }
.fld > span { font-weight: 600; font-size: .9rem; }
.fld > span small { font-weight: 400; color: var(--steel); }
.fld input, .fld select, .fld textarea, .vhead__tools input, .vhead__tools select {
  width: 100%; min-height: 44px; padding: .6rem .8rem; border: 1.5px solid var(--line); border-radius: 4px; background: var(--white);
}
.fld textarea { min-height: 110px; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .vhead__tools input:focus, .vhead__tools select:focus { outline: none; border-color: var(--asphalt); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.check { display: flex; align-items: center; gap: .6rem; font-weight: 600; margin-bottom: .75rem; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--asphalt); }
.err { color: var(--laterite); font-weight: 600; min-height: 1.2em; margin: 0 0 .75rem; font-size: .92rem; }

/* login */
.login { min-height: 100svh; display: grid; place-items: center; padding: 1.5rem; background: var(--asphalt); background-image: repeating-linear-gradient(-45deg, transparent 0 28px, rgba(245, 181, 10, .05) 28px 56px); }
.login__card { width: min(420px, 100%); background: var(--white); padding: 2.25rem; border-top: 6px solid var(--yellow); border-radius: 4px; }
.login__logo { width: 120px; margin-bottom: 1.5rem; }
.login h1 { margin-bottom: .35rem; }
.login p.muted { margin: 0 0 1.75rem; }
.back { display: inline-block; margin-top: 1.25rem; color: var(--steel); font-size: .92rem; }

/* layout */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100svh; }
.side { background: var(--asphalt); color: var(--white); padding: 1.5rem 1rem; display: flex; flex-direction: column; gap: 2rem; position: sticky; top: 0; height: 100svh; }
.side__brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; padding: 0 .5rem; }
.side__brand img { height: 40px; width: auto; }
.side__brand span { font-weight: 800; font-variation-settings: "wdth" 120; color: #a3a4a7; }
.side__nav { display: grid; gap: .25rem; }
.side__nav button { display: flex; align-items: center; gap: .75rem; padding: .75rem .75rem; border-radius: 4px; font-weight: 600; color: #c9cacc; text-align: left; }
.side__nav button svg { width: 20px; height: 20px; flex: none; }
.side__nav button:hover { background: var(--asphalt-2); color: var(--white); }
.side__nav button[aria-current="page"] { background: var(--asphalt-2); color: var(--white); box-shadow: inset 3px 0 0 var(--yellow); }
.count { margin-left: auto; background: var(--yellow); color: var(--asphalt); font-size: .78rem; min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 11px; padding: 0 6px; }
.side__foot { margin-top: auto; display: grid; gap: .25rem; }
.side__foot a, .side__foot button { padding: .6rem .75rem; color: #a3a4a7; text-decoration: none; text-align: left; border-radius: 4px; font-weight: 500; }
.side__foot a:hover, .side__foot button:hover { color: var(--white); background: var(--asphalt-2); }

.main { padding: 2rem clamp(1rem, 3vw, 2.5rem) 4rem; min-width: 0; }
.linkbtn { display: block; margin: 1rem auto 0; color: var(--steel); font-size: .92rem; text-decoration: underline; }
.ok { color: #2f6b3a; font-weight: 600; margin: 0 0 .75rem; font-size: .92rem; }
.linkbtn { display: block; margin: 1rem auto 0; color: var(--steel); font-size: .92rem; text-decoration: underline; }
.ok { color: #2f6b3a; font-weight: 600; margin: 0 0 .75rem; font-size: .92rem; }
.linkbtn { display: block; margin: 1rem auto 0; color: var(--steel); font-size: .92rem; text-decoration: underline; }
.ok { color: #2f6b3a; font-weight: 600; margin: 0 0 .75rem; font-size: .92rem; }
.vhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.vhead p { margin: .3rem 0 0; }
.vhead__tools { display: flex; gap: .5rem; flex-wrap: wrap; }
.vhead__tools input { width: 260px; }
.vhead__tools select { width: auto; }

/* enquiries table */
.table { background: var(--white); border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.tr { display: grid; grid-template-columns: 110px 1.2fr 1.2fr 1fr 120px; gap: 1rem; align-items: center; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.tr:last-child { border-bottom: 0; }
.tr--head { background: #f7f7f5; font-size: .82rem; font-weight: 700; color: var(--steel); padding-block: .7rem; }
button.tr:hover { background: #fafaf7; }
.tr .nm { font-weight: 700; }
.tr .sub { display: block; font-size: .85rem; color: var(--steel); font-weight: 400; }
.tr.is-new .nm::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); margin-right: .5rem; vertical-align: middle; }
.status { display: inline-block; font-size: .8rem; font-weight: 700; padding: .25rem .55rem; border-radius: 3px; background: var(--concrete); }
.status--new { background: var(--yellow); }
.status--contacted { background: #dbe6f3; }
.status--quoted { background: #ece1f5; }
.status--won { background: #d6ebdf; color: var(--ok); }
.status--closed { background: #ececea; color: var(--steel); }
.empty { padding: 3rem 1.5rem; text-align: center; }
.empty h3 { margin: 0 0 .4rem; }
.empty p { margin: 0; color: var(--steel); }

/* projects grid */
.pgrid-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.pa { background: var(--white); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; }
.pa__img { aspect-ratio: 16 / 10; background: var(--asphalt); position: relative; }
.pa__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pa__img .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: #a3a4a7; font-size: .9rem; background-image: repeating-linear-gradient(-45deg, transparent 0 16px, rgba(245, 181, 10, .08) 16px 32px); }
.pa__tags { position: absolute; left: .6rem; top: .6rem; display: flex; gap: .35rem; }
.pa__tags span { background: var(--white); font-size: .75rem; font-weight: 700; padding: .2rem .45rem; border-radius: 3px; }
.pa__tags .t-draft { background: var(--laterite); color: var(--white); }
.pa__tags .t-feat { background: var(--yellow); }
.pa__body { padding: 1rem; flex: 1; }
.pa__body strong { display: block; font-variation-settings: "wdth" 110; line-height: 1.25; }
.pa__body span { color: var(--steel); font-size: .88rem; }
.pa__foot { display: flex; gap: .5rem; padding: 0 1rem 1rem; }
.pa__foot .abtn { flex: 1; min-height: 38px; }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(15, 16, 17, .45); z-index: 80; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100%); background: var(--white); z-index: 90; display: flex; flex-direction: column; box-shadow: -20px 0 50px rgba(0, 0, 0, .15); animation: slideIn .35s cubic-bezier(.2, .7, .1, 1); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
.drawer__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--line); }
.drawer__body { padding: 1.5rem; overflow-y: auto; flex: 1; }
.drawer__foot { padding: 1rem 1.5rem; border-top: 1px solid var(--line); display: flex; gap: .5rem; justify-content: space-between; flex-wrap: wrap; }
.drawer__foot .right { display: flex; gap: .5rem; margin-left: auto; }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: .6rem 1rem; margin: 0 0 1.5rem; }
.kv dt { color: var(--steel); font-size: .9rem; }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.msgbox { background: var(--concrete); padding: 1rem; border-radius: 4px; white-space: pre-wrap; margin-bottom: 1.5rem; }
.quick { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }

.cover { aspect-ratio: 16 / 9; background: var(--concrete); border-radius: 4px; overflow: hidden; margin-bottom: .6rem; position: relative; display: grid; place-items: center; color: var(--steel); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; margin-bottom: .75rem; }
.gal__item { position: relative; aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: var(--concrete); }
.gal__item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gal__item.is-cover { box-shadow: 0 0 0 3px var(--yellow); }
.gal__ctrl { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; background: linear-gradient(0deg, rgba(0, 0, 0, .7), transparent); padding: .25rem; }
.gal__ctrl button { width: 28px; height: 28px; display: grid; place-items: center; color: #fff; border-radius: 3px; font-size: .8rem; font-weight: 700; }
.gal__ctrl button:hover { background: rgba(255, 255, 255, .2); }
.gal__ctrl svg { width: 16px; height: 16px; }
.upload { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.upload input { display: none; }
.hint { font-size: .85rem; color: var(--steel); margin: -.4rem 0 1rem; }
.sect { font-size: .82rem; font-weight: 700; color: var(--steel); margin: 1.5rem 0 .75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 200%); visibility: hidden; background: var(--asphalt); color: var(--white); padding: .8rem 1.2rem; border-radius: 4px; font-weight: 600; z-index: 100; transition: transform .35s cubic-bezier(.2, .7, .1, 1); max-width: calc(100% - 2rem); }
.toast.on { transform: translate(-50%, 0); visibility: visible; }
.toast.is-err { background: var(--laterite); }

/* responsive */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: .4rem; gap: 0; z-index: 70; }
  .side__brand, .side__foot a { display: none; }
  .side__nav { grid-auto-flow: column; flex: 1; }
  .side__nav button { justify-content: center; flex-direction: column; gap: .15rem; font-size: .78rem; padding: .5rem; position: relative; }
  .side__nav button[aria-current="page"] { box-shadow: inset 0 3px 0 var(--yellow); }
  .count { position: absolute; top: 4px; right: calc(50% - 26px); margin: 0; }
  .side__foot { margin: 0; display: flex; }
  .side__foot button { font-size: .78rem; padding: .5rem .75rem; align-self: center; }
  .main { padding-bottom: 6rem; }
  .demo { display: block; }
  .demo button { display: block; margin-top: .4rem; }
  .toast { bottom: 5.5rem; }
  .vhead__tools, .vhead__tools input { width: 100%; }
  .vhead__tools input { flex: 1 1 100%; }
  .tr { grid-template-columns: 1fr auto; gap: .25rem 1rem; }
  .tr--head { display: none; }
  .tr > :nth-child(1) { grid-column: 1 / -1; order: 3; font-size: .82rem; color: var(--steel); }
  .tr > :nth-child(3), .tr > :nth-child(4) { grid-column: 1; font-size: .88rem; color: var(--steel); }
  .tr > :nth-child(5) { grid-column: 2; grid-row: 1; }
  .row2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: .1rem; }
  .kv dd { margin-bottom: .6rem; }
}
