/* DAR Technology Tools: brand navy #12263F + orange #D28B2A, IBM Plex for UI, Inter for the wordmark. */
:root {
  --brand-navy: #12263F;
  --brand-orange: #D28B2A;
  --ink-950: #0C1B2E;
  --ink-900: #12263F;
  --ink-800: #1C3556;
  --bg: #F2F5F8;
  --surface: #FFFFFF;
  --surface-2: #F6F8FA;
  --text: #15212C;
  --text-2: #465665;
  --muted: #77868F;
  --line: #DCE3E9;
  --line-2: #C5D0D9;
  --accent: #1C4673;
  --accent-600: #12263F;
  --accent-soft: #E2EAF4;
  --accent-glow: #E09A3A;
  --ok: #1F7A48;
  --ok-bg: #E3F4EA;
  --err: #B42318;
  --err-bg: #FCE8E6;
  --warn: #9A5B00;
  --warn-bg: #FFF1D6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-1: 0 1px 2px rgba(11, 28, 42, .06), 0 1px 1px rgba(11, 28, 42, .04);
  --shadow-2: 0 10px 30px -12px rgba(11, 28, 42, .28), 0 2px 6px rgba(11, 28, 42, .06);
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; font-weight: 700; margin: 0 0 .35rem; }
h2 { font-size: 1.1rem; font-weight: 600; margin: 0 0 1rem; display: flex; align-items: center; gap: 8px; }
h2 .ico { width: 20px; height: 20px; color: var(--accent); }
.muted { color: var(--muted); }
.lead { margin: 0 0 1.5rem; }
code { font-family: var(--mono); font-size: .88em; background: #EBF0F4; padding: 1px 6px; border-radius: 4px; }
.ico { width: 1em; height: 1em; flex: none; }

/* Blueprint grid used on dark surfaces */
.blueprint {
  background-color: var(--ink-900);
  background-image:
    radial-gradient(1100px 380px at 88% -10%, rgba(210, 139, 42, .16), transparent 60%),
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 100% 100%, 28px 28px, 28px 28px;
  background-position: 0 0, -1px -1px, -1px -1px;
}
.eyebrow {
  font-family: var(--mono); font-size: .74rem; font-weight: 500; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent-glow); margin: 0 0 .6rem;
}

