*{box-sizing:border-box}

:root{
  --green:#1d6040;
  --green2:#0f5132;
  --blue:#155eef;
  --bg:#eef4fb;
  --text:#111827;
  --muted:#64748b;
  --line:#d8e1ee;
  --card:#fff;
}

html,body{
  width:100%;
  min-height:100%;
  overflow-x:hidden;
}

body{
  margin:0;
  background:var(--bg);
  font-family:Arial,Helvetica,sans-serif;
  color:var(--text);
}

.app{
  display:block;
  width:100%;
  min-height:100vh;
}

.sidebar,
.hamb,
.features{
  display:none!important;
}

.main{
  width:100%;
  max-width:none;
  margin-left:0;
  padding:0 30px 40px;
}

.topbar{
  min-height:90px;
  margin:0 -30px 28px;
  padding:14px 30px;
  background:#fff;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
}

.top-brand{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.logo,
.top-brand .logo{
  width:52px;
  height:52px;
  flex:0 0 52px;
  border:0;
  border-radius:13px;
  background:linear-gradient(135deg,#155eef,#19b98e);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
  font-weight:800;
  box-shadow:0 7px 18px rgba(21,94,239,.22);
}

.top-brand h1{
  margin:0;
  color:var(--text);
  font-size:26px;
  line-height:1.1;
}

.top-brand p{
  margin:6px 0 0;
  color:#64748b;
  font-size:15px;
}

.top-actions{
  display:flex;
  gap:10px;
  flex:0 0 auto;
}

.logout-form{margin:0;display:inline-flex;}
.logout-form button{white-space:nowrap;}

.top-actions a,
.top-actions button{
  border:1px solid var(--line);
  background:#fff;
  border-radius:10px;
  padding:12px 18px;
  color:#111827;
  font-weight:bold;
  text-decoration:none;
  cursor:pointer;
  white-space:nowrap;
}

.hero{
  width:100%;
  overflow:hidden;
  border-radius:18px;
  padding:36px 42px;
  background:linear-gradient(135deg,#155eef,#19b98e);
  color:#fff;
  box-shadow:0 16px 38px rgba(15,23,42,.10);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:25px;
}

.hero>div:first-child{
  min-width:0;
  flex:1;
}

.badge{
  display:block;
  width:max-content;
  max-width:100%;
  padding:8px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.18);
  font-size:13px;
  font-weight:bold;
  line-height:1.35;
  white-space:normal;
  overflow-wrap:anywhere;
  box-decoration-break:clone;
  -webkit-box-decoration-break:clone;
}

.hero h2{
  margin:18px 0 12px;
  font-size:35px;
  line-height:1.12;
}

.hero p{
  margin:0;
  max-width:720px;
  line-height:1.7;
}

.hero-cards{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  flex:0 0 auto;
}

.hero-cards div{
  min-width:120px;
  padding:18px;
  border-radius:14px;
  background:rgba(255,255,255,.14);
  text-align:center;
}

.hero-cards b{
  display:block;
  font-size:26px;
}

.hero-cards span{
  font-size:12px;
}

.card{
  width:100%;
  margin-top:24px;
  padding:26px 30px 30px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
  box-shadow:0 16px 38px rgba(15,23,42,.08);
}

.card h2{
  margin:0 0 8px;
}

.card p{
  margin:0 0 22px;
  color:var(--muted);
}

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

.field{
  display:flex;
  flex-direction:column;
  gap:9px;
  min-width:0;
}

.field.wide{
  grid-column:span 2;
}

label{
  font-size:14px;
  font-weight:bold;
}

label span{
  color:red;
}

input,
select,
textarea{
  width:100%;
  border:1px solid #cbd6e6;
  border-radius:9px;
  padding:15px 16px;
  background:#fff;
  font-family:Arial,Helvetica,sans-serif;
  font-size:14px;
  outline:none;
}

input:focus,
select:focus,
textarea:focus{
  border-color:var(--green);
  box-shadow:0 0 0 3px rgba(29,96,64,.12);
}

input[readonly]{
  background:#f1f5f9;
  color:#1d6040;
  font-weight:bold;
}

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

textarea[name="konteks"]{
  height:72px;
  min-height:72px;
}

.field:has(textarea[name="konteks"]){
  gap:7px;
}

small{
  color:#64748b;
}

.checkbox-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  padding:14px;
  border:1px solid #d8e1ee;
  border-radius:10px;
  background:#f8fbf9;
}

.checkbox-grid label{
  display:flex;
  align-items:center;
  gap:8px;
  color:#334155;
  font-weight:600;
}

.checkbox-grid input{
  width:auto;
}

.dpl-panel{
  display:flex!important;
  flex-direction:column!important;
  gap:5px!important;
  height:auto!important;
}

.dpl-panel>label{
  margin-bottom:2px;
  font-size:14px;
  line-height:1.2;
}

.dpl-panel .checkbox-grid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  column-gap:34px!important;
  row-gap:7px!important;
  min-height:0!important;
  height:auto!important;
  padding:12px 16px!important;
  border:1px solid #d8e1ee!important;
  border-radius:10px!important;
  background:#fff!important;
  align-content:start!important;
}

