/* Step 02: reusable app shell and UI components.
   Source palette and component policy: resources/standard-template/hive-ui-step-06-v1.6.1/.
   Scoped overrides avoid changing the preserved JS prototype. */
.hive-step02{--sidebar:252px;--hive-nav-z:50}
.hive-step02 .sidebar{top:0;z-index:var(--hive-nav-z);width:var(--sidebar)}
.hive-step02 .app-frame{padding-top:0;min-height:100vh;margin-inline-start:var(--sidebar)}
.hive-step02 .topbar{top:0;z-index:34;background:var(--surface);height:76px;box-shadow:0 1px 0 var(--line)}
.hive-step02 .sidebar-brand{display:flex;align-items:center;justify-content:space-between;min-height:86px;padding:16px 20px;border-bottom:1px solid var(--line)}
.hive-shell-brand{display:flex;align-items:center;gap:9px;min-width:0;color:var(--ink)}
.hive-shell-logo{width:48px;height:48px;object-fit:contain}
.hive-shell-brand .brand-copy{display:flex;flex-direction:column;line-height:1.17;letter-spacing:.06em}
.hive-shell-brand .brand-copy strong{font-size:17px;color:var(--ink);font-weight:850}
.hive-shell-brand .brand-copy small{font-size:9px;color:var(--muted);font-weight:700;letter-spacing:.16em}
.hive-nav-close{display:none!important}
.hive-step02 .workspace-picker{cursor:default;min-height:62px}
.hive-step02 .workspace-picker .avatar{flex:0 0 auto;display:grid;place-items:center}
.hive-context-icon{width:14px;height:14px;color:var(--muted);margin-inline-start:auto}
.hive-step02 .nav-link{font-size:12px;transition:background .15s ease,color .15s ease;min-height:43px}
.hive-step02 .nav-link .nav-label{flex:1;min-width:0}
.hive-step02 .nav-heading{font-size:10px;letter-spacing:.08em}
.hive-step02 .nav-group summary{cursor:pointer;list-style:none}
.hive-step02 .nav-group summary::-webkit-details-marker{display:none}
.hive-step02 .nav-group .chevron{width:13px;height:13px;transition:transform .2s}
.hive-step02 .nav-group[open] .chevron{transform:rotate(90deg)}
.hive-step02 .nav-children{margin-left:16px;padding-left:8px;border-left:1px solid var(--line)}
.hive-step02 .nav-children .nav-link{font-size:11px;min-height:36px}
.hive-step02 .sidebar-bottom{padding:12px 15px 16px;border-top:1px solid var(--line)}
.hive-step02 .sidebar-user{border:0;margin:8px 0 0;padding:7px 4px}
.hive-step02 .sidebar-user strong{font-size:11px}
.hive-step02 .sidebar-user small{font-size:10px;color:var(--muted)}
.hive-sidebar-reference{width:100%;justify-content:flex-start}
.hive-sidebar-reference svg{width:15px;height:15px}
.hive-step02 .topbar-tools{margin-left:auto;display:flex;align-items:center;gap:8px}
.hive-step02 .hive-topbar-menus{display:flex;gap:4px}
.hive-step02 .breadcrumb{white-space:nowrap;overflow:hidden;min-width:0}
.hive-step02 .breadcrumb strong{overflow:hidden;text-overflow:ellipsis}
.hive-step02 .command-btn{min-width:240px;margin-left:auto;cursor:pointer}
.hive-step02 .hive-preview-label{white-space:nowrap;font-size:9px}
.hive-step02 .hive-account-avatar{display:grid;place-items:center}
.hive-step02 .hive-account-avatar svg{width:17px;height:17px}
.hive-step02 .content{max-width:1650px;width:100%;padding:28px clamp(18px,3.2vw,50px) 38px}
.hive-step02 .scope-line{margin-bottom:24px}
.hive-step02 .workspace-footer{border-top:1px solid var(--line);margin-top:30px}
.hive-step02 .workspace-domain-label{display:inline-flex;align-items:center;gap:5px;color:var(--green);font-weight:850;font-size:10px}
.hive-step02 .workspace-domain-label svg{width:14px;height:14px}
.hive-step02 .workspace-domain-label.platform{color:var(--gold-ink)}
.hive-step02 .scope-line .pill{border:1px solid var(--line);border-radius:20px;padding:4px 9px;background:var(--surface-2)}
.hive-step02 .drawer-backdrop[hidden],.hive-notifications[hidden]{display:none!important}
.hive-step02 .hive-notifications{position:absolute;right:88px;top:calc(100% - 2px);width:min(340px,calc(100vw - 24px));padding:18px;background:var(--surface);border:1px solid var(--line);border-radius:13px;box-shadow:0 15px 45px #0002;z-index:45}
.hive-notifications strong{font-size:14px}
.hive-notifications p{font-size:12px;color:var(--muted);line-height:1.7}
.hive-ui-card{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:26px;box-shadow:0 9px 30px #00000008;margin:20px 0}
.hive-ui-card h2{margin:0 0 9px;font-size:20px;line-height:1.3;letter-spacing:-.035em;color:var(--ink)}
.hive-ui-card-head{display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap;margin-bottom:22px}
.hive-ui-section-intro{padding:18px 21px;background:var(--surface-2);border:1px solid var(--line);border-radius:13px;margin:16px 0 25px}
.hive-ui-section-intro>div{display:flex;gap:9px;flex-wrap:wrap}
.hive-ui-section-intro p{font-size:12px;line-height:1.8;color:var(--muted);margin:10px 0 0}
.hive-ui-sample-row{display:flex;align-items:center;gap:11px;flex-wrap:wrap;margin:10px 0 20px}
.hive-muted-meta{color:var(--muted);font-size:11px;line-height:1.7}
.hive-status{display:inline-flex;align-items:center;border-radius:30px;padding:5px 11px;font-size:11px;font-weight:700;border:1px solid var(--line);white-space:nowrap;background:var(--surface-2);color:var(--muted)}
.hive-status-success{color:#13653f;background:#e6f6ec;border-color:#bce4cc}
.hive-status-warning{color:#896015;background:#fff3d9;border-color:#f2dba6}
.hive-status-danger{color:#b23d3d;background:#feebeb;border-color:#f4caca}
.hive-status-info{color:#285a93;background:#edf4ff;border-color:#cadaf2}
html[data-theme=dark] .hive-status-success{color:#9ae1bc;background:#183f2c;border-color:#285f44}
html[data-theme=dark] .hive-status-warning{color:#ffe0a2;background:#473b23;border-color:#6b5530}
html[data-theme=dark] .hive-status-danger{color:#ffb9b9;background:#492827;border-color:#6a3333}
html[data-theme=dark] .hive-status-info{color:#b5d1ff;background:#263b57;border-color:#365476}
.hive-notice{display:flex;align-items:flex-start;gap:12px;padding:13px 16px;border:1px solid var(--line);background:var(--surface-2);border-radius:10px;color:var(--ink)}
.hive-notice svg{width:17px;height:17px;flex:0 0 auto;color:var(--green);margin-top:2px}
.hive-notice p{font-size:12px;line-height:1.6;margin:0}
.hive-notice-warning svg{color:#d19425}.hive-notice-danger svg{color:#b54444}
.hive-ui-field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px}
.hive-ui-field-grid>.hive-field:last-child{grid-column:1/-1}
.hive-ui-field-grid .hive-field{margin:0}
.hive-ui-field-grid .hive-field input,.hive-ui-field-grid .hive-field select,.hive-ui-field-grid .hive-field textarea{width:100%;min-width:0;max-width:100%;box-sizing:border-box}
.hive-ui-field-grid .hive-field textarea{min-height:95px;resize:vertical}
.hive-ui-table-tools{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:15px}
.hive-ui-table-tools label{position:relative;flex:1;max-width:370px;min-width:210px;display:flex;align-items:center}
.hive-ui-table-tools label svg{width:16px;height:16px;position:absolute;left:13px;color:var(--muted)}
.hive-ui-table-tools input{width:100%;box-sizing:border-box;padding:12px 12px 12px 38px;min-height:43px;border-radius:9px;border:1px solid var(--line);background:var(--surface);color:var(--ink);font:inherit;font-size:12px}
.hive-ui-table-tools span{font-size:11px;color:var(--muted)}
.hive-table-scroll{overflow-x:auto;max-width:100%;border-radius:10px;border:1px solid var(--line)}
.hive-data-table{border-collapse:collapse;width:100%;min-width:640px;font-size:12px}
.hive-data-table thead{background:var(--surface-2)}
.hive-data-table th,.hive-data-table td{padding:14px 16px;border-bottom:1px solid var(--line);text-align:left;vertical-align:middle}
.hive-data-table th{font-size:10px;color:var(--muted);font-weight:750;text-transform:uppercase;letter-spacing:.055em}
.hive-data-table tr:last-child td{border-bottom:0}
.hive-data-table tbody tr:hover{background:var(--surface-2)}
.hive-data-table tr[hidden]{display:none}
.hive-ui-table-empty,.hive-table-empty{padding:20px;text-align:center;color:var(--muted);font-size:12px}
.hive-ui-metrics{margin:12px 0 26px}
.hive-ui-metrics .hive-card{box-shadow:none;padding:20px}
.hive-ui-tabs{display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--line)}
.hive-ui-tabs button{background:transparent;border:0;padding:12px 15px;font:inherit;font-size:12px;color:var(--muted);cursor:pointer;border-bottom:2px solid transparent}
.hive-ui-tabs button[aria-selected=true]{color:var(--ink);border-color:var(--gold);font-weight:750}
.hive-ui-tab-panel{padding:20px 4px 5px;line-height:1.9;font-size:12px;color:var(--muted)}
.hive-ui-tab-panel[hidden]{display:none}
.hive-ui-states .hive-ui-card{margin:0}
.hive-ui-empty{display:flex;flex-direction:column;align-items:center;text-align:center;justify-content:center;padding:37px 20px;min-height:230px}
.hive-ui-empty>svg{width:28px;height:28px;color:var(--muted);margin-bottom:12px}
.hive-ui-empty h3{font-size:16px;letter-spacing:-.02em;margin:4px 0 6px}
.hive-ui-empty p{font-size:12px;color:var(--muted);max-width:320px;margin:0;line-height:1.75}
.hive-ui-skeleton{min-height:230px;display:flex;flex-direction:column;justify-content:center;gap:12px;padding:25px}
.hive-ui-skeleton span{height:16px;background:linear-gradient(90deg,var(--surface-2),var(--line),var(--surface-2));background-size:200% 100%;border-radius:6px;animation:hive-shimmer 2.5s linear infinite}
.hive-ui-skeleton span:nth-child(2){width:75%}.hive-ui-skeleton span:nth-child(3){width:85%}.hive-ui-skeleton span:nth-child(4){width:43%}
@keyframes hive-shimmer{from{background-position:200% 0}to{background-position:-200% 0}}
.hive-ui-dialog{border:0;border-radius:14px;max-width:min(640px,calc(100vw - 32px));width:100%;max-height:min(90dvh,900px);background:var(--surface);color:var(--ink);padding:0;box-shadow:0 30px 100px #0005;overflow:hidden}
.hive-ui-dialog::backdrop{background:rgba(7,15,10,.58)}
.hive-ui-dialog[open]{display:flex;flex-direction:column}
.hive-dialog-frame{display:flex;flex-direction:column;min-height:0;width:100%;max-height:min(90dvh,900px)}
.hive-dialog-header,.hive-dialog-footer{padding:18px 22px;display:flex;align-items:center;justify-content:space-between;gap:14px;flex-shrink:0}
.hive-dialog-header{border-bottom:1px solid var(--line)}
.hive-dialog-header h2{font-size:20px;margin:0}
.hive-dialog-footer{border-top:1px solid var(--line);justify-content:flex-end;flex-wrap:wrap}
.hive-dialog-body{overflow-y:auto;padding:22px;min-height:0}
.hive-ui-modal-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.hive-ui-modal-fields .hive-field{margin:0}
.hive-ui-modal-fields .hive-field:last-child{grid-column:1/-1}
.hive-ui-modal-fields+.hive-notice{margin-top:20px}
.hive-ui-drawer{position:fixed;inset:0 0 0 auto;height:100dvh;max-height:100dvh;max-width:min(520px,100vw);border-radius:0;border-left:1px solid var(--line);margin:0}
.hive-ui-drawer .hive-dialog-frame{height:100%;max-height:100dvh}
.hive-ui-drawer .hive-dialog-body .hive-field{margin-bottom:18px}
.hive-command-dialog{width:min(540px,calc(100vw - 26px))}
.hive-command-wrap{padding:20px;display:flex;flex-direction:column;gap:10px}
.hive-command-wrap .hive-field{margin:0}
.hive-command-results{display:flex;flex-direction:column;max-height:330px;overflow:auto}
.hive-command-results a{display:block;padding:11px 12px;border-radius:8px;color:var(--ink);font-size:13px}
.hive-command-results a:hover{background:var(--surface-2)}
.hive-command-results p{color:var(--muted);font-size:12px}
.hive-toasts{position:fixed;z-index:200;bottom:22px;right:24px;display:flex;flex-direction:column;gap:10px;max-width:min(420px,calc(100vw - 30px))}
.hive-ui-toast{background:#212622;color:#fff;box-shadow:0 14px 45px #0004;padding:14px 16px;border-radius:10px;display:flex;align-items:center;gap:18px;font-size:12px}
.hive-ui-toast button{background:none;border:0;color:#ffce60;cursor:pointer;font:inherit;font-weight:800}
.hive-step02 button:focus-visible,.hive-step02 a:focus-visible,.hive-step02 input:focus-visible,.hive-step02 select:focus-visible,.hive-ui-dialog button:focus-visible,.hive-ui-dialog input:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
@media(min-width:821px){.hive-step02 .collapsed .sidebar{width:80px}.hive-step02 .collapsed .app-frame{margin-inline-start:80px}.hive-step02 .collapsed .workspace-text,.hive-step02 .collapsed .hive-context-icon,.hive-step02 .collapsed .brand-copy,.hive-step02 .collapsed .nav-label,.hive-step02 .collapsed .nav-heading,.hive-step02 .collapsed .sidebar-user .grow,.hive-step02 .collapsed .sidebar-bottom>.btn,.hive-step02 .collapsed .nav-group .chevron{display:none}.hive-step02 .collapsed .workspace-picker{justify-content:center}.hive-step02 .collapsed .workspace-picker .avatar{margin:0}.hive-step02 .collapsed .sidebar-brand{justify-content:center}.hive-step02 .collapsed .nav-link{justify-content:center}.hive-step02 .collapsed .sidebar-user{justify-content:center}.hive-step02 .collapsed .nav-group .nav-children{display:none}}
@media(max-width:1160px){.hive-step02 .command-btn{min-width:160px}.hive-step02 .command-btn .kbd{display:none}.hive-step02 .topbar{padding-inline:19px}}
@media(max-width:820px){.hive-step02 .sidebar{top:0;bottom:0;transform:translateX(-110%);width:260px!important;transition:transform .18s ease}.hive-step02 .app-frame{margin-inline-start:0!important}.hive-step02 .hive-topbar-menus .mobile-only{display:inline-flex}.hive-step02 .hive-topbar-menus .desktop-only{display:none}.hive-step02 .hive-nav-close{display:inline-flex!important}.hive-step02.hive-nav-open .sidebar{transform:translateX(0)}.hive-step02 .drawer-backdrop{position:fixed;inset:0;border:0;background:#0007;z-index:48;cursor:pointer;display:none}.hive-step02.hive-nav-open .drawer-backdrop{display:block}.hive-step02 .command-btn{margin-left:auto;min-width:43px;width:43px;padding:0;justify-content:center}.hive-step02 .command-btn .command-label{display:none}.hive-step02 .bottom-tabs{display:flex;position:fixed;z-index:35;inset:auto 0 0;min-height:66px;justify-content:space-around;align-items:center;background:var(--surface);border-top:1px solid var(--line)}.hive-step02 .bottom-tab{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px;border:0;background:none;color:var(--muted);font:inherit;font-size:10px;padding:8px 12px}.hive-step02 .bottom-tab svg{height:19px;width:19px}.hive-step02 .content{padding-bottom:88px}}
@media(max-width:670px){.hive-ui-field-grid,.hive-ui-modal-fields{grid-template-columns:1fr}.hive-ui-card{padding:18px}.hive-ui-card h2{font-size:18px}.hive-step02 .hive-preview-label{display:none}.hive-step02 .topbar-tools{gap:2px}.hive-step02 .topbar{padding:0 11px}.hive-step02 .breadcrumb{gap:3px}.hive-step02 .breadcrumb>span{display:none}.hive-step02 .content{padding:22px 15px 84px}.hive-step02 .scope-role{display:none}.hive-ui-dialog .hive-dialog-header,.hive-ui-dialog .hive-dialog-footer{padding:14px}.hive-ui-dialog .hive-dialog-body{padding:14px}.hive-ui-card-head{gap:9px}.hive-ui-sample-row{gap:8px}}
@media(prefers-reduced-motion:reduce){.hive-ui-skeleton span{animation:none}}

/* Public site has separate header/footer partials but uses the same global design tokens. */
.hive-step02-public .hive-public-toggle{display:none}
@media(max-width:700px){.hive-step02-public .hive-public-header{position:relative;gap:9px}.hive-step02-public .hive-public-toggle{display:inline-flex;min-width:42px;min-height:42px;padding:9px}.hive-step02-public .hive-public-nav.is-open{display:flex;position:absolute;z-index:15;top:100%;right:12px;left:12px;flex-direction:column;align-items:stretch;gap:0;background:var(--hive-surface);padding:12px 18px;border:1px solid var(--hive-line);border-radius:12px;box-shadow:var(--hive-shadow)}.hive-step02-public .hive-public-nav.is-open a{padding:12px 6px;border-bottom:1px solid var(--hive-line)}.hive-step02-public .hive-public-actions{gap:5px}}

.hive-ui-data-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(260px,100%),1fr));gap:12px}
.hive-record-card{border:1px solid var(--line);background:var(--surface-2);padding:18px;border-radius:12px;display:grid;gap:9px}
.hive-record-card>div{display:flex;justify-content:space-between;align-items:start;gap:15px;font-size:12px}
.hive-record-card span{color:var(--muted);font-size:11px}
.hive-record-card strong{text-align:right;font-size:12px;overflow-wrap:anywhere}
.hive-ui-data-cards[hidden],#hive-record-table-wrap[hidden],.hive-record-card[hidden]{display:none!important}
.hive-view-switch{display:flex;align-items:center;background:var(--surface-2);padding:3px;border-radius:10px;border:1px solid var(--line)}
.hive-view-switch>.btn{min-height:36px;padding:7px 11px;box-shadow:none;border:0;background:transparent;font-size:11px}
.hive-view-switch>.btn[aria-pressed=true]{background:var(--surface);box-shadow:0 2px 8px #0001;color:var(--ink)}
