:root{
  --fft-primary:#0B2E59;
  --fft-accent:#10B981;
  --fft-support:#0F766E;

  --fft-bg:#f4f7fb;
  --fft-bg-soft:#eef2f7;
  --fft-card:#ffffff;
  --fft-text:#0f172a;
  --fft-muted:#64748b;
  --fft-border:rgba(15,23,42,.10);

  --fft-shadow-sm:0 2px 10px rgba(16,24,40,.06);
  --fft-shadow-md:0 10px 30px rgba(16,24,40,.10);

  --fft-radius:16px;
  --fft-radius-lg:18px;

  --fft-topbar-height:72px;
  --fft-content-max:1480px;
  --fft-content-pad:24px;
}

/* ==========================================================================
   Base
========================================================================== */
html,
body{
  height:100%;
  max-width:100%;
  overflow-x:hidden;
}

body{
  margin:0;
  background:
    radial-gradient(circle at 20% 20%, rgba(11,46,89,.05), transparent 28%),
    radial-gradient(circle at 80% 80%, rgba(15,118,110,.05), transparent 30%),
    linear-gradient(90deg, #f7f9fc 0%, #eef2f7 40%, #f7f9fc 100%);
  color:var(--fft-text);
  font-family:Arial, Helvetica, sans-serif;
  line-height:1.45;
}

a{
  color:var(--fft-primary);
}

a:hover{
  color:var(--fft-support);
}

/* ==========================================================================
   App shell
========================================================================== */
body.app-page{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

.app-shell{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  width:100%;
  max-width:100%;
  overflow-x:hidden;
}

.app-main{
  flex:1 0 auto;
  width:100%;
  display:block;
}

.app-content{
  width:100%;
  max-width:var(--fft-content-max);
  margin:0 auto;
  padding:22px 24px 28px;
  box-sizing:border-box;
}

.app-footer{
  margin-top:auto;
  flex-shrink:0;
  padding:10px 20px 14px;
  text-align:center;
  color:var(--fft-muted);
  font-size:12px;
  border-top:1px solid rgba(15,23,42,.06);
  background:rgba(255,255,255,.92);
}

/* ==========================================================================
   Fixed pages
========================================================================== */
body.fixed-page{
  overflow:hidden;
}

body.fixed-page .app-shell{
  height:100vh;
  overflow:hidden;
}

body.fixed-page .app-main{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

body.fixed-page .app-content{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
}

@media (max-width: 768px){
  body.fixed-page{
    overflow:auto;
  }

  body.fixed-page .app-shell{
    height:auto;
    overflow:visible;
  }

  body.fixed-page .app-main{
    display:block;
    overflow:visible;
    min-height:auto;
  }

  body.fixed-page .app-content{
    overflow:visible;
    min-height:auto;
  }
}

/* ==========================================================================
   Content width
========================================================================== */
@media (max-width: 1600px){
  .app-content{
    max-width:1400px;
  }
}

@media (max-width: 1400px){
  .app-content{
    max-width:1280px;
    padding:20px 20px 24px;
  }
}

@media (max-width: 1200px){
  .app-content{
    max-width:1120px;
    padding:18px 16px 22px;
  }
}

@media (max-width: 768px){
  .app-content{
    padding:14px;
  }
}

/* ==========================================================================
   Topbar
========================================================================== */
.app-topbar{
  min-height:var(--fft-topbar-height);
  background:var(--fft-primary);
  color:#fff;
  box-shadow:var(--fft-shadow-sm);
  border-bottom:1px solid rgba(255,255,255,.08);
}

.topbar-inner{
  width:100%;
  max-width:var(--fft-content-max);
  margin:0 auto;
  padding:14px 22px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}

.brand-block{
  display:inline-flex;
  align-items:center;
  gap:14px;
  text-decoration:none;
  min-width:0;
}

.brand-mark{
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.14);
  border-radius:18px;
  padding:10px 14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 10px 24px rgba(0,0,0,.12);
}

.brand-logo{
  height:34px;
  width:auto;
  display:block;
  object-fit:contain;
}

.brand-meta{
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-width:0;
}

.brand-title{
  color:#fff;
  font-size:1.95rem;
  font-weight:800;
  line-height:1.05;
  letter-spacing:-.02em;
  margin:0 0 4px 0;
}

.brand-tagline{
  color:rgba(255,255,255,.92);
  font-size:.98rem;
  font-weight:500;
  line-height:1.2;
  margin:0;
}

.topbar-right{
  display:flex;
  align-items:center;
  gap:16px;
}

.topbar-user-block{
  color:#fff;
  text-align:right;
  font-size:.98rem;
  line-height:1.35;
}

.topbar-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

.topbar-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius:12px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.12);
  color:#fff;
  text-decoration:none;
  font-weight:600;
  transition:.2s ease;
}