.dpl-panel .checkbox-grid label{
  min-height:19px!important;
  margin:0!important;
  padding:0!important;
  gap:8px!important;
  color:#334155!important;
  font-size:13px!important;
  font-weight:600!important;
  line-height:1.15!important;
  white-space:nowrap!important;
}

.dpl-panel .checkbox-grid input[type="checkbox"]{
  width:14px!important;
  height:14px!important;
  flex:0 0 14px!important;
  margin:0!important;
  accent-color:#1473e6;
}

.dpl-panel small{
  display:block;
  margin-top:2px;
  font-size:12px;
  line-height:1.25;
}

.signer-upload-panel{
  display:flex!important;
  flex-direction:column;
  gap:14px;
  height:auto;
}

.signer-box,
.upload-box{
  padding:14px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#f8fbf9;
}

.signer-box{
  height:100%;
}

.signer-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px 14px;
  margin-top:10px;
}

.field.mini{
  gap:6px;
}

.field.mini label{
  font-size:13px;
}

.field.mini input{
  height:44px;
  padding:11px 13px;
}

.upload-under-dpl{
  margin-top:8px;
}

.upload-box input[type="file"]{
  background:#fff;
}

.actions{
  display:flex;
  justify-content:space-between;
  gap:15px;
  margin-top:30px;
}

.btn-primary,
.btn-light{
  display:inline-block;
  border:0;
  border-radius:10px;
  padding:15px 26px;
  font-size:14px;
  font-weight:bold;
  text-decoration:none;
  cursor:pointer;
}

