:root{
  --tw-yellow:#f2b408;
  --tw-yellow-soft:#fff7dc;
  --tw-charcoal:#292627;
  --tw-charcoal-2:#373234;
  --tw-red:#e51d2a;
  --tw-burgundy:#7d2d31;

  --bg:#f3f5f7;
  --surface:#ffffff;
  --surface-2:#fafbfc;
  --text:#24282d;
  --muted:#6b7580;
  --line:#dde3e8;
  --line-dark:#cdd5dc;
  --success:#25704a;
  --danger:#b83232;

  --radius:14px;
  --shadow:0 8px 28px rgba(25,32,40,.07);
  --shadow-hover:0 14px 34px rgba(25,32,40,.11);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
html{background:var(--bg)}
body{
  min-height:100vh;
  background:var(--bg);
  color:var(--text);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit}

/* ---------- HEADER ---------- */
.topbar{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(255,255,255,.98);
  border-bottom:1px solid var(--line);
  box-shadow:0 2px 10px rgba(20,25,31,.04);
}
.topbar::after{
  content:"";
  position:absolute;
  left:0;right:0;bottom:-1px;
  height:2px;
  background:linear-gradient(90deg,var(--tw-yellow) 0 56%,var(--tw-burgundy) 78%,var(--tw-red) 100%);
}
.topbar-inner{
  max-width:1220px;
  min-height:70px;
  margin:0 auto;
  padding:0 20px;
  display:flex;
  align-items:center;
  gap:18px;
}
.app-mark{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:max-content;
  color:var(--tw-charcoal);
  font-size:15px;
  font-weight:900;
  letter-spacing:.13em;
}
.app-mark-dot{
  width:9px;height:26px;
  border-radius:3px;
  background:var(--tw-yellow);
  box-shadow:inset 0 -8px 0 rgba(229,29,42,.12);
}
.topbar nav{
  display:flex;
  align-items:center;
  gap:3px;
}
.topbar nav a{
  position:relative;
  padding:10px 12px;
  border-radius:9px;
  color:#59636e;
  font-size:14px;
  font-weight:700;
  transition:.16s ease;
}
.topbar nav a:hover{
  color:var(--text);
  background:#f4f5f6;
}
.topbar nav a.active{
  color:var(--tw-charcoal);
  background:var(--tw-yellow-soft);
}
.topbar nav a.active::after{
  content:"";
  position:absolute;
  left:12px;right:12px;bottom:5px;
  height:2px;border-radius:2px;
  background:var(--tw-yellow);
}
.topbar-spacer{flex:1}
.header-logo{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  width:190px;
  height:42px;
  overflow:hidden;
  flex:0 0 190px;
}
.header-logo img{
  width:190px !important;
  height:36px !important;
  max-width:190px !important;
  max-height:36px !important;
  object-fit:contain !important;
}
.logout-form{margin:0}
.logout-button{
  border:1px solid var(--line);
  background:#fff;
  color:#69727c;
  border-radius:9px;
  padding:8px 11px;
  font-size:13px;
  font-weight:750;
  cursor:pointer;
}
.logout-button:hover{
  color:var(--danger);
  border-color:#e6c5c5;
  background:#fff8f8;
}
.menu-btn{
  display:none;
  border:0;
  background:transparent;
  color:var(--tw-charcoal);
  font-size:25px;
  cursor:pointer;
}

/* ---------- LAYOUT ---------- */
.container{
  max-width:1220px;
  margin:0 auto;
  padding:32px 20px 64px;
}
.page-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:24px;
  margin-bottom:22px;
}
.page-head.compact{align-items:center;margin-bottom:14px}
.page-head h1{
  margin:2px 0 6px;
  color:var(--tw-charcoal);
  font-size:30px;
  line-height:1.15;
  letter-spacing:-.02em;
}
.page-head p{
  margin:0;
  color:var(--muted);
  font-size:15px;
}
.eyebrow{
  color:var(--tw-burgundy);
  font-size:11px;
  font-weight:900;
  letter-spacing:.16em;
}
.crumb{
  margin-bottom:12px;
  color:var(--muted);
  font-size:13px;
  font-weight:750;
}
.crumb a:hover{color:var(--tw-burgundy)}

