*{box-sizing:border-box}

body{
  margin:0;
  font-family:Arial,Helvetica,sans-serif;
  background:#f3f7fb;
  color:#0f172a;
}

.header{
  position:sticky;
  top:0;
  z-index:1000;
  background:linear-gradient(90deg,#03162e,#062c5d);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  padding:14px 24px;
  box-shadow:0 8px 24px rgba(0,0,0,.18);
}

.brand{
  color:#fff;
  font-size:24px;
  font-weight:900;
  line-height:1.1;
}

.brand span{color:#49d7ff}

.brand small{
  display:block;
  color:#8fdfff;
  font-size:12px;
  margin-top:4px;
}

.pfHomeHamburger{
  display:none;
}

.menu{
  display:flex;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
}

.menu a{
  color:#e8f8ff;
  text-decoration:none;
  font-weight:800;
  font-size:13px;
  padding:8px 10px;
  border-radius:8px;
}

.menu a:hover,
.menu a.active{
  background:#0b5cab;
  color:#fff;
}

.main{
  max-width:1180px;
  margin:0 auto;
  padding:22px;
}

h1,h2,h3{
  color:#0f172a;
}

.grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}

.kpi{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px;
}

.card,.box{
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:16px;
  padding:18px;
  box-shadow:0 8px 24px rgba(15,23,42,.08);
}

label{
  display:block;
  margin:10px 0 6px;
  font-weight:800;
  color:#0f172a;
}

input,select,textarea{
  width:100%;
  padding:11px 12px;
  border:1px solid #cbd5e1;
  border-radius:10px;
  background:#fff;
  color:#0f172a;
  font-size:15px;
}

textarea{
  min-height:160px;
  resize:vertical;
}

button,.btn,.btn2,.actions a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:10px 14px;
  border:0;
  border-radius:10px;
  background:#0b5cab;
  color:#fff;
  font-weight:900;
  text-decoration:none;
  cursor:pointer;
}

.btn2{
  background:#0f766e;
}

button:disabled{
  opacity:.65;
  cursor:not-allowed;
}

.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.small{
  font-size:12px;
  color:#64748b;
}

.hide{
  display:none!important;
}

.tableWrap{
  overflow-x:auto;
}

table{
  width:100%;
  border-collapse:collapse;
  background:#fff;
}

th,td{
  border:1px solid #e2e8f0;
  padding:9px;
  text-align:left;
  font-size:13px;
}

th{
  background:#eaf3ff;
  font-weight:900;
}

.money,.num{
  text-align:right;
  font-variant-numeric:tabular-nums;
}

.uploadBtn{
  display:block;
  text-align:center;
  border:2px dashed #0b5cab;
  border-radius:18px;
  padding:34px;
  background:#eef7ff;
  color:#0b2d5c;
  cursor:pointer;
}

.uploadBtn .ico{
  font-size:52px;
}

.previewImg{
  width:100%;
  max-height:420px;
  object-fit:contain;
  border-radius:14px;
  background:#f8fafc;
}

#previewBox{
  width:100%;
  min-height:190px;
  border-radius:16px;
  background:#f8fafc;
}

#previewBox img{
  width:100%;
  height:auto;
  max-height:430px;
  object-fit:contain;
  display:block;
  border-radius:14px;
}

#pfProcessingOverlay{
  z-index:999999!important;
}

