* { box-sizing: border-box; }
html { font-size: var(--base); }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; font-variant-numeric: tabular-nums; }
code, pre, kbd, samp, input, button, select, textarea { font-family: var(--font); font-size: 1rem; }
a { color: var(--blue); } a:hover { color: var(--blue-dark); }
h1, h2, h3 { color: var(--navy); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 10; }

/* header */
.site-header { background: var(--navy); color: #fff; }
.site-header .bar { max-width: 1100px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.brand img { width: 40px; height: 40px; border-radius: 9px; box-shadow: 0 0 0 2px rgba(255,255,255,.15); }
.brand small { display: block; font-weight: 400; font-size: .8rem; color: #BFDBFE; }
.tabs { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.tabs a { color: #DBEAFE; text-decoration: none; padding: 10px 14px; border-radius: 8px; font-weight: 600; min-height: var(--tap); display: inline-flex; align-items: center; }
.tabs a:hover, .tabs a[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; }
.tabs a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--gold); }
.account { position: relative; }
.account > button { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); }
.account-menu { position: absolute; right: 0; top: 110%; background: #fff; color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 240px; padding: 8px; z-index: 20; }
.account-menu a, .account-menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; background: none; border: 0; color: var(--ink); text-decoration: none; font-weight: 400; min-height: 0; }
.account-menu a:hover, .account-menu button:hover { background: var(--pale-blue); }
.account-menu .who { padding: 8px 12px; color: var(--muted); font-size: .85rem; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

main { max-width: 1100px; margin: 0 auto; padding: 28px 20px 64px; }
main.narrow { max-width: 560px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

/* forms */
label { display: block; font-weight: 600; margin: 14px 0 6px; }
.hint { font-weight: 400; color: var(--muted); font-size: .88rem; display: block; margin-top: 2px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=number], input[type=search], input:not([type]), select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.2); }
fieldset { border: 0; padding: 0; margin: 14px 0 0; } legend { font-weight: 600; margin-bottom: 6px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; margin: 8px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 3px; accent-color: var(--blue); }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 10px 20px;
  border-radius: 10px; border: 2px solid transparent; background: var(--blue); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; }
button:hover, .btn:hover { background: var(--blue-dark); color: #fff; }
button.secondary, .btn.secondary { background: #fff; color: var(--navy); border-color: var(--line); }
button.secondary:hover, .btn.secondary:hover { background: var(--pale-blue); color: var(--navy); }
button.danger { background: #fff; color: var(--danger); border-color: #FCA5A5; } button.danger:hover { background: #FEF2F2; }
button.link { background: none; border: 0; color: var(--blue); padding: 4px 6px; min-height: 0; text-decoration: underline; font-weight: 600; }
button:disabled { opacity: .55; cursor: not-allowed; }
.form-error { background: #FEF2F2; border: 1px solid #FCA5A5; color: var(--danger); padding: 12px 14px; border-radius: 10px; margin-top: 14px; }
.form-ok { background: #F0FDF4; border: 1px solid #86EFAC; color: var(--ok); padding: 12px 14px; border-radius: 10px; margin-top: 14px; }
.seg { display: flex; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 20px; }
.seg button { flex: 1; border-radius: 0; background: #fff; color: var(--navy); border: 0; }
.seg button[aria-selected="true"] { background: var(--navy); color: #fff; }

/* how-to panel */
details.howto { background: var(--pale-gold); border: 1px solid #F3D27A; border-left: 6px solid var(--gold); border-radius: var(--radius); padding: 4px 18px; margin-bottom: 22px; }
details.howto summary { cursor: pointer; font-weight: 700; color: var(--navy); padding: 12px 0; min-height: var(--tap); list-style: none; display: flex; align-items: center; gap: 10px; }
details.howto summary::before { content: "?"; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; font-size: .9rem; }
details.howto summary::-webkit-details-marker { display: none; }
details.howto ol, details.howto ul { margin: 0 0 14px; padding-left: 1.3em; } details.howto li { margin: 4px 0; }

/* dashboard tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin: 20px 0 28px; }
.tile { background: #fff; border: 1px solid var(--line); border-top: 6px solid var(--blue); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 8px; min-height: 210px; }
a.tile:hover { border-color: var(--light-blue); transform: translateY(-1px); color: var(--ink); }
.tile .ic { width: 52px; height: 52px; border-radius: 12px; background: var(--pale-blue); display: grid; place-items: center; }
.tile h2 { margin: 4px 0 0; } .tile p { margin: 0; color: var(--muted); }
.tile .go { margin-top: auto; font-weight: 700; color: var(--blue); }
.tile .badge { align-self: flex-start; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--pale-blue); color: var(--navy); }
.badge.gold { background: var(--pale-gold); color: #7A5600; border: 1px solid #F3D27A; }
.tile.soon { border-top-color: var(--line); }

/* tables */
table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th, table.list td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { color: var(--navy); font-size: .88rem; background: var(--pale-blue); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.empty { text-align: center; padding: 28px; color: var(--muted); }
.role-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* dialog + toast */
dialog { border: 0; border-radius: 16px; padding: 24px; max-width: 560px; width: calc(100% - 32px); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(15,23,42,.5); }
.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; }
.toast { background: var(--navy); color: #fff; padding: 14px 18px; border-radius: 12px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; }
.toast button { background: var(--gold); color: var(--navy); min-height: 40px; padding: 6px 14px; }
.copy-box { display: flex; gap: 8px; } .copy-box input { flex: 1; }
.site-footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px; }
@media (max-width: 640px) { .tabs { margin-left: 0; width: 100%; } .tabs a { flex: 1; justify-content: center; padding: 8px; } h1 { font-size: 1.45rem; } }

.soon-tag { display: inline-block; font-size: .68em; font-weight: 700; background: var(--pale-gold); color: #7C5A00; border-radius: 99px; padding: 1px 7px; margin-left: 4px; vertical-align: middle; }
