:root { --ink:#1b2530; --soft:#5b6875; --line:#dde2e7; --bg:#f6f4ef; --card:#fff; --accent:#1f5f4a; --accent-soft:#e3efe9; --warn:#9a3412; --warn-soft:#fdeee4; --blue:#1d4f91; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 7px 12px; }
button:hover { border-color: #b9c2cb; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
button:disabled { opacity: .55; cursor: not-allowed; }
input, select, textarea { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: #fff; width: 100%; }
textarea { min-height: 84px; resize: vertical; }
label { display: block; font-size: 12.5px; color: var(--soft); margin: 10px 0 3px; }
a { color: var(--blue); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.muted { color: var(--soft); } .small { font-size: 12.5px; } .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.banner { background: #fff7d6; border-bottom: 1px solid #ecd98a; padding: 6px 16px; font-size: 12.5px; }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #eef1f4; color: var(--soft); white-space: nowrap; }
.badge.applied { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.badge.closed { background: var(--warn-soft); color: var(--warn); }
.error { color: var(--warn); }

/* Owner page */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.top { background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.top h1 { font-size: 17px; }
.stat { min-width: 150px; }
.stat b { font-size: 26px; line-height: 1; display: block; }
.stat span { font-size: 12.5px; color: var(--soft); display: block; }
.top .spacer { flex: 1; }
.top .actions { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.top .actions button { white-space: nowrap; }
.status { font-size: 12.5px; color: var(--soft); text-align: right; }
.panes { flex: 1; display: grid; grid-template-columns: minmax(300px, 400px) 1fr; min-height: 0; }
.list { border-right: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; min-height: 0; }
.filters { padding: 10px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.jobs { overflow: auto; flex: 1; }
.job { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 10px 12px; background: none; }
.job:hover { background: #f4f6f8; }
.job.sel { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.job b { display: block; } .job .role { display: block; color: var(--soft); font-size: 13.5px; margin: 1px 0 4px; }
.detail { overflow: auto; padding: 18px 22px 60px; min-width: 0; }
.detail h2 { font-size: 22px; } .detail .role { font-size: 16px; color: var(--soft); margin: 2px 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-top: 14px; }
.card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--soft); margin-bottom: 8px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 16px; }
.facts div span { display: block; font-size: 12px; color: var(--soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
ul.plain { list-style: none; padding: 0; margin: 0; } ul.plain li { padding: 5px 0; border-bottom: 1px dashed var(--line); } ul.plain li:last-child { border: 0; }
.back { display: none; margin-bottom: 10px; }
.empty { padding: 40px 20px; text-align: center; color: var(--soft); }
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 18px; width: min(480px, 92vw); }
dialog::backdrop { background: rgba(20, 28, 36, .4); }
.notbuilt { border: 1px dashed #c8cfd6; border-radius: 8px; padding: 8px 10px; background: #fafbfc; color: var(--soft); font-size: 13px; margin-top: 8px; }

@media (max-width: 800px) {
  .panes { grid-template-columns: 1fr; }
  .app[data-view="detail"] .list, .app[data-view="list"] .detail { display: none; }
  .back { display: inline-block; }
  .top { gap: 10px; } .top h1 { width: 100%; } .top .spacer { display: none; } .stat { min-width: 0; flex: 1 1 40%; } .stat b { font-size: 24px; } .status { text-align: left; width: 100%; } .top .actions { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .grid2 { grid-template-columns: 1fr; } .detail { padding: 12px 12px 60px; }
}
#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: min(560px, 92vw); background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 10; }
#toast.show { opacity: 1; } #toast.bad { background: var(--warn); }

/* Public pages */
.page { max-width: 820px; margin: 0 auto; padding: 28px 18px 60px; }
.page h1 { font-size: 30px; margin-bottom: 6px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.tile b { font-size: 40px; line-height: 1; display: block; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); } th { font-size: 12px; text-transform: uppercase; color: var(--soft); }
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr; } }
