/* v11 - compact unified program pages
   Purpose: keep Subscribers/Add Subscriber untouched, shrink rebuilt pages, and normalize legacy pages. */
:root{
  --ua11-bg: rgba(6,16,29,.72);
  --ua11-card: linear-gradient(180deg,rgba(9,22,39,.84),rgba(6,16,30,.72));
  --ua11-card2: rgba(10,24,42,.78);
  --ua11-border: rgba(144,184,62,.30);
  --ua11-border-soft: rgba(255,211,92,.14);
  --ua11-gold: #ffd15a;
  --ua11-cyan: #42e1ff;
  --ua11-text: #eef7ff;
  --ua11-muted: rgba(238,247,255,.66);
  --ua11-radius: 16px;
  --ua11-shadow: 0 10px 24px rgba(0,0,0,.18);
}

/* page shell must be compact and not consume half the screen */
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .content-wrapper{
  margin:0 !important;
  padding:0 !important;
  border-radius:18px !important;
  border:1px solid rgba(255,211,92,.10) !important;
  background:radial-gradient(circle at 86% 0%,rgba(61,221,255,.055),transparent 30%),linear-gradient(180deg,rgba(8,18,33,.76),rgba(4,12,23,.58)) !important;
  box-shadow:0 12px 34px rgba(0,0,0,.18) !important;
  overflow:hidden !important;
}
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) section.content,
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .content{
  padding:12px 14px 18px !important;
}
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .container,
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .container-fluid{
  width:100% !important;
  max-width:none !important;
  padding-left:0 !important;
  padding-right:0 !important;
}

/* compact page title strip for legacy pages */
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .content-header{
  margin:0 0 10px !important;
  padding:10px 14px !important;
  border-radius:16px !important;
  border:1px solid rgba(255,211,92,.13) !important;
  background:linear-gradient(135deg,rgba(9,23,42,.88),rgba(13,29,51,.62)) !important;
  box-shadow:0 10px 26px rgba(0,0,0,.16) !important;
}
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .content-header h1,
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .content-header h2{
  font-size:1.32rem !important;
  line-height:1.35 !important;
  margin:0 !important;
  font-weight:950 !important;
  color:#f7fbff !important;
}
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .content-header p,
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .content-header .text-muted{
  display:block !important;
  font-size:.82rem !important;
  line-height:1.65 !important;
  margin:4px 0 0 !important;
  color:var(--ua11-muted) !important;
}

/* compact rebuilt studio pages */
.ua-studio-wrap{padding:0 !important;}
.ua-studio-hero{
  min-height:0 !important;
  margin:0 0 10px !important;
  padding:12px 16px !important;
  border-radius:18px !important;
  border:1px solid rgba(255,211,92,.14) !important;
  background:linear-gradient(135deg,rgba(9,23,42,.90),rgba(13,29,51,.64)) !important;
  box-shadow:0 10px 24px rgba(0,0,0,.16) !important;
}
.ua-studio-hero h1{
  font-size:1.42rem !important;
  line-height:1.35 !important;
  margin:0 !important;
  letter-spacing:.05px !important;
}
.ua-studio-hero p{
  font-size:.84rem !important;
  line-height:1.65 !important;
  margin:5px 0 0 !important;
  color:var(--ua11-muted) !important;
}
.ua-studio-actions{gap:8px !important;}
.ua-studio-grid{
  grid-template-columns:repeat(12,minmax(0,1fr)) !important;
  gap:10px !important;
  margin:0 !important;
}
.ua-studio-card{
  min-height:0 !important;
  border-radius:16px !important;
  border:1px solid var(--ua11-border) !important;
  box-shadow:var(--ua11-shadow) !important;
}
.ua-studio-card.ua-wide,
.ua-studio-card.ua-compact{min-height:0 !important;}
.ua-studio-card-head{
  min-height:0 !important;
  padding:9px 11px !important;
  gap:8px !important;
  border-bottom:1px solid rgba(255,211,92,.11) !important;
}
.ua-studio-title{
  font-size:.96rem !important;
  line-height:1.35 !important;
  gap:7px !important;
}
.ua-studio-title i{
  width:27px !important;
  height:27px !important;
  min-width:27px !important;
  border-radius:10px !important;
  font-size:.86rem !important;
}
.ua-studio-meta{
  padding:3px 8px !important;
  font-size:.70rem !important;
}
.ua-studio-body{
  padding:10px 11px !important;
  gap:8px !important;
}
.ua-studio-text{
  font-size:.82rem !important;
  line-height:1.6 !important;
}
.ua-studio-footer{gap:7px !important;}
.ua-studio-kpi-value{font-size:1.06rem !important;line-height:1.35 !important;}
body.ua-p-automation-comms .ua-studio-card,
body.ua-p-automation-comms .ua-studio-card.ua-compact,
body.ua-p-mikrotik-dashboard .ua-studio-card,
body.ua-p-mikrotik-dashboard .ua-studio-card.ua-compact{min-height:0 !important;}
body.ua-p-automation-comms .ua-studio-card.ua-wide{grid-column:span 6 !important;}
body.ua-p-automation-comms .ua-studio-card.ua-compact{grid-column:span 4 !important;}
body.ua-p-mikrotik-dashboard .mk-stat-card{grid-column:span 3 !important;}
body.ua-p-mikrotik-dashboard .ua-studio-card.ua-full{grid-column:span 12 !important;}

