
:root{
  --cwf:#203878;
  --cwf-2:#29478f;
  --cwf-3:#162b5d;
  --bg:#f3f6fb;
  --card:#ffffff;
  --ink:#162033;
  --muted:#697386;
  --line:#dfe5ef;
  --soft:#eef3ff;
  --ok:#177549;
  --ok-bg:#eaf8f1;
  --warn:#8a6500;
  --warn-bg:#fff5da;
  --bad:#a53b3b;
  --bad-bg:#fdeeee;
  --shadow:0 12px 34px rgba(23,39,75,.08);
}

*{box-sizing:border-box}

html,body{
  margin:0;
  min-height:100%;
  background:var(--bg);
  color:var(--ink);
  font-family:Montserrat,"Segoe UI",Arial,sans-serif;
}

button,input{
  font:inherit;
}

button{
  cursor:pointer;
}

img{
  max-width:100%;
}

.hidden{
  display:none!important;
}

/* BOOT */
.boot{
  min-height:100vh;
  display:grid;
  place-content:center;
  justify-items:center;
  gap:12px;
  color:var(--muted);
  font-size:12px;
}

.spinner{
  width:34px;
  height:34px;
  border:3px solid #d8e0ef;
  border-top-color:var(--cwf);
  border-radius:50%;
  animation:spin .8s linear infinite;
}

@keyframes spin{to{transform:rotate(360deg)}}

/* LOGIN */
.auth{
  min-height:100vh;
  display:grid;
  grid-template-columns:minmax(360px,44%) minmax(420px,56%);
}

.auth-brand{
  position:relative;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  min-height:100vh;
  padding:46px;
  background:
    radial-gradient(circle at 18% 16%,rgba(255,255,255,.13),transparent 30%),
    linear-gradient(145deg,var(--cwf),var(--cwf-3));
  color:#fff;
}

.auth-brand:after{
  content:"";
  position:absolute;
  right:-130px;
  bottom:-150px;
  width:420px;
  height:420px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:50%;
  box-shadow:
    0 0 0 55px rgba(255,255,255,.035),
    0 0 0 110px rgba(255,255,255,.025);
}

.brand-copy{
  position:relative;
  z-index:1;
  max-width:580px;
}

.brand-logo{
  width:200px;
  min-height:52px;
  object-fit:contain;
  object-position:left center;
  filter:brightness(0) invert(1);
}

.brand-fallback{
  display:none;
  font-size:30px;
  font-weight:900;
  letter-spacing:1px;
}

.brand-copy h1{
  margin:58px 0 14px;
  font-size:34px;
  line-height:1.08;
}

.brand-copy p{
  max-width:520px;
  margin:0;
  color:rgba(255,255,255,.76);
  font-size:14px;
  line-height:1.7;
}

.brand-points{
  position:relative;
  z-index:1;
  display:grid;
  gap:10px;
  margin-top:34px;
}

.brand-point{
  display:flex;
  align-items:center;
  gap:10px;
  color:rgba(255,255,255,.84);
  font-size:12px;
}

.brand-point i{
  display:grid;
  place-items:center;
  width:25px;
  height:25px;
  border:1px solid rgba(255,255,255,.16);
  border-radius:7px;
  background:rgba(255,255,255,.08);
  font-style:normal;
}

.brand-footer{
  position:relative;
  z-index:1;
  color:rgba(255,255,255,.46);
  font-size:12px;
  letter-spacing:.5px;
}

.auth-form-wrap{
  display:grid;
  place-items:center;
  padding:42px;
  background:#fff;
}

.auth-card{
  width:min(440px,100%);
}

.auth-card .eyebrow{
  color:var(--cwf);
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:1.2px;
}

.auth-card h2{
  margin:8px 0 8px;
  font-size:25px;
}

.auth-card > p{
  margin:0 0 24px;
  color:var(--muted);
  font-size:12px;
  line-height:1.6;
}

.field{
  margin-bottom:14px;
}

.field label{
  display:block;
  margin-bottom:6px;
  color:#465169;
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.55px;
}

