:root{
  --c1:#82ccdd; /* light teal */
  --c2:#60a3bc; /* mid teal */
  --c3:#3c6382; /* steel blue */
  --c4:#0a3d62; /* deep blue */
  --c5:#a8d5ff; /* sky blue */
  --cW:#ffffff; /* white */
  --sidebar-width:300px;
}
html,body{height:100%;}
body{
  margin:0;
  min-height:100vh;
  background:#f7f7fb;
  color:#1f2d3d;
  --motion-login-animation:loginGradientShift 20s ease-in-out infinite;
  --motion-home-animation:homeBackgroundShift 24s ease-in-out infinite;
  --motion-brand-animation:brandSymbolFloat 12s ease-in-out infinite;
}
.home-gradient-background{
  position:relative;
  background:#f7f7fb;
}
.home-gradient-background::before{
  content:"";
  position:fixed;
  inset:0;
  background:radial-gradient(circle at 20% 20%, rgba(130,204,221,.65), transparent 55%),
             radial-gradient(circle at 80% 0%, rgba(96,163,188,.55), transparent 50%),
             radial-gradient(circle at 50% 75%, rgba(10,61,98,.55), transparent 60%);
  background-color:#f7f7fb;
  background-size:120% 120%;
  animation:var(--motion-home-animation, homeBackgroundShift 24s ease-in-out infinite);
  z-index:-1;
  pointer-events:none;
}
.home-gradient-background::after{
  content:"";
  position:fixed;
  inset:0;
  background:linear-gradient(135deg, rgba(247,247,251,.75), rgba(247,247,251,.35));
  z-index:-1;
  pointer-events:none;
}
.btn-primary,
.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-light{
  transition:background-color .2s, box-shadow .2s;
}
.btn-primary{
  background-color:var(--c3);
  border-color:var(--c3);
  color:var(--cW);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active{
  background-color:var(--c4);
  border-color:var(--c4);
  color:var(--cW);
}
.btn-primary:focus,
.btn-primary:active:focus{
  box-shadow:0 0 0 .25rem rgba(10,61,98,.35);
}
.btn-outline-secondary,
.btn-outline-primary{
  background-color:transparent;
  color:var(--c4);
  border-color:var(--c4);
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active,
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active{
  background-color:var(--c4);
  border-color:var(--c4);
  color:var(--cW);
}
.btn-outline-secondary:focus,
.btn-outline-secondary:active:focus,
.btn-outline-primary:focus,
.btn-outline-primary:active:focus{
  box-shadow:0 0 0 .25rem rgba(10,61,98,.28);
}
.btn-outline-light{
  color:var(--cW);
  border-color:var(--cW);
  background-color:transparent;
}
.btn-outline-light:hover,
.btn-outline-light:focus,
.btn-outline-light:active{
  background-color:var(--cW);
  border-color:var(--cW);
  color:var(--c4);
}
.btn-outline-light:focus,
.btn-outline-light:active:focus{
  box-shadow:0 0 0 .25rem rgba(255,255,255,.35);
}
.login-page{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg, var(--c4) 0%, var(--c2) 50%, var(--c5) 100%);
  background-size:300% 300%;
  animation:var(--motion-login-animation, loginGradientShift 20s ease-in-out infinite);
  padding:1.5rem;
}
.login-main{
  width:100%;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:1.5rem;
}
.app-shell{
  min-height:100vh;
  width:100%;
  display:grid;
  grid-template-columns:minmax(0,var(--sidebar-width)) minmax(0,1fr);
  grid-template-rows:auto 1fr auto;
  grid-template-areas:
    "header header"
    "sidebar main"
    "footer footer";
    transition:grid-template-columns .3s ease, grid-template-rows .3s ease;
    position:relative;
  z-index:0;
}
.app-shell.sidebar-collapsed{
  grid-template-columns:0 minmax(0,1fr);
}
.app-header{
  grid-area:header;
  background:linear-gradient(90deg,var(--c4),var(--c3));
  display:flex;
  align-items:center;
  position:relative;
  z-index:5;
  min-height:56px;
}
.navbar-brand{color:#fff;font-family:"Poppins",system-ui,Arial,sans-serif;letter-spacing:.2px}
.navbar-brand .brand-symbol{max-height:34px;height:auto;width:auto}
.brand-symbol-animated{
  animation:var(--motion-brand-animation, brandSymbolFloat 12s ease-in-out infinite);
}
.brand-symbol-animated:hover{
  animation-play-state:paused;
}
.home-gradient-background,
.home-gradient-background::before,
.home-gradient-background::after,
.brand-symbol-animated{
  will-change:transform,opacity,background-position;
}

body.motion-enabled{
  --motion-login-animation:loginGradientShift 20s ease-in-out infinite;
  --motion-home-animation:homeBackgroundShift 24s ease-in-out infinite;
  --motion-brand-animation:brandSymbolFloat 12s ease-in-out infinite;
}

body.motion-reduced{
  --motion-login-animation:none;
  --motion-home-animation:none;
  --motion-brand-animation:none;
}

@keyframes loginGradientShift{
  0%{background-position:0% 50%;}
  50%{background-position:100% 50%;}
  100%{background-position:0% 50%;}
}

@keyframes homeBackgroundShift{
  0%{background-position:0% 50%;}
  25%{background-position:50% 30%;}
  50%{background-position:100% 70%;}
  75%{background-position:40% 90%;}
  100%{background-position:0% 50%;}
}

@keyframes brandSymbolFloat{
  0%,100%{transform:translateY(0) scale(1);filter:drop-shadow(0 4px 12px rgba(10,61,98,.25));}
  30%{transform:translateY(-6px) scale(1.03);filter:drop-shadow(0 6px 16px rgba(10,61,98,.28));}
  60%{transform:translateY(4px) scale(.99);filter:drop-shadow(0 3px 10px rgba(10,61,98,.2));}
}

@media (prefers-reduced-motion:reduce){
  body:not(.motion-enabled){
    --motion-login-animation:none;
    --motion-home-animation:none;
    --motion-brand-animation:none;
  }
}
.navbar-brand .brand-logo{max-height:24px;height:auto;width:auto}
.navbar-brand .brand-title{display:flex;align-items:center;gap:.5rem}
.navbar-brand .brand-tagline{font-family:"Poppins",system-ui,Arial,sans-serif;letter-spacing:.2px;font-weight:200;text-transform:uppercase;line-height:1}
.navbar .btn{border-color:#fff;color:#fff}
.navbar .btn:hover{background:#fff;color:var(--c4)}
.logout-button{
  background-color:#ff7979;
  border-color:#ff7979;
  color:#fff;
}
.logout-button:hover,
.logout-button:focus{
  background-color:#fff;
  border-color:#ff7979;
  color:#ff7979;
}
.app-sidebar{
  grid-area:sidebar;
  width:100%;
  background:linear-gradient(180deg,var(--c3),var(--c4));
  color:#fff;
  overflow-y:auto;
  align-self:stretch;
  transition:opacity .3s ease, visibility .3s ease, max-height .3s ease, padding .3s ease;
}
.app-shell.sidebar-collapsed .app-sidebar{
  width:0;
  max-width:0;
  min-width:0;
  opacity:0;
  visibility:hidden;
  overflow:hidden;
  pointer-events:none;
  padding:0 !important;
}
.app-shell.sidebar-collapsed .app-content{
  grid-column:2;
}
.app-sidebar a{color:#fff;text-decoration:none}
.app-sidebar a:hover{background:rgba(255,255,255,.1)}
.sidebar-nav-divider{margin-top:.5rem;padding-top:.75rem;border-top:1px solid rgba(255,255,255,.35)}
.sidebar-nav-label{display:block;font-size:.7rem;font-family:"Poppins",system-ui,Arial,sans-serif;text-transform:uppercase;letter-spacing:.08em;color:rgba(255,255,255,.7);margin-bottom:.25rem}
.sidebar-action-link{border:1px solid rgba(255,255,255,.25);background:rgba(255,255,255,.05);transition:background-color .2s ease,border-color .2s ease,color .2s ease}
.sidebar-action-link:hover,.sidebar-action-link:focus{background:rgba(255,255,255,.18);border-color:rgba(255,255,255,.4);color:#fff}
.sidebar-divider{border-top:1px solid rgba(255,255,255,.35)}
.sidebar-partner-logo{max-width:160px;width:100%;height:auto;object-fit:contain}
.app-content{
  grid-area:main;
  padding:1.75rem;
  width:100%;
}
.card{border:none;border-radius:.75rem}
.card-title{font-family:"Poppins",system-ui,Arial,sans-serif;color:var(--c4)}
.required::after{content:"*";margin-left:.25rem;color:#dc3545;font-weight:700}
.badge-doc{font-weight:500}
.field-help{font-size:.85rem;color:#6c757d}
.sticky-actions{position:sticky;bottom:0;background:#fff;border-top:1px solid #eee;padding:.75rem;z-index:5}
.doc-info{color:var(--c3);display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;border-radius:50%;transition:background-color .2s,color .2s;}
.doc-info:focus,.doc-info:hover{background:rgba(60,99,130,.1);color:var(--c4);outline:none;}
.doc-info i{font-size:1rem;}
.popover.doc-popover{max-width:280px;}
.doc-check.form-check-input{
  background-color:#dff9fb;
  border-color:var(--c3);
}
.doc-check.form-check-input:focus{
  box-shadow:0 0 0 .25rem rgba(130,204,221,.35);
  border-color:var(--c3);
}
.doc-check.form-check-input:checked{
  background-color:var(--c3);
  border-color:var(--c3);
}
.popover-doc{font-size:.875rem;color:#1f2d3d;}
.popover-doc-section{margin-bottom:.75rem;}
.popover-doc-section:last-child{margin-bottom:0;}
.popover-doc-heading{font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--c3);margin-bottom:.25rem;}
.popover-doc .badge-doc{font-size:.75rem;font-weight:500;}
.app-footer{
  grid-area:footer;
  background:linear-gradient(90deg,var(--c4),var(--c3));
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:.75rem 1rem;
}
.app-footer .small{line-height:1;}
.doc-popover{max-width:320px;}
.doc-popover .popover-header{background:var(--c3);color:#fff;font-family:"Poppins",system-ui,Arial,sans-serif;font-weight:600;display:flex;align-items:center;gap:.5rem;}
.doc-popover .popover-header i{color:#fff;}
.doc-popover .popover-body{font-size:.9rem;color:#1f2d3d;}
.login-wrapper{width:100%;max-width:440px;}
.login-card{border-radius:1.25rem;background:rgba(255,255,255,.92);backdrop-filter:blur(6px);}
.login-symbol{max-width:72px;width:100%;height:auto;margin:0;}
.login-logo{max-width:220px;width:100%;height:auto;margin:0;}
.login-footer{color:#fff;text-align:center;font-size:.85rem;line-height:1.4;}
.login-footer .small{color:inherit;}
.motion-toggle-button{
  position:fixed;
  left:50%;
  bottom:1.5rem;
  transform:translate(-50%,0);
  display:inline-flex;
  align-items:center;
  gap:.75rem;
  padding:.5rem 1.1rem;
  border-radius:999px;
  border:1px solid rgba(10,61,98,.2);
  background-color:rgba(255,255,255,.75);
  color:var(--c4);
  font-family:"Poppins",system-ui,Arial,sans-serif;
  font-size:.875rem;
  font-weight:500;
  line-height:1.2;
  box-shadow:0 8px 20px rgba(10,61,98,.14);
  transition:transform .2s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
  cursor:pointer;
  z-index:1050;
}
.motion-toggle-button:hover,
.motion-toggle-button:focus{
  transform:translate(-50%,-1px);
  background-color:rgba(255,255,255,.88);
  border-color:rgba(10,61,98,.32);
  color:var(--c4);
  box-shadow:0 10px 24px rgba(10,61,98,.18);
}
.motion-toggle-button:focus-visible{
  outline:0;
  box-shadow:0 0 0 .25rem rgba(96,163,188,.25);
}
.motion-toggle-button.motion-toggle-off{
  background-color:rgba(248,250,252,.82);
  color:#1f2d3d;
  border-color:rgba(15,23,42,.16);
  box-shadow:0 6px 16px rgba(15,23,42,.12);
}
.motion-toggle-button.motion-toggle-off:hover,
.motion-toggle-button.motion-toggle-off:focus{
  background-color:rgba(248,250,252,.92);
  border-color:rgba(15,23,42,.26);
  color:#1f2d3d;
}
.motion-toggle-button.motion-toggle-on{
  color:var(--c4);
}
.motion-toggle-button .motion-toggle-icon{
  font-size:1.1rem;
  line-height:1;
}
.motion-toggle-button .motion-toggle-text{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:.1rem;
}
.motion-toggle-button .motion-toggle-label{
  font-size:.7rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  opacity:.75;
}
.motion-toggle-button .motion-toggle-status{
  font-size:.95rem;
  font-weight:600;
}
@media (max-width:576px){
  .motion-toggle-button{
    bottom:1rem;
    padding:.45rem .9rem;
    font-size:.8rem;
  }
  .motion-toggle-button .motion-toggle-status{
    font-size:.85rem;
  }
}
.doc-popover-content{display:flex;flex-direction:column;gap:.5rem;}
.doc-popover-title{font-size:.7rem;text-transform:uppercase;letter-spacing:.08em;color:var(--c3);font-weight:600;}
.doc-popover-badges{display:flex;flex-wrap:wrap;gap:.25rem;margin-top:.35rem;}
.doc-popover .badge-doc{font-size:.75rem;}
.preview-frame-wrapper{
  border:1px solid #dee2e6;
  border-radius:.75rem;
  overflow:hidden;
  background:#fff;
  min-height:60vh;
  position:relative;
}
.preview-frame-wrapper iframe{
  width:100%;
  height:100%;
  min-height:60vh;
  border:0;
  background:#fff;
}
.preview-banner{
  border-radius:.75rem;
  font-size:.9rem;
}

/* Print core (used within print pages also) */
@page{size:A4;margin:2cm}
.print-a4{font-family:Arial,Helvetica,sans-serif;font-size:12pt;line-height:1.5;color:#000}
.doc-title{font-family:"Poppins",system-ui,Arial,sans-serif;text-transform:uppercase;font-weight:700;text-align:center;margin:0 0 24px;color:#000}
.signature-line{margin-top:48px;text-align:center}
.signature-line .line{border-top:1px solid #000;width:60%;margin:0 auto 6px}
.print-layout{--print-header-offset:0cm;--print-footer-offset:0cm;padding:1.5rem;padding-top:calc(var(--print-header-offset) + 1.5rem);padding-bottom:calc(var(--print-footer-offset) + 1.5rem)}
.print-layout .print-spacer{display:block}
.print-layout .print-spacer[data-role="header"]{min-height:var(--print-header-offset)}
.print-layout .print-spacer[data-role="footer"]{min-height:var(--print-footer-offset)}

@media (max-width:991.98px){
  .app-shell{
    grid-template-columns:1fr;
    grid-template-rows:auto auto 1fr auto;
    grid-template-areas:
      "header"
      "sidebar"
      "main"
      "footer";
  }

  .app-shell.sidebar-collapsed{
    grid-template-columns:1fr;
    grid-template-rows:auto 0 1fr auto;
  }

  .app-shell.sidebar-collapsed .app-sidebar{
    max-height:0;
    padding:0;
  }

  .app-shell.sidebar-collapsed .app-content{
    grid-column:1;
  }
  .app-sidebar{
    max-height:none;
    overflow:visible;
  }

  .app-content{
    padding:1.5rem;
  }
}