
/* =========================================================
   ACS OPS UI V13 FINAL OVERHAUL
   Premium app shell + mobile cleanup + remaining old UI fixes
   ========================================================= */

:root{
  --bg:#090b10;
  --bg2:#10131b;
  --panel:#111827;
  --panel2:#151b26;
  --card:#ffffff;
  --soft:#f6f7fb;
  --text:#101827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --red:#dc2626;
  --red2:#991b1b;
  --red3:#7f1d1d;
  --gold:#f7c948;
  --green:#16a34a;
  --shadow:0 18px 45px rgba(2,6,23,.16);
  --shadow2:0 12px 28px rgba(2,6,23,.10);
  --radius:22px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body.acs-shell{
  margin:0;
  min-height:100vh;
  color:var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(220,38,38,.28), transparent 30%),
    radial-gradient(circle at 90% 0%, rgba(255,255,255,.08), transparent 26%),
    linear-gradient(180deg,#090b10 0%,#111827 270px,#f4f6fb 271px,#f4f6fb 100%);
  padding-bottom:92px;
  font-family:Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

body.acs-shell a{text-decoration:none;color:inherit}

/* Top shell */
body.acs-shell .topbar{
  position:sticky;
  top:0;
  z-index:80;
  min-height:66px;
  padding:12px clamp(12px,3vw,24px);
  background:rgba(9,11,16,.78);
  border-bottom:1px solid rgba(255,255,255,.10);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  color:#fff;
}

body.acs-shell .brand{
  min-width:0;
  display:flex;
  align-items:center;
  gap:11px;
}

body.acs-shell .logo{
  width:40px;
  height:40px;
  border-radius:14px;
  background:#fff;
  box-shadow:0 10px 30px rgba(220,38,38,.28);
}

body.acs-shell .brand-name{
  color:#fff;
  font-size:17px;
  font-weight:950;
  letter-spacing:-.03em;
  white-space:nowrap;
}

body.acs-shell .top-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}

body.acs-shell .container{
  width:min(1180px,100%);
  max-width:1180px;
  margin:0 auto;
  padding:22px clamp(12px,3vw,22px) 30px;
}

/* Page hero */
body.acs-shell h1{
  color:#fff;
  font-size:clamp(27px,5vw,46px);
  line-height:1;
  margin:0 0 8px;
  letter-spacing:-.055em;
  font-weight:1000;
}

body.acs-shell h2{
  color:#111827;
  font-size:20px;
  letter-spacing:-.025em;
  font-weight:950;
}

body.acs-shell .page-head,
body.acs-shell .row.space.wrap:first-child{
  position:relative;
  overflow:hidden;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  padding:22px;
  margin:4px 0 18px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:28px;
  color:#fff;
  background:
    linear-gradient(135deg,rgba(255,255,255,.13),rgba(255,255,255,.04)),
    radial-gradient(circle at 96% 16%, rgba(220,38,38,.45), transparent 32%);
  box-shadow:0 22px 70px rgba(0,0,0,.28);
}

body.acs-shell .page-head h1,
body.acs-shell .row.space.wrap:first-child h1{
  color:#fff;
}

body.acs-shell .page-head .muted,
body.acs-shell .row.space.wrap:first-child .muted{
  color:rgba(255,255,255,.74);
}

body.acs-shell .eyebrow{
  margin:0 0 6px;
  color:#fecaca;
  font-size:12px;
  font-weight:950;
  text-transform:uppercase;
  letter-spacing:.15em;
}

/* Cards */
body.acs-shell .card,
body.acs-shell .stat,
body.acs-shell .listitem,
body.acs-shell .note,
body.acs-shell .expense-group,
body.acs-shell .employee-card,
body.acs-shell .profit-summary-box,
body.acs-shell .budget-group,
body.acs-shell .budget-action,
body.acs-shell .budget-goal-card,
body.acs-shell .budget-ideas>div{
  background:rgba(255,255,255,.98);
  border:1px solid rgba(226,232,240,.95);
  border-radius:var(--radius);
  box-shadow:var(--shadow2);
}

body.acs-shell .card{
  padding:18px;
  margin:14px 0;
}

body.acs-shell .card:hover{
  box-shadow:var(--shadow);
}

/* Buttons */
body.acs-shell .btn,
body.acs-shell button.btn,
body.acs-shell a.btn{
  min-height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius:15px;
  border:1px solid #dbe2ec;
  background:#fff;
  color:#111827;
  font-weight:950;
  line-height:1;
  box-shadow:0 8px 18px rgba(15,23,42,.06);
}

body.acs-shell .btn:hover{
  transform:translateY(-1px);
  border-color:#cbd5e1;
  box-shadow:0 12px 24px rgba(15,23,42,.12);
}

body.acs-shell .btn-primary,
body.acs-shell .btn-acs,
body.acs-shell .btn-red{
  border-color:transparent!important;
  color:#fff!important;
  background:linear-gradient(135deg,var(--red),var(--red2))!important;
  box-shadow:0 14px 28px rgba(220,38,38,.28)!important;
}

body.acs-shell .danger,
body.acs-shell .btn-danger{
  color:#fff!important;
  background:linear-gradient(135deg,#ef4444,#991b1b)!important;
  border-color:transparent!important;
}

body.acs-shell .btn-ghost{
  background:rgba(255,255,255,.08);
  color:#fff;
  border-color:rgba(255,255,255,.14);
  box-shadow:none;
}

/* Top pills */
body.acs-shell .pill,
body.acs-shell .badge,
body.acs-shell .chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  border-radius:999px;
  border:1px solid #e2e8f0;
  background:#f8fafc;
  color:#111827;
  font-size:12px;
  font-weight:950;
  padding:7px 10px;
}

body.acs-shell .topbar .pill{
  background:rgba(220,38,38,.16);
  color:#fff;
  border-color:rgba(248,113,113,.38);
}

/* Inputs */
body.acs-shell input,
body.acs-shell select,
body.acs-shell textarea{
  width:100%;
  min-height:44px;
  margin-top:6px;
  padding:11px 13px;
  border:1px solid #dbe2ec;
  border-radius:15px;
  color:#111827;
  background:#fff;
  font-size:15px;
  outline:none;
}

body.acs-shell textarea{min-height:96px}
body.acs-shell input:focus,
body.acs-shell select:focus,
body.acs-shell textarea:focus{
  border-color:rgba(220,38,38,.48);
  box-shadow:0 0 0 4px rgba(220,38,38,.10);
}

body.acs-shell label{
  font-weight:900;
  color:#111827;
}

/* Stats */
body.acs-shell .grid3 .stat,
body.acs-shell .payroll-summary-grid .stat-card,
body.acs-shell .stat-card{
  position:relative;
  overflow:hidden;
  padding:18px;
  border-radius:22px;
  background:
    linear-gradient(180deg,#fff,#f8fafc);
}

body.acs-shell .stat-k,
body.acs-shell .stat-card span{
  color:#64748b;
  font-size:12px;
  font-weight:950;
  text-transform:uppercase;
  letter-spacing:.05em;
}

body.acs-shell .stat-v,
body.acs-shell .stat-card strong,
body.acs-shell .bigmoney{
  color:#0f172a;
  font-size:clamp(24px,4vw,42px);
  font-weight:1000;
  letter-spacing:-.055em;
}

/* Tables */
body.acs-shell .table-wrap{
  width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  border-radius:18px;
}

body.acs-shell .table,
body.acs-shell .data-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  font-size:14px;
}

body.acs-shell .table th,
body.acs-shell .data-table th{
  background:#f8fafc;
  color:#64748b;
  font-size:12px;
  font-weight:950;
  text-transform:uppercase;
  letter-spacing:.05em;
}

body.acs-shell .table th,
body.acs-shell .table td,
body.acs-shell .data-table th,
body.acs-shell .data-table td{
  padding:12px 10px;
  border-bottom:1px solid #e5e7eb;
  vertical-align:top;
}

/* Bottom mobile nav */
body.acs-shell .bottombar{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:100;
  display:flex;
  justify-content:center;
  gap:8px;
  padding:9px 10px calc(9px + env(safe-area-inset-bottom));
  background:rgba(9,11,16,.92);
  border-top:1px solid rgba(255,255,255,.12);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  box-shadow:0 -20px 45px rgba(0,0,0,.24);
}

body.acs-shell .navitem{
  flex:1;
  max-width:150px;
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  padding:8px 4px;
  border-radius:18px;
  color:rgba(255,255,255,.72);
  font-size:11px;
  font-weight:950;
  white-space:nowrap;
  border:1px solid transparent;
}

body.acs-shell .navitem::before{
  display:block;
  font-size:18px;
  line-height:1;
}

body.acs-shell .navitem[href*="dashboard"]::before,
body.acs-shell .navitem[href="/admin"]::before{content:"⌂"}
body.acs-shell .navitem[href*="payroll"]::before{content:"$"}
body.acs-shell .navitem[href*="jobs"]::before{content:"▣"}
body.acs-shell .navitem[href*="receipts"]::before{content:"◫"}
body.acs-shell .navitem[href*="calendar"]::before{content:"◷"}

body.acs-shell .navitem.active{
  color:#fff;
  background:linear-gradient(135deg,var(--red),var(--red2));
  border-color:rgba(255,255,255,.12);
  box-shadow:0 10px 24px rgba(220,38,38,.30);
}

/* Admin dashboard */
body.acs-endpoint-admin_home .admin-hero-grid{
  display:grid;
  grid-template-columns:1.4fr .8fr;
  gap:14px;
}

body.acs-endpoint-admin_home .quick-action-grid,
body.acs-shell .quick-action-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:12px;
}