/* Logo: DAR Technology wordmark */
.logo { display: inline-flex; align-items: center; text-decoration: none; color: #fff; }
.brand { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1; color: #fff; font-family: "Inter", "Segoe UI", Arial, sans-serif; }
.brand-dar { font-weight: 800; font-size: 25px; letter-spacing: .01em; }
.brand-sub { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-weight: 600; font-size: 7.4px; letter-spacing: .44em; }
.brand-sub i { display: block; width: 12px; height: 2.5px; background: var(--brand-orange); }
.brand.lg .brand-dar { font-size: 56px; }
.brand.lg .brand-sub { gap: 12px; margin-top: 10px; font-size: 14.5px; }
.brand.lg .brand-sub i { width: 28px; height: 5px; }
.product {
  margin-left: 16px; padding: 4px 0 4px 16px; border-left: 1px solid rgba(255, 255, 255, .2);
  font-family: var(--mono); font-size: .72rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
}

/* Top bar */
.topbar { background: var(--ink-950); border-bottom: 1px solid rgba(255, 255, 255, .07); position: sticky; top: 0; z-index: 20; }
.topbar-inner {
  max-width: 1160px; margin: 0 auto; padding: 0 24px; height: 62px;
  display: flex; align-items: center; gap: 28px;
}
.topbar-inner.wide { max-width: none; }
.mainnav { display: flex; gap: 4px; height: 100%; }
.mainnav a {
  display: flex; align-items: center; padding: 0 12px; color: rgba(255, 255, 255, .68);
  text-decoration: none; font-weight: 500; font-size: .93rem; position: relative;
}
.mainnav a:hover { color: #fff; }
.mainnav a.on { color: #fff; }
.mainnav a.on::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px;
  background: var(--accent-glow); border-radius: 2px 2px 0 0;
}
.userbox { margin-left: auto; display: flex; align-items: center; gap: 10px; color: rgba(255, 255, 255, .85); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink-800); border: 1px solid rgba(255, 255, 255, .14);
  font-size: .75rem; font-weight: 600; color: #fff;
}
.username { font-size: .9rem; font-weight: 500; }
.signout {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; padding: 7px 10px;
  background: transparent; border: 1px solid rgba(255, 255, 255, .16); border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, .8); font: inherit; font-size: .85rem; cursor: pointer;
}
.signout:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.signout .ico { width: 16px; height: 16px; }
.inline { display: inline; margin: 0; }

/* Hero band */
.hero { color: #fff; }
.hero-inner { max-width: 1160px; margin: 0 auto; padding: 44px 24px 96px; }
.hero h1 { font-size: 2.1rem; color: #fff; margin: 0; }
.hero-text { color: rgba(255, 255, 255, .7); margin: .6rem 0 0; font-size: 1.02rem; }

/* Page container */
main.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 32px 24px 40px; flex: 1; }
main.container.lift { margin-top: -64px; padding-top: 0; }
main.container.wide { max-width: none; padding: 16px 20px 0; }
.foot {
  width: 100%; max-width: 1160px; margin: 0 auto; padding: 22px 24px 28px;
  display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .84rem;
}
.foot.wide { max-width: none; padding: 12px 20px 16px; }
.foot a { color: inherit; text-decoration: none; }
.foot a:hover { color: var(--accent); }

/* Tool cards */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.tool-card {
  --tool: var(--accent);
  position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 230px;
  padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); text-decoration: none; color: inherit; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tool-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--tool);
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--tool) 45%, var(--line)); }
.tool-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--tool) 45%, transparent); outline-offset: 2px; }
.tool-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tool-icon {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px;
  color: var(--tool, var(--accent)); background: color-mix(in srgb, var(--tool, var(--accent)) 11%, #fff);
  border: 1px solid color-mix(in srgb, var(--tool, var(--accent)) 22%, #fff);
}
.tool-icon .ico { width: 28px; height: 28px; }
.tool-icon.small { width: 40px; height: 40px; border-radius: 10px; }
.tool-icon.small .ico { width: 22px; height: 22px; }
.tag {
  font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line);
  padding: 3px 8px; border-radius: 999px; white-space: nowrap;
}
.tool-name { font-size: 1.12rem; font-weight: 600; color: var(--text); }
.tool-desc { color: var(--text-2); font-size: .93rem; flex: 1; }
.tool-open {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding-top: 14px;
  border-top: 1px solid var(--line); font-weight: 600; font-size: .9rem; color: var(--tool);
}
.tool-open .ico { width: 16px; height: 16px; transition: transform .18s ease; }
.tool-card:hover .tool-open .ico { transform: translateX(4px); }

/* Tool page header */
.tool-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.tool-head-text { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tool-head h1 { font-size: 1.15rem; margin: 0; }
.back {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm);
  color: var(--text-2); border: 1px solid var(--line); text-decoration: none;
}
.back:hover { color: var(--accent); border-color: var(--accent); }
.back .ico { width: 18px; height: 18px; }
.push { margin-left: auto; }
.app-frame {
  display: block; width: 100%; height: calc(100vh - 62px - 16px - 66px - 14px - 52px); min-height: 560px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-1);
}