.btn-primary{
  min-width:260px;
  background:linear-gradient(135deg,var(--green),#17895e);
  color:#fff;
  text-align:center;
}

.btn-light{
  border:1px solid var(--line);
  background:#fff;
  color:#111827;
}

.dark{
  --bg:#0f172a;
  --text:#e5e7eb;
  --card:#111827;
  --line:#334155;
}

.dark .topbar,
.dark .card,
.dark input,
.dark select,
.dark textarea,
.dark .top-actions a,
.dark .top-actions button,
.dark .checkbox-grid,
.dark .signer-box,
.dark .upload-box{
  background:#111827;
  color:#e5e7eb;
}

.dark .dpl-panel .checkbox-grid{
  background:#111827!important;
}

.dark .dpl-panel .checkbox-grid label{
  color:#e5e7eb!important;
}

@media(max-width:1100px){
  .grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .hero{
    display:block;
  }

  .hero-cards{
    margin-top:20px;
  }
}

@media(max-width:850px){
  .main{
    padding:0 15px 25px;
  }

  .topbar{
    min-height:86px;
    margin:0 -15px 20px;
    padding:10px 15px;
    gap:10px;
  }

  .top-brand{
    flex:1;
    gap:10px;
  }

  .top-brand>div:last-child{
    min-width:0;
  }

  .top-brand .logo,
  .logo{
    width:44px;
    height:44px;
    flex-basis:44px;
    font-size:17px;
  }

  .top-brand h1{
    font-size:18px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .top-brand p{
    margin-top:4px;
    font-size:13px;
    white-space:nowrap;
  }

  .top-actions{
    gap:6px;
  }

  .top-actions a,
  .top-actions button{
    padding:9px 10px;
    font-size:12px;
  }

  .hero{
    display:block;
    padding:24px 20px;
    border-radius:20px;
  }

  .badge{
    padding:7px 11px;
    border-radius:12px;
    font-size:12px;
  }

  .hero h2{
    margin:20px 0 12px;
    font-size:30px;
  }

  .hero p{
    font-size:16px;
    line-height:1.6;
  }

  .hero-cards{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:8px;
    width:100%;
    margin-top:20px;
  }

  .hero-cards div{
    min-width:0;
    min-height:82px;
    padding:12px 5px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
  }

  .hero-cards b{
    font-size:12px;
    line-height:1.2;
    overflow-wrap:anywhere;
  }

  .hero-cards span{
    margin-top:6px;
    font-size:9px;
    line-height:1.2;
  }

  .grid,
  .checkbox-grid,
  .signer-grid{
    grid-template-columns:1fr;
  }

  .field.wide{
    grid-column:span 1;
  }

  textarea[name="konteks"]{
    height:auto;
    min-height:90px;
  }

  .dpl-panel .checkbox-grid{
    grid-template-columns:1fr!important;
    row-gap:7px!important;
    padding:12px 14px!important;
  }

  .dpl-panel .checkbox-grid label{
    white-space:normal!important;
  }

  .actions{
    flex-direction:column;
  }

  .btn-primary,
  .btn-light{
    width:100%;
    text-align:center;
  }
}

/* Tata letak ponsel: header tidak berdesakan dan formulir nyaman disentuh. */
@media(max-width:600px){
  .main{padding:0 12px 24px}

  .topbar{
    margin:0 -12px 16px;
    padding:12px;
    display:grid;
    grid-template-columns:1fr;
    gap:12px;
  }

  .top-brand .logo,.logo{
    width:46px;
    height:46px;
    flex-basis:46px;
  }

  .top-brand h1{
    font-size:19px;
    white-space:normal;
    overflow:visible;
  }

  .top-brand p{white-space:normal}

  .top-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    width:100%;
  }

  .top-actions a,.top-actions button{
    display:block;
    width:100%;
    padding:10px 8px;
    text-align:center;
    font-size:12px;
  }

  .hero{
    padding:20px 16px;
    border-radius:16px;
  }

  .badge{
    width:100%;
    max-width:none;
    padding:9px 11px;
    border-radius:10px;
    font-size:12px;
    line-height:1.4;
  }

  .hero h2{
    margin:16px 0 10px;
    font-size:27px;
  }

  .hero p{
    font-size:14px;
    line-height:1.6;
  }

  .hero-cards{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:6px;
    margin-top:16px;
  }

  .hero-cards div{
    min-height:72px;
    padding:9px 3px;
    border-radius:11px;
  }

  .hero-cards b{font-size:10px}
  .hero-cards span{font-size:8px}

  .card{
    margin-top:16px;
    padding:20px 14px;
    border-radius:16px;
  }

  .card h2{font-size:22px}

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

@media(max-width:430px){

  .top-brand h1{
    font-size:18px;
  }

  .top-brand p{
    font-size:12px;
  }

  .top-actions button{
    padding:8px;
    font-size:10px;
  }

  .hero{
    padding:22px 17px;
  }

  .hero h2{
    font-size:28px;
  }

  .hero p{
    font-size:15px;
  }

  .hero-cards{
    gap:6px;
  }

  .hero-cards div{
    min-height:78px;
    padding:10px 3px;
  }

  .hero-cards b{
    font-size:11px;
  }

  .hero-cards span{
    font-size:9px;
  }

  .card{
    padding:22px 16px;
  }
}
.generate-progress{
    margin-top:18px;
    padding:18px;
    background:#f7fbf8;
    border:1px solid #d7e6dc;
    border-radius:14px;
}

.generate-progress-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:15px;
    margin-bottom:10px;
}

.generate-progress-head strong{
    font-size:14px;
    color:#174c35;
}

.generate-progress-head span{
    font-size:13px;
    font-weight:700;
    color:#155f3d;
}

.generate-progress-track{
    width:100%;
    height:12px;
    background:#e2ebe6;
    border-radius:999px;
    overflow:hidden;
}

.generate-progress-bar{
    width:0%;
    height:100%;
    background:linear-gradient(90deg,#155f3d,#23a36d);
    border-radius:999px;
    transition:width .4s ease;
}

.generate-progress-text{
    margin-top:9px;
    font-size:13px;
    color:#647067;
}

#buatModulBtn:disabled{
    opacity:.7;
    cursor:not-allowed;
}

@media(max-width:700px){
    .generate-progress{
        padding:14px;
    }
}