body.acs-shell .quick-action{
  min-height:96px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding:16px;
  border:1px solid #e2e8f0;
  border-radius:22px;
  background:
    linear-gradient(180deg,#fff,#f8fafc);
  box-shadow:0 10px 24px rgba(15,23,42,.07);
}

body.acs-shell .quick-action b{
  font-size:15px;
  font-weight:1000;
  letter-spacing:-.03em;
}

body.acs-shell .quick-action span{
  margin-top:7px;
  color:#64748b;
  font-size:12px;
  font-weight:800;
}

/* Jobs list - fixes phone overflow */
body.acs-shell .job-filter-bar{
  display:grid;
  grid-template-columns:minmax(0,1fr) 180px auto;
  gap:10px;
  margin:0 0 14px;
}

body.acs-shell .jobs-card-list{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}

body.acs-shell .job-list-card{
  overflow:hidden;
  padding:16px;
  margin:0;
}

body.acs-shell .job-list-top{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-start;
  min-width:0;
}

body.acs-shell .job-list-top h2{
  margin:3px 0 4px;
  font-size:21px;
  line-height:1.05;
}

body.acs-shell .job-address{
  color:#64748b;
  font-weight:700;
  overflow-wrap:anywhere;
}

body.acs-shell .job-list-status{
  display:flex;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:6px;
  flex-shrink:0;
}

body.acs-shell .job-mini-note{
  margin-top:10px;
  padding:10px 12px;
  border:1px solid #e2e8f0;
  border-radius:15px;
  background:#f8fafc;
  color:#475569;
  font-size:13px;
  line-height:1.35;
}

body.acs-shell .job-list-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
  color:#475569;
  font-size:13px;
}

