/* FreiDeCa Studio Build 015 – Responsive Foundation */
:root{--fdc-touch:46px;--fdc-safe-bottom:env(safe-area-inset-bottom,0px)}
*,*:before,*:after{box-sizing:border-box}
img,svg,video,canvas{max-width:100%;height:auto}
.fdc-app,.fdc-auth-shell,.fdc-studio-portal,.fdc-admin,.fdc-compact-admin{width:min(100%,1400px)}
.fdc-app input,.fdc-app select,.fdc-app textarea,.fdc-app button,
.fdc-auth-shell input,.fdc-auth-shell select,.fdc-auth-shell textarea,.fdc-auth-shell button,
.fdc-sales-modal input,.fdc-sales-modal select,.fdc-sales-modal textarea,.fdc-sales-modal button{font-size:16px}
.fdc-primary,.fdc-sales-btn,.fdc-app button,.fdc-auth-shell button{min-height:var(--fdc-touch)}
.fdc-accordion>summary,.fdc-sales-tool>summary{min-height:var(--fdc-touch)}
.fdc-responsive-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}

@media (max-width:1100px){
 .fdc-app{margin:16px auto;border-radius:20px;grid-template-columns:88px minmax(0,1fr)}
 .fdc-app-main{padding:22px!important;min-width:0}
 .fdc-app-nav{padding:20px 12px!important}
 .fdc-app-nav span,.fdc-app-logo div{display:none!important}
 .fdc-app-nav a{justify-content:center!important;padding:13px!important}
 .fdc-app-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .fdc-module-cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .fdc-profile-section{grid-template-columns:1fr!important}
 .fdc-order-grid,.fdc-kpis,.fdc-module-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

@media (max-width:782px){
 body{overflow-x:hidden}
 .fdc-app{display:block!important;width:100%!important;margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;min-height:100dvh;padding-bottom:calc(78px + var(--fdc-safe-bottom))}
 .fdc-app-main{padding:12px!important}
 .fdc-app-nav{position:fixed!important;z-index:999990;left:0;right:0;bottom:0;top:auto!important;height:auto!important;display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:space-around!important;padding:8px 8px calc(8px + var(--fdc-safe-bottom))!important;background:#172018!important;border-radius:18px 18px 0 0;box-shadow:0 -10px 30px rgba(0,0,0,.2)}
 .fdc-app-logo{display:none!important}
 .fdc-app-nav nav{display:flex!important;flex:1;justify-content:space-around;gap:4px!important}
 .fdc-app-nav a{min-width:54px;min-height:50px;display:grid!important;place-items:center!important;padding:8px!important;font-size:22px!important}
 .fdc-app-nav a span{display:none!important}
 .fdc-nav-logout{margin:0!important}
 .fdc-app-hero{display:block!important;padding:20px!important;border-radius:16px!important}
 .fdc-app-hero h1{font-size:clamp(27px,8vw,34px)!important;line-height:1.1}
 .fdc-user-chip{margin-top:16px!important;width:100%}
 .fdc-app-stats,.fdc-module-cards,.fdc-order-grid,.fdc-kpis,.fdc-module-grid,.fdc-layout{grid-template-columns:1fr!important}
 .fdc-app-section,.fdc-panel,.fdc-module,.fdc-kpis>div{padding:16px!important;border-radius:15px!important}
 .fdc-section-head,.fdc-studio-portal header{align-items:flex-start!important;gap:10px;flex-wrap:wrap}
 .fdc-profile-form{padding:14px!important}
 .fdc-toolbar{position:sticky;top:0;z-index:40;box-shadow:0 8px 18px rgba(0,0,0,.08)}
 .fdc-accordion>summary{padding:14px!important;gap:10px!important}
 .fdc-summary-meta{padding-left:0!important}
 .fdc-accordion-body{padding:14px!important}
 .fdc-inline-form{flex-direction:column;align-items:stretch!important}
 .fdc-inline-form>*{width:100%}
 .fdc-auth-shell{width:calc(100% - 16px)!important;margin:8px!important;border-radius:16px!important;min-height:auto!important}
 .fdc-auth-panel{padding:22px!important;min-height:auto!important}
 .fdc-auth-card{padding:24px 18px!important}
 .fdc-form{gap:12px!important}
 .fdc-form label{min-width:0}
 .fdc-form input,.fdc-form select,.fdc-form textarea{width:100%;min-height:46px}
 table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
}

@media (max-width:480px){
 .fdc-app-main{padding:9px!important}
 .fdc-app-section,.fdc-app-hero{padding:14px!important}
 .fdc-app-stats article{padding:15px!important}
 .fdc-module-cards article{padding:14px!important}
 .fdc-toolbar{padding:9px!important}
 .fdc-sales-btn{width:100%;margin:10px 0 0!important}
}

/* Build 015.1 – jederzeit sichtbare Abmeldung */
.fdc-user-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:flex-end}
.fdc-hero-logout,.fdc-nav-logout,.fdc-logout{background:#b42318!important;color:#fff!important;border:2px solid rgba(255,255,255,.25)!important;border-radius:12px!important;font-weight:800!important;text-decoration:none!important;opacity:1!important;box-shadow:0 7px 18px rgba(180,35,24,.22)}
.fdc-hero-logout{display:inline-flex;align-items:center;justify-content:center;min-height:46px;padding:11px 17px}
.fdc-nav-logout,.fdc-logout{display:flex!important;align-items:center!important;justify-content:center!important;gap:8px!important}
.fdc-nav-logout:hover,.fdc-logout:hover,.fdc-hero-logout:hover{background:#8f1b13!important;color:#fff!important}
@media(max-width:1100px) and (min-width:783px){.fdc-nav-logout{font-size:0!important}.fdc-nav-logout:before{content:"↪";font-size:22px}.fdc-nav-logout span{display:none!important}}
@media(max-width:782px){
 .fdc-user-actions{width:100%;justify-content:stretch}
 .fdc-user-actions .fdc-user-chip{flex:1;min-width:0}
 .fdc-hero-logout{width:100%;font-size:16px}
 .fdc-nav-logout{display:flex!important;min-width:78px!important;font-size:13px!important;line-height:1.05!important;grid-template-columns:1fr!important;padding:7px 9px!important}
 .fdc-nav-logout span{display:block!important;font-size:11px!important}
 .fdc-logout{position:static!important;margin-top:12px!important;min-height:46px!important}
 .fdc-logout span{display:inline!important}
}


/* Build 015.2 – einheitlicher Benutzer-Header */
.fdc-global-header{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:18px;padding:14px 16px;background:#fff;border:1px solid #e1e7e2;border-radius:16px;box-shadow:0 7px 24px rgba(28,45,32,.07)}
.fdc-global-search{flex:1;max-width:620px;display:flex;align-items:center;gap:10px;background:#f5f7f5;border:1px solid #dfe6df;border-radius:12px;padding:0 13px}
.fdc-global-search span{font-size:22px;color:#68746b}.fdc-global-search input{width:100%;min-height:44px;border:0!important;outline:0!important;background:transparent!important;box-shadow:none!important;padding:0!important}
.fdc-header-user{display:flex;align-items:center;gap:10px;flex:0 0 auto}.fdc-header-avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:#568f36;color:#fff;font-weight:900}.fdc-header-user-text{display:grid;min-width:130px}.fdc-header-user-text b{line-height:1.2}.fdc-header-user-text small{display:flex;align-items:center;gap:6px;color:#6c766e}.fdc-online-dot{width:8px;height:8px;border-radius:50%;background:#2f9e44;box-shadow:0 0 0 3px rgba(47,158,68,.13)}
.fdc-header-logout{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px;padding:10px 15px;border-radius:11px;background:#b42318!important;color:#fff!important;text-decoration:none!important;font-weight:850!important;box-shadow:0 7px 18px rgba(180,35,24,.24)}.fdc-header-logout:hover{background:#8f1b13!important;color:#fff!important}
.fdc-app-hero .fdc-user-actions{flex-wrap:nowrap}.fdc-app-nav>.fdc-nav-logout,.fdc-side>.fdc-logout{display:none!important}
@media(max-width:900px){.fdc-global-header{align-items:stretch;flex-direction:column-reverse}.fdc-global-search{max-width:none}.fdc-header-user{width:100%}.fdc-header-user-text{flex:1}.fdc-header-logout{min-width:132px}}
@media(max-width:600px){.fdc-global-header{padding:12px}.fdc-header-avatar{width:38px;height:38px}.fdc-header-user-text{min-width:0}.fdc-header-user-text b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.fdc-header-logout{min-width:auto;padding:10px 13px}.fdc-global-search input{font-size:14px}.fdc-app-hero .fdc-user-actions{display:grid;grid-template-columns:1fr}.fdc-app-hero .fdc-hero-logout{width:100%}}

/* Build 015.3 – Smartphone UI: echte Mobile-First-Ansicht */
@media (max-width: 782px){
 html,body{max-width:100%;overflow-x:hidden!important}
 body{font-size:15px}
 .fdc-app,.fdc-customer-app,.fdc-studio-portal,.fdc-admin,.fdc-compact-admin{max-width:100%!important;overflow:visible!important}
 .fdc-app-main,.fdc-main{width:100%!important;min-width:0!important;padding:10px 10px calc(92px + var(--fdc-safe-bottom))!important}

 /* Kompakter mobiler Kopfbereich */
 .fdc-global-header{position:sticky!important;top:0!important;z-index:99970!important;display:grid!important;grid-template-columns:1fr auto!important;gap:10px!important;margin:0 -10px 12px!important;padding:10px 12px!important;border-radius:0 0 16px 16px!important;border-top:0!important;background:rgba(255,255,255,.97)!important;backdrop-filter:blur(12px);box-shadow:0 7px 20px rgba(22,38,27,.12)!important}
 .fdc-header-user{grid-column:1/-1;display:grid!important;grid-template-columns:40px minmax(0,1fr) auto!important;width:100%!important;gap:9px!important;align-items:center!important}
 .fdc-header-avatar{width:40px!important;height:40px!important;font-size:14px!important}
 .fdc-header-user-text{min-width:0!important;display:block!important}
 .fdc-header-user-text b{display:block!important;font-size:15px!important;line-height:1.2!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
 .fdc-header-user-text small{font-size:12px!important;line-height:1.2!important;margin-top:3px!important}
 .fdc-header-logout{min-width:0!important;min-height:42px!important;padding:9px 12px!important;font-size:14px!important;border-radius:10px!important;white-space:nowrap!important}
 .fdc-global-search{grid-column:1/-1;order:2;width:100%!important;min-width:0!important;max-width:none!important;min-height:42px!important;padding:0 11px!important;border-radius:11px!important}
 .fdc-global-search input{font-size:16px!important;min-width:0!important}

 /* Seitennavigation als ruhige Bottom-Bar */
 .fdc-app-nav{height:72px!important;min-height:72px!important;padding:6px 6px calc(6px + var(--fdc-safe-bottom))!important;border-radius:16px 16px 0 0!important;overflow-x:auto!important;overflow-y:hidden!important;justify-content:flex-start!important;scrollbar-width:none}
 .fdc-app-nav::-webkit-scrollbar{display:none}
 .fdc-app-nav nav{display:flex!important;flex:0 0 auto!important;min-width:max-content!important;justify-content:flex-start!important;gap:3px!important}
 .fdc-app-nav a{display:flex!important;flex-direction:column!important;gap:2px!important;min-width:62px!important;width:62px!important;min-height:56px!important;padding:6px 4px!important;border-radius:11px!important;font-size:20px!important;line-height:1!important}
 .fdc-app-nav a span{display:block!important;max-width:58px!important;font-size:10px!important;line-height:1.05!important;text-align:center!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}

 /* Hero, Status und Überschriften */
 .fdc-app-hero{padding:16px!important;margin-bottom:12px!important;border-radius:15px!important}
 .fdc-app-hero h1{font-size:27px!important;line-height:1.08!important;margin:0 0 8px!important}
 .fdc-app-hero p,.fdc-lead{font-size:14px!important;line-height:1.45!important}
 .fdc-user-chip{width:100%!important;max-width:none!important;padding:10px 12px!important}
 .fdc-section-head,.fdc-head,.fdc-doc-head,.fdc-sales-top{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:9px!important}
 .fdc-section-head h2,.fdc-head h2{font-size:21px!important;line-height:1.2!important;margin:0!important}
 .fdc-head-actions,.fdc-actions,.fdc-row-actions,.fdc-doc-actions{display:grid!important;grid-template-columns:1fr!important;width:100%!important;gap:8px!important}
 .fdc-head-actions>* ,.fdc-actions>* ,.fdc-row-actions>* ,.fdc-doc-actions>*{width:100%!important;margin:0!important}

 /* Karten und Listen */
 .fdc-app-stats,.fdc-module-cards,.fdc-module-grid,.fdc-order-grid,.fdc-kpis,.fdc-device-grid,.fdc-vehicle-grid,.fdc-document-grid,.fdc-mailbox-grid,.fdc-data-grid,.fdc-manage-grid,.fdc-grid-2,.fdc-grid-3,.fdc-grid-4,.fdc-grid-address,.fdc-field-grid,.fdc-grid-form,.fdc-sales-grid,.fdc-campsite-layout{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:10px!important}
 .fdc-app-section,.fdc-panel,.fdc-module,.fdc-order,.fdc-vehicle-card,.fdc-device-card,.fdc-document-card,.fdc-doc-card,.fdc-mail-card,.fdc-account-box,.fdc-confirm-card,.fdc-create-box,.fdc-manage-panel{width:100%!important;min-width:0!important;padding:14px!important;margin:0 0 10px!important;border-radius:14px!important}
 .fdc-summary-title{min-width:0!important;font-size:15px!important}
 .fdc-summary-meta{display:flex!important;flex-wrap:wrap!important;gap:5px 8px!important;font-size:12px!important}
 .fdc-accordion>summary,.fdc-sales-tool>summary{padding:13px 12px!important;align-items:flex-start!important}
 .fdc-accordion-body,.fdc-sales-tool-body{padding:12px!important}

 /* Formulare ohne Überbreite */
 .fdc-form,.fdc-profile-form,.fdc-vehicle-editor,.fdc-inline-form,.fdc-block-row{display:grid!important;grid-template-columns:minmax(0,1fr)!important;width:100%!important;gap:11px!important}
 .fdc-form>*,.fdc-profile-form>*,.fdc-vehicle-editor>*,.fdc-inline-form>*,.fdc-block-row>*{min-width:0!important;max-width:100%!important;width:100%!important}
 input,select,textarea,button{max-width:100%!important}
 .fdc-app input,.fdc-app select,.fdc-app textarea,.fdc-customer-app input,.fdc-customer-app select,.fdc-customer-app textarea,.fdc-admin input,.fdc-admin select,.fdc-admin textarea{width:100%!important;min-height:46px!important;border-radius:10px!important}
 textarea{min-height:104px!important}
 .fdc-primary,.fdc-secondary,.fdc-danger,.fdc-sales-btn,.fdc-ocr-button,.fdc-qr-button{width:100%!important;min-height:48px!important;justify-content:center!important}
 .fdc-checks,.fdc-checkbox-card{display:grid!important;grid-template-columns:1fr!important}

 /* Tabellen mobil in lesbare Datenkarten umwandeln */
 .fdc-responsive-scroll,table{width:100%!important;max-width:100%!important;overflow-x:auto!important;border-radius:12px!important;-webkit-overflow-scrolling:touch}
 table{font-size:13px!important}
 th,td{min-width:120px;padding:10px 9px!important;white-space:normal!important;vertical-align:top!important}

 /* Modale Fenster und Dokumente als Vollbild */
 .fdc-sales-modal,.fdc-profile-modal,.fdc-customer-vehicle-modal,.fdc-print-card-modal{position:fixed!important;inset:0!important;z-index:1000000!important;padding:0!important;overflow:hidden!important;background:rgba(15,23,18,.72)!important}
 .fdc-sales-sheet,.fdc-customer-vehicle-sheet,.fdc-print-card-sheet{position:absolute!important;inset:0!important;width:100%!important;max-width:none!important;height:100dvh!important;max-height:none!important;margin:0!important;border-radius:0!important;overflow-y:auto!important;overscroll-behavior:contain!important;padding:12px 10px calc(24px + var(--fdc-safe-bottom))!important}
 .fdc-sales-layout,.fdc-doc-layout{display:block!important;width:100%!important}
 .fdc-sales-editor,.fdc-sales-preview,.fdc-doc-sidebar,.fdc-doc-canvas-wrap{width:100%!important;min-width:0!important;max-width:none!important}
 .fdc-sales-preview,.fdc-doc-canvas-wrap{overflow-x:auto!important}
 .fdc-sales-mobile-tabs{position:sticky!important;top:0!important;z-index:20!important;display:grid!important;grid-template-columns:1fr 1fr!important;gap:6px!important;padding:8px 0!important;background:#fff!important}
 .fdc-sales-mobile-tabs button{min-height:44px!important}
 .fdc-sales-close,.fdc-profile-close,.fdc-customer-modal-close,.fdc-print-close{position:sticky!important;top:0!important;z-index:30!important;float:right!important;min-width:44px!important;min-height:44px!important;margin-left:auto!important}
 .fdc-a4,.fdc-doc-page{min-width:720px!important;transform-origin:top left}

 /* Bilder und Upload */
 .fdc-photo-grid,.fdc-device-images,.fdc-image-placeholders{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
 .fdc-upload-box,.fdc-photo-panel,.fdc-ocr-box{padding:13px!important;border-radius:13px!important}

 /* Login / Registrierung */
 .fdc-auth-shell{display:block!important;width:100%!important;min-height:100dvh!important;margin:0!important;border-radius:0!important}
 .fdc-auth-brand{padding:24px 18px 18px!important;min-height:auto!important}
 .fdc-auth-panel{padding:14px!important}
 .fdc-auth-card{width:100%!important;max-width:none!important;padding:20px 15px!important;border-radius:15px!important}
 .fdc-auth-copy h1{font-size:29px!important}
}

@media (max-width: 420px){
 .fdc-header-logout{font-size:0!important;width:44px!important;padding:0!important}
 .fdc-header-logout:before{content:"↪";font-size:22px!important;color:#fff}
 .fdc-app-main,.fdc-main{padding-left:8px!important;padding-right:8px!important}
 .fdc-global-header{margin-left:-8px!important;margin-right:-8px!important}
 .fdc-photo-grid,.fdc-device-images,.fdc-image-placeholders{grid-template-columns:1fr!important}
}

/* Build 015.6: all main workspace accordions start closed and remain natively toggleable */
.fdc-dashboard-panel:not([open]) > :not(summary),
.fdc-vehicle-modal-panel:not([open]) > :not(summary),
.fdc-accordion:not([open]) > :not(summary),
.fdc-sales-tool:not([open]) > :not(summary){display:none!important}
.fdc-dashboard-panel > summary,
.fdc-vehicle-modal-panel > summary,
.fdc-accordion > summary,
.fdc-sales-tool > summary{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