.field input{
  width:100%;
  height:46px;
  padding:0 13px;
  border:1px solid var(--line);
  border-radius:9px;
  outline:none;
  background:#fff;
  color:var(--ink);
  transition:.18s;
}

.field input:focus{
  border-color:var(--cwf);
  box-shadow:0 0 0 3px rgba(32,56,120,.08);
}

.password-row{
  position:relative;
}

.password-row input{
  padding-right:75px;
}

.password-toggle{
  position:absolute;
  top:5px;
  right:5px;
  height:36px;
  padding:0 10px;
  border:0;
  border-radius:7px;
  background:#f1f4f8;
  color:#526079;
  font-size:12px;
  font-weight:800;
}

.auth-submit{
  width:100%;
  min-height:46px;
  margin-top:4px;
  border:0;
  border-radius:9px;
  background:var(--cwf);
  color:#fff;
  font-size:12px;
  font-weight:900;
  letter-spacing:.25px;
}

.auth-submit:hover{
  background:var(--cwf-2);
}

.auth-submit:disabled{
  opacity:.55;
  cursor:not-allowed;
}

.alert{
  margin:0 0 14px;
  padding:11px 12px;
  border-radius:8px;
  font-size:12px;
  line-height:1.45;
}

.alert.error{
  background:var(--bad-bg);
  color:var(--bad);
}

.alert.info{
  background:var(--warn-bg);
  color:#6e5913;
}

.password-rules{
  margin:0 0 16px;
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#f8fafc;
  color:var(--muted);
  font-size:12px;
  line-height:1.6;
}

/* PORTAL */
.appbar{
  position:sticky;
  top:0;
  z-index:20;
  min-height:68px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  padding:11px 24px;
  background:var(--cwf);
  color:#fff;
  box-shadow:0 5px 22px rgba(14,28,66,.16);
}

.appbar-brand{
  display:flex;
  align-items:center;
  gap:18px;
}

.appbar-logo{
  width:148px;
  max-height:42px;
  object-fit:contain;
  object-position:left;
  filter:brightness(0) invert(1);
}

.appbar-title{
  padding-left:17px;
  border-left:1px solid rgba(255,255,255,.22);
}

.appbar-title strong{
  display:block;
  font-size:12px;
}

.appbar-title span{
  display:block;
  margin-top:3px;
  color:rgba(255,255,255,.6);
  font-size:12px;
}

.userbar{
  display:flex;
  align-items:center;
  gap:12px;
}

.usertext{
  text-align:right;
}

.usertext strong{
  display:block;
  font-size:12px;
}

.usertext span{
  display:block;
  margin-top:3px;
  color:rgba(255,255,255,.58);
  font-size:12px;
}

.logout{
  min-height:36px;
  padding:0 12px;
  border:1px solid rgba(255,255,255,.22);
  border-radius:8px;
  background:rgba(255,255,255,.08);
  color:#fff;
  font-size:12px;
  font-weight:900;
}

.page{
  width:min(1540px,calc(100% - 34px));
  margin:0 auto;
  padding:24px 0 38px;
}

.portal-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:20px;
  margin-bottom:14px;
}

.portal-head h1{
  margin:0;
  font-size:23px;
}

.portal-head p{
  margin:5px 0 0;
  color:var(--muted);
  font-size:12px;
}

.readonly{
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:7px 10px;
  border-radius:999px;
  background:var(--soft);
  color:var(--cwf);
  font-size:12px;
  font-weight:900;
}

.tabs{
  display:flex;
  gap:6px;
  margin-bottom:14px;
  padding:5px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  width:max-content;
  max-width:100%;
  box-shadow:0 5px 18px rgba(30,42,70,.04);
}

.tabs button{
  min-height:38px;
  padding:0 14px;
  border:0;
  border-radius:7px;
  background:transparent;
  color:#657085;
  font-size:12px;
  font-weight:900;
}

.tabs button.active{
  background:var(--cwf);
  color:#fff;
}

.layout{
  display:grid;
  grid-template-columns:330px minmax(0,1fr);
  gap:13px;
  align-items:start;
}