/* Cards, panels, grid */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-1); }
.card.narrow { max-width: 520px; margin-top: 24px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* Forms */
label { display: block; font-weight: 500; font-size: .88rem; color: var(--text-2); margin-bottom: 16px; }
input, select {
  display: block; width: 100%; margin-top: 6px; height: 44px; padding: 0 13px; font: inherit; font-size: .95rem;
  color: var(--text); background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover { border-color: #A9B6C1; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(28, 70, 115, .18); }
input:disabled { background: var(--surface-2); color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px;
  background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; font-size: .93rem; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--accent-600); border-color: var(--accent-600); }
.btn:focus-visible { outline: 3px solid rgba(210, 139, 42, .45); outline-offset: 2px; }
.btn .ico { width: 16px; height: 16px; }
.btn.full { width: 100%; }
.btn.small { height: 32px; padding: 0 11px; font-size: .82rem; font-weight: 500; }
.btn.ghost { background: #fff; color: var(--text); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--surface-2); border-color: #A9B6C1; color: var(--accent); }
.btn.danger { background: #fff; color: var(--err); border-color: #F1C3BE; }
.btn.danger:hover { background: var(--err-bg); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }

.alert { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: .92rem; border: 1px solid transparent; }
.alert.success { background: var(--ok-bg); color: var(--ok); border-color: #BFE3CD; }
.alert.error { background: var(--err-bg); color: var(--err); border-color: #F3C7C2; }
main.container.lift > .alert { box-shadow: var(--shadow-1); }

/* Auth layout */
body.auth { background: var(--surface); }
.auth-shell { display: grid; grid-template-columns: minmax(380px, 46%) 1fr; min-height: 100vh; }
.auth-aside { color: #fff; padding: 40px 64px; display: flex; flex-direction: column; }
/* Logo + pitch sit together, centred vertically; copyright pinned to the bottom */
.auth-aside > .logo { margin-top: auto; }
.auth-pitch { max-width: 460px; margin-top: 56px; }
.aside-foot { margin-top: auto !important; padding-top: 40px; }
.auth-pitch h2 { display: block; font-size: 2rem; font-weight: 600; line-height: 1.2; margin: 0 0 28px; color: #fff; }
.pitch-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.pitch-list li { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, .85); font-weight: 500; }
.pitch-icon {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); color: var(--accent-glow);
}
.pitch-icon .ico { width: 19px; height: 19px; }
.aside-foot { margin: 0; color: rgba(255, 255, 255, .45); font-size: .82rem; }
.auth-main { display: grid; place-items: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 1.7rem; }
.links { font-size: .9rem; margin-top: 20px; color: var(--muted); }
.links a { font-weight: 500; text-decoration: none; }
.links a:hover { text-decoration: underline; }

/* Admin */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tabs > a {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text-2); font-size: .88rem; font-weight: 500; border: 1px solid transparent;
}
.tabs > a:hover { color: var(--text); background: #fff; border-color: var(--line); }
.tabs > a.on { background: #fff; color: var(--accent); border-color: var(--line-2); box-shadow: var(--shadow-1); }
.pill { font-family: var(--mono); font-size: .72rem; padding: 1px 7px; border-radius: 999px; background: #E6ECF1; color: var(--text-2); }
.tabs > a.on .pill { background: var(--accent-soft); color: var(--accent-600); }
.tabs .search { margin-left: auto; min-width: 260px; }
.tabs .search input { margin: 0; height: 36px; }
.table-wrap { overflow-x: auto; }
.panel .table-wrap { border: 0; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; background: #fff; }
tbody tr:hover td { background: #FAFBFC; }
tr:last-child td { border-bottom: 0; }
td.actions form { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
td a { text-decoration: none; font-weight: 500; }
td a:hover { text-decoration: underline; }
td a.btn:hover { text-decoration: none; }

/* Admin working inside a customer's projects */
.viewing-as {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 10px 14px; border-radius: var(--radius);
  background: #FFF4E3; border: 1px solid #F0D3A6; color: #7A4B0E; font-size: .9rem;
}
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; text-transform: capitalize; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.active { background: var(--ok-bg); color: var(--ok); }
.status.pending { background: var(--warn-bg); color: var(--warn); }
.status.disabled { background: #ECEFF3; color: var(--muted); }

/* Quote tool */
.quote-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; align-items: center; }
.quote-head input { display: inline-block; width: auto; min-width: 240px; margin-left: 8px; }
.quote .table-wrap { margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.quote td input { margin: 0; height: 38px; }
.num { text-align: right; }
td.num input { text-align: right; max-width: 140px; margin-left: auto; }
.totals { max-width: 360px; margin-left: auto; margin-top: 20px; }
.totals label { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.totals label input { width: 120px; margin: 0; height: 38px; text-align: right; }
.totals div { display: flex; justify-content: space-between; padding: 6px 0; color: var(--text-2); }
.totals b { font-family: var(--mono); font-weight: 500; color: var(--text); }
.totals .grand { border-top: 2px solid var(--text); margin-top: 8px; padding-top: 10px; font-size: 1.1rem; color: var(--text); font-weight: 600; }

@media print {
  .topbar, .hero, .foot, .no-print, .tool-head { display: none !important; }
  main.container.lift { margin-top: 0; }
  body { background: #fff; }
  .card, .table-wrap { border: 0; padding: 0; box-shadow: none; }
  input { border: 0; padding: 0; height: auto; }
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { padding: 22px 24px; }
  .auth-aside > .logo { margin-top: 0; }
  .auth-pitch { margin-top: 18px; }
  .auth-pitch h2 { font-size: 1.35rem; margin-bottom: 0; }
  .pitch-list, .aside-foot { display: none; }
  .auth-main { place-items: start center; padding: 32px 20px; }
}
@media (max-width: 960px) {
  .username, .signout span { display: none; }
}
@media (max-width: 720px) {
  .topbar-inner { padding: 0 16px; gap: 14px; height: 56px; }
  .product { display: none; }
  .brand.lg .brand-dar { font-size: 40px; }
  .brand.lg .brand-sub { font-size: 10.5px; gap: 9px; margin-top: 7px; }
  .brand.lg .brand-sub i { width: 20px; height: 4px; }
  .mainnav a { padding: 0 9px; }
  .hero-inner { padding: 30px 16px 84px; }
  .hero h1 { font-size: 1.6rem; }
  main.container { padding-left: 16px; padding-right: 16px; }
  .tool-grid { grid-template-columns: 1fr; }
  .tabs .search { margin-left: 0; width: 100%; min-width: 0; }
  .foot { padding-left: 16px; padding-right: 16px; }
  .app-frame { height: calc(100vh - 200px); }
}
@media (max-width: 560px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 10px; row-gap: 4px; }
  .mainnav { order: 3; width: 100%; height: 42px; margin-left: -9px; }
  .avatar { display: none; }
}
