/* Studio-Leitzentrale V23.16 – Mobile-first App-Oberfläche.
   Ausschließlich Darstellung. D1, R2, Owner-Login und Push bleiben unverändert. */
:root { --app-ink:#422e37; --app-pink:#8f5369; --app-surface:#fffdfd;
  --app-canvas:#fbf7f6; --app-border:#e9dadd; --app-shadow:0 12px 34px rgba(74,42,49,.10); }
.app-sidebar-heading { display:none; }
.studio-mobile-bottom-nav svg { display:block; width:24px; height:24px; flex:none; }
.studio-mobile-bottom-nav button .app-nav-label { display:block; font-size:10px; line-height:1.2; font-weight:700; letter-spacing:0; }
#admin-sidebar .app-sidebar-heading button { appearance:none; }
/* Tablet: keep the editor usable in landscape, without squeezing calendar panels. */
@media (min-width:861px) and (max-width:1180px) {
 #dashboard { grid-template-columns:218px minmax(0,1fr); }
 .sidebar {padding:22px 12px;gap:13px;}
 .main-column {padding:0 22px 56px;}
 .sidebar-search {padding:10px 4px 4px;}
 .tab {min-height:46px;padding:11px 9px;gap:9px;}
 .topbar {min-height:98px;padding:16px 0;}
 .topbar h1 {font-size:clamp(27px,3vw,34px);}
 .topbar-right {gap:6px;}
 .admin-version-top {display:none;}
 .panel {padding:clamp(18px,2.1vw,30px);}
 .dashboard-stats {grid-template-columns:repeat(2,minmax(0,1fr));}
 .dashboard-columns,.cockpit-columns {grid-template-columns:1fr;}
 .quick-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
 .service-field-grid {grid-template-columns:minmax(0,1fr);}
}
@media (max-width:860px) {
 html {background:var(--app-canvas);}
 body {background:var(--app-canvas);}
 #dashboard {background:var(--app-canvas);padding-bottom:calc(102px + env(safe-area-inset-bottom));}
 .main-column {padding:0 16px calc(30px + env(safe-area-inset-bottom));overflow:visible;}
 .topbar {position:sticky;top:0;z-index:65;display:flex;min-height:79px;
   margin:0 -16px 18px;padding:12px max(15px,env(safe-area-inset-left)) 13px;
   border-bottom:1px solid var(--app-border);border-radius:0;
   background:rgba(251,247,246,.94);box-shadow:0 5px 14px #44303908;
   -webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px); }
 .topbar-leading {flex:1;min-width:0;align-items:center;gap:12px;}
 .topbar-leading > div {min-width:0;}
 .topbar .kicker {display:block;color:#9c7680;font-size:9px;letter-spacing:.08em;font-weight:750;}
 .topbar h1 {margin:3px 0 0;font:750 clamp(21px,3.6vw,29px)/1.13 system-ui,sans-serif;letter-spacing:-.035em;color:var(--app-ink);}
 .topbar-right {flex:0 0 auto;gap:4px;}
 #mobile-nav-toggle {padding:0;width:46px;height:46px;min-width:46px;min-height:46px;
   border:1px solid var(--app-border);border-radius:15px;background:#fff;
   color:var(--app-ink);box-shadow:0 3px 8px #4430390a;font-size:0;gap:0;justify-content:center;}
 #mobile-nav-toggle span {font-size:23px;}
 #admin-command-open {display:flex;justify-content:center;width:46px;min-width:46px;height:46px;min-height:46px;
   padding:0;border-radius:15px;border-color:var(--app-border);box-shadow:0 3px 8px #4430390a;}
 #admin-command-open::before {font-size:24px;}
 .panel,.dashboard-section,.cockpit-box,.welcome {background:var(--app-surface);
   border-radius:19px;border-color:var(--app-border);box-shadow:0 5px 20px #37202e08;}
 .panel {padding:17px 15px;}
 .panel-overview {padding:0;background:transparent;border:none;box-shadow:none;}
 .welcome {padding:23px 20px;border-radius:20px;background:linear-gradient(125deg,#f7e8e8,#fffdfd 85%);}
 .welcome h2 {font-size:clamp(28px,4vw,39px);}
 .dashboard-stat {border-radius:18px;min-height:112px;box-shadow:0 4px 16px #4430390a;}
 .dashboard-stat strong {font-size:clamp(24px,5vw,35px);}
 .section-heading {gap:10px;margin-bottom:18px;}
 .section-heading h2 {font-size:clamp(23px,5vw,30px);}
 .button {min-height:46px;border-radius:14px;}
 input:not([type=checkbox]):not([type=radio]):not([type=range]),
 select,textarea {min-height:44px;border-radius:11px;}
 .sidebar {display:flex;position:fixed;top:0;bottom:0;left:0;width:min(350px,91vw);
   height:100dvh;max-height:100dvh;overflow-x:hidden;overscroll-behavior:contain;
   padding:calc(13px + env(safe-area-inset-top)) 17px calc(15px + env(safe-area-inset-bottom));
   gap:10px;border-right:1px solid var(--app-border);background:#fffdfd;
   box-shadow:25px 0 65px #261c2236;z-index:250;}
 .app-sidebar-heading {display:flex;justify-content:space-between;align-items:center;
   font-weight:800;color:var(--app-ink);font-size:15px;letter-spacing:-.02em;min-height:45px;}
 .app-sidebar-heading button {display:grid;place-items:center;background:#f5e9eb;color:#654551;
   border:0;border-radius:13px;width:44px;height:44px;font-size:29px;line-height:1;cursor:pointer;}
 .sidebar .admin-brand {display:none;}
 .sidebar-search {padding:6px 0 10px;}
 .sidebar-search input {font-size:16px;min-height:46px;border-radius:13px;}
 .tabs {padding:1px 4px 8px 0;}
 .tab {min-height:49px;border-radius:13px;font-size:14px;padding:12px;}
 .tab.active {border-color:#ebd3da;background:#f9ecf0;color:#764254;}
 .nav-group {margin-bottom:16px;}
 .sidebar-bottom {padding-top:13px;}
 .nav-backdrop:not([hidden]) {background:rgba(38,23,33,.57);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);}
 .studio-mobile-bottom-nav {display:grid;position:fixed;z-index:80;
   left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));
   bottom:calc(10px + env(safe-area-inset-bottom));grid-template-columns:repeat(5,minmax(0,1fr));
   gap:2px;padding:8px 5px;border:1px solid #e5d0d8;border-radius:23px;
   background:rgba(255,253,253,.97);box-shadow:0 12px 38px rgba(70,36,49,.20);
   -webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);}
 .studio-mobile-bottom-nav button {display:flex;position:relative;flex-direction:column;
   justify-content:center;align-items:center;gap:5px;min-width:0;min-height:58px;
   border:0;border-radius:17px;background:transparent;color:#8d7780;
   font-size:11px;font-weight:690;line-height:1.2;padding:6px 1px;touch-action:manipulation;}
 .studio-mobile-bottom-nav button svg {width:23px;height:23px;stroke-width:1.85;}
 .studio-mobile-bottom-nav button .app-nav-label {font-size:10px;}
 .studio-mobile-bottom-nav button.active,.studio-mobile-bottom-nav button[aria-current=page] {
   background:#f6e6eb;color:#83435e;border-radius:17px;}
 .studio-mobile-bottom-nav button.active svg {stroke-width:2.35;}
 .studio-mobile-bottom-nav button:focus-visible {outline:2px solid #9a6075;outline-offset:1px;}
 #global-status.notice {position:fixed;z-index:90;bottom:calc(98px + env(safe-area-inset-bottom));
   left:15px;right:15px;width:auto;max-width:none;box-shadow:var(--app-shadow);}
 .admin-command-dialog {width:min(94vw,550px);max-height:min(81dvh,660px);top:6dvh;
   border-radius:22px;}
 .admin-command-result {min-height:58px;}
 .studio-toolbar,.studio-actions,.security-r2-actions {gap:10px;}
 .studio-calendar {gap:4px;}
 .studio-day {min-height:77px;padding:6px;border-radius:10px;}
 .studio-day-num {font-size:13px;}
 .studio-day small {font-size:9px;}
 .studio-calendar.calendar-list-view .studio-day {min-height:70px;}
 .studio-customer-filters, .customer-detail, .security-r2 {min-width:0;max-width:100%;}
 /* Tables stay usable through local horizontal scrolling instead of overflowing the viewport. */
 .panel table {max-width:100%;}
 .studio-mobile-bottom-nav[hidden] {display:none;}
}
@media (max-width:560px) {
 .main-column {padding:0 12px calc(27px + env(safe-area-inset-bottom));}
 .topbar {margin-left:-12px;margin-right:-12px;min-height:75px;padding:10px 12px 12px;}
 .topbar h1 {font-size:clamp(18px,5.6vw,25px);}
 .topbar .kicker {font-size:8px;}
 .welcome {padding:19px 16px;}
 .welcome p:not(.kicker) {font-size:13px;}
 .dashboard-stats {gap:10px;grid-template-columns:repeat(2,minmax(0,1fr));}
 .dashboard-stat {padding:13px;min-height:103px;}
 .dashboard-stat strong {font-size:clamp(21px,7vw,31px);}
 .quick-grid,.cockpit-shortcuts .quick-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
 .quick-grid button {min-height:110px;padding:13px 11px;border-radius:16px;}
 .quick-grid strong {font-size:15px;}
 .studio-mobile-bottom-nav {left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));
   bottom:calc(6px + env(safe-area-inset-bottom));border-radius:20px;padding:6px 3px;}
 .studio-mobile-bottom-nav button {font-size:10px;min-height:55px;gap:3px;padding:5px 0;}
 .studio-mobile-bottom-nav button svg {width:22px;height:22px;}
 .studio-mobile-bottom-nav button .app-nav-label {font-size:10px;}
 .sidebar {width:min(340px,93vw);}
 .panel {padding:15px 12px;}
 .login-shell {padding:15px 12px;}
 .login-card {width:100%;padding:clamp(21px,5vw,30px) 18px;border-radius:25px;}
 .login-card h1 {font-size:clamp(30px,9vw,40px);}
 .topbar .admin-version-top {display:none;}
}
@media (max-width:360px) {
 .studio-mobile-bottom-nav button {font-size:9px;}
 .studio-mobile-bottom-nav button svg {width:21px;height:21px;}
 .studio-mobile-bottom-nav button .app-nav-label {font-size:9px;}
 #mobile-nav-toggle,#admin-command-open {width:42px;min-width:42px;height:44px;min-height:44px;}
 .topbar-leading {gap:7px;}
 .topbar h1 {font-size:18px;}
}
@media (prefers-reduced-motion:reduce) {
 .studio-mobile-bottom-nav *, .sidebar {animation:none!important;transition:none!important;}
}
@media print {
 .studio-mobile-bottom-nav, .app-sidebar-heading {display:none!important;}
}
