/*
  The look follows physicalsandbox.com's app: the same colours, type, header,
  side menu, panels and buttons, so that the two read as one family.
*/
:root {
  --paper: #f3f6fb; --paper2: #e7eef7; --white: #ffffff;
  --ink: #0f1e33; --ink2: #33445c; --mute: #6b7787; --line: #d3dce8;
  --blue: #1657a8; --blue-d: #0f3f7e; --blue-l: #3f86d6;
  --accent: #ff9a3c; --danger: #a3341c; --ok: #1d5b31;
  --font: 'Hiragino Kaku Gothic ProN', 'Yu Gothic', YuGothic, 'Noto Sans JP', sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.7; -webkit-text-size-adjust: 100%; }
body.demo { padding-bottom: 64px; }
a { color: var(--blue); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--blue-l); outline-offset: 2px; }
h1 { font-size: 24px; font-weight: 800; line-height: 1.4; margin: 0 0 18px; }
h2 { font-size: 17px; font-weight: 800; margin: 30px 0 10px; }
h3 { font-size: 15px; font-weight: 800; margin: 0; }
p { margin: 0 0 14px; }
.note { font-size: 13px; color: var(--mute); }
.note.error { color: var(--danger); }
code, .mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }

.top { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,0.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand img { display: block; height: 22px; width: auto; }
.brand b { font-size: 15px; font-weight: 800; color: var(--ink2); white-space: nowrap; }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mute); }
.who select { padding: 5px 8px; font-size: 13px; }

.layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100vh - 62px); }
.side { background: var(--white); border-right: 1px solid var(--line); padding: 16px 12px; }
.side a { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: 8px; color: var(--ink2); text-decoration: none; font-size: 14px; }
.side a:hover { background: var(--paper); }
.side a[aria-current="page"] { background: var(--paper2); color: var(--ink); font-weight: 800; }
.side-title { font-size: 12px; font-weight: 800; color: var(--mute); padding: 14px 12px 4px; }
.side .count { font-size: 11px; font-weight: 800; background: var(--danger); color: var(--white); border-radius: 999px; padding: 0 7px; line-height: 18px; }
.page { padding: 28px 24px 56px; min-width: 0; max-width: 1180px; }
@media (max-width: 780px) {
  .layout { grid-template-columns: 1fr; }
  .side { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-title { display: none; }
  .page { padding: 20px 16px 48px; }
}

.panel { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin: 0 0 18px; }
.panel > * { margin-top: 0; margin-bottom: 0; }
.panel > * + * { margin-top: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.split > .panel { margin: 0; }
.split.three { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.split + * { margin-top: 18px; }

button, .button { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 800; line-height: 1; padding: 11px 16px; border-radius: 9px; border: 0; background: var(--blue); color: var(--white); cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: var(--blue-d); }
button:disabled { background: var(--line); color: var(--mute); cursor: not-allowed; }
.cta { background: var(--accent); color: #3a2000; }
.cta:hover { background: var(--accent); filter: brightness(1.06); }
.row-button { font-size: 13px; font-weight: 700; padding: 7px 12px; background: var(--white); color: var(--blue); border: 1px solid var(--line); }
.row-button:hover { background: var(--paper); }
.row-button.danger { color: var(--danger); border-color: #efc9bd; }
.row-button[aria-current="true"] { background: var(--paper2); color: var(--ink); border-color: var(--paper2); }
input, select, textarea { font: inherit; font-size: 14px; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--white); color: var(--ink); }
input[type="checkbox"] { width: 18px; height: 18px; margin: 0; padding: 0; }
input[type="number"] { width: 90px; }
textarea { width: 100%; min-height: 96px; }
textarea.mono { font-family: ui-monospace, monospace; font-size: 12px; }
label { font-size: 13px; font-weight: 700; color: var(--ink2); }
.fields { display: grid; grid-template-columns: max-content 1fr; gap: 10px 14px; align-items: center; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form input[type="text"] { flex: 1 1 240px; min-width: 0; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 0 0 18px; }
.tile { display: block; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: var(--ink); }
.tile:hover { border-color: var(--blue-l); }
.tile b { display: block; font-size: 30px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile span { font-size: 13px; color: var(--ink2); font-weight: 700; }
.tile.overdue b { color: var(--danger); } .tile.soon b { color: #b05a00; } .tile.done b { color: var(--ok); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; color: var(--mute); font-weight: 800; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.check { width: 34px; }
.tablewrap { overflow-x: auto; }

.badge { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 6px; vertical-align: 1px; background: var(--paper2); color: var(--ink2); white-space: nowrap; }
.badge.overdue, .badge.bad { background: #fbe9e4; color: var(--danger); }
.badge.due_soon, .badge.warn { background: #ffe8d2; color: #7a3d00; }
.badge.done, .badge.good { background: #dcf2e2; color: var(--ok); }
.badge.done_late { background: #fdf3cf; color: #6b5200; }
.badge.excepted, .badge.info { background: #dbe8f8; color: var(--blue-d); }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.item { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.item-name { font-weight: 800; font-size: 15px; overflow-wrap: anywhere; }
.item-name a { color: var(--ink); }
.item-meta { font-size: 12.5px; color: var(--mute); margin-top: 4px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.timeline li:last-child { border-bottom: 0; }
.timeline time { color: var(--mute); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.clause { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; color: var(--ink2); }
.meter { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--paper2); }
.meter i { display: block; } .meter .a { background: #3a9c5a; } .meter .b { background: #e2b93b; } .meter .c { background: var(--danger); } .meter .d { background: var(--blue-l); }
pre.snippet { background: #101a2b; color: #d8e6ff; font-size: 12px; line-height: 1.6; border-radius: 10px; padding: 14px 16px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.banner { border-radius: 10px; padding: 12px 16px; font-weight: 700; }
.banner.good { background: #dcf2e2; color: var(--ok); } .banner.bad { background: #fbe9e4; color: var(--danger); } .banner.warn { background: #ffe8d2; color: #7a3d00; }
.banner span { display: block; font-weight: 400; font-size: 13px; }
.empty { color: var(--mute); font-size: 14px; }

/* The demo's controls: not part of the product */
.demo-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 16px; background: #1b2638; color: #cfd8e6; border-top: 3px solid var(--accent); font-size: 12.5px; }
.demo-bar b { background: var(--accent); color: #3a2000; border-radius: 4px; padding: 0 8px; }
.demo-bar form { display: inline; }
.demo-bar button, .demo-bar a { font-size: 12.5px; font-weight: 700; padding: 6px 10px; background: #2a3852; color: #e9eef6; border: 1px solid #44536e; border-radius: 6px; text-decoration: none; }
.demo-bar .sep { flex: 1; }

/* The stand-in for a customer's own site */
body.site { background: #fbfaf7; }
.site-top { background: #2f5d50; color: #fff; padding: 16px 24px; font-weight: 800; font-size: 18px; }
.site-top small { display: block; font-weight: 400; font-size: 12px; opacity: 0.85; }
.site-main { max-width: 640px; margin: 28px auto; padding: 0 20px; }
.site-main .panel { border-color: #e2ddd2; }
.site-main button { background: #2f5d50; }
.site-main .fields { grid-template-columns: 1fr; }
.site-main input, .site-main select { width: 100%; }
.lock { display: inline-block; font-size: 12px; color: #2f5d50; background: #e4f1ec; border-radius: 999px; padding: 1px 10px; }