body.acs-shell .job-list-meta span{
  border:1px solid #e2e8f0;
  background:#fff;
  border-radius:999px;
  padding:7px 10px;
}

body.acs-shell .job-card-actions,
body.acs-shell .quick-actions,
body.acs-shell .actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}

body.acs-shell .job-card-actions{
  margin-top:12px;
}

/* Employee home compact */
body.acs-shell .job-list-card.simple{
  display:grid;
  grid-template-columns:1fr auto;
  gap:10px;
  align-items:center;
  border:1px solid #e2e8f0;
  border-radius:18px;
  background:#fff;
  box-shadow:0 8px 18px rgba(15,23,42,.06);
}

/* Website manager */
body.acs-endpoint-admin_website .website-tool-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:12px;
}

body.acs-shell .website-tool-card{
  position:relative;
  overflow:hidden;
  min-height:132px;
  padding:18px;
  border:1px solid #e2e8f0;
  border-radius:24px;
  background:linear-gradient(180deg,#fff,#f8fafc);
  box-shadow:0 12px 26px rgba(15,23,42,.08);
}

body.acs-shell .website-tool-card .tool-icon{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:15px;
  color:#fff;
  background:linear-gradient(135deg,var(--red),var(--red2));
  box-shadow:0 12px 24px rgba(220,38,38,.23);
  font-weight:1000;
  margin-bottom:12px;
}

body.acs-shell .website-tool-card b{
  display:block;
  font-size:17px;
  font-weight:1000;
  letter-spacing:-.03em;
}

body.acs-shell .website-tool-card p{
  margin:6px 0 0;
  color:#64748b;
  font-size:13px;
  line-height:1.35;
}

/* Forms */
body.acs-shell .grid-form,
body.acs-shell .form-grid.two,
body.acs-shell .budget-mini-form,
body.acs-shell .budget-edit-form{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:12px;
}

body.acs-shell .grid-form .full,
body.acs-shell .form-grid .wide,
body.acs-shell .full{
  grid-column:1/-1;
}

body.acs-shell .inline-form{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

body.acs-shell .inline-form input,
body.acs-shell .inline-form select{
  width:auto;
  min-width:190px;
  flex:1;
}

/* Calendar cleanup */
body.acs-shell .cal-wrap{
  display:grid;
  grid-template-columns:minmax(260px,330px) minmax(0,1fr);
  gap:14px;
}

body.acs-shell .cal-main,
body.acs-shell .fc,
body.acs-shell #calendar{
  min-width:0;
}

body.acs-shell .job-card,
body.acs-shell .cal-job{
  max-width:100%;
  overflow:hidden;
  border-radius:16px;
}

/* Flash messages */
body.acs-shell .flash{
  border-radius:16px;
  border:1px solid #e2e8f0;
  box-shadow:0 10px 20px rgba(15,23,42,.08);
}

/* Login */
body.acs-endpoint-login{
  background:
    radial-gradient(circle at 20% 0%, rgba(220,38,38,.38), transparent 30%),
    linear-gradient(135deg,#090b10,#111827 55%,#1f2937);
}

body.acs-endpoint-login .container{
  min-height:calc(100vh - 72px);
  display:grid;
  place-items:center;
}

body.acs-endpoint-login .narrow{
  width:min(480px,100%);
  margin:0 auto;
}

/* Mobile */
@media(max-width:760px){
  body.acs-shell{
    background:
      radial-gradient(circle at 10% 0%, rgba(220,38,38,.30), transparent 33%),
      linear-gradient(180deg,#090b10 0%,#111827 210px,#f4f6fb 211px);
    padding-bottom:88px;
  }

  body.acs-shell .topbar{
    padding:9px 10px;
  }

  body.acs-shell .brand-name{
    font-size:15px;
  }

  body.acs-shell .logo{
    width:34px;
    height:34px;
  }

  body.acs-shell .top-actions .btn{
    min-height:34px;
    padding:8px 9px;
    font-size:12px;
  }

  body.acs-shell .container{
    padding:14px 10px 24px;
  }

  body.acs-shell .page-head,
  body.acs-shell .row.space.wrap:first-child{
    display:block;
    padding:16px;
    border-radius:23px;
  }

  body.acs-shell .page-head .actions,
  body.acs-shell .row.space.wrap:first-child .actions,
  body.acs-shell .page-head .btn{
    margin-top:10px;
  }

  body.acs-shell h1{
    font-size:30px;
  }

  body.acs-shell h2{
    font-size:18px;
  }

  body.acs-shell .card{
    padding:14px;
    border-radius:20px;
  }

  body.acs-shell .grid2,
  body.acs-shell .grid3,
  body.acs-shell .grid4,
  body.acs-endpoint-admin_home .admin-hero-grid,
  body.acs-shell .cal-wrap{
    grid-template-columns:1fr!important;
  }

  body.acs-shell .job-filter-bar{
    grid-template-columns:1fr;
  }

  body.acs-shell .job-list-top{
    display:block;
  }

  body.acs-shell .job-list-status{
    justify-content:flex-start;
    margin-top:8px;
  }

  body.acs-shell .job-list-top h2{
    font-size:18px;
  }

  body.acs-shell .job-address,
  body.acs-shell .job-mini-note{
    font-size:12px;
  }

  body.acs-shell .job-mini-note{
    max-height:58px;
    overflow:hidden;
  }

  body.acs-shell .job-card-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
  }

  body.acs-shell .job-card-actions .btn,
  body.acs-shell .quick-actions .btn{
    width:100%;
    min-width:0;
    padding:10px 8px;
    font-size:12px;
  }

  body.acs-shell .job-list-meta{
    display:grid;
    grid-template-columns:1fr 1fr;
  }

  body.acs-shell .job-list-meta span{
    min-width:0;
    font-size:12px;
    padding:7px 8px;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  body.acs-shell .job-list-card.simple{
    grid-template-columns:1fr;
  }

  body.acs-shell .inline-form{
    display:grid;
    grid-template-columns:1fr;
  }

  body.acs-shell .inline-form input,
  body.acs-shell .inline-form select,
  body.acs-shell .inline-form .btn{
    width:100%;
    min-width:0;
  }

  body.acs-shell .bottombar{
    gap:5px;
    padding-left:7px;
    padding-right:7px;
  }

  body.acs-shell .navitem{
    font-size:10px;
    border-radius:15px;
    padding:7px 2px;
  }

  body.acs-shell .navitem::before{
    font-size:16px;
  }

  body.acs-shell .table-wrap,
  body.acs-shell .card{
    max-width:100%;
    overflow-x:auto;
  }
}

@media(max-width:390px){
  body.acs-shell .navitem{
    font-size:9px;
  }

  body.acs-shell .job-card-actions{
    grid-template-columns:1fr;
  }
}

@media print{
  body.acs-shell{
    background:#fff!important;
    padding-bottom:0!important;
  }
  body.acs-shell .topbar,
  body.acs-shell .bottombar,
  body.acs-shell .no-print{
    display:none!important;
  }
  body.acs-shell .container{
    max-width:none;
    padding:0;
  }
  body.acs-shell .card{
    box-shadow:none;
    break-inside:avoid;
  }
}
