:root{
  --line:#d07b26;
  --line-soft:rgba(208,123,38,.38);
  --text:#f6dec2;
  --muted:#efba80;
  --good:#9add5d;
  --bad:#ff5d4b;
  --gold:#efb257;
}
*{box-sizing:border-box}

body{
  font-family:'Montserrat',sans-serif;
  color:var(--text);
  background:
    linear-gradient(180deg, rgba(21,8,6,.28) 0%, rgba(20,9,7,.38) 28%, rgba(20,9,7,.62) 58%, rgba(23,9,7,.88) 100%),
    url('../img/bg.jpg?v=20260323-2') center center / cover no-repeat fixed;
}
.page-overlay{
  position:fixed;
  inset:0;
  pointer-events:none;
  background:radial-gradient(circle at 75% 55%, rgba(255,154,47,.08), transparent 28%);
}
.floating-links{
  position:fixed;
  left:18px;
  top:120px;
  display:flex;
  flex-direction:column;
  gap:12px;
  z-index:50;
}
.float-btn{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  min-width:200px;
  text-decoration:none;
  color:#ffd39a;
  background:linear-gradient(180deg, rgba(42,18,11,.92), rgba(27,11,9,.92));
  border:1px solid var(--line-soft);
  border-radius:14px;
  box-shadow:0 0 12px rgba(208,123,38,.12);
  font-size:15px;
  font-weight:600;
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.float-btn:hover{
  transform:translateX(3px);
  box-shadow:0 0 16px rgba(208,123,38,.18);
  border-color:rgba(255,184,95,.55);
}
.float-btn img{
  width:24px;
  height:24px;
  object-fit:contain;
  display:block;
}
.wrap{
  width:min(96vw, 1560px);
  margin:0 auto;
  padding:18px 10px 28px;
}
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-height:68px;
  padding:6px 18px;
  background:linear-gradient(180deg, rgba(29,13,10,.92), rgba(24,11,9,.9));
  border:1px solid var(--line-soft);
  box-shadow:inset 0 1px 0 rgba(255,204,155,.05), 0 0 18px rgba(208,123,38,.10);
  gap:18px;
}
.brand{
  display:flex;
  align-items:center;
  min-width:0;
}
.brand img{
  display:block;
  width:86px;
  height:auto;
  object-fit:contain;
}
.nav{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.nav a{
  color:var(--muted);
  text-decoration:none;
  font-size:16px;
  font-weight:500;
  position:relative;
  padding:4px 0;
  transition:.18s ease;
}
.nav a:hover,.nav a.active{
  color:#ffd39a;
  text-shadow:0 0 10px rgba(255,165,72,.45);
}
.nav a::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:-8px;
  height:3px;
  border-radius:999px;
  background:linear-gradient(90deg, transparent, rgba(255,184,95,1), transparent);
  box-shadow:0 0 10px rgba(255,166,77,.75);
  opacity:0;
  transform:scaleX(.5);
  transition:opacity .18s ease, transform .18s ease;
}
.nav a:hover::after,.nav a.active::after{
  opacity:1;
  transform:scaleX(1);
}
.nav span{color:#a96831}
.sound{
  border:0;
  background:none;
  color:#efb15d;
  font-size:22px;
  cursor:pointer;
  padding-left:2px;
  text-shadow:0 0 8px rgba(255,165,72,.35);
}
.hero{
  text-align:center;
  padding:50px 20px 34px;
}
.hero h1{
  margin:0;
  font-size:52px;
  line-height:1.05;
  font-weight:800;
  letter-spacing:.3px;
  color:#f9e7d1;
  text-shadow:0 2px 8px rgba(0,0,0,.18);
}
.hero p{
  margin:18px 0 0;
  font-size:20px;
  color:#f6dec2;
  font-weight:500;
}
.stats{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:18px;
  width:min(92vw, 1360px);
  margin:0 auto;
}
.card{
  min-height:126px;
  background:linear-gradient(180deg, rgba(34,16,11,.84), rgba(24,11,9,.88));
  border:1px solid var(--line-soft);
  border-radius:16px;
  box-shadow:inset 0 1px 0 rgba(255,193,138,.05), 0 0 16px rgba(208,123,38,.10);
  padding:18px 22px;
  display:flex;
  flex-direction:column;
}
.label{
  font-size:19px;
  font-weight:600;
  color:#f3dcc1;
}
.meta-line{
  margin-top:8px;
  min-height:24px;
  font-size:15px;
  color:#efba80;
  font-weight:600;
  line-height:1.2;
}
.value-line{
  margin-top:auto;
  display:flex;
  align-items:flex-end;
  gap:10px;
  flex-wrap:wrap;
}
.value{
  font-size:54px;
  font-weight:800;
  line-height:1;
  color:#f8e7d1;
}
.card-simple .simple-value{
  margin-top:auto;
  align-self:flex-start;
  line-height:1;
  transform:translateY(7px);
}
.suffix{
  font-size:20px;
  font-weight:700;
  line-height:1.1;
  color:#efc592;
  margin-bottom:6px;
  letter-spacing:.3px;
}
.value.good{color:var(--good)}
.value.bad{color:var(--bad)}
.panel{
  width:min(93vw, 1380px);
  margin:24px auto 0;
  background:linear-gradient(180deg, rgba(33,16,11,.86), rgba(23,11,9,.90));
  border:1px solid var(--line-soft);
  border-radius:18px;
  overflow:hidden;
  box-shadow:0 0 16px rgba(208,123,38,.10);
}
.panel h2{
  margin:0;
  padding:18px 18px 14px;
  font-size:20px;
  color:#efb35d;
  font-weight:700;
  border-bottom:1px solid rgba(208,123,38,.28);
}
table{
  width:100%;
  border-collapse:collapse;
}
thead{
  background:rgba(20,10,8,.28);
}
thead th{
  padding:13px 12px 11px;
  text-align:center;
  vertical-align:middle;
  color:#efc592;
  font-size:17px;
  font-weight:700;
  border-bottom:2px solid rgba(235,138,37,.85);
}
tbody td{
  padding:8px 12px;
  text-align:center;
  vertical-align:middle;
  font-size:16px;
  color:#f3dcc0;
  border-bottom:1px solid rgba(208,123,38,.15);
  line-height:1.05;
}
tbody tr:hover td{
  background:rgba(255,166,72,.05);
}
tbody tr:last-child td{
  border-bottom:none;
}
.ranking-table{
  table-layout:fixed;
}
.ranking-table th.col-pilot,
.ranking-table td.td-pilot{width:12%}
.ranking-table th.col-callsign,
.ranking-table td.td-callsign{width:26%}
.ranking-table th.col-fpm,
.ranking-table td.td-fpm{width:16%}
.ranking-table th.col-dest,
.ranking-table td.td-dest{width:18%}
.ranking-table td.td-pilot{
  text-align:left !important;
  vertical-align:middle !important;
  color:#f0c06f !important;
  font-size:16px !important;
  font-weight:600 !important;
  padding-left:8px !important;
  padding-right:4px !important;
}
.ranking-table td.td-callsign{
  text-align:center !important;
  vertical-align:middle !important;
  color:#f3dcc0 !important;
  font-size:16px !important;
  font-weight:500 !important;
  letter-spacing:0 !important;
}
.ranking-table td.td-fpm{
  text-align:center !important;
  vertical-align:middle !important;
  color:#f4c257 !important;
  font-size:16px !important;
  font-weight:700 !important;
}
.ranking-table td.td-dest{
  text-align:center !important;
  vertical-align:middle !important;
  color:#f3dcc0 !important;
  font-size:16px !important;
  font-weight:500 !important;
}
.status-note{
  width:min(93vw, 1380px);
  margin:10px auto 0;
  text-align:center;
  color:#cbb69f;
  font-size:13px;
}
.footer{
  text-align:center;
  padding:14px 0 10px;
}
.footer-brand{
  font-size:42px;
  font-weight:800;
  color:var(--gold);
  text-shadow:0 0 14px rgba(255,166,72,.18);
}
.footer-copy{
  margin-top:8px;
  font-size:16px;
  color:#cbb69f;
}
@media (max-width:1200px){
  .floating-links{top:150px}
}
@media (max-width:1080px){
  .floating-links{
    position:static;
    flex-direction:row;
    flex-wrap:wrap;
    width:min(96vw, 1560px);
    margin:12px auto 0;
    padding:0 10px;
    z-index:1;
  }
  .float-btn{min-width:unset}
}
@media (max-width:1100px){
  .topbar{align-items:flex-start;flex-direction:column;min-height:auto}
  .nav{justify-content:flex-start}
  .hero h1{font-size:46px}
  .hero p{font-size:18px}
  .stats{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:760px){
  .wrap{width:98vw;padding:8px}
  .topbar{gap:12px}
  .brand img{width:min(100px, 34vw)}
  .nav{gap:8px}
  .nav a{font-size:15px}
  .floating-links{width:100%;margin:10px auto 0;padding:0 8px}
  .float-btn{width:100%;justify-content:flex-start}
  .hero{padding:42px 14px 22px}
  .hero h1{font-size:36px}
  .hero p{font-size:15px}
  .stats{grid-template-columns:1fr;width:100%}
  .value{font-size:42px}
  .suffix{font-size:18px;margin-bottom:4px}
  .panel,.status-note{width:100%}
  thead th, tbody td{font-size:14px;padding:8px 8px}
  .ranking-table th.col-pilot,.ranking-table td.td-pilot{width:18%}
  .ranking-table th.col-callsign,.ranking-table td.td-callsign{width:26%}
  .ranking-table th.col-fpm,.ranking-table td.td-fpm{width:18%}
  .ranking-table th.col-dest,.ranking-table td.td-dest{width:18%}
  .ranking-table td.td-pilot,.ranking-table td.td-callsign,.ranking-table td.td-fpm,.ranking-table td.td-dest{font-size:14px !important}
  .footer-copy{font-size:14px}
}


/* ===== Historial specific ===== */
.hero{
  padding:34px 20px 22px;
}
.filters-panel{
  width:min(93vw, 1380px);
  margin:0 auto 18px;
  background:linear-gradient(180deg, rgba(33,16,11,.86), rgba(23,11,9,.90));
  border:1px solid var(--line-soft);
  border-radius:18px;
  box-shadow:0 0 16px rgba(208,123,38,.10);
  padding:18px;
}
.filters-grid{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:14px;
}
.filter-box label{
  display:block;
  margin-bottom:8px;
  color:#efc592;
  font-size:14px;
  font-weight:700;
}
.filter-box input,.filter-box select{
  width:100%;
  height:44px;
  padding:0 12px;
  border-radius:12px;
  border:1px solid rgba(208,123,38,.28);
  background:rgba(14,7,6,.72);
  color:#f6dec2;
  font-size:15px;
  outline:none;
}
.filter-box input::placeholder{color:#b89670}
.filters-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  margin-top:16px;
}
.btn-primary,.btn-secondary{
  height:42px;
  padding:0 18px;
  border-radius:12px;
  border:1px solid rgba(208,123,38,.35);
  cursor:pointer;
  font-weight:700;
  font-size:14px;
}
.btn-primary{background:#d07b26;color:#160d0a}
.btn-secondary{background:rgba(14,7,6,.72);color:#efc592}

.stats.historial-stats .card{
  min-height:110px;
}
.stats.historial-stats .meta-line{
  min-height:20px;
}
.stats.historial-stats .value{
  font-size:48px;
}
.stats.historial-stats .card-simple .simple-value{
  transform:translateY(2px);
}

.history-panel{
  margin-top:18px;
}
.history-table{
  table-layout:fixed;
}
.history-table th.col-pilot,.history-table td.td-pilot{width:18%}
.history-table th.col-callsign,.history-table td.td-callsign{width:18%}
.history-table th.col-fpm,.history-table td.td-fpm{width:10%}
.history-table th.col-aircraft,.history-table td.td-aircraft{width:12%}
.history-table th.col-airport,.history-table td.td-airport{width:18%}
.history-table th.col-date,.history-table td.td-date{width:24%}

.history-table td.td-pilot{
  text-align:left !important;
  color:#f0c06f !important;
  font-size:16px !important;
  font-weight:600 !important;
}
.history-table td.td-callsign,
.history-table td.td-aircraft,
.history-table td.td-airport,
.history-table td.td-date{
  text-align:center !important;
  color:#f3dcc0 !important;
  font-size:16px !important;
  font-weight:500 !important;
}
.history-table td.td-fpm{
  text-align:center !important;
  font-size:16px !important;
  font-weight:700 !important;
}
.history-table td.td-fpm.good{color:var(--good)!important}
.history-table td.td-fpm.bad{color:var(--bad)!important}
.history-table td.td-fpm.warn{color:#f4c257!important}

.table-scroll{
  max-height:330px;
  overflow-y:auto;
}
.table-scroll::-webkit-scrollbar{width:10px}
.table-scroll::-webkit-scrollbar-thumb{
  background:rgba(208,123,38,.55);
  border-radius:999px;
}
.table-scroll thead{
  position:sticky;
  top:0;
  z-index:3;
  background:rgba(20,10,8,.96);
}

.pagination{
  width:min(93vw, 1380px);
  margin:10px auto 0;
  text-align:center;
  color:#cbb69f;
  font-size:14px;
}
.page-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:42px;
  height:28px;
  padding:0 10px;
  border-radius:10px;
  border:1px solid rgba(208,123,38,.35);
  background:rgba(14,7,6,.72);
  color:#efc592;
  font-weight:700;
}
.page-text{
  display:inline-block;
  margin:0 10px;
}

.sticky-cluster{
  position:sticky;
  top:96px;
  z-index:40;
}
.sticky-cluster::before{
  content:"";
  position:absolute;
  inset:-10px -20px 0 -20px;
  background:linear-gradient(180deg, rgba(10,5,4,.94), rgba(10,5,4,0));
  pointer-events:none;
  z-index:-1;
}

@media (max-width:1200px){
  .filters-grid{grid-template-columns:repeat(3,1fr)}
}

@media (max-width:1100px){
  .sticky-cluster{position:static}
}

@media (max-width:760px){
  .filters-grid{grid-template-columns:1fr}
  .history-table th.col-pilot,.history-table td.td-pilot{width:20%}
  .history-table th.col-callsign,.history-table td.td-callsign{width:20%}
  .history-table th.col-fpm,.history-table td.td-fpm{width:14%}
  .history-table th.col-aircraft,.history-table td.td-aircraft{width:14%}
  .history-table th.col-airport,.history-table td.td-airport{width:14%}
  .history-table th.col-date,.history-table td.td-date{width:18%}
  .history-table td.td-pilot,.history-table td.td-callsign,.history-table td.td-fpm,.history-table td.td-aircraft,.history-table td.td-airport,.history-table td.td-date{
    font-size:14px !important
  }
  .table-scroll{max-height:none}
}


/* ===== Historial fix scroll-only + remove extra shadow ===== */

body{
  
}
.wrap{width:min(96vw,1560px);margin:0 auto;padding:6px 10px 20px;}
.sticky-cluster{
  position:static !important;
  top:auto !important;
  background:transparent !important;
  padding-bottom:0 !important;
}
.sticky-cluster::before{
  display:none !important;
}
.filters-panel{
  margin-bottom:12px !important;
}
.history-panel{
  margin-top:12px !important;
}
.table-scroll{
  max-height:calc(100vh - 590px) !important;
  min-height:220px;
  overflow-y:auto !important;
}
.td-date{
  color:#f3dcc0 !important;
  font-size:15px !important;
  white-space:nowrap;
}
@media (max-width: 1100px){
  body{
    overflow:auto;
  }
  .wrap{
    height:auto;
    overflow:visible;
  }
  .table-scroll{
    max-height:none !important;
  }
}


/* ===== Final historial fixes ===== */
html, body{
  min-height:100%;
}
body{
  overflow-y:auto !important;
}
.wrap{
  width:min(96vw,1560px);
  margin:0 auto;
  padding:6px 10px 20px;
}
.sticky-cluster{
  position:sticky;
  top:96px;
  z-index:40;
  background:transparent !important;
  padding-bottom:0 !important;
}
.sticky-cluster::before{
  display:none !important;
}
.filters-panel,
.stats.historial-stats{
  box-shadow:0 0 16px rgba(208,123,38,.10) !important;
  background:linear-gradient(180deg, rgba(33,16,11,.86), rgba(23,11,9,.90)) !important;
}
.table-scroll{
  max-height:340px !important;
  overflow-y:auto !important;
}
.td-date{
  white-space:nowrap;
  color:#f3dcc0 !important;
}
@media (max-width:1100px){
  .sticky-cluster{
    position:static !important;
    top:auto !important;
  }
  .table-scroll{
    max-height:none !important;
  }
}
