:root{
  --bg:#f3f6ff;
  --page:#edf2ff;
  --card:#ffffff;
  --border:#dbe3f3;
  --text:#24324d;
  --muted:#6e7e9d;
  --primary:#60c0c1;
  --primary-dark:#49a9aa;
  --primary-soft:#e8f8f8;
  --danger:#e65d76;
  --success:#34d399;
  --warning:#fbbf24;
  --topbar:#60c0c1;
  --shadow:0 8px 22px rgba(35,55,105,.12);
}

*{box-sizing:border-box}
body{
  margin:0;
  background:radial-gradient(circle at 10% 0%, #f8faff 0%, var(--bg) 45%, #edf2ff 100%);
  color:var(--text);
  font-family:"Source Sans Pro", sans-serif;
  font-size:14px;
  line-height:1.5;
}

.topbar-shell{
  position:sticky;
  top:0;
  z-index:60;
  background:rgba(245,248,255,.95);
  backdrop-filter:blur(6px);
  border-bottom:1px solid var(--border);
}

.topbar{
  max-width:1320px;
  margin:0 auto;
  margin-top:10px;
  padding:12px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  background:var(--topbar);
  border:1px solid #49a9aa;
  border-radius:6px;
}

.brand{display:flex;align-items:center;gap:10px}
.brand strong{font-size:16px;letter-spacing:.2px;color:#f4f7ff}

.topbar-user{display:flex;align-items:center;gap:10px}
.topbar-client-form{
  display:flex;
  align-items:center;
  gap:6px;
  margin:0;
}
.topbar-client-label{
  color:#f4f7ff;
  font-weight:600;
  white-space:nowrap;
}
.topbar-client-select{
  min-width:180px;
  max-width:240px;
  height:32px;
  padding:5px 8px;
  border:1px solid rgba(255,255,255,.28);
  background:rgba(255,255,255,.14);
  color:#f4f7ff;
}
.topbar-client-select option{
  color:#24324d;
}
.user-menu{position:relative}
.user-menu-toggle{
  border:none;
  cursor:pointer;
  white-space:nowrap;
}
.user-menu-dropdown{
  display:none;
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  min-width:190px;
  background:#ffffff;
  border:1px solid var(--border);
  border-radius:6px;
  box-shadow:var(--shadow);
  z-index:70;
  overflow:hidden;
}
.user-menu-dropdown.open{display:block}
.user-menu-dropdown a{
  display:block;
  padding:8px 10px;
  color:#31426f;
  text-decoration:none;
  font-weight:600;
  border-bottom:1px solid #eef2ff;
}
.user-menu-dropdown a:last-child{border-bottom:none}
.user-menu-dropdown a:hover,
.user-menu-dropdown a.active{
  background:#e8f8f8;
  color:#1f3e62;
}
.menu-toggle{
  display:none;
  width:36px;
  height:32px;
  border:1px solid rgba(255,255,255,.35);
  background:rgba(255,255,255,.12);
  border-radius:5px;
  padding:6px 7px;
  cursor:pointer;
}
.menu-toggle span{
  display:block;
  height:2px;
  margin:4px 0;
  border-radius:2px;
  background:#ffffff;
}
.topbar-user .pill{
  background:rgba(255,255,255,.16);
  color:#f4f7ff;
  border:1px solid rgba(255,255,255,.22);
}
.topbar-user a{
  text-decoration:none;
  color:#d7dfff;
  font-weight:600;
}
.topbar-user a:hover{color:#ffffff}

.subnav{
  max-width:1320px;
  margin:0 auto;
  padding:8px 16px 12px 16px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.subnav a{
  text-decoration:none;
  color:#506084;
  font-size:14px;
  font-weight:600;
  border:1px solid transparent;
  background:transparent;
  border-radius:5px;
  padding:7px 12px;
}
.subnav a:hover{background:#e8edff;color:#2c3d73}
.subnav a.active{
  background:var(--primary-soft);
  color:#2e3f84;
  border-color:#cad3f4;
}

.wrap{
  max-width:1320px;
  margin:18px auto 24px auto;
  padding:0 16px;
}

.page-shell{
  background:var(--page);
  border:1px solid var(--border);
  border-radius:8px;
  padding:14px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:6px;
  padding:14px;
  margin-bottom:14px;
  box-shadow:var(--shadow);
}

h2{
  margin:0 0 10px 0;
  font-size:16px;
  font-weight:700;
  color:#1f2d4d;
}

.muted{color:var(--muted);font-size:12px}
.small{font-size:12px;color:#5f708f}

.grid{
  display:grid;
  grid-template-columns:repeat(12,1fr);
  gap:10px;
  align-items:end;
}
.col-3{grid-column:span 3}
.col-4{grid-column:span 4}
.col-6{grid-column:span 6}
.col-12{grid-column:span 12}

input,select,textarea{
  width:100%;
  border:1px solid #cfd8ee;
  border-radius:5px;
  background:#fff;
  color:#24324d;
  padding:7px 9px;
  font-size:13px;
  outline:none;
}
input:focus,select:focus,textarea:focus{
  border-color:#8fa1df;
  box-shadow:0 0 0 3px rgba(47,63,143,.14);
}
textarea{min-height:72px}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  border:none;
  border-radius:5px;
  background:var(--primary);
  color:#fff;
  padding:8px 12px;
  line-height:1;
  box-sizing:border-box;
  vertical-align:middle;
  text-decoration:none;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}
.btn:hover{background:var(--primary-dark)}
.btn.secondary{
  background:#e9edf8;
  color:#31426f;
}
.btn.secondary:hover{background:#dbe3f3}
.btn.danger{
  background:var(--danger);
  color:#fff;
}
.btn.danger:hover{background:#d54762}

.pill{
  display:inline-block;
  padding:3px 9px;
  border-radius:15%;
  background:var(--primary-soft);
  color:#344788;
  font-size:12px;
  font-weight:700;
}

.matrix-table .pill[data-pill-value="completed"],
.matrix-table .pill[data-pill-value="complete"],
.matrix-table .pill[data-pill-value="yes"]{
  background:#dcfce7;
  color:#166534;
}
.matrix-table .pill[data-pill-value="no"]{
  background:#ffe4ea;
  color:#9f1239;
}
.matrix-table .pill[data-pill-value="in progress"]{
  background:#fff7da;
  color:#8a5a00;
}
.matrix-table .pill[data-pill-value="not started"],
.matrix-table .pill[data-pill-value="na"],
.matrix-table .pill[data-pill-value="-"],
.matrix-table .pill[data-pill-value="waiting"]{
  background:#eef2ff;
  color:#475569;
}

.badge-Yes,.badge-Complete{background:#dcfce7;color:#166534}
.badge-No{background:#ffe4ea;color:#9f1239}
.badge-NA,.badge-Not\ Started,.badge-NAoverall{background:#eef2ff;color:#475569}
.badge-In\ Progress{background:#fff7da;color:#8a5a00}

.table-wrap{width:100%;overflow-x:auto}
table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  border:1px solid var(--border);
  border-radius:5px;
  background:#fff;
}
th,td{
  border-bottom:1px solid var(--border);
  border-right:1px solid var(--border);
  padding:9px 10px;
  vertical-align:middle;
  font-size:12px;
  text-align:left;
}
tr > th:last-child,
tr > td:last-child{
  border-right:none;
}
thead th{
  background:#60c0c1;
  color:#f4f7ff;
  font-weight:700;
  border-bottom:1px solid #49a9aa;
}
tbody tr:last-child td{border-bottom:none}
td,th{word-break:break-word}

.split{
  display:grid;
  grid-template-columns:60% 40%;
  gap:12px;
  align-items:start;
}
@media(max-width:980px){.split{grid-template-columns:1fr}}

.row-actions{
  white-space:nowrap;
  min-width:70px;
  max-width:140px;
  text-align:center;
  overflow:visible;
}

.row-actions .iconbtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:27px;
  height:27px;
  border-radius:4px;
  border:1px solid #c8d3eb;
  background:#eef3ff;
  color:#60c0c1;
  text-decoration:none;
  margin-right:5px;
  padding:0;
  font-size:16px !important;
  line-height:1;
  cursor:pointer;
  transition:all .15s ease;
}
.row-actions .iconbtn:hover{
  background:#dfe8ff;
  border-color:#b7c6e9;
}
.row-actions .iconbtn.danger{
  background:#fde9ed;
  border-color:#f5c3cd;
  color:#b4233f;
}
.row-actions .iconbtn.danger:hover{
  background:#fbd6de;
  border-color:#efadb9;
}

.tight select{padding:5px 7px;font-size:12px}
.narrow-half{max-width:860px}

.filters{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:flex-end;
}
.filters .f{min-width:150px;flex:1}
.filters .f.small{min-width:140px;flex:0.8}
.filters .f.wide{min-width:240px;flex:1.4}
.filters .f.events{min-width:360px;flex:2.6}
.filters .f input[type="text"],
.filters .f input[type="date"],
.filters .f select:not([multiple]){
  height:34px;
  min-height:34px;
}
.filters .f select[multiple]{
  height:auto;
  min-height:120px;
}
.filters .actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.filters-card{overflow:visible}

.matrix-table th{font-size:12px;line-height:14px;padding:10px 8px}
.matrix-table td{padding:10px 8px}
.matrix-table select,.matrix-table input{max-width:100%;font-size:12px}
.matrix-table td.tight select{min-width:62px;width:62px}

.flow-row{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:nowrap;
}
.flow-row select.flow{width:70px}
.flow-row select.sync{width:88px}
.flow-row select.sys{width:105px}

.flow-wrapper{display:flex;flex-direction:column;gap:6px}
.flow-cell{min-width:220px}

.pager-wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:14px;
  flex-wrap:wrap;
}
.pager-meta{font-size:12px;opacity:.8}
.pager{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.pager .page{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:34px;
  height:34px;
  padding:0 10px;
  border:1px solid var(--border);
  border-radius:4px;
  background:#fff;
  color:var(--text);
  text-decoration:none;
}
.pager .page.active{
  background:var(--primary);
  color:#fff;
  border-color:var(--primary);
}
.pager .page.nav{min-width:54px}
.pager .page.disabled{pointer-events:none;opacity:.5}
.pager .page.dots{border:none;background:transparent;min-width:auto;padding:0 4px}

@media (max-width: 780px){
  .topbar{padding:10px 12px;align-items:flex-start;flex-direction:column}
  .subnav{padding:0 12px 10px 12px}
  .wrap{padding:0 12px}
  .page-shell{padding:10px}
}

img{max-width:100%;height:auto}

@media (max-width: 1100px){
  .grid .col-3{grid-column:span 6}
  .grid .col-4{grid-column:span 6}
  .grid .col-6{grid-column:span 12}
}

@media (max-width: 900px){
  .topbar{
    margin-top:0;
    border-radius:0;
    border-left:none;
    border-right:none;
  }
  .brand strong{font-size:15px}
  .topbar-user{
    width:100%;
    justify-content:space-between;
    flex-wrap:wrap;
  }
  .topbar-client-form{
    width:100%;
    order:2;
  }
  .topbar-client-select{
    width:100%;
    max-width:none;
  }
  .user-menu-dropdown{
    right:auto;
    left:0;
  }
  .menu-toggle{
    display:inline-block;
    order:-1;
  }
  .subnav{
    display:none;
    flex-direction:column;
    gap:6px;
    overflow:visible;
    white-space:normal;
    padding:8px 12px 10px 12px;
  }
  .subnav.open{display:flex}
  .subnav a{flex:0 0 auto}
  .split{grid-template-columns:1fr}
  .card{
    padding:12px;
    margin-bottom:12px;
  }
  .filters .f,
  .filters .f.small,
  .filters .f.wide,
  .filters .f.events{
    min-width:100%;
    flex:1 1 100%;
  }
  .filters .actions{
    width:100%;
    justify-content:flex-start;
  }
  .row-actions{
    min-width:120px;
  }
  .card table:not(.matrix-table){
    display:block;
    width:max-content;
    min-width:100%;
    max-width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }
  .card table:not(.matrix-table) th,
  .card table:not(.matrix-table) td{
    white-space:nowrap;
  }
}

@media (max-width: 640px){
  .grid .col-3,
  .grid .col-4,
  .grid .col-6,
  .grid .col-12{
    grid-column:span 12;
  }
  input,select,textarea,.btn{
    font-size:14px;
  }
  .btn{
    min-height:36px;
  }
  h2{font-size:15px}
  .row-actions .iconbtn{
    width:29px;
    height:29px;
  }
  .pager-wrap{
    flex-direction:column;
    align-items:flex-start;
  }
}