.topbar-link:hover{
  background:rgba(255,255,255,.14);
  color:#fff;
}

.topbar-logout{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 16px;
  border-radius:14px;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.16);
  color:#fff;
  text-decoration:none;
  font-weight:700;
  transition:.2s ease;
}

.topbar-logout:hover{
  background:rgba(255,255,255,.18);
  color:#fff;
}

@media (max-width: 992px){
  .topbar-inner{
    flex-direction:column;
    align-items:stretch;
  }

  .topbar-right{
    justify-content:space-between;
  }

  .brand-title{
    font-size:1.45rem;
  }

  .brand-logo{
    height:28px;
  }
}

@media (max-width: 576px){
  .brand-block{
    gap:10px;
  }

  .brand-mark{
    padding:8px 10px;
    border-radius:14px;
  }

  .brand-title{
    font-size:1.15rem;
  }

  .brand-tagline,
  .topbar-user-block{
    font-size:.86rem;
  }

  .topbar-right{
    flex-direction:column;
    align-items:flex-start;
  }

  .topbar-user-block{
    text-align:left;
  }
}

/* ==========================================================================
   Module navigation
========================================================================== */
.module-nav{
  background:#ffffff;
  border-bottom:1px solid rgba(15,23,42,.08);
  box-shadow:0 2px 8px rgba(15,23,42,.04);
  width:100%;
  overflow-x:auto;
  overflow-y:hidden;
}

.module-nav-inner{
  max-width:1440px;
  margin:0 auto;
  padding:0 18px;
  display:flex;
  flex-wrap:nowrap;
  gap:6px;
  align-items:center;
  min-height:44px;
  white-space:nowrap;
}

.module-nav-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:32px;
  padding:0 10px;
  border-radius:9px;
  text-decoration:none;
  color:var(--fft-primary);
  font-weight:600;
  font-size:12px;
  transition:.15s ease-in-out;
  flex:0 0 auto;
}

.module-nav-link:hover{
  background:rgba(16,185,129,.08);
  color:var(--fft-support);
}

.module-nav-link.active{
  background:rgba(16,185,129,.15);
  color:var(--fft-support);
  box-shadow:inset 0 0 0 1px rgba(16,185,129,.25);
}

@media (max-width: 768px){
  .module-nav-inner{
    padding:6px 12px;
    gap:6px;
    min-height:42px;
  }

  .module-nav-link{
    height:32px;
    padding:0 10px;
    font-size:12px;
  }
}

/* ==========================================================================
   Cards / alerts / forms / buttons
========================================================================== */
.card{
  border:1px solid var(--fft-border);
  border-radius:var(--fft-radius-lg);
  background:var(--fft-card);
  box-shadow:var(--fft-shadow-sm);
  transition:box-shadow .15s ease-in-out, transform .15s ease-in-out;
}

.card:hover{
  box-shadow:var(--fft-shadow-md);
}

.alert{
  border:none;
  border-radius:14px;
  box-shadow:var(--fft-shadow-sm);
}

.form-control,
.form-select,
textarea{
  min-height:44px;
  border-radius:12px;
  border:1px solid var(--fft-border);
  box-shadow:none;
}

.form-control:focus,
.form-select:focus,
textarea:focus{
  border-color:rgba(16,185,129,.35);
  box-shadow:0 0 0 .2rem rgba(16,185,129,.10);
}

.btn{
  border-radius:12px;
  font-weight:700;
  min-height:44px;
}

.btn-primary{
  background:var(--fft-primary);
  border-color:var(--fft-primary);
}

.btn-primary:hover,
.btn-primary:focus{
  background:#0a274c;
  border-color:#0a274c;
}

.btn-outline-primary{
  color:var(--fft-primary);
  border-color:rgba(11,46,89,.24);
}

.btn-outline-primary:hover{
  background:var(--fft-primary);
  border-color:var(--fft-primary);
}

.text-muted{
  color:var(--fft-muted) !important;
}

/* ==========================================================================
   Tables
========================================================================== */
.table{
  background:#fff;
}

.table thead th{
  background:rgba(15,23,42,.03);
  color:var(--fft-muted);
  font-weight:700;
  border-bottom:1px solid var(--fft-border);
}

.table td,
.table th{
  vertical-align:middle;
  border-color:rgba(15,23,42,.08);
}

.table-hover tbody tr:hover{
  background:rgba(16,185,129,.04);
}

/* ==========================================================================
   Badges / states
========================================================================== */
.badge{
  display:inline-flex;
  align-items:center;
  padding:5px 10px;
  border-radius:999px;
  font-size:.82rem;
  font-weight:700;
  line-height:1;
}