/* legacy cards: same personality, smaller footprint */
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) :where(.box,.card,.panel,.well,.callout,.ua-card,.sa-card){
  min-height:0 !important;
  margin-bottom:10px !important;
  border-radius:16px !important;
  border:1px solid var(--ua11-border) !important;
  background:var(--ua11-card) !important;
  color:var(--ua11-text) !important;
  box-shadow:var(--ua11-shadow) !important;
  overflow:hidden !important;
}
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) :where(.box-header,.card-header,.panel-heading){
  min-height:0 !important;
  padding:9px 12px !important;
  border-bottom:1px solid var(--ua11-border-soft) !important;
  background:linear-gradient(180deg,rgba(255,255,255,.035),rgba(255,255,255,.008)) !important;
}
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) :where(.box-title,.card-title,.panel-title){
  font-size:.98rem !important;
  line-height:1.4 !important;
  margin:0 !important;
  color:#f7fbff !important;
  font-weight:950 !important;
}
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) :where(.box-body,.card-body,.panel-body){
  padding:11px 12px !important;
}
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) :where(.callout){padding:11px 12px !important;}
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) :where(.box,.card,.panel,.callout) :where(h1,h2,h3,h4,h5){
  font-size:1.02rem !important;
  line-height:1.45 !important;
  margin:0 0 8px !important;
  color:#f7fbff !important;
  font-weight:950 !important;
}
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) p,
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .small,
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .text-muted{
  color:var(--ua11-muted) !important;
}

/* controls */
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .btn{
  min-height:32px !important;
  padding:6px 12px !important;
  border-radius:12px !important;
  font-size:.84rem !important;
  line-height:1.25 !important;
  font-weight:950 !important;
  white-space:nowrap;
}
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .form-control,
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .form-select,
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) select,
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) textarea,
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) input[type="text"],
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) input[type="password"],
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) input[type="number"],
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) input[type="email"],
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) input[type="date"]{
  min-height:34px !important;
  padding:6px 10px !important;
  border-radius:12px !important;
  font-size:.84rem !important;
  background:rgba(13,27,47,.86) !important;
  border:1px solid rgba(255,211,92,.20) !important;
  color:#f4fbff !important;
}
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) label{
  margin-bottom:4px !important;
  font-size:.82rem !important;
  line-height:1.45 !important;
  font-weight:950 !important;
}
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .form-group{margin-bottom:9px !important;}

