/* Clean, airy layout (monday.com-inspired) in Western Borders colors:
   Dark Navy for headings, hero colors as small accents, Growth Green for actions. */
:root {
  --navy: #073763; --red: #fc6e51; --blue: #579bfc; --orange: #ffba00; --green: #00cc70;
  --bg: #f6f7fb; --surface: #ffffff; --text: #323338; --heading: #073763; --muted: #676879;
  --line: #e6e9ef; --hover: #f5f6f8; --error: #d83a52;
  --shadow: 0 4px 12px rgba(29,38,56,.06);
  --shadow-hover: 0 8px 24px rgba(29,38,56,.12);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #181b34; --surface: #20253f; --text: #d5d8df; --heading: #ffffff; --muted: #9699a6;
    --line: #363b57; --hover: #2a3050; --error: #ff7a8a;
    --shadow: 0 4px 12px rgba(0,0,0,.25); --shadow-hover: 0 8px 24px rgba(0,0,0,.4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #181b34; --surface: #20253f; --text: #d5d8df; --heading: #ffffff; --muted: #9699a6;
  --line: #363b57; --hover: #2a3050; --error: #ff7a8a;
  --shadow: 0 4px 12px rgba(0,0,0,.25); --shadow-hover: 0 8px 24px rgba(0,0,0,.4); color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; }
h1, h2 { color: var(--heading); font-weight: 700; text-wrap: balance; letter-spacing: -.01em; }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 1120px; margin: 0 auto; padding-block: 8px 72px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* Header: white bar, logo left, account right */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1120px; margin: 0 auto; height: 60px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand img { height: 32px; width: auto; display: block; }
.brand span { font-weight: 500; color: var(--heading); white-space: nowrap; }
.who { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--blue); color: #fff; font-weight: 700; font-size: 13px; }
.who .name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30vw; }
.who a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 6px; }
.who a:hover, .who a:focus-visible { background: var(--hover); color: var(--text); outline: none; }

/* Greeting */
.intro { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 36px 0 24px; }
.intro h1 { margin: 0 0 4px; font-size: clamp(26px, 4vw, 32px); }
.intro p { margin: 0; color: var(--muted); font-size: 16px; }
.search { width: 100%; max-width: 320px; padding: 9px 14px 9px 38px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23676879' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E") no-repeat 13px center;
  color: var(--text); font: inherit; }
.search:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(87,155,252,.25); }
.section-title { font-size: 13px; font-weight: 500; color: var(--muted); margin: 0 0 12px; }

/* Tiles */
.grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.tile-inner { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 22px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
a.tile-inner:hover, a.tile-inner:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow-hover); outline: none; }
a.tile-inner:focus-visible { border-color: var(--blue); }
.icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 10px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: color-mix(in srgb, var(--accent) 70%, var(--heading)); }
.icon .initial { font-weight: 700; font-size: 18px; }
.name { font-weight: 700; font-size: 17px; color: var(--heading); }
.ext { color: var(--muted); font-weight: 400; }
.desc { color: var(--muted); font-size: 14px; flex: 1; }
.cat { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.cat::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.soon .tile-inner { background: transparent; border-style: dashed; box-shadow: none; }
.soon .icon { background: var(--hover); color: var(--muted); }
.badge { margin-left: 6px; font-size: 11px; padding: 1px 8px; border-radius: 99px; background: var(--hover); color: var(--muted); }
.empty { color: var(--muted); }

/* Card, login, buttons (Growth Green = action) */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 24px; }
.login { max-width: 400px; margin: 12vh auto 0; text-align: center; padding: 40px 32px; }
.login img { width: 150px; height: auto; }
.login h1 { font-size: 24px; margin: 22px 0 6px; }
.login p { color: var(--muted); margin: 0 0 22px; }
.error { color: var(--error) !important; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: 8px; border: 0;
  background: var(--green); color: var(--navy); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: filter .15s ease; }
.btn:hover { filter: brightness(.95); }
.btn:focus-visible { outline: 3px solid rgba(87,155,252,.5); outline-offset: 2px; }
.login .btn { width: 100%; padding: 12px 20px; }

/* Shared app styles */
.app-head { margin: 32px 0 20px; }
.app-head a { color: var(--muted); font-size: 14px; text-decoration: none; }
.app-head a:hover { color: var(--text); }
.app-head h1 { margin: 6px 0 0; font-size: 28px; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input[type=number] { padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; }
input[type=number]:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(87,155,252,.25); }
.results { display: grid; gap: 12px; margin-top: 22px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.stat { padding: 14px 16px; border-radius: 10px; background: var(--bg); }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 700; color: var(--heading); font-variant-numeric: tabular-nums; }
.stat .v.neg { color: var(--error); }
@media (max-width: 560px) { .brand span, .who .name-text { display: none; } .search { max-width: none; } }
@media (prefers-reduced-motion: reduce) { .tile-inner, .btn { transition: none; } }