.panel{
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fff;
  box-shadow:var(--shadow);
}

.panelhead{
  padding:13px 14px;
  border-bottom:1px solid var(--line);
  background:#fbfcfe;
  font-size:12px;
  font-weight:900;
}

.projects{
  max-height:calc(100vh - 220px);
  overflow:auto;
  padding:7px;
}

.project{
  width:100%;
  margin-bottom:6px;
  padding:11px;
  border:1px solid transparent;
  border-radius:9px;
  background:#f8fafc;
  color:inherit;
  text-align:left;
}

.project:hover{
  background:#f0f4fb;
}

.project.active{
  border-color:var(--cwf);
  background:var(--soft);
}

.project strong{
  display:block;
  font-size:12px;
}

.project span{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
}

.detail{
  min-height:520px;
}

.empty{
  padding:48px 20px;
  color:var(--muted);
  text-align:center;
  font-size:12px;
}

.project-hero{
  padding:17px;
  background:linear-gradient(120deg,var(--cwf),var(--cwf-2));
  color:#fff;
}

.project-hero h2{
  margin:0;
  font-size:18px;
}

.project-hero p{
  margin:5px 0 0;
  color:rgba(255,255,255,.72);
  font-size:12px;
}

.orders{
  padding:12px;
}

.order{
  overflow:hidden;
  margin-bottom:11px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
}

.order:last-child{
  margin-bottom:0;
}

.orderhead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:12px 13px;
  border-bottom:1px solid var(--line);
  background:#fafbfd;
}

.orderhead strong{
  font-size:12px;
}

.orderhead p{
  margin:4px 0 0;
  color:var(--muted);
  font-size:12px;
}

.chip{
  display:inline-flex;
  padding:5px 8px;
  border-radius:999px;
  background:#edf0f4;
  color:#606b7e;
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
}

.chip.ok{
  background:var(--ok-bg);
  color:var(--ok);
}

.chip.warn{
  background:var(--warn-bg);
  color:var(--warn);
}

.chip.bad{
  background:var(--bad-bg);
  color:var(--bad);
}

.orderbody{
  padding:12px 13px;
}

.metrics{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:8px;
}

.metric{
  min-height:67px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fbfcfe;
}

.metric label{
  display:block;
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
}

.metric strong{
  display:block;
  margin-top:6px;
  font-size:12px;
}

.progress{
  margin-top:8px;
  height:7px;
  overflow:hidden;
  border-radius:999px;
  background:#e7ebf1;
}

.progress span{
  display:block;
  height:100%;
  border-radius:999px;
  background:var(--cwf);
}

.section{
  margin-top:13px;
}

.section h3{
  margin:0 0 8px;
  font-size:12px;
}

.timeline,.quality{
  display:grid;
  gap:6px;
}

.step,.q{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  padding:9px 10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fbfcfd;
}

.step strong,.q strong{
  font-size:12px;
}

.step span,.q span{
  color:var(--muted);
  font-size:12px;
  text-align:right;
}

.gallery{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
}

.pic{
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
}

.pic button{
  display:block;
  width:100%;
  padding:0;
  border:0;
  background:#eef1f5;
}

.pic img{
  display:block;
  width:100%;
  aspect-ratio:4/3;
  object-fit:cover;
}

.pic div{
  min-height:42px;
  padding:8px;
  color:#596378;
  font-size:12px;
  line-height:1.35;
}

.attachments{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:8px;
}

.attachment{
  min-height:34px;
  padding:0 10px;
  border:1px solid var(--line);
  border-radius:7px;
  background:#fff;
  color:var(--cwf);
  font-size:12px;
  font-weight:900;
}

/* PROPOSALS */
.proposal-section{
  margin-bottom:17px;
}

.proposal-section > h2{
  margin:0 0 9px;
  font-size:13px;
}

.proposal-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}

.proposal-card{
  display:flex;
  flex-direction:column;
  min-height:190px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  box-shadow:0 7px 20px rgba(23,39,75,.05);
}

.proposal-type{
  width:max-content;
  padding:4px 7px;
  border-radius:999px;
  background:var(--soft);
  color:var(--cwf);
  font-size:12px;
  font-weight:900;
}

