/* Shared brand.css and premium-panel.css supply the organizer theme and tokens.
   Keep Desk layout here without changing main-site, fixture or print styles. */
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
[hidden] { display: none !important; }
button, input, select { font: inherit; touch-action: manipulation; }
a { color: var(--blue); text-underline-offset: 3px; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 17px; border: 1px solid var(--blue); border-radius: 7px; background: var(--blue); color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .16s, border-color .16s, transform .16s; }
button:hover, .button:hover { background: #104bad; }
button:active:not(:disabled), .button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; }
.secondary, .quiet { color: #23354e; border-color: #ced8e6; background: #fff; }
.secondary:hover, .quiet:hover { background: #f1f5fb; border-color: #a6b8cf; }
.quiet { padding: 7px 12px; }
.skip { position: fixed; top: -80px; left: 16px; z-index: 90; padding: 12px 18px; border-radius: 5px; background: #fff; }
.skip:focus { top: 10px; }
.app { display: grid; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; overflow: hidden; }
.sidebar .brand { color: #fff; text-decoration: none; }
.side-nav { display: flex; flex: 1; flex-direction: column; min-height: 0; overflow-y: auto; }
.side-nav a, .side-logout a { display: flex; align-items: center; text-decoration: none; }
.side-logout { padding-top: 12px; border-top: 1px solid; }
.nav-icon { display: inline-flex; }
.nav-icon svg, [data-menu] svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-icon svg { width: 20px; height: 20px; }
[data-menu] svg { width: 19px; height: 19px; }
[data-menu] { display: grid; place-items: center; padding: 0; color: var(--ink); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; }
.account { display: flex; align-items: center; gap: 16px; margin-left: auto; min-width: 0; color: var(--muted); font-size: 12px; }
.account span { overflow: hidden; max-width: 330px; text-overflow: ellipsis; white-space: nowrap; }
.auth-brand { display: none !important; }
.desk-signed-out .app { display: block; }
.desk-signed-out .sidebar, .desk-signed-out [data-menu], .desk-signed-out .panel-breadcrumb { display: none; }
.desk-signed-out .auth-brand { display: inline-flex !important; color: var(--navy); text-decoration: none; font-size: 20px; }
.desk-page main { max-width: 1600px; min-height: calc(100dvh - 152px); margin: auto; padding: 30px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(28px, 3vw, 36px); line-height: 1.2; letter-spacing: -.045em; font-weight: 650; text-wrap: balance; }
h2 { font-size: 20px; letter-spacing: -.025em; font-weight: 650; }
h3 { font-size: 17px; font-weight: 650; }
p { color: var(--muted); }
.eyebrow { margin-bottom: 10px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.lead { margin-top: 12px; max-width: 70ch; }
.page-head, .section-head { display: flex; justify-content: space-between; gap: 20px; }
.section-head { align-items: center; margin-bottom: 18px; }
.head-actions, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.section { margin-top: 28px; }
.back { display: inline-block; margin-bottom: 22px; font-size: 13px; text-decoration: none; }
.panel { padding: 24px; }
.muted { color: var(--muted); font-size: 13px; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 5px; background: #edf3ff; color: #1c55a7; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge.warn { background: #fff4dd; color: #805315; }
.badge.error { background: #fff0f2; color: #a82d3d; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.stat { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.stat strong { display: block; margin-bottom: 5px; font-size: 27px; font-weight: 650; letter-spacing: -.04em; }
.stat span { font-size: 12px; color: var(--muted); }
.events { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.event { display: flex; flex-direction: column; gap: 16px; min-height: 220px; color: inherit; text-decoration: none; transition: border-color .16s; }
.desk-page .event:hover { border-color: #a6b8cf; background: #f8faff; }
.event h3 { font-size: 20px; overflow-wrap: anywhere; }
.event .badge { align-self: flex-start; }
.event-bottom { display: flex; justify-content: space-between; gap: 12px; margin-top: auto; font-size: 12px; }
.event-bottom b { color: var(--blue); font-weight: 600; }
.empty { padding: 48px 24px; text-align: center; background: #fff; border: 1px dashed #ced8e6; border-radius: 10px; }
.empty p { margin: 8px auto 20px; max-width: 540px; }
.workflow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 24px; border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.workflow article { padding: 20px; }
.workflow article + article { border-left: 1px solid var(--line); }
.workflow small { display: inline-grid; place-items: center; width: 28px; height: 28px; color: #1c55a7; background: #edf3ff; border-radius: 6px; font-size: 11px; font-weight: 700; }
.workflow h3 { margin: 10px 0 5px; font-size: 15px; }
.workflow p { font-size: 13px; }
.desk-page .toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 20px 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; }
.toolbar label { min-width: 150px; }
.toolbar label:first-child { flex: 1; }
label { display: block; color: #23354e; font-size: 13px; font-weight: 600; }
input, select { display: block; width: 100%; min-height: 44px; margin-top: 7px; padding: 10px 12px; border: 1px solid #ced8e6; border-radius: 6px; color: var(--ink); background: #fff; }
input[type=checkbox] { flex-shrink: 0; width: 18px; min-height: 18px; margin: 2px 0 0; accent-color: var(--blue); }
.check { display: flex; align-items: flex-start; gap: 12px; font-weight: 400; line-height: 1.6; }
.form-grid, .mapping { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.full { grid-column: 1 / -1; }
.form-note { margin: 20px 0; padding: 14px 16px; border: 1px solid #dce7f8; border-radius: 7px; background: #f3f7fe; font-size: 13px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
table { width: 100%; border-collapse: collapse; text-align: left; }
td { max-width: 360px; overflow-wrap: anywhere; }
td small { display: block; margin-top: 4px; color: var(--muted); }
.table-name { min-width: 190px; }
details { margin-top: 20px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
summary { cursor: pointer; font-size: 14px; font-weight: 600; }
.tools { display: flex; flex-wrap: wrap; gap: 10px; }
.history { margin: 14px 0 0; padding: 0; list-style: none; }
.history li { display: flex; justify-content: space-between; gap: 15px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 13px; }
.guide { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.guide ol { margin: 16px 0 0; padding-left: 22px; }
.guide li { padding: 8px 0; color: var(--muted); }
.guide strong { color: var(--ink); }
footer { display: flex; justify-content: space-between; gap: 20px; margin: 0 30px; padding: 24px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
#notice { margin: 20px 30px 0; padding: 14px 18px; border: 1px solid #bee4d0; border-radius: 7px; color: #126644; background: #eaf7f0; font-size: 13px; }
#notice.error { border-color: #edc5ce; background: #fff0f2; color: #a82d3d; }
.error { color: #a82d3d; font-size: 13px; }
.loading { padding: 60px 20px; text-align: center; }
.login { max-width: 470px; margin: 40px auto; padding: 32px; }
.login h1 { font-size: 32px; }
.login form { margin-top: 28px; }
.login label { margin: 18px 0; }
.login button { width: 100%; }
.login .actions { justify-content: space-between; margin-top: 24px; font-size: 13px; }
.login p { margin-top: 14px; }
dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 28px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; box-shadow: 0 24px 70px rgb(10 25 44 / 20%); }
dialog::backdrop { background: rgb(6 17 32 / 55%); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
#dialog-error { margin-top: 20px; }
.import-stage { margin-bottom: 12px; color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.mapping { margin-top: 20px; }
.preview-summary { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.preview-table { max-height: 280px; overflow: auto; }
.warning { margin: 16px 0; padding: 12px 16px; border-left: 3px solid #d88900; background: #fff4dd; color: #805315; font-size: 13px; }
.safe-note { margin-top: 12px; font-size: 12px; }
@media (min-width: 801px) {
  .sidebar-collapsed .sidebar { visibility: hidden; }
}
@media (max-width: 1200px) {
  .events { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .desk-page .page-head { flex-wrap: wrap; }
  .account span { max-width: 190px; }
}
@media (max-width: 800px) {
  .desk-page main { padding: 24px 16px 40px; }
  .desk-page .topbar .panel-breadcrumb strong { display: inline; }
  .account span { display: none; }
  .account { gap: 0; }
  .desk-page [data-menu] { padding: 10px; }
  .desk-page .sidebar .panel-nav-close, .desk-page .panel-nav-backdrop { min-height: 0; padding: 0; }
  .panel-nav-backdrop:hover { background: rgb(6 17 32 / 55%); }
  .sidebar .panel-nav-close:hover { background: #152b46; }
  .panel, .login { padding: 20px; }
  .desk-page input, .desk-page select { font-size: 16px; }
  .guide, .form-grid, .mapping { grid-template-columns: minmax(0, 1fr); }
  .workflow { grid-template-columns: 1fr; }
  .workflow article { display: grid; grid-template-columns: 28px 1fr; column-gap: 12px; padding: 16px; }
  .workflow article + article { border-left: 0; border-top: 1px solid var(--line); }
  .workflow small { grid-row: span 2; }
  .workflow h3 { margin: 0 0 4px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .toolbar label { flex: 1; min-width: 130px; }
  .desk-page .toolbar input, .desk-page .toolbar select { width: 100%; }
  footer { margin: 0 16px; }
  #notice { margin: 16px 16px 0; }
}
@media (max-width: 600px) {
  .events { grid-template-columns: 1fr; }
  .stats { gap: 8px; }
  .stat { padding: 14px 10px; }
  .stat strong { font-size: 24px; }
  .stat span { font-size: 11px; }
  .head-actions { width: 100%; }
  .head-actions button { flex: 1; }
  dialog { padding: 20px; width: calc(100vw - 20px); }
  .dialog-heading h2 { font-size: 20px; }
  .form-actions { flex-wrap: wrap; }
  .form-actions button { flex: 1; }
  .tools { display: grid; grid-template-columns: minmax(0, 1fr); }
  .tools .button { width: 100%; }
  .history li, footer { flex-direction: column; gap: 6px; }
  table { min-width: 720px; }
  .table-wrap::before { content: "Swipe to see all columns →"; display: block; position: sticky; left: 0; padding: 9px 14px; color: var(--muted); font-size: 11px; background: #fff; }
  .preview-table table { min-width: 560px; }
  .desk-page .panel-breadcrumb { gap: 7px; font-size: 11px; }
}
@media print {
  .sidebar, .topbar, footer, dialog { display: none; }
  .app { display: block; }
  body { color: #17263c; background: #fff; }
}
