/* Desktop SaaS Shell: linke Navigation und ruhigeres Backend-Layout.
   Mobile bleibt bewusst unverändert. */
@media (min-width: 1024px){
  body.jg-desktop-shell{
    --bg:#f6f7f9;
    --card:#ffffff;
    --ink:#111827;
    --muted:#64748b;
    --line:#dfe4ea;
    --brand:#0f172a;
    --brand2:#1e293b;
    --radius:14px;
    --shadow:0 1px 2px rgba(15,23,42,.04),0 10px 28px rgba(15,23,42,.06);
    background:#f6f7f9;
    font-size:14px;
  }

  body.jg-desktop-shell .app{max-width:none;margin:0;padding:24px 34px 92px 306px;min-height:100vh;}
  body.jg-desktop-shell .topbar{position:fixed;inset:0 auto 0 0;width:276px;margin:0;padding:22px 18px 108px;background:#0f172a;color:#e5e7eb;border:0;border-right:1px solid rgba(148,163,184,.18);box-shadow:none;overflow:auto;backdrop-filter:none;}
  body.jg-desktop-shell .brand{display:block;padding:0 0 18px;border-bottom:1px solid rgba(148,163,184,.18);}
  body.jg-desktop-shell .brand .row{display:flex;gap:12px;align-items:center;}
  body.jg-desktop-shell .brand h1{color:#fff;font-size:17px;letter-spacing:-.015em;}
  body.jg-desktop-shell .brand .sub{color:#94a3b8;font-size:11px;}
  body.jg-desktop-shell .logo{background:#fff;color:#0f172a;border-radius:10px;width:40px;height:40px;}
  body.jg-desktop-shell .pill{display:none!important;}

  body.jg-desktop-shell .main-tabs{margin-top:18px;}
  body.jg-desktop-shell .desktop-main-tabs{display:grid;grid-template-columns:1fr;gap:4px;}
  body.jg-desktop-shell .jg-nav-group-label{margin:18px 10px 7px;color:#94a3b8;font-size:10px;font-weight:900;letter-spacing:.10em;text-transform:uppercase;}
  body.jg-desktop-shell .main-tab{width:100%;min-height:38px;display:flex;align-items:center;justify-content:flex-start;gap:10px;padding:9px 12px;border-radius:10px;background:transparent;color:#cbd5e1;box-shadow:none;border:1px solid transparent;font-size:13px;font-weight:800;text-align:left;}
  body.jg-desktop-shell .main-tab:hover{background:rgba(148,163,184,.12);color:#fff;}
  body.jg-desktop-shell .main-tab.active,
  body.jg-desktop-shell .main-tab.jg-settings-active{background:#ffffff;color:#0f172a;border-color:#fff;}
  body.jg-desktop-shell .main-tab::before{width:22px;text-align:center;color:inherit;opacity:.95;}
  body.jg-desktop-shell .main-tab[data-main-tab="dashboard"]::before{content:"⌂";}
  body.jg-desktop-shell .main-tab[data-main-tab="calendar"]::before{content:"◷";}
  body.jg-desktop-shell .main-tab[data-main-tab="offer"]::before{content:"▤";}
  body.jg-desktop-shell .main-tab[data-main-tab="invoice"]::before{content:"◫";}
  body.jg-desktop-shell .main-tab[data-main-tab="inspection"]::before{content:"◎";}
  body.jg-desktop-shell .main-tab[data-main-tab="archive"]::before{content:"▦";}
  body.jg-desktop-shell .main-tab[data-main-tab="customers"]::before{content:"◉";}
  body.jg-desktop-shell .main-tab[data-main-tab="settings"]::before{content:"⚙";}
  body.jg-desktop-shell .main-tab.jg-masteradmin-tab::before{content:"◆";}

  body.jg-desktop-shell .jg-sidebar-subnav{display:none;margin:3px 0 8px 32px;gap:2px;}
  body.jg-desktop-shell .main-tab.jg-settings-active + .jg-settings-subnav,
  body.jg-desktop-shell .main-tab.jg-masteradmin-tab.active + .jg-sidebar-subnav{display:grid;}
  body.jg-desktop-shell .jg-sidebar-subnav button{min-height:28px;border-radius:8px;background:transparent;color:#94a3b8;text-align:left;padding:6px 8px;font-size:11px;font-weight:800;}
  body.jg-desktop-shell .jg-sidebar-subnav button:hover,
  body.jg-desktop-shell .jg-sidebar-subnav button.active{background:rgba(148,163,184,.12);color:#fff;}

  body.jg-desktop-shell .jg-sidebar-profile{position:fixed;left:18px;bottom:16px;width:240px;padding:12px;border-radius:14px;background:#111c2f;border:1px solid rgba(148,163,184,.18);box-shadow:0 12px 30px rgba(0,0,0,.18);z-index:30;}
  body.jg-desktop-shell .jg-sidebar-profile .profile-email{font-size:12px;font-weight:900;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  body.jg-desktop-shell .jg-sidebar-profile .profile-role{font-size:11px;color:#94a3b8;margin-top:2px;}
  body.jg-desktop-shell .jg-sidebar-profile button{margin-top:10px;width:100%;min-height:32px;border-radius:9px;background:#ef4444;color:#fff;font-size:12px;font-weight:900;}

  body.jg-desktop-shell .work-actions{display:grid;grid-template-columns:1fr;gap:6px;margin-top:18px;padding-top:16px;border-top:1px solid rgba(148,163,184,.18);}
  body.jg-desktop-shell .work-action{min-height:36px;border-radius:10px;background:rgba(148,163,184,.10);color:#cbd5e1;border-color:rgba(148,163,184,.16);font-size:12px;text-align:left;justify-content:flex-start;}
  body.jg-desktop-shell .work-action.active{background:rgba(255,255,255,.94);color:#0f172a;}
  body.jg-desktop-shell .tabs{display:grid!important;grid-template-columns:1fr;gap:5px;margin:4px 0 8px 32px;padding:0;border-top:0;overflow:visible;}
  body.jg-desktop-shell .tabs.jg-workflow-subnav{display:grid!important;}
  body.jg-desktop-shell .tab{flex:none;min-height:30px;border-radius:8px;background:transparent;color:#94a3b8;box-shadow:none;font-size:11px;text-align:left;padding:6px 8px;}
  body.jg-desktop-shell .tab:hover{background:rgba(148,163,184,.12);color:#fff;}
  body.jg-desktop-shell .tab.active{background:#263348;color:#fff;}

  body.jg-desktop-shell #view{max-width:1320px;margin:0 auto;}
  body.jg-desktop-shell:not(:has(.preview-wrap)) #view{max-width:1120px;}
  body.jg-desktop-shell .settings-page{max-width:1120px;margin:0 auto;}
  body.jg-desktop-shell .doc-context,
  body.jg-desktop-shell .basis-card,
  body.jg-desktop-shell .card:has(.template-grid),
  body.jg-desktop-shell .card:has(#offerNoInput),
  body.jg-desktop-shell .card:has(#invoiceNoInput){max-width:1120px;margin-left:auto;margin-right:auto;}
  body.jg-desktop-shell .preview-wrap{max-width:1320px;margin-left:auto;margin-right:auto;border-radius:14px;}

  body.jg-desktop-shell .card,
  body.jg-desktop-shell .settings-accordion,
  body.jg-desktop-shell .settings-mini-card,
  body.jg-desktop-shell .item,
  body.jg-desktop-shell .overview-box{border-radius:14px;box-shadow:0 1px 2px rgba(15,23,42,.035);}
  body.jg-desktop-shell .card{padding:18px;margin-bottom:14px;}
  body.jg-desktop-shell .section-title h2,
  body.jg-desktop-shell .settings-summary-main strong{font-size:16px;letter-spacing:-.01em;}
  body.jg-desktop-shell .section-title p,
  body.jg-desktop-shell .settings-summary-main small,
  body.jg-desktop-shell .hint,
  body.jg-desktop-shell .muted{color:#64748b;}
  body.jg-desktop-shell label{font-size:11px;color:#475569;letter-spacing:.055em;}
  body.jg-desktop-shell input,
  body.jg-desktop-shell textarea,
  body.jg-desktop-shell select{border-radius:10px;padding:10px 11px;min-height:40px;border-color:#d7dee8;}
  body.jg-desktop-shell textarea{min-height:76px;}
  body.jg-desktop-shell input[type="checkbox"]{width:16px!important;height:16px!important;min-height:16px!important;padding:0!important;transform:none!important;accent-color:#2563eb;}
  body.jg-desktop-shell .checkline{display:flex;align-items:flex-start;gap:9px;font-size:12px;line-height:1.35;letter-spacing:.02em;}
  body.jg-desktop-shell .btn{border-radius:10px;min-height:38px;padding:9px 12px;font-size:13px;}
  body.jg-desktop-shell .btn.small{min-height:32px;padding:7px 10px;font-size:12px;}
  body.jg-desktop-shell .actions .btn{flex:0 0 auto;}

  body.jg-desktop-shell .settings-hero{display:none!important;}
  body.jg-desktop-shell .settings-quicknav{display:none;}
  body.jg-desktop-shell .settings-accordion{background:transparent;border:0;box-shadow:none;padding:0;margin:0;}
  body.jg-desktop-shell .settings-accordion > summary{display:none!important;}
  body.jg-desktop-shell .settings-panel-body{padding:0!important;border:0!important;background:transparent!important;}
  body.jg-desktop-shell .settings-accordion.jg-panel-visible{display:block!important;}
  body.jg-desktop-shell .settings-accordion.jg-panel-hidden{display:none!important;}

  body.jg-desktop-shell #settings-calendar-templates.jg-calendar-only .settings-split{display:block;}
  body.jg-desktop-shell #settings-calendar-templates.jg-calendar-only .settings-split > .settings-mini-card:nth-child(2){display:none!important;}
  body.jg-desktop-shell #settings-calendar-templates.jg-templates-only .settings-split{display:block;}
  body.jg-desktop-shell #settings-calendar-templates.jg-templates-only .settings-split > .settings-mini-card:nth-child(1){display:none!important;}
  body.jg-desktop-shell #settings-calendar-templates.jg-templates-only .settings-split > .settings-mini-card:nth-child(2){display:block!important;}

  body.jg-desktop-shell .jg-page-title{margin:0 0 18px;display:flex;align-items:flex-end;justify-content:space-between;gap:16px;}
  body.jg-desktop-shell .jg-page-title h2{margin:0;font-size:24px;letter-spacing:-.03em;color:#111827;}
  body.jg-desktop-shell .jg-page-title p{margin:4px 0 0;color:#64748b;}

  body.jg-desktop-shell #usersList.jg-users-table{display:block;border:0;border-radius:0;overflow:visible;background:transparent;}
  body.jg-desktop-shell .jg-data-table{border:1px solid #dfe4ea;border-radius:12px;overflow:hidden;background:#fff;box-shadow:0 1px 2px rgba(15,23,42,.035);}
  body.jg-desktop-shell .jg-table-head,
  body.jg-desktop-shell .jg-table-row{display:grid;grid-template-columns:1.2fr .55fr 1.15fr .85fr .65fr 1fr;align-items:center;column-gap:10px;}
  body.jg-desktop-shell .jg-table-head{min-height:38px;background:#f8fafc;border-bottom:1px solid #e5eaf0;color:#64748b;font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.06em;padding:0 12px;}
  body.jg-desktop-shell .jg-table-row{min-height:64px;padding:10px 12px;border-bottom:1px solid #edf1f5;}
  body.jg-desktop-shell .jg-table-row:last-child{border-bottom:0;}
  body.jg-desktop-shell .jg-table-row:hover{background:#fbfdff;}
  body.jg-desktop-shell .jg-table-cell{min-width:0;display:flex;flex-direction:column;gap:4px;}
  body.jg-desktop-shell .jg-table-cell input,
  body.jg-desktop-shell .jg-table-cell select{width:100%;min-height:34px;padding:7px 9px;border-radius:8px;font-size:13px;background:#fff;}
  body.jg-desktop-shell .jg-table-cell small{color:#64748b;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  body.jg-desktop-shell .jg-table-actions{display:flex!important;justify-content:flex-end;align-items:center;gap:8px;margin:0!important;flex-wrap:nowrap;}
  body.jg-desktop-shell .jg-table-actions .btn{min-height:32px;padding:7px 10px;font-size:12px;}
  body.jg-desktop-shell #settings-users .settings-mini-card > .section-title{align-items:center;}
  body.jg-desktop-shell #settings-users .settings-mini-card > .section-title::after{content:'Benutzer anlegen';display:inline-flex;align-items:center;justify-content:center;min-height:32px;padding:0 12px;border-radius:9px;background:#047857;color:#fff;font-size:12px;font-weight:900;}

  body.jg-desktop-shell .jg-offer-table .jg-table-head,
  body.jg-desktop-shell .jg-offer-table .jg-table-row,
  body.jg-desktop-shell .jg-invoice-table .jg-table-head,
  body.jg-desktop-shell .jg-invoice-table .jg-table-row{grid-template-columns:1.05fr 1.65fr .55fr .8fr 1.05fr;}
  body.jg-desktop-shell .jg-inspection-table .jg-table-head,
  body.jg-desktop-shell .jg-inspection-table .jg-table-row{grid-template-columns:1.15fr 1.3fr 1.45fr 1fr;}
  body.jg-desktop-shell .jg-customers-table .jg-table-head,
  body.jg-desktop-shell .jg-customers-table .jg-table-row{grid-template-columns:1.1fr 1fr 1.55fr 1fr;}
  body.jg-desktop-shell .jg-archive-table .jg-table-cell,
  body.jg-desktop-shell .jg-customers-table .jg-table-cell{font-size:13px;line-height:1.3;}
  body.jg-desktop-shell .jg-archive-table .jg-table-row,
  body.jg-desktop-shell .jg-customers-table .jg-table-row{min-height:54px;}

  body.jg-desktop-shell [data-archive-offer],
  body.jg-desktop-shell [data-archive-invoice],
  body.jg-desktop-shell .archive-list .item,
  body.jg-desktop-shell .settings-list-compact .item,
  body.jg-desktop-shell #backupList .item,
  body.jg-desktop-shell #companiesList .item{box-shadow:none;border-radius:0;border-left:0;border-right:0;border-top:0;margin:0;padding:12px 14px;background:#fff;}
  body.jg-desktop-shell .archive-list,
  body.jg-desktop-shell #backupList,
  body.jg-desktop-shell #companiesList{border:1px solid #dfe4ea;border-radius:14px;overflow:hidden;background:#fff;display:grid;gap:0;}
  body.jg-desktop-shell [data-archive-offer] .item-head,
  body.jg-desktop-shell [data-archive-invoice] .item-head{display:grid;grid-template-columns:minmax(0,1fr) 140px;gap:14px;align-items:center;}
  body.jg-desktop-shell [data-archive-offer] .actions,
  body.jg-desktop-shell [data-archive-invoice] .actions{margin-top:8px!important;justify-content:flex-end;}

  body.jg-desktop-shell .bottom{left:276px;padding:10px 34px;background:rgba(255,255,255,.96);}
  body.jg-desktop-shell .bottom-inner{max-width:1120px;grid-template-columns:auto auto;justify-content:flex-end;}
  body.jg-desktop-shell .modal-backdrop{left:276px;}
  body.jg-desktop-shell .modal{max-width:980px;margin:0 auto;border-radius:20px 20px 0 0;}
  body.jg-desktop-shell .inspection-form-grid{max-width:1120px;margin-left:auto;margin-right:auto;}
  body.jg-desktop-shell .toast{bottom:28px;left:calc(276px + (100vw - 276px)/2);}
}