/* table compact, with subscribers-like borders */
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .table-responsive{
  border-radius:15px !important;
  border:1px solid var(--ua11-border) !important;
  background:rgba(6,16,30,.70) !important;
  box-shadow:0 8px 20px rgba(0,0,0,.14) !important;
  overflow:auto !important;
}
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) table.table{
  margin:0 !important;
  font-size:.82rem !important;
  color:#eef7ff !important;
  border-color:rgba(144,184,62,.30) !important;
}
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .table > :not(caption) > * > *{
  padding:7px 8px !important;
  border-color:rgba(144,184,62,.28) !important;
  background:rgba(9,21,37,.48) !important;
  color:#eef7ff !important;
  vertical-align:middle !important;
  text-align:center !important;
}
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .table thead th,
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .table thead td{
  background:rgba(14,28,48,.95) !important;
  font-weight:950 !important;
}

/* rows and legacy bootstrap grids should not create huge empty spaces */
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .row{
  --bs-gutter-x: 10px !important;
  --bs-gutter-y: 10px !important;
  row-gap:10px !important;
}
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) hr{
  margin:10px 0 !important;
  border-color:rgba(255,255,255,.10) !important;
  opacity:1 !important;
}
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .alert{
  padding:9px 12px !important;
  border-radius:14px !important;
  margin-bottom:10px !important;
  font-size:.84rem !important;
}

/* old nav tabs/pills, as compact top buttons */
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .nav-tabs,
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .nav-pills{
  gap:7px !important;
  margin:0 0 10px !important;
  padding:6px !important;
  border-radius:15px !important;
  border:1px solid rgba(255,211,92,.12) !important;
  background:rgba(6,16,30,.45) !important;
}
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .nav-tabs>li>a,
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .nav-pills>li>a,
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .nav-link{
  min-height:30px !important;
  padding:6px 12px !important;
  border-radius:12px !important;
  border:1px solid rgba(255,255,255,.10) !important;
  background:rgba(13,29,50,.70) !important;
  color:#eef7ff !important;
  font-size:.82rem !important;
}
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .nav-tabs>li.active>a,
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .nav-pills>li.active>a,
body.ua-shell-chrome:not(.ua-page-dashboard):not(.ua-p-subscribers):not(.ua-p-subscribers-add) .nav-link.active{
  background:linear-gradient(180deg,#ffd65a,#e8a90f) !important;
  color:#111 !important;
  border-color:rgba(255,225,116,.75) !important;
}

/* explicit old pages that looked scattered: give their action tiles the same compact button-card style */
body.ua-p-sales section.content .row > [class*="col-"] > a.btn,
body.ua-p-automation section.content .row > [class*="col-"] > a.btn,
body.ua-p-system section.content .row > [class*="col-"] > a.btn,
body.ua-p-maintenance section.content .row > [class*="col-"] > a.btn{
  width:100% !important;
  min-height:54px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:8px !important;
  border-radius:16px !important;
  background:linear-gradient(180deg,rgba(11,32,55,.92),rgba(7,20,36,.86)) !important;
  color:#f7fbff !important;
  border:1px solid var(--ua11-border) !important;
}

@media (max-width:1100px){
  body.ua-p-mikrotik-dashboard .mk-stat-card,
  body.ua-p-automation-comms .ua-studio-card.ua-wide,
  body.ua-p-automation-comms .ua-studio-card.ua-compact,
  .ua-studio-card,.ua-studio-card.ua-wide,.ua-studio-card.ua-compact{grid-column:span 12 !important;}
}

/* JS-assisted normalization */
body.ua-v11-normalized .ua-v11-action-grid{display:grid !important;grid-template-columns:repeat(auto-fit,minmax(190px,1fr)) !important;gap:10px !important;margin:0 0 10px !important;}
body.ua-v11-normalized .ua-v11-action-grid > [class*="col-"]{width:auto !important;max-width:none !important;flex:none !important;padding:0 !important;}
body.ua-v11-normalized .ua-v11-action-tile{width:100% !important;min-height:48px !important;display:flex !important;align-items:center !important;justify-content:center !important;gap:8px !important;margin:0 !important;}
body.ua-v11-normalized .ua-v11-card-plain{padding:11px 12px !important;}
body.ua-v11-normalized .ua-v11-title-strip.has-actions{display:flex !important;align-items:center !important;justify-content:space-between !important;gap:10px !important;flex-wrap:wrap !important;}
