/* Shared application layout; every authenticated route uses the dashboard's tokens. */
.cg-sidebar {position:relative; display:flex; flex-direction:column; align-self:stretch;}
.cg-sidebar nav {flex:1;}
.cg-sidebar-note {display:flex; align-items:center; gap:8px; margin:28px 12px 0; padding-top:20px; border-top:1px solid #334155; color:#94A3B8; font-size:13px;}
.cg-logo {flex:none;}
.cg-logo strong {text-transform:uppercase;}
.cg-page-heading {display:flex; gap:12px; align-items:center; min-width:0;}
.cg-page-heading h1,.cg-header p {overflow-wrap:anywhere;}
.cg-page .menu-toggle,.cg-menu-close,.cg-menu-overlay {display:none;}
.cg-page-tabs {display:flex; align-items:center; gap:6px; padding:6px; max-width:100%; overflow-x:auto; border:1px solid var(--line); border-radius:12px; background:var(--surface); scrollbar-width:thin;}
.cg-page-tabs a {display:flex; justify-content:center; align-items:center; flex:none; min-height:44px; padding:10px 16px; border-radius:8px; font-size:14px; font-weight:500; white-space:nowrap;}
.cg-page-tabs a:hover {background:var(--soft);}
.cg-page-tabs a[aria-current=page] {background:var(--brand-soft); color:var(--accent); font-weight:600;}
.cg-page-content {min-width:0;}
.cg-work-page {display:grid; gap:24px; align-content:start; animation:cg-page-enter .2s ease-out;}
.cg-work-page > .card {width:100%; max-width:none; margin:0;}
.cg-work-page > .local-footnote {margin:0;}
.cg-page .card {border-radius:14px; box-shadow:none;}
.cg-page .card-heading {padding:22px 24px;}
.cg-page .card-heading h2,.cg-page .card-heading h3 {font-size:16px; font-weight:600;}
.cg-page .card-heading p {font-size:14px; line-height:1.6;}
.cg-page .btn {min-height:44px; border-radius:10px; line-height:1.4; white-space:normal;}
.cg-page .btn-small {font-size:14px;}
.cg-page .btn-ghost,.cg-page button.text-link,.cg-page button.key-cell {min-height:44px; min-width:44px;}
.cg-page .btn-primary {background:var(--accent); border-color:var(--accent); color:white;}
.cg-page .field {min-width:0;}
.cg-page .field label {font-size:14px; font-weight:500;}
.cg-page .field input,.cg-page .field select,.cg-page .field textarea {border-radius:10px; font-size:16px; min-height:44px;}
.cg-page .field small {font-size:13px; line-height:1.6;}
.cg-page table {font-size:14px;}
.cg-page th {background:var(--soft); color:var(--muted);}
.cg-page .table-wrap {max-width:100%;}
.cg-page .audit-notice {border-radius:10px; font-size:14px;}
.cg-page .pill {font-size:13px;}
.cg-page .form-error {border-radius:10px; background:var(--loss-bg); color:var(--loss-strong);}
.cg-upload-grid {display:grid; grid-template-columns:minmax(0,1.65fr) minmax(230px,1fr); gap:24px; align-items:start;}
.cg-upload-card .card-heading {border-bottom:0; padding-bottom:0;}
.cg-upload-icon {display:grid; place-items:center; width:44px; height:44px; border-radius:12px; margin-bottom:16px; background:var(--brand-soft); color:var(--accent);}
.cg-upload-card .card-heading h2 {font-size:20px;}
.cg-file-picker {padding:22px; border:1px dashed #94A3B8; border-radius:12px; background:var(--soft);}
.cg-file-picker:focus-within {border-color:var(--accent); outline:2px solid var(--brand-soft);}
.cg-file-picker .field {margin:0;}
.cg-page .cg-file-picker input[type=file] {padding:0; border:0; min-height:44px; width:100%; background:transparent; font-size:14px;}
.cg-file-picker input::file-selector-button {min-height:44px; padding:10px 14px; margin-right:12px; border:1px solid #D9DEE8; border-radius:10px; background:white; color:#374151; font:inherit; font-weight:500; cursor:pointer;}
.cg-file-picker input::file-selector-button:hover {border-color:var(--accent); color:var(--accent);}
.cg-upload-card .form-actions {margin-top:22px;}
.cg-upload-card .upload-files:empty {display:none;}
.cg-upload-card .upload-file {background:var(--soft); border-radius:10px; font-size:14px;}
.cg-upload-help {padding:24px;}
.cg-upload-help h2 {font-size:16px; font-weight:600;}
.cg-upload-help ol {list-style:none; padding:0; margin:24px 0; display:grid; gap:24px;}
.cg-upload-help li {display:flex; align-items:start; gap:12px;}
.cg-upload-help li > span {display:grid; place-items:center; width:34px; height:34px; flex:none; border-radius:8px; background:var(--soft); color:var(--accent);}
.cg-upload-help strong {display:block; font-size:14px; font-weight:600; margin-bottom:4px;}
.cg-upload-help li p {font-size:14px; line-height:1.65; color:var(--muted);}
.cg-upload-note {display:flex; gap:8px; align-items:start; padding-top:20px; border-top:1px solid var(--line); font-size:13px; color:var(--muted);}
.cg-upload-empty {padding:26px 16px; text-align:center;}
.cg-upload-empty > .icon {width:36px; height:36px; color:#94A3B8; margin:0 auto 12px;}
.cg-upload-empty h3 {font-size:16px; margin-bottom:6px;}
.cg-upload-empty p {font-size:14px; color:var(--muted);}
@keyframes cg-page-enter {from {opacity:.5; transform:translateY(4px);} to {opacity:1; transform:none;}}
@media (min-width:800px) and (max-width:1099px) {
  .cg-upload-grid {grid-template-columns:1fr;}
}
@media (max-width:799px) {
  .cg-page .menu-toggle {display:flex;}
  .cg-menu-close {display:flex; position:absolute; top:16px; right:16px;}
  .cg-sidebar {position:fixed; inset:0 auto 0 0; z-index:70; width:min(300px,calc(100vw - 48px)); height:100dvh; overflow-y:auto; padding:26px 18px; pointer-events:none; transform:translateX(-100%); transition:transform .22s ease;}
  .cg-sidebar .cg-logo {margin:0 46px 28px 10px;}
  .cg-sidebar nav {display:block; flex:initial;}
  .cg-sidebar .cg-nav-label {padding:0 12px; margin-bottom:12px;}
  .cg-sidebar .cg-account-label {margin-top:28px;}
  .cg-sidebar .cg-nav {font-size:14px; margin-bottom:5px; padding:11px 12px;}
  .cg-menu-overlay {position:fixed; inset:0; border:0; background:rgba(15,23,42,.5); z-index:65;}
  .cg-page.mobile-open .cg-sidebar {pointer-events:auto; transform:none;}
  .cg-page.mobile-open .cg-menu-overlay {display:block;}
  .cg-page.mobile-open {overflow:hidden;}
  .cg-header {gap:16px;}
  .cg-page-heading {width:100%; align-items:start;}
  .cg-header h1 {font-size:24px;}
  .cg-header-actions {width:100%; justify-content:flex-end;}
  .cg-header-actions .cg-period {margin-right:auto;}
  .cg-header-actions .cg-org {max-width:180px;}
  .cg-upload-grid {grid-template-columns:1fr; gap:20px;}
  .cg-page .card-heading,.cg-page .card-body {padding:20px;}
  .cg-upload-card .card-heading {padding-bottom:0;}
  .cg-file-picker {padding:16px;}
  .cg-upload-help {padding:20px;}
  .cg-upload-card .form-actions .btn {width:100%;}
  .cg-import-history .section-row {align-items:start;}
}
@media (prefers-reduced-motion:reduce) {
  .cg-work-page {animation:none;}
  .cg-sidebar {transition:none;}
}