.proposal-type.commercial{
  background:#eef6f1;
  color:#26704c;
}

.proposal-card h3{
  margin:12px 0 6px;
  font-size:13px;
}

.proposal-card p{
  margin:0;
  color:#3d485d;
  font-size:12px;
  line-height:1.45;
}

.proposal-meta{
  margin-top:8px;
  color:var(--muted);
  font-size:12px;
  line-height:1.45;
}

.proposal-btn{
  min-height:37px;
  margin-top:auto;
  border:0;
  border-radius:8px;
  background:var(--cwf);
  color:#fff;
  font-size:12px;
  font-weight:900;
}

/* MODAL */
.modal,.lightbox{
  position:fixed;
  inset:0;
  z-index:100;
  display:grid;
  place-items:center;
  padding:22px;
  background:rgba(7,13,28,.72);
}

.modalbox{
  position:relative;
  width:min(980px,100%);
  max-height:88vh;
  overflow:auto;
  padding:20px;
  border-radius:12px;
  background:#fff;
  box-shadow:0 30px 80px rgba(0,0,0,.25);
}

.modalclose,.light-close{
  position:absolute;
  top:10px;
  right:10px;
  width:34px;
  height:34px;
  border:0;
  border-radius:8px;
  background:#edf0f5;
  color:#31405d;
  font-size:18px;
  z-index:2;
}

.modalbox h2{
  margin:0 45px 5px 0;
  font-size:18px;
}

.modalmeta{
  margin:0 0 14px;
  color:var(--muted);
  font-size:12px;
}

.commercial-summary{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin-bottom:12px;
}

.commercial-summary div{
  padding:10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fafbfd;
}

.commercial-summary label{
  display:block;
  color:var(--muted);
  font-size:12px;
  text-transform:uppercase;
  font-weight:800;
}

.commercial-summary strong{
  display:block;
  margin-top:5px;
  font-size:12px;
}

.tablewrap{
  overflow:auto;
  border:1px solid var(--line);
  border-radius:8px;
}

table{
  width:100%;
  border-collapse:collapse;
  font-size:12px;
}

th{
  padding:8px;
  border-bottom:1px solid var(--line);
  background:#f3f5f8;
  color:#596273;
  text-align:left;
  white-space:nowrap;
}

td{
  padding:8px;
  border-bottom:1px solid #edf0f4;
  vertical-align:top;
}

tr:last-child td{
  border-bottom:0;
}

.lightbox{
  z-index:110;
}

.lightbox img{
  max-width:min(1200px,95vw);
  max-height:88vh;
  border-radius:8px;
  background:#fff;
}

.light-close{
  position:fixed;
  top:20px;
  right:20px;
}

/* MOBILE */
@media(max-width:1080px){
  .layout{
    grid-template-columns:1fr;
  }

  .projects{
    max-height:300px;
  }

  .metrics{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .proposal-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .gallery{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:760px){
  .auth{
    grid-template-columns:1fr;
  }

  .auth-brand{
    min-height:auto;
    padding:28px 22px;
  }

  .brand-copy h1{
    margin-top:35px;
    font-size:27px;
  }

  .brand-points,.brand-footer{
    display:none;
  }

  .auth-form-wrap{
    padding:30px 20px 42px;
  }

  .appbar{
    padding:10px 13px;
  }

  .appbar-title{
    display:none;
  }

  .appbar-logo{
    width:120px;
  }

  .usertext{
    display:none;
  }

  .page{
    width:min(100% - 20px,1540px);
    padding-top:16px;
  }

  .portal-head{
    align-items:flex-start;
    flex-direction:column;
  }

  .tabs{
    width:100%;
  }

  .tabs button{
    flex:1;
    padding:0 8px;
  }

  .metrics{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .proposal-grid{
    grid-template-columns:1fr;
  }

  .gallery{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .commercial-summary{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .step,.q{
    align-items:flex-start;
    flex-direction:column;
    gap:4px;
  }

  .step span,.q span{
    text-align:left;
  }
}