.badge-success{
  background:#d1fae5;
  color:#065f46;
}

.badge-warning{
  background:#fef3c7;
  color:#92400e;
}

.badge-danger{
  background:#fee2e2;
  color:#991b1b;
}

.badge-muted{
  background:#eef2f7;
  color:#475569;
}

.empty-state{
  padding:28px 18px;
  text-align:center;
  color:var(--fft-muted);
}

/* ==========================================================================
   Login page
========================================================================== */
body.login-page{
  min-height:100vh;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  background:
    radial-gradient(circle at 20% 20%, rgba(11,46,89,.05), transparent 28%),
    radial-gradient(circle at 80% 80%, rgba(15,118,110,.05), transparent 30%),
    linear-gradient(90deg, #f7f9fc 0%, #eef2f7 40%, #f7f9fc 100%);
}

body.login-page .app-topbar,
body.login-page .module-nav{
  display:none;
}

body.login-page .app-shell{
  min-height:100vh;
}

body.login-page .app-main{
  flex:1;
  display:flex;
}

body.login-page .app-content{
  flex:1;
  max-width:100%;
  padding:0;
  margin:0;
  display:flex;
}

.login-shell{
  flex:1;
  height:100vh;
  position:relative;
  background:
    linear-gradient(rgba(15,23,42,.30), rgba(15,23,42,.30)),
    url("/static/img/background.jpg");
  background-size:cover;
  background-position:center center;
  background-repeat:no-repeat;
  animation:fadeLogin .5s ease;
}

.login-row{
  height:100%;
  align-items:stretch;
}

.login-left-panel{
  background:rgba(255,255,255,.62);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  border-right:1px solid rgba(255,255,255,.22);
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  overflow:hidden;
}

.login-left-panel::before,
.login-left-panel::after{
  content:"";
  position:absolute;
  border-radius:50%;
  z-index:0;
}

.login-left-panel::before{
  width:360px;
  height:360px;
  top:-120px;
  left:-100px;
  background:radial-gradient(circle, rgba(11,46,89,.12), transparent 70%);
}

.login-left-panel::after{
  width:320px;
  height:320px;
  right:-80px;
  bottom:-100px;
  background:radial-gradient(circle, rgba(16,185,129,.10), transparent 70%);
}

.login-brand-wrap{
  max-width:520px;
  width:100%;
  min-height:100%;
  display:flex;
  flex-direction:column;
  justify-content:center;
  position:relative;
  z-index:1;
}

.login-brand-copy{
  margin-bottom:1rem;
}

.logo-wrap{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  border-radius:50%;
  background:rgba(255,255,255,.92);
  box-shadow:0 8px 25px rgba(0,0,0,.08);
  margin-bottom:1rem;
}

.logo-wrap img{
  max-height:160px;
  width:auto;
  display:block;
}

.login-eyebrow{
  color:#2563eb;
  text-transform:uppercase;
  letter-spacing:.12em;
  font-size:.83rem;
  font-weight:800;
}

.login-brand-title{
  color:var(--fft-primary);
  font-size:3rem;
  line-height:1.05;
  letter-spacing:-.03em;
  margin:0;
}

.login-brand-subtitle{
  color:#5b6b80;
  font-size:1.08rem;
  line-height:1.55;
  margin:0;
}

.login-feature-card{
  max-width:420px;
  margin:0 auto;
  background:rgba(255,255,255,.88);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
}

.login-right-panel{
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,.48);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

.login-form-wrap{
  width:100%;
  max-width:460px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.login-form-card{
  border:1px solid rgba(255,255,255,.28);
  border-radius:18px;
  box-shadow:var(--fft-shadow-md);
  background:rgba(255,255,255,.82);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  transition:all .25s ease;
}

.login-form-card:hover{
  transform:translateY(-2px);
  box-shadow:0 20px 40px rgba(0,0,0,.18);
}

.login-form-card .card-body{
  padding:2rem;
}

.login-form-heading{
  letter-spacing:-.02em;
  color:var(--fft-text);
}

.login-support{
  border-top:1px solid var(--fft-border);
}

.login-mobile-brand img{
  max-height:110px;
  width:auto;
}

/* ==========================================================================
   Dashboard / Reports
========================================================================== */
body.login-page{
  min-height:100vh;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  background:
    radial-gradient(circle at 20% 20%, rgba(11,46,89,.05), transparent 28%),
    radial-gradient(circle at 80% 80%, rgba(15,118,110,.05), transparent 30%),
    linear-gradient(90deg, #f7f9fc 0%, #eef2f7 40%, #f7f9fc 100%);
}

body.login-page .app-topbar,
body.login-page .module-nav,
body.login-page .app-footer{
  display:none;
}

body.login-page .app-shell{
  min-height:100vh;
}

body.login-page .app-main{
  flex:1;
  display:flex;
}

body.login-page .app-content{
  flex:1;
  max-width:100%;
  padding:0;
  margin:0;
  display:flex;
}

.login-shell{
  flex:1;
  min-height:100vh;
  position:relative;
  background:
    linear-gradient(rgba(15,23,42,.20), rgba(15,23,42,.20)),
    linear-gradient(135deg, rgba(255,255,255,.85), rgba(241,245,249,.88));
  animation:fadeLogin .4s ease;
}

.login-row{
  min-height:100vh;
  align-items:stretch;
}

.login-left-panel{
  background:rgba(255,255,255,.68);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  border-right:1px solid rgba(255,255,255,.22);
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  overflow:hidden;
  padding:32px 0;
}

.login-left-panel::before,
.login-left-panel::after{
  content:"";
  position:absolute;
  border-radius:50%;
  z-index:0;
}

.login-left-panel::before{
  width:360px;
  height:360px;
  top:-120px;
  left:-100px;
  background:radial-gradient(circle, rgba(11,46,89,.10), transparent 70%);
}

.login-left-panel::after{
  width:320px;
  height:320px;
  right:-80px;
  bottom:-100px;
  background:radial-gradient(circle, rgba(16,185,129,.08), transparent 70%);
}

.login-brand-wrap{
  max-width:560px;
  width:100%;
  position:relative;
  z-index:1;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.logo-wrap{
  display:flex;
  align-items:center;
  justify-content:center;
  margin:0 auto 1.25rem auto;
  padding:0;
  background:transparent;
  box-shadow:none;
  border-radius:0;
  max-width:100%;
}

.logo-wrap img{
  display:block;
  width:100%;
  max-width:420px;
  max-height:120px;
  object-fit:contain;
}

.login-brand-copy{
  margin-bottom:1rem;
}

.login-eyebrow{
  color:#2563eb;
  text-transform:uppercase;
  letter-spacing:.12em;
  font-size:.80rem;
  font-weight:800;
}

.login-brand-title{
  color:var(--fft-primary);
  font-size:2.5rem;
  line-height:1.08;
  letter-spacing:-.03em;
  margin:0;
}

.login-brand-subtitle{
  color:#5b6b80;
  font-size:1.02rem;
  line-height:1.6;
  margin:0 auto;
  max-width:520px;
}

.login-feature-card{
  max-width:430px;
  margin:0 auto;
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
}

.login-right-panel{
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,.46);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  padding:32px 0;
}

.login-form-wrap{
  width:100%;
  max-width:460px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.login-form-card{
  border:1px solid rgba(255,255,255,.28);
  border-radius:18px;
  box-shadow:var(--fft-shadow-md);
  background:rgba(255,255,255,.88);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}

.login-form-card .card-body{
  padding:2rem;
}

.login-form-heading{
  letter-spacing:-.02em;
  color:var(--fft-text);
}

.login-support{
  border-top:1px solid var(--fft-border);
}

.login-mobile-brand img{
  width:100%;
  max-width:280px;
  max-height:80px;
  object-fit:contain;
}

@media (max-width: 1200px){
  .login-brand-title{
    font-size:2.1rem;
  }

  .logo-wrap img{
    max-width:360px;
    max-height:100px;
  }
}

@media (max-width: 768px){
  body.login-page{
    overflow:auto;
  }

  .login-shell{
    min-height:100vh;
    height:auto;
  }

  .login-row{
    min-height:100vh;
  }

  .login-right-panel{
    background:rgba(255,255,255,.72);
    padding:24px 0;
  }

  .login-form-card .card-body{
    padding:1.5rem;
  }

  .login-mobile-brand .logo-wrap{
    margin-bottom:1rem;
  }

  .login-mobile-brand img{
    max-width:220px;
    max-height:72px;
  }
}
/* ==========================================================================
   Utility
========================================================================== */
.comment-box{
  white-space:normal;
  word-break:break-word;
}

[dir="rtl"]{
  text-align:right;
}

[dir="rtl"] .text-muted{
  direction:rtl;
}

@keyframes fadeLogin{
  from{
    opacity:0;
    transform:translateY(8px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

/* ==========================================================================
   Print
========================================================================== */
@media print{
  .app-topbar,
  .module-nav,
  .btn,
  .alert,
  form{
    display:none !important;
  }

  body{
    background:#fff !important;
  }

  .app-content{
    max-width:100% !important;
    padding:0 !important;
  }

  .card{
    box-shadow:none !important;
    border:1px solid #ddd !important;
  }

  .table thead th{
    background:#f5f5f5 !important;
    color:#333 !important;
  }
}