/* ---------- CARDS ---------- */
.card,.site-card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.site-list{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
}
.site-card{
  position:relative;
  overflow:hidden;
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;
}
.site-card::before{
  content:"";
  position:absolute;
  left:0;right:0;top:0;
  height:4px;
  background:linear-gradient(90deg,var(--tw-yellow) 0 70%,var(--tw-burgundy) 100%);
}
.site-card:hover{
  transform:translateY(-1px);
  box-shadow:var(--shadow-hover);
  border-color:#d1d8de;
}
.site-main{
  min-height:102px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:22px 21px 19px;
  transition:background .15s ease;
}
.site-main:hover{background:#fffdf7}
.site-title-wrap{display:flex;flex-direction:column;gap:3px;min-width:0}
.site-title-wrap strong{
  color:#1f2327;
  font-size:20px;
  line-height:1.25;
}
.site-title-wrap small{
  color:var(--muted);
  font-size:12px;
}
.site-kicker{
  margin-bottom:2px;
  color:var(--tw-burgundy);
  font-size:10px;
  font-weight:900;
  letter-spacing:.14em;
}
.round-arrow{
  width:34px;height:34px;
  display:grid;place-items:center;
  flex:0 0 34px;
  border:1px solid #e0e5e9;
  border-radius:50%;
  background:#fff;
  color:#7b858e;
  font-size:25px;
  line-height:1;
}
.workpoint-row{
  min-height:64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 20px;
  border-top:1px solid var(--line);
  background:#fff;
  transition:.15s ease;
}
.workpoint-row:hover{
  background:#f8f9fa;
  padding-left:23px;
}
.workpoint-text{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.workpoint-icon{
  color:var(--tw-yellow);
  font-size:22px;
  font-weight:900;
}
.workpoint-text span:last-child{
  display:flex;
  flex-direction:column;
  min-width:0;
}
.workpoint-text small{
  color:#8a939c;
  font-size:9px;
  font-weight:900;
  letter-spacing:.12em;
}
.workpoint-text strong{
  overflow:hidden;
  color:#3b444d;
  font-size:14px;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.row-arrow{
  color:#8b949c;
  font-size:20px;
}
.site-admin-row{
  display:flex;
  align-items:center;
  gap:8px;
  padding:11px 14px;
  border-top:1px solid var(--line);
  background:var(--surface-2);
}
.mini-action{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:7px 10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  color:#5b6670;
  font-size:12px;
  font-weight:800;
  transition:.15s ease;
}
.mini-action:hover{
  border-color:#bfc8d0;
  color:var(--tw-charcoal);
  transform:translateY(-1px);
}
.mini-action.accent{
  border-color:#ead284;
  background:var(--tw-yellow-soft);
  color:#5d4a04;
}
.empty{
  grid-column:1/-1;
  padding:48px 24px;
  border:1px dashed #cbd4db;
  border-radius:var(--radius);
  background:#fff;
  text-align:center;
  color:var(--muted);
}
.empty-icon{
  width:50px;height:50px;
  margin:0 auto 12px;
  display:grid;place-items:center;
  border-radius:50%;
  background:var(--tw-yellow-soft);
  color:#8b6800;
  font-size:28px;
}
.empty h2{margin:0 0 7px;color:var(--text);font-size:19px}
.empty p{margin:0 0 18px}

/* ---------- BUTTONS ---------- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:41px;
  padding:9px 14px;
  border:1px solid var(--line-dark);
  border-radius:10px;
  background:#fff;
  color:#3d4650;
  font-weight:800;
  font-size:14px;
  cursor:pointer;
  box-shadow:0 1px 2px rgba(20,25,30,.04);
  transition:transform .12s ease,box-shadow .12s ease,background .12s ease,border-color .12s ease;
}
.btn:hover{
  transform:translateY(-1px);
  box-shadow:0 5px 14px rgba(25,31,37,.08);
  border-color:#b9c2ca;
}
.btn.primary{
  border-color:var(--tw-charcoal);
  background:var(--tw-charcoal);
  color:#fff;
}
.btn.primary:hover{
  border-color:#171617;
  background:#171617;
}
.btn.primary .btn-icon{color:var(--tw-yellow);font-size:18px;line-height:1}
.btn.danger{
  border-color:#e4bcbc;
  background:#fff8f8;
  color:var(--danger);
}
.btn.wide{width:100%;min-height:48px;font-size:15px}
.btn.small{min-height:32px;padding:6px 9px;border-radius:8px;font-size:12px}

/* ---------- FORMS ---------- */
.entry-card{
  max-width:680px;
  padding:22px;
}
.stack-form p{margin:0 0 16px}
.stack-form label,.filters label{
  display:block;
  margin-bottom:6px;
  color:#414a53;
  font-size:13px;
  font-weight:800;
}
input,select,textarea{
  width:100%;
  min-height:44px;
  padding:10px 12px;
  border:1px solid var(--line-dark);
  border-radius:9px;
  outline:none;
  background:#fff;
  color:var(--text);
  transition:border-color .12s ease,box-shadow .12s ease;
}
textarea{min-height:92px;resize:vertical}
input:focus,select:focus,textarea:focus{
  border-color:#c29a14;
  box-shadow:0 0 0 3px rgba(242,180,8,.15);
}
input[type=file]{padding:8px;background:#fafbfc}
.helptext,.hint,.muted{
  color:var(--muted);
  font-size:12px;
}
.errorlist{
  margin:0 0 8px;
  padding-left:18px;
  color:var(--danger);
  font-size:13px;
}

/* ---------- TABS / ENTRY ---------- */
.tabs{
  display:inline-flex;
  gap:4px;
  margin:12px 0 15px;
  padding:4px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#e9edf0;
}
.tabs a{
  min-width:145px;
  padding:9px 14px;
  border-radius:8px;
  color:#59636c;
  text-align:center;
  font-size:13px;
  font-weight:850;
}
.tabs a.active{
  background:#fff;
  color:var(--tw-charcoal);
  box-shadow:0 2px 8px rgba(20,25,31,.08);
}
.target{margin-top:2px!important}
.recent{max-width:680px;margin-top:28px}
.recent h2,.report-section h2{
  margin:0 0 12px;
  color:#353d45;
  font-size:16px;
}
.history-row{
  display:flex;
  justify-content:space-between;
  gap:16px;
  padding:12px 2px;
  border-top:1px solid var(--line);
}
.history-row div{display:flex;flex-direction:column;gap:3px}
.history-row span{color:#4d5760;font-size:13px}
.history-row small{color:var(--muted);font-size:12px;white-space:nowrap}

/* ---------- REPORTS ---------- */
.filters{
  display:grid;
  grid-template-columns:2fr 2fr 1.2fr 1.2fr auto;
  gap:12px;
  align-items:end;
  margin-bottom:18px;
  padding:16px;
}
.filters label{margin:0}
.summary-grid{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:12px;
  margin-bottom:18px;
}
.metric{
  position:relative;
  overflow:hidden;
  padding:17px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  box-shadow:0 4px 14px rgba(25,32,40,.04);
}
.metric::before{
  content:"";
  position:absolute;
  left:0;top:0;bottom:0;
  width:3px;
  background:#ccd3d9;
}
.metric span{
  display:block;
  margin-bottom:7px;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}
.metric strong{
  color:#2f353b;
  font-size:18px;
}
.metric.accent::before{background:var(--tw-yellow)}
.metric.positive::before{background:var(--success)}
.metric.positive strong{color:var(--success)}
.metric.negative::before{background:var(--danger)}
.metric.negative strong{color:var(--danger)}
.report-section{padding:18px;margin-bottom:16px}
.report-row{
  display:flex;
  justify-content:space-between;
  gap:20px;
  padding:10px 0;
  border-top:1px solid var(--line);
}
.table-wrap{overflow:auto}
table{
  width:100%;
  min-width:720px;
  border-collapse:collapse;
}
th,td{
  padding:11px 12px;
  border-bottom:1px solid var(--line);
  text-align:left;
  font-size:13px;
}
th{
  background:#fafbfc;
  color:#737e88;
  font-size:10px;
  font-weight:900;
  letter-spacing:.07em;
  text-transform:uppercase;
}
tbody tr:hover td{background:#fffdf7}
.num{text-align:right}
.doc-link{color:var(--tw-burgundy);font-weight:800}

/* ---------- ADMIN ---------- */
.admin-site{padding:17px;margin-bottom:14px}
.admin-site-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.admin-site-head strong{font-size:17px}
.actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.actions form{margin:0}
.status{
  display:inline-flex;
  margin-left:8px;
  padding:4px 7px;
  border-radius:99px;
  font-size:10px;
  font-weight:900;
}
.status.on{background:#e8f4ed;color:var(--success)}
.status.off{background:#edf0f2;color:#6d7780}
.admin-wp{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid var(--line);
  color:#4a555f;
  font-size:13px;
}
.admin-wp .actions a,.link-button{
  padding:0;
  border:0;
  background:transparent;
  color:var(--tw-burgundy);
  font-weight:800;
  font-size:12px;
  cursor:pointer;
}

/* ---------- MESSAGES ---------- */
.message{
  margin-bottom:16px;
  padding:12px 14px;
  border:1px solid #bcd7c8;
  border-left:4px solid var(--success);
  border-radius:10px;
  background:#edf8f1;
  color:#285b3f;
  font-size:13px;
}

/* ---------- LOGIN ---------- */
.login-wrap{
  min-height:calc(100vh - 64px);
  display:grid;
  place-items:center;
  padding:28px 0;
}
.login-card{
  position:relative;
  width:min(455px,100%);
  overflow:hidden;
  padding:33px 34px 31px;
  box-shadow:0 18px 50px rgba(28,31,35,.11);
}
.login-card::before{
  content:"";
  position:absolute;
  left:0;right:0;top:0;
  height:5px;
  background:linear-gradient(90deg,var(--tw-yellow) 0 65%,var(--tw-burgundy) 84%,var(--tw-red) 100%);
}
.login-brand{
  margin:0 auto 27px;
  text-align:center;
}
.login-brand img{
  width:330px !important;
  height:62px !important;
  max-width:100% !important;
  max-height:62px !important;
  object-fit:contain !important;
}
.login-app-name{
  margin-top:12px;
  color:var(--tw-charcoal);
  font-size:19px;
  font-weight:950;
  letter-spacing:.27em;
  text-indent:.27em;
}
.login-subtitle{
  margin-top:6px;
  color:#87909a;
  font-size:12px;
}
.login-form label{font-size:12px}
.login-form input{min-height:46px}

/* ---------- RESPONSIVE ---------- */
@media(max-width:900px){
  .site-list{grid-template-columns:1fr}
  .filters{grid-template-columns:1fr 1fr}
  .filters .btn{grid-column:1/-1}
  .summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .topbar-inner{padding:0 14px}
  .app-mark{display:none}
  .menu-btn{display:block;order:3;margin-left:auto}
  .topbar nav{
    display:none;
    position:absolute;
    left:0;right:0;top:70px;
    flex-direction:column;
    align-items:stretch;
    gap:4px;
    padding:10px 14px 14px;
    border-bottom:1px solid var(--line);
    background:#fff;
    box-shadow:0 10px 25px rgba(20,25,31,.09);
  }
  .menu-open .topbar nav{display:flex}
  .topbar nav a{padding:11px 12px}
  .topbar nav a.active::after{display:none}
  .topbar-spacer{display:none}
  .header-logo{
    order:1;
    width:160px;
    flex-basis:160px;
    margin-right:auto;
  }
  .header-logo img{
    width:160px !important;
    height:31px !important;
    max-width:160px !important;
    max-height:31px !important;
  }
  .logout-form{order:2}
  .menu-btn{order:3}
}

@media(max-width:560px){
  .container{padding:23px 13px 50px}
  .page-head{align-items:flex-start}
  .page-head h1{font-size:25px}
  .page-head>div{min-width:0}
  .page-head>.btn{
    min-height:39px;
    padding:8px 11px;
    white-space:nowrap;
  }
  .site-main{padding:20px 17px 17px}
  .site-title-wrap strong{font-size:18px}
  .workpoint-row{padding:12px 17px}
  .site-admin-row{padding:10px;flex-wrap:wrap}
  .mini-action{flex:1;justify-content:center}
  .filters{grid-template-columns:1fr}
  .summary-grid{grid-template-columns:1fr 1fr}
  .metric strong{font-size:16px}
  .tabs{display:flex;width:100%}
  .tabs a{flex:1;min-width:0}
  .entry-card{padding:17px}
  .history-row{flex-direction:column;gap:4px}
  .login-card{padding:29px 20px 25px}
  .login-brand img{
    width:285px !important;
    height:54px !important;
    max-width:100% !important;
  }
  .header-logo{
    width:142px;
    flex-basis:142px;
  }
  .header-logo img{
    width:142px !important;
    height:27px !important;
    max-width:142px !important;
    max-height:27px !important;
  }
  .logout-button{padding:7px 9px}
}
