/* Shared layout and component refinements. */
:root {
    --orange: var(--color-primary);
    --muted: #667280;
    --line: var(--color-border);
    --color-text-secondary: #667280;
}
body { font-size: 14px; line-height: 1.55; }
:focus-visible { outline: 3px solid #ed751e; outline-offset: 3px; }
.ui-icon { flex: 0 0 auto; vertical-align: middle; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 12px; background: white; }
.skip-link:focus { top: 12px; }
h1 { font-size: clamp(24px, 2.1vw, 32px); letter-spacing: -.8px; line-height: 1.25; }
h2 { font-size: 17px; letter-spacing: -.25px; }
h3 { line-height: 1.4; }
p { overflow-wrap: anywhere; }
.sidebar { width: 244px; padding: 24px 14px 0; }
.brand { margin: 0 10px 28px; font-size: 25px; gap: 10px; flex-shrink: 0; }
.brand small { font-size: 8px; letter-spacing: 1px; margin-top: 2px; color: #a3adba; }
.brand-logo-link { min-height: 64px; padding: 8px 10px; justify-content: center; background: #fff; border-radius: 12px; }
.brand-logo-full { display: block; width: 100%; max-width: 184px; height: auto; object-fit: contain; }
.brand-login-logo { margin: 0 0 28px; justify-content: flex-start; }
.brand-login-logo .brand-logo-full { max-width: 220px; }
.workspace-label { font-size: 10px; letter-spacing: 1.1px; color: #9aa7b5; }
.sidebar > nav { overflow-y: auto; min-height: 0; padding-bottom: 16px; scrollbar-width: thin; }
.sidebar nav a { font-size: 13px; min-height: 42px; margin: 3px 0; }
.sidebar nav a.active { background: #ff7417; color: #19232d; }
.nav-divider { margin: 16px 10px; }
.profile { margin-top: auto; min-height: 83px; flex-shrink: 0; gap: 10px; }
.avatar { flex: 0 0 34px; background: #344555; }
.profile-info { min-width: 0; }
.profile b { display: block; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.profile small { font-size: 11px; line-height: 1.4; }
.profile form { flex-shrink: 0; }
.main { margin-left: 244px; min-width: 0; }
.guest { margin-left: 0; }
.topbar { padding: 0 30px; gap: 24px; height: 72px; }
.breadcrumbs { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.breadcrumbs strong { color: #334153; font-weight: 500; }
.global-search { min-width: 160px; max-width: 360px; }
.global-search > svg { position: absolute; top: 10px; left: 12px; color: #82909c; }
.global-search input { padding-left: 40px; font-size: 13px; }
.notification-button { position: relative; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; color: #536170; }
.notification-count { position: absolute; top: -5px; right: -5px; background: #fff0e2; color: #9c4100; font-weight: 700; }
main { padding: 30px; max-width: 1650px; }
.page-heading { margin-bottom: 26px; align-items: center; }
.page-heading > div { min-width: 0; }
.page-heading > .button { flex-shrink: 0; }
.page-heading p { font-size: 14px; }
.eyebrow { font-size: 10px; color: #717d8a; letter-spacing: 1.4px; }
.button { min-height: 40px; font-size: 13px; border-radius: 8px; padding: 9px 15px; white-space: nowrap; }
.button.primary { background: #e85d04; border-color: #e85d04; }
.button.primary:hover { background: #cc5000; border-color: #cc5000; }
.button.small { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px; border-radius: 8px; }
.icon-button:hover { background: #ffffff16; }
.mobile-menu { display: none; }
.panel { border-color: #e3e7ed; box-shadow: 0 2px 4px #20354b03; border-radius: 12px; }
.panel-header { padding: 18px 20px; gap: 16px; flex-wrap: wrap; }
.panel-header h2 { line-height: 1.4; }
.panel-header > a { font-size: 12px; color: #b74900; font-weight: 600; }
.panel-body { padding: 20px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 19px 20px; margin: 0; transition: border-color .15s, box-shadow .15s; }
.stat:hover { border-color: #edb181; box-shadow: 0 4px 15px #17202a08; color: inherit; }
.stat-top { font-size: 13px; color: #4c5b6a; align-items: center; gap: 8px; }
.stat-icon { width: 34px; height: 34px; flex-shrink: 0; }
.stat-value { font-size: 36px; line-height: 1.2; margin: 17px 0 6px; }
.stat-note { font-size: 12px; color: #667280; }
.dashboard-grid, .detail-grid { grid-template-columns: minmax(0, 1.8fr) minmax(290px, 1fr); gap: 22px; align-items: start; }
.dashboard-grid > *, .detail-grid > * { min-width: 0; }
.attention-row { display: flex; align-items: flex-start; gap: 12px; padding: 17px 20px; border-bottom: 1px solid #edf0f3; }
.attention-row:last-child { border: 0; }
.attention-row > div { flex: 1; min-width: 0; }
.attention-row b { font-size: 13px; }
.attention-row p { color: #697583; font-size: 13px; line-height: 1.5; margin: 4px 0 0; }
.attention-row > a { display: grid; place-items: center; min-width: 32px; min-height: 32px; border: 1px solid #e5e7eb; border-radius: 8px; }
.attention-icon { display: grid; place-items: center; flex: 0 0 30px; height: 30px; background: #fff0e9; color: #be520d; font-weight: 700; border-radius: 9px; }
.mini-row { font-size: 13px; padding: 13px 0; }
.mini-row small, td small, .entry small { color: #697583; font-size: 12px; }
.circle-number { color: #506071; flex-shrink: 0; font-size: 13px; }
.table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
table { font-size: 13px; }
th { background: #f8f9fb; color: #667280; font-size: 11px; padding: 12px 18px; white-space: nowrap; }
td { padding: 16px 18px; vertical-align: middle; }
td small { max-width: 330px; }
.table-wrap table { min-width: 620px; }
.badge { font-size: 11px; line-height: 1.4; padding: 5px 9px; white-space: nowrap; font-weight: 600; }
.badge.new, .badge.measurement { color: #245cae; }
.badge.waiting, .badge.paused { color: #8b6415; background: #fff3d6; }
.badge.cancelled, .badge.archived { color: #647080; background: #edf0f4; }
.progress-line { font-size: 12px; white-space: nowrap; }
progress { min-width: 55px; accent-color: #36996a; }
.filters { padding: 14px; gap: 10px; }
.inline-check { font-size: 12px; white-space: normal; }
.inline-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-form select, .inline-form input { flex: 1 1 150px; width: auto; min-width: 0; }
.inline-form .button { flex: 0 0 auto; }
input, select, textarea { max-width: 100%; }
textarea { min-height: 104px; resize: vertical; line-height: 1.6; }
input[type=checkbox], input[type=radio] { width: 17px; min-height: 17px; accent-color: #df5900; }
input[type=file] { padding: 8px; font-size: 12px; background: #f8f9fb; }
input[type=file]::file-selector-button { padding: 6px 10px; border: 0; background: #e8edf2; border-radius: 5px; margin-right: 10px; color: #334153; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
details { margin: 16px 0 0; border: 1px solid #e3e7ed; border-radius: 9px; background: #fafbfc; }
summary { cursor: pointer; padding: 12px 15px; font-weight: 600; font-size: 13px; color: #455568; }
details[open] > summary { border-bottom: 1px solid #e3e7ed; margin-bottom: 15px; }
details > form, details > .form-grid { padding: 0 15px 15px; }
.tabs { gap: 5px; padding: 4px 4px 0; margin: 22px 0; border-radius: 10px 10px 0 0; background: #eef1f5; }
.tabs button { padding: 12px 15px; color: #526170; font-size: 13px; border-radius: 7px 7px 0 0; }
.tabs button:hover { background: #ffffff80; }
.tabs button.active { background: white; color: #bc4b00; }
.meta { gap: 10px 22px; font-size: 13px; color: #667280; }
.steps { padding: 18px 20px; font-size: 12px; overflow-x: auto; }
.step { white-space: nowrap; }
.entry, .item-card { padding: 20px; }
.entry p { margin: 8px 0 12px; }
.entry p.danger { color: #bd3030; }
.stack h3 { margin-bottom: 0; }
.file-link { display: flex; align-items: center; gap: 12px; min-width: 0; overflow-wrap: anywhere; }
.file-icon { display: grid; place-items: center; width: 40px; height: 44px; flex: 0 0 40px; border-radius: 8px; background: #edf2f8; color: #536d89; }
.empty { color: #687583; font-size: 13px; padding: 36px 22px; }
.pagination { flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 36px; text-align: center; }
footer { font-size: 11px; padding: 16px 30px; color: #74808d; }
.tv .main { margin-left: 0; }
.tv .topbar { display: none; }
.tv-clock { font-size: 32px; font-variant-numeric: tabular-nums; }
.board { grid-template-columns: repeat(6, minmax(240px, 1fr)); padding-bottom: 16px; }
.board-column { min-width: 0; }
.task-card { border-left: 3px solid #ff7417; }
.menu-backdrop { display: none; }
.custom-fields { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; }
.custom-fields h3 { margin-bottom: 16px; }
.custom-checkbox { align-self: center; padding-top: 20px; }
.custom-values { margin: 0; }
.custom-values > div { display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px solid #edf0f3; }
.custom-values > div:last-child { border: 0; }
.custom-values dt { color: var(--muted); min-width: 120px; }
.custom-values dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
@media (max-width: 1200px) {
    main { padding: 26px 24px; }
    .topbar { padding: 0 24px; gap: 16px; }
    .today { display: none; }
    .dashboard-grid, .detail-grid { grid-template-columns: minmax(0, 1fr); }
    .stats { gap: 12px; }
    .stat { padding: 16px; }
    .stat-top { font-size: 12px; }
}
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
    .sidebar { width: 268px; z-index: 50; visibility: hidden; transition: transform .2s ease; }
    .menu-open .sidebar { visibility: visible; }
    .menu-open { overflow: hidden; }
    .menu-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 40; background: #14223280; border: 0; }
    .main { margin-left: 0; }
    .mobile-menu { display: inline-flex; flex-shrink: 0; }
    .topbar { padding: 0 14px; height: 60px; gap: 10px; }
    .topbar-right { margin-left: auto; }
    .breadcrumbs { font-size: 12px; }
    .crumb { padding: 0 7px; }
    main { padding: 24px 16px 90px; }
    .page-heading { flex-wrap: wrap; gap: 16px; }
    .page-heading h1 { font-size: 26px; }
    .page-heading p { font-size: 13px; }
    .page-heading .button { font-size: 13px; padding: 10px 14px; }
    .stats { gap: 10px; }
    .stat { padding: 14px; }
    .stat-top { font-size: 12px; align-items: flex-start; }
    .stat-icon { width: 26px; height: 26px; }
    .stat-icon svg { width: 17px; height: 17px; }
    .stat-value { font-size: 30px; margin-top: 12px; }
    .stat-note { font-size: 11px; line-height: 1.5; }
    .panel-header, .panel-body, .entry, .item-card { padding: 16px; }
    .panel-header { gap: 8px; }
    .panel-header h2 { font-size: 16px; }
    .attention-row { padding: 16px; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .form-actions { flex-wrap: wrap; }
    .tabs { gap: 0; }
    .tabs button { padding: 12px; font-size: 12px; }
    .mobile-nav { height: calc(66px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
    .mobile-nav a, .mobile-nav button { padding: 8px 0; margin: 0; min-height: 56px; font-size: 11px; border-radius: 0; color: #687583; gap: 4px; }
    .mobile-nav a.active { background: #fff8f2; color: #b94b00; }
    .mobile-nav a:hover:not(.active) { background: #f5f6f8; color: #334153; }
    .guest main { padding: 24px 16px; }
    .guest footer { text-align: center; justify-content: center; }
    .tv main { padding-bottom: 24px; }
    .login { padding: 26px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }

.workflow-panel{border-left:4px solid var(--orange,#f28c28)}.workflow-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}.deadline-chip{display:inline-flex;padding:7px 11px;border-radius:999px;background:#edf7ef;color:#28733d;font-size:13px;font-weight:700}.deadline-chip.soon,.deadline-chip.due_today{background:#fff3d6;color:#8c5d00}.deadline-chip.overdue{background:#ffe4e1;color:#a83228}.photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;margin:16px 0}.photo-card{overflow:hidden;border:1px solid var(--line,#e8e2dc);border-radius:14px;background:#fff;color:inherit;text-decoration:none}.photo-card img{display:block;width:100%;height:120px;object-fit:cover}.photo-card span{display:block;padding:10px;font-size:13px}.photo-card small{display:block;margin-top:4px;color:var(--muted,#766f69)}
