/* MIBERLY RENT 4.1 · UI / layout cleanup
   Loaded after V2/V3/V4. This file intentionally normalizes the final cascade. */

/* ---------- Public site ---------- */
.miberly-vibrant{overflow-x:clip;overflow-y:visible}
.miberly-vibrant .v-nav{min-width:0}
.miberly-vibrant .v-nav-links{min-width:0;gap:clamp(14px,2vw,28px)}
.miberly-vibrant .v-nav-links>a{white-space:nowrap}

/* The V4 hero contains a real search form. Never lock its height. */
.miberly-v2 .v2-hero{height:auto!important;min-height:680px;overflow:hidden}
.miberly-v2 .v2-hero .v-hero-content{min-height:680px;padding-top:72px;padding-bottom:105px}
.miberly-v2 .v2-hero-copy{min-width:0}
.miberly-v2 .v2-hero h1{max-width:760px}
.miberly-v2 .v2-hero .v-hero-image{height:100%;top:0;bottom:auto;object-fit:cover}
.v2-quick-search{width:100%;max-width:500px;justify-self:end;align-self:center;padding:26px;gap:15px;border-radius:14px;box-shadow:0 18px 55px rgba(22,10,14,.24)}
.v2-quick-heading{margin-bottom:1px}
.v2-quick-heading strong{font-size:22px}
.v2-quick-heading p{margin:6px 0 0;color:#85747a;font-size:10px;line-height:1.6}
.v41-quick-dates{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.v2-quick-search input{min-height:46px}
.v2-quick-search>.button{margin-top:1px}

/* Advanced booking fields belong to the full pricing panel, not the hero. */
.miberly-vibrant .rental-date-form .v3-booking-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;grid-column:1/-1}
.miberly-vibrant .rental-date-form .v3-booking-meta label{min-width:0}
.miberly-vibrant .rental-date-form .v3-booking-meta input,
.miberly-vibrant .rental-date-form .v3-booking-meta select{min-height:46px;width:100%}
.miberly-vibrant .rental-date-form .v3-extras-box{grid-column:1/-1;margin:0;padding:15px;border-radius:10px;background:#f7f2ee}
.miberly-vibrant .rental-date-form .v3-extra-options{gap:7px}

/* V4 customer tools are now a light, separate section instead of a second dark B2B block. */
.v4-public-section{padding:88px 0;background:#f8f4f0;border-top:1px solid #e4dad3;border-bottom:1px solid #e4dad3}
.v4-public-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.v4-public-grid article{min-width:0;padding:28px;border:1px solid #e1d6cf;border-radius:13px;background:#fffdfa;display:flex;flex-direction:column;align-items:flex-start}
.v4-public-icon{width:42px;height:42px;border-radius:10px;background:#eee1df;color:#682b3d;display:grid;place-items:center;margin-bottom:28px}
.v4-public-icon .icon{width:20px;height:20px}
.v4-public-grid h3{font:750 19px/1.2 var(--heading);margin:0 0 11px;color:#3f3035}
.v4-public-grid p{margin:0 0 22px;color:#74676b;font-size:12px;line-height:1.75;flex:1}
.v4-public-grid a{display:inline-flex;align-items:center;gap:8px;color:#682b3d;font-size:11px;font-weight:750}
.v4-public-grid a .icon{width:14px;height:14px}

/* Keep filters and floating compare controls from forcing horizontal overflow. */
.miberly-vibrant .v3-needs{max-width:100%;overflow-x:auto;flex-wrap:nowrap;padding-bottom:5px;scrollbar-width:thin}
.miberly-vibrant .v3-needs button{flex:0 0 auto}
.miberly-vibrant .v3-compare-bar{max-width:min(720px,calc(100vw - 28px))}

/* ---------- Admin shell ---------- */
body:has(.admin-shell){background:#f4efe8;overflow-x:hidden}
.admin-shell{display:grid!important;grid-template-columns:250px minmax(0,1fr)!important;min-height:100vh!important;align-items:stretch}
.admin-shell .admin-body{min-width:0;width:100%}
.admin-shell .admin-main{width:100%;max-width:1580px;margin:0 auto;padding:34px clamp(24px,3vw,48px) 60px;overflow:clip}
.admin-shell .admin-heading{align-items:flex-start;flex-wrap:wrap}
.admin-shell .admin-heading>div{min-width:0;flex:1 1 520px}
.admin-shell .admin-heading>.button{flex:0 0 auto}
.admin-shell .panel,.admin-shell .metric,.admin-shell .work-board,.admin-shell article,.admin-shell section{min-width:0}
.admin-shell .panel-heading{align-items:flex-start;padding:20px 22px}
.admin-shell .panel-heading>div{min-width:0}
.admin-shell .panel-heading p{max-width:780px;line-height:1.6}

/* A sane sidebar for the 4.0 feature set. */
.admin-shell .sidebar{position:sticky;top:0;height:100vh;min-height:0;overflow:hidden;padding:24px 14px 18px;gap:18px;background:#4a2634}
.admin-shell .sidebar>.miberly-brand{margin:0 8px 4px!important;flex:0 0 auto}
.admin-shell .admin-mobile-menu{display:flex;flex-direction:column;min-height:0;flex:1}
.admin-shell .admin-mobile-menu>summary{display:none;list-style:none}
.admin-shell .admin-nav-groups{display:block!important;min-height:0;overflow-y:auto;overflow-x:hidden;padding:2px 4px 14px 0;scrollbar-width:thin;scrollbar-color:#75505e transparent}
.admin-shell .admin-nav-group{border-bottom:1px solid rgba(255,255,255,.09);padding:5px 0 7px}
.admin-shell .admin-nav-group:last-child{border-bottom:0}
.admin-shell .admin-nav-group>summary{display:flex;align-items:center;justify-content:space-between;gap:10px;list-style:none;padding:10px 10px 8px;color:#bcaeb3;font-size:8px;font-weight:800;letter-spacing:1.15px;cursor:pointer;user-select:none}
.admin-shell .admin-nav-group>summary::-webkit-details-marker{display:none}
.admin-shell .admin-nav-group>summary .icon{width:13px;height:13px;transition:transform .16s}
.admin-shell .admin-nav-group[open]>summary .icon{transform:rotate(90deg)}
.admin-shell .admin-nav-items{display:grid;gap:3px;padding:0 2px 5px}
.admin-shell .admin-nav-items button{display:flex;align-items:center;gap:10px;width:100%;min-height:39px;padding:9px 11px;border:0;border-radius:8px;background:transparent;color:#d1c4c8;text-align:left;font:600 10.5px/1.25 var(--heading)}
.admin-shell .admin-nav-items button:hover{background:rgba(255,255,255,.075);color:#fffdfa}
.admin-shell .admin-nav-items button.active{background:#eee1df;color:#302a2b;font-weight:800}
.admin-shell .admin-nav-items button .icon{width:16px;height:16px;flex:0 0 auto}
.admin-shell .admin-nav-items button>span{display:flex!important;align-items:center;gap:7px;min-width:0;flex:1}
.admin-shell .admin-nav-items .inbox-count{margin-left:auto}
.admin-shell .sidebar-footer{flex:0 0 auto;margin-top:0;padding:15px 5px 0}

/* V4 panels: one common inner box fixes the uneven edge-to-edge content. */
.v4-top-actions{display:flex;flex-wrap:wrap;gap:9px;margin:-8px 0 20px}
.v4-panel{margin-bottom:0;overflow:hidden}
.v4-panel-body{padding:20px 22px 22px;min-width:0}
.v4-panel-body>:first-child{margin-top:0}
.v4-panel-body>:last-child{margin-bottom:0}
.v4-grid{gap:16px;margin-bottom:16px;align-items:start}
.v4-grid>*,.v4-hero-grid>*,.v4-lifecycle-grid>*{min-width:0}
.v4-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.v4-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.v4-hero-grid{gap:12px;margin-bottom:16px}
.v4-command-card{min-height:132px;padding:19px 20px;border-radius:12px}
.v4-command-card strong{font-size:clamp(25px,2.4vw,34px);overflow-wrap:anywhere}
.v4-command-card .v4-text-strong{font-size:17px;line-height:1.25}
.v4-command-card span{line-height:1.45}
.v4-row{min-width:0;gap:14px;padding:12px 0}
.v4-row>div:first-child{min-width:0}
.v4-row b,.v4-row strong,.v4-row span,.v4-row small{overflow-wrap:anywhere}
.v4-mini-metrics{max-width:55%}
.v4-mini-metrics span{white-space:normal;text-align:center}
.v4-action-list article{min-width:0;grid-template-columns:32px minmax(0,1fr) auto;padding:12px}
.v4-action-list article .button{white-space:normal}
.v4-insight-grid{gap:9px}
.v4-insight-grid article{min-width:0;padding:14px}
.v4-insight-grid strong{font-size:24px;overflow-wrap:anywhere}
.v4-health-list>div{grid-template-columns:minmax(110px,1fr) minmax(90px,2fr) 58px}
.v4-health-list span{overflow-wrap:anywhere}
.v4-table-wrap{max-width:100%;overflow:auto;border:1px solid #eee5df;border-radius:9px}
.v4-table{min-width:680px}
.v4-table th,.v4-table td{padding:11px 12px}
.v4-table td strong,.v4-table td b{white-space:normal}
.v4-form{gap:12px}
.v4-form>div{gap:10px}
.v4-form input,.v4-form select,.v4-form textarea,.v4-ai textarea{min-height:43px}
.v4-form textarea{min-height:92px;resize:vertical}
.v4-form>.button,.v4-panel-body>.button{justify-self:start;margin-top:2px}
.v4-case{min-width:0;gap:15px;padding:14px}
.v4-case>div:first-child{min-width:0}
.v4-parking{grid-template-columns:repeat(2,minmax(0,1fr))}
.v4-route>div{grid-template-columns:54px minmax(0,1fr) auto}
.v4-lifecycle-grid{grid-template-columns:repeat(auto-fit,minmax(245px,1fr));gap:10px}
.v4-lifecycle-grid article{min-height:235px;padding:17px}
.v4-lifecycle-grid h3{padding-right:48px;overflow-wrap:anywhere}
.v4-benchmark{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}
.v4-plans{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}
.v4-experiments{grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}
.v4-api-key{overflow-wrap:anywhere}

/* Existing V2/V3 admin modules also get width guards. */
.admin-v2-grid,.admin-v2-summary,.v3-admin-grid,.v3-crm-grid,.v3-service-grid,.v3-form-grid,.payment-grid,.handover-status,.handover-form-grid{max-width:100%}
.v3-row,.admin-v2-task,.admin-v2-health-row{min-width:0}
.v3-row>div,.admin-v2-task>div{min-width:0}
.v3-timeline{max-width:none}
.v3-calendar-wrap{max-width:100%;overflow:auto}

/* ---------- Self-service ---------- */
.v4-self{padding:clamp(14px,3vw,34px)}
.v4-self-shell{max-width:900px}
.v4-self-card{padding:clamp(18px,3vw,28px);border-radius:14px}
.v4-self-steps label{min-width:0}
.v4-self-guide{grid-template-columns:repeat(3,minmax(0,1fr))}

/* ---------- Responsive ---------- */
@media(max-width:1180px){
  .miberly-vibrant .v-nav-links>a[href="#jak-to-dziala"],
  .miberly-vibrant .v-nav-links>a[href="#faq"]{display:none}
  .miberly-vibrant .v-nav-links{gap:18px}
  .v4-grid.three{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:980px){
  .miberly-v2 .v2-hero{min-height:0}
  .miberly-v2 .v2-hero .v-hero-content{grid-template-columns:1fr!important;min-height:0;gap:34px;padding-top:54px;padding-bottom:96px}
  .miberly-v2 .v2-hero .v-hero-image{height:100%!important;top:0!important;bottom:auto!important;object-position:60% center}
  .miberly-v2 .v2-hero .v-hero-shade{background:linear-gradient(180deg,rgba(50,37,42,.94) 0%,rgba(50,37,42,.85) 46%,rgba(50,37,42,.68) 100%)}
  .v2-quick-search{justify-self:start;max-width:640px}
  .admin-shell{display:block!important;min-height:100vh!important}
  .admin-shell .sidebar{position:sticky;top:0;height:auto;min-height:0;padding:9px 12px;overflow:visible;z-index:60}
  .admin-shell .sidebar>.miberly-brand,.admin-shell .sidebar-footer{display:none!important}
  .admin-shell .admin-mobile-menu{display:block}
  .admin-shell .admin-mobile-menu>summary{display:flex;align-items:center;gap:9px;list-style:none;min-height:42px;padding:8px 10px;border-radius:8px;color:#fffdfa;font-size:11px;font-weight:800;cursor:pointer}
  .admin-shell .admin-mobile-menu>summary::-webkit-details-marker{display:none}
  .admin-shell .admin-mobile-menu>summary .icon:first-child{width:17px;height:17px}
  .admin-shell .admin-mobile-menu>summary .icon:last-child{width:14px;height:14px;margin-left:auto;transition:transform .16s}
  .admin-shell .admin-mobile-menu[open]>summary{background:rgba(255,255,255,.08)}
  .admin-shell .admin-mobile-menu[open]>summary .icon:last-child{transform:rotate(90deg)}
  .admin-shell .admin-nav-groups{display:none!important;max-height:65vh;margin-top:7px;padding:7px;background:#3f202c;border:1px solid rgba(255,255,255,.09);border-radius:10px;overflow:auto}
  .admin-shell .admin-mobile-menu[open]>.admin-nav-groups{display:block!important}
  .admin-shell .admin-nav-group>summary{padding:9px 8px}
  .admin-shell .admin-nav-items{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
  .admin-shell .admin-nav-items button{min-height:40px;padding:9px}
  .admin-shell .admin-top{height:57px;padding:0 20px}
  .admin-shell .admin-main{padding:25px 20px 44px;overflow:visible}
  .v4-hero-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .v4-grid.two,.v4-grid.three{grid-template-columns:1fr}
  .v4-mini-metrics{max-width:65%}
  .v4-lifecycle-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(min-width:981px){
  /* Desktop sidebar stays visible even though the outer details element is closed. */
  .admin-shell .admin-mobile-menu>.admin-nav-groups{display:block!important}
}

@media(max-width:650px){
  .miberly-vibrant .v-contact-ribbon{display:none}
  .miberly-vibrant .v-nav{min-height:72px}
  .miberly-v2 .v2-hero .v-hero-content{padding-top:38px;padding-bottom:54px;gap:27px}
  .miberly-v2 .v2-hero h1{font-size:clamp(38px,11vw,50px)!important;letter-spacing:-2px!important}
  .miberly-v2 .v2-hero-copy>p{font-size:13px}
  .miberly-v2 .v2-hero .v-hero-bottom{display:none}
  .v2-quick-search{padding:18px;border-radius:12px;gap:13px}
  .v2-quick-heading strong{font-size:20px}
  .v41-quick-dates{grid-template-columns:1fr}
  .v2-quick-search input{font-size:16px;min-height:49px}
  .miberly-vibrant .rental-date-form .v3-booking-meta{grid-template-columns:1fr}
  .miberly-vibrant .rental-date-form .v3-extra-options{display:grid;grid-template-columns:1fr}
  .miberly-vibrant .rental-date-form .v3-extra-options label{border-radius:9px;justify-content:flex-start}
  .v4-public-section{padding:58px 0}
  .v4-public-grid{grid-template-columns:1fr}
  .v4-public-grid article{padding:22px}
  .v4-public-icon{margin-bottom:20px}
  .admin-shell .admin-nav-items{grid-template-columns:1fr}
  .admin-shell .admin-top{padding:0 15px}
  .admin-shell .breadcrumbs{font-size:9px;min-width:0;overflow:hidden}
  .admin-shell .breadcrumbs b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .admin-shell .admin-main{padding:21px 14px 36px}
  .admin-shell .admin-heading{display:grid;grid-template-columns:1fr;gap:13px;margin-bottom:20px}
  .admin-shell .admin-heading>div{min-width:0}
  .admin-shell .admin-heading>.button{width:100%;white-space:normal}
  .v4-top-actions{display:grid;grid-template-columns:1fr;margin-top:0}
  .v4-top-actions .button{width:100%}
  .v4-hero-grid{grid-template-columns:1fr;gap:9px}
  .v4-command-card{min-height:106px;padding:16px 17px}
  .v4-command-card strong{font-size:27px}
  .v4-panel-body{padding:16px}
  .v4-panel .panel-heading{padding:17px 16px}
  .v4-panel .panel-heading h2{font-size:15px}
  .v4-grid{gap:11px;margin-bottom:11px}
  .v4-action-list article{grid-template-columns:30px minmax(0,1fr)}
  .v4-action-list article .button{grid-column:2;width:100%}
  .v4-row{align-items:flex-start;flex-direction:column;gap:8px}
  .v4-mini-metrics{max-width:100%;justify-content:flex-start!important}
  .v4-health-list>div{grid-template-columns:1fr 52px}
  .v4-health-track{grid-column:1/3;grid-row:2}
  .v4-case{grid-template-columns:1fr}
  .v4-case>div:last-child{justify-items:start}
  .v4-parking,.v4-lifecycle-grid{grid-template-columns:1fr}
  .v4-route>div{grid-template-columns:46px minmax(0,1fr)}
  .v4-route small{grid-column:2}
  .v4-form>div{grid-template-columns:1fr}
  .v4-plans,.v4-experiments{grid-template-columns:1fr}
  .v4-self-guide{grid-template-columns:1fr}
}
