/* V136W Mobile + SEO foundation */

/* Global mobile safety */
html{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
  scroll-behavior:smooth;
}

body{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
}

*,*::before,*::after{
  box-sizing:border-box;
}

img,picture,video,canvas,svg,iframe{
  max-width:100%;
}

img,picture,video{
  height:auto;
}

a,button,input,select,textarea{
  touch-action:manipulation;
}

button,
[role="button"],
input[type="submit"],
input[type="button"],
.cw-btn,
.cw-mini,
.cw-icon-btn{
  min-height:44px;
}

table{
  max-width:100%;
}

main,
section,
article,
header,
footer,
nav,
.cw-main,
.cw-content,
.cw-shell{
  max-width:100%;
}

/* Avoid page-wide sideways scroll. Tables/cards can scroll internally only. */
.cw-table,
.table-responsive,
.responsive-table,
.overflow-table{
  max-width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

/* Dashboard shell */
.cw-shell{
  min-height:100dvh;
}

.cw-content{
  width:100%;
}

.cw-top,
.cw-topbar{
  max-width:100%;
}

.cw-search-wrap,
.cw-search{
  max-width:100%;
}

.cw-card,
.cw-stat,
.cw-section,
.cw-form-card,
.cw-status-card{
  min-width:0;
}

.cw-card-grid,
.cw-grid,
.cw-two,
.cw-form-grid{
  min-width:0;
}

.cw-grid > *,
.cw-card-grid > *,
.cw-two > *,
.cw-form-grid > *{
  min-width:0;
}

/* Sidebar desktop polish */
.cw-side{
  background:#e8f0fb!important;
  border-right:1px solid #ceddf1!important;
  color:#24324a!important;
}

.cw-nav-group small{
  display:none!important;
}

.cw-nav-group{
  margin:5px 0!important;
}

.cw-nav-group a{
  color:#24324a!important;
  border-radius:16px!important;
}

.cw-nav-group a:hover,
.cw-nav-group a.active{
  background:#dbe8fa!important;
  color:#0f172a!important;
}

.cw-nav-icon{
  background:#f8fbff!important;
  color:#155eef!important;
}

.cw-company-card{
  background:rgba(255,255,255,.78)!important;
  border:1px solid #ceddf1!important;
}

.cw-company-meta strong{
  color:#24324a!important;
}

.cw-company-meta span{
  color:#5b6b84!important;
}

/* Bottom sidebar: open shows logo/privacy/bug/logout; closed shows only logout */
.cw-side-bottom{
  position:absolute!important;
  left:10px!important;
  right:10px!important;
  bottom:10px!important;
  background:transparent!important;
  border-top:1px solid #ceddf1!important;
  padding-top:8px!important;
}

.cw-bottom-collapsed{
  display:flex;
  justify-content:center;
  align-items:center;
}

.cw-bottom-open{
  display:none;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}

.cw-side:hover .cw-bottom-collapsed{
  display:none!important;
}

.cw-side:hover .cw-bottom-open{
  display:flex!important;
}

.cw-bottom-open-left{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.cw-bottom-open-logo{
  display:flex;
  align-items:center;
  justify-content:center;
}

.cw-bottom-open-logo img{
  max-width:150px;
  max-height:34px;
  object-fit:contain;
  display:block;
}

.cw-bottom-privacy{
  color:#5b6b84!important;
  font-size:12px!important;
  font-weight:800!important;
  text-decoration:none!important;
  white-space:nowrap;
}

.cw-bottom-open-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

.cw-bottom-open-actions a,
.cw-bottom-open-actions button,
.cw-bottom-collapsed a,
.cw-bottom-collapsed button{
  width:34px!important;
  height:34px!important;
  min-height:34px!important;
  border-radius:12px!important;
  display:grid!important;
  place-items:center!important;
  background:#fff!important;
  border:1px solid #ceddf1!important;
  color:#155eef!important;
  font-size:15px!important;
  line-height:1!important;
  padding:0!important;
  margin:0!important;
  box-shadow:0 8px 18px rgba(37,88,216,.08)!important;
}

/* Top bar sync/theme buttons */
.cw-top-actions{
  max-width:100%;
}

.cw-top-actions .cw-icon-btn{
  flex:0 0 auto;
}

/* Full-year calendar mobile safety */
.cw-calendar-layout{
  display:grid;
  grid-template-columns:minmax(0,7fr) minmax(280px,3fr);
  gap:18px;
  align-items:start;
}

.cw-year-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}

.cw-month-card{
  min-width:0;
}

.cw-month-mini-grid{
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  gap:6px;
}

.cw-day-cell,
.cw-day-empty{
  min-width:0;
}

/* Dark theme */
body.cw-theme-dark{
  background:#08121f!important;
  color:#e6edf7!important;
}

body.cw-theme-dark .cw-main,
body.cw-theme-dark .cw-content{
  background:#08121f!important;
}

body.cw-theme-dark .cw-top{
  background:rgba(8,18,31,.92)!important;
  border-color:#1b2b42!important;
}

body.cw-theme-dark .cw-side{
  background:#0d1b2d!important;
  border-color:#1b2b42!important;
}

body.cw-theme-dark .cw-nav-group a{
  color:#dbe7f7!important;
}

body.cw-theme-dark .cw-nav-group a:hover,
body.cw-theme-dark .cw-nav-group a.active{
  background:#172945!important;
  color:#fff!important;
}

body.cw-theme-dark .cw-nav-icon{
  background:#11233b!important;
  color:#8db5ff!important;
}

body.cw-theme-dark .cw-card,
body.cw-theme-dark .cw-stat,
body.cw-theme-dark .cw-section,
body.cw-theme-dark .cw-form-card,
body.cw-theme-dark .cw-status-card,
body.cw-theme-dark .cw-table,
body.cw-theme-dark .cw-month-card,
body.cw-theme-dark .cw-activity-panel{
  background:#0d1b2d!important;
  color:#e6edf7!important;
  border-color:#1b2b42!important;
  box-shadow:none!important;
}

body.cw-theme-dark p,
body.cw-theme-dark small,
body.cw-theme-dark .cw-muted{
  color:#9fb0c6!important;
}

body.cw-theme-dark input,
body.cw-theme-dark select,
body.cw-theme-dark textarea{
  background:#081725!important;
  color:#e6edf7!important;
  border-color:#1b2b42!important;
}

body.cw-theme-dark .cw-btn,
body.cw-theme-dark .cw-icon-btn,
body.cw-theme-dark .cw-mini{
  background:#11233b!important;
  color:#e6edf7!important;
  border-color:#1f3756!important;
}

body.cw-theme-dark .cw-btn.blue,
body.cw-theme-dark .cw-btn.primary{
  background:#2563eb!important;
  border-color:#2563eb!important;
  color:#fff!important;
}

/* Main mobile behavior */
@media (max-width:1100px){
  .cw-calendar-layout{
    grid-template-columns:1fr!important;
  }

  .cw-activity-panel{
    position:static!important;
  }
}

@media (max-width:860px){
  body{
    font-size:15px;
  }

  .cw-shell{
    display:block!important;
  }

  .cw-side{
    position:sticky!important;
    top:0!important;
    z-index:80!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    padding:10px!important;
    overflow:hidden!important;
    border-right:0!important;
    border-bottom:1px solid #ceddf1!important;
  }

  .cw-side:hover{
    width:100%!important;
  }

  .cw-collapsed-mark{
    display:none!important;
  }

  .cw-company-card{
    display:flex!important;
    align-items:center!important;
    gap:12px!important;
    height:auto!important;
    opacity:1!important;
    padding:10px!important;
    margin:0 0 10px!important;
    border-radius:18px!important;
  }

  .cw-company-logo{
    width:82px!important;
    min-width:82px!important;
    height:58px!important;
    border-radius:16px!important;
  }

  .cw-company-logo img{
    max-width:74px!important;
    max-height:44px!important;
  }

  .cw-company-avatar{
    width:38px!important;
    height:38px!important;
    right:-8px!important;
    bottom:-8px!important;
    border-radius:14px!important;
  }

  .cw-company-meta{
    padding-top:0!important;
    min-width:0!important;
  }

  .cw-company-meta strong,
  .cw-company-meta span{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    max-width:calc(100vw - 140px);
  }

  .cw-nav-scroll{
    height:auto!important;
    display:flex!important;
    gap:8px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    padding:0 0 8px!important;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
  }

  .cw-nav-scroll::-webkit-scrollbar{
    display:none;
  }

  .cw-nav-group{
    display:flex!important;
    flex:0 0 auto!important;
    gap:8px!important;
    margin:0!important;
  }

  .cw-nav-group a{
    flex:0 0 auto!important;
    min-width:74px!important;
    min-height:58px!important;
    padding:8px 10px!important;
    display:flex!important;
    flex-direction:column!important;
    justify-content:center!important;
    align-items:center!important;
    gap:5px!important;
    font-size:11px!important;
    text-align:center!important;
  }

  .cw-nav-icon{
    width:30px!important;
    height:30px!important;
    min-width:30px!important;
    border-radius:12px!important;
  }

  .cw-nav-icon svg{
    width:17px!important;
    height:17px!important;
  }

  .cw-nav-label{
    display:block!important;
    opacity:1!important;
    max-width:68px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .cw-side-bottom{
    display:none!important;
  }

  .cw-main{
    width:100%!important;
    min-width:0!important;
  }

  .cw-top{
    position:sticky!important;
    top:0!important;
    z-index:70!important;
    height:auto!important;
    min-height:0!important;
    padding:10px 12px!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    gap:10px!important;
  }

  .cw-greeting{
    flex:1 1 100%!important;
    min-width:0!important;
  }

  .cw-greeting strong,
  .cw-greeting span{
    display:block!important;
    max-width:100%!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }

  .cw-search-wrap{
    order:3!important;
    flex:1 1 100%!important;
    width:100%!important;
    max-width:100%!important;
  }

  .cw-search{
    width:100%!important;
    height:44px!important;
  }

  .cw-top-actions{
    order:2!important;
    flex:1 1 auto!important;
    display:flex!important;
    justify-content:flex-start!important;
    gap:8px!important;
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch;
    padding-bottom:2px;
  }

  .cw-top-actions::-webkit-scrollbar{
    display:none;
  }

  .cw-top-actions .cw-icon-btn{
    width:44px!important;
    min-width:44px!important;
    height:44px!important;
  }

  .cw-btn{
    min-height:44px!important;
    white-space:nowrap!important;
  }

  .cw-content{
    padding:14px!important;
    max-width:100%!important;
  }

  .cw-hero{
    display:block!important;
    margin-bottom:14px!important;
  }

  .cw-hero h1,
  h1{
    font-size:clamp(28px, 9vw, 38px)!important;
    line-height:1.02!important;
    letter-spacing:-.045em!important;
  }

  .cw-grid,
  .cw-card-grid,
  .cw-two,
  .cw-form-grid{
    grid-template-columns:1fr!important;
    gap:12px!important;
  }

  .cw-stat,
  .cw-card,
  .cw-section,
  .cw-form-card,
  .cw-status-card{
    border-radius:20px!important;
    padding:15px!important;
  }

  .cw-section-head{
    flex-direction:column!important;
    align-items:flex-start!important;
    gap:10px!important;
  }

  .cw-table{
    overflow-x:auto!important;
    border-radius:18px!important;
  }

  .cw-table table{
    min-width:760px!important;
  }

  .cw-campaign-action-stack{
    min-width:150px!important;
  }

  .cw-budget-box input{
    width:76px!important;
  }

  .cw-year-grid{
    grid-template-columns:1fr!important;
  }

  .cw-month-mini-grid{
    gap:5px!important;
  }

  .cw-day-cell,
  .cw-day-empty{
    min-height:42px!important;
  }

  .cw-modal-card,
  .cw-drawer-panel{
    width:calc(100vw - 24px)!important;
    max-width:calc(100vw - 24px)!important;
  }
}

@media (max-width:480px){
  .cw-content{
    padding:10px!important;
  }

  .cw-company-card{
    padding:8px!important;
  }

  .cw-top{
    padding:8px!important;
  }

  .cw-nav-group a{
    min-width:68px!important;
    font-size:10px!important;
  }

  .cw-grid,
  .cw-card-grid,
  .cw-two,
  .cw-form-grid{
    gap:10px!important;
  }

  .cw-stat strong{
    font-size:25px!important;
  }

  .cw-search{
    font-size:14px!important;
  }

  .cw-table table{
    min-width:700px!important;
  }
}