/* MOBILE */
@media(max-width:850px){

  body{
    overflow-x:hidden;
  }

  .header{
    display:block;
    padding:12px;
  }

  .brand{
    font-size:21px;
    white-space:normal;
  }

  .brand small{
    font-size:11px;
  }

  .pfHomeHamburger{
    display:block;
    width:100%;
    min-height:46px;
    margin-top:10px;
    border-radius:12px;
    background:#0b5cab;
    color:#fff;
    font-size:15px;
    font-weight:900;
  }

  .menu{
    display:none!important;
    flex-direction:column;
    align-items:stretch;
    gap:8px;
    margin-top:10px;
    overflow:visible!important;
    white-space:normal!important;
  }

  body.pfMenuOpen .menu{
    display:flex!important;
  }

  .menu a{
    display:block;
    width:100%;
    padding:12px;
    background:#0d3e73;
    color:#fff!important;
    font-size:15px;
    text-align:left;
    border-radius:10px;
    white-space:normal;
  }

  .main{
    padding:12px;
  }

  h2{
    font-size:21px;
    margin:12px 0;
  }

  .grid,.kpi{
    display:block;
  }

  .card,.box{
    padding:15px;
    margin-bottom:14px;
  }

  input,select,textarea{
    font-size:16px;
    min-height:48px;
  }

  textarea#pasteText{
    min-height:220px!important;
  }

  .actions{
    display:block!important;
  }

  button,.btn,.btn2,.actions a{
    width:100%;
    min-height:52px;
    margin-top:10px;
    font-size:16px;
    border-radius:13px;
  }

  #btnAnalisa{
    width:100%!important;
    height:58px;
    font-size:18px;
    background:#0b5cab;
    color:#fff;
    margin-top:16px;
  }

  #workStatus{
    display:block;
    width:100%;
    text-align:center;
    margin-top:10px;
    font-size:13px;
    color:#0b5cab;
  }

  #notaFile{
    display:block!important;
    width:100%!important;
    min-height:70px!important;
    padding:18px!important;
    border:2px dashed #0b5cab!important;
    border-radius:16px!important;
    background:#eef7ff!important;
    color:#0b2d5c!important;
    font-size:16px!important;
  }

  .card > div[style*="display:flex"]{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    gap:10px!important;
  }

  #previewStep{
    display:block;
  }

  #previewStep.hide{
    display:none!important;
  }

  #previewBox{
    min-height:230px;
    border:1px solid #d9e3ef;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
  }

  #previewBox img{
    width:100%;
    max-height:440px;
    object-fit:contain;
  }

  .uploadBtn{
    min-height:190px;
    padding:28px 18px;
    font-size:17px;
  }

  th,td{
    font-size:12px;
    padding:8px;
  }

  #pfProcessingOverlay > div{
    max-width:92vw!important;
    width:92vw!important;
    padding:24px 18px!important;
  }
}

/* === PORTAL OLD OCEAN THEME OVERRIDE === */
body{
  background:#061f3f!important;
  color:#eaf9ff!important;
}

.card,
.box{
  background:#082c56!important;
  border:1px solid rgba(126,220,255,.18)!important;
  color:#eaf9ff!important;
}

h1,h2,h3,
label{
  color:#eaf9ff!important;
}

.small{
  color:#aeeaff!important;
}

input,
select,
textarea{
  background:#041f3d!important;
  color:#ffffff!important;
  border:1px solid #2f7fb7!important;
}

input::placeholder,
textarea::placeholder{
  color:#8fdfff!important;
}

button,
.btn,
.actions a{
  background:#1597ff!important;
  color:white!important;
}

.btn2{
  background:#063b73!important;
  color:white!important;
}

.uploadBtn{
  background:#07315d!important;
  border:2px dashed #61dfff!important;
  color:#dff7ff!important;
}

#previewBox{
  background:#021428!important;
  border:1px solid rgba(126,220,255,.18)!important;
}

table{
  background:#082c56!important;
  color:white!important;
}

th{
  background:#0b5cab!important;
  color:white!important;
}

td{
  border-color:rgba(255,255,255,.12)!important;
  color:white!important;
}

.num{
  color:#7de0ff!important;
}


.demoEmptyNote{padding:12px;border:1px dashed #61dfff;border-radius:12px;color:#aeeaff}

/* FORCE readable header brand subtitle */
.header .brand,
.header .brand span,
.header .brand small,
.brand small {
  color: #ffffff !important;
  opacity: 1 !important;
}
