/* V9.06 · Interfaz oscura definitiva.
   La capa visual se aplica de forma permanente y no altera datos ni lógica. */

/* Paleta y tipografía */
html[data-interface="modern"]{
  --modern-accent:#f97316;
  --modern-accent-hover:#fb923c;
  --modern-accent-deep:#c2410c;
  --modern-accent-rgb:249,115,22;
  --modern-bg:#111217;
  --modern-shell:#15161b;
  --modern-sidebar:#17181d;
  --modern-surface:#1b1c22;
  --modern-surface-raised:#202128;
  --modern-surface-soft:#24262e;
  --modern-border:#2b2d35;
  --modern-border-strong:#383a44;
  --modern-text:#f4f4f5;
  --modern-muted:#92949f;
  --modern-faint:#666873;
  --bg:var(--modern-bg);
  --panel:var(--modern-surface);
  --panel-2:var(--modern-surface-raised);
  --line:var(--modern-border);
  --text:var(--modern-text);
  --muted:var(--modern-muted);
  --accent:var(--modern-accent);
  --accent-2:#22c55e;
  --shadow:0 18px 50px rgba(0,0,0,.28);
  --radius:5px;
  --sport-surface:var(--modern-surface);
  --sport-surface-raised:var(--modern-surface-raised);
  --sport-surface-soft:var(--modern-surface-soft);
  --sport-border:var(--modern-border);
  --sport-text:var(--modern-text);
  --sport-muted:var(--modern-muted);
  --sport-faint:var(--modern-faint);
  --sport-white:#fff;
  color-scheme:dark;
  background:var(--modern-bg);
  scrollbar-color:#41434d #15161b;
}

html[data-interface="modern"] body{
  color:var(--modern-text);
  background:
    linear-gradient(rgba(255,255,255,.012) 1px,transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,.012) 1px,transparent 1px),
    var(--modern-bg);
  background-size:42px 42px;
  font-family:Inter,Roboto,"Segoe UI",ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
}

html[data-interface="modern"] ::selection{
  color:#fff;
  background:rgba(var(--modern-accent-rgb),.48);
}
html[data-interface="modern"] ::-webkit-scrollbar{width:9px;height:9px}
html[data-interface="modern"] ::-webkit-scrollbar-track{background:#15161b}
html[data-interface="modern"] ::-webkit-scrollbar-thumb{
  border:2px solid #15161b;
  border-radius:8px;
  background:#41434d;
}
html[data-interface="modern"] ::-webkit-scrollbar-thumb:hover{background:#555864}

html[data-interface="modern"] h1,
html[data-interface="modern"] h2,
html[data-interface="modern"] h3,
html[data-interface="modern"] h4{
  color:#f7f7f8;
  letter-spacing:-.018em;
}
html[data-interface="modern"] h2{font-weight:720}
html[data-interface="modern"] h3{font-weight:700}
html[data-interface="modern"] .label,
html[data-interface="modern"] label,
html[data-interface="modern"] .eyebrow{
  color:#858792;
  font-size:9px;
  font-weight:760;
  letter-spacing:.10em;
}
html[data-interface="modern"] .muted,
html[data-interface="modern"] .tagline,
html[data-interface="modern"] .events{color:var(--modern-muted)}

/* Marco principal inspirado en paneles de gestión deportiva */
@media (min-width:901px){
  html[data-interface="modern"] .topbar{
    position:sticky;
    top:0;
    z-index:800;
    display:grid;
    grid-template-columns:252px minmax(0,1fr);
    align-items:stretch;
    width:min(1880px,calc(100% - 24px));
    min-height:70px;
    margin:12px auto 0;
    padding:0;
    gap:0;
    border:1px solid var(--modern-border);
    border-bottom-color:#24262d;
    border-radius:5px 5px 0 0;
    background:rgba(23,24,29,.97);
    box-shadow:0 16px 42px rgba(0,0,0,.28);
    backdrop-filter:blur(18px) saturate(115%);
  }
  html[data-interface="modern"] .topbar-brand{
    width:auto;
    min-width:0;
    min-height:68px;
    padding:9px 17px;
    justify-content:flex-start;
    border-right:1px solid var(--modern-border);
    background:#18191e;
  }
  html[data-interface="modern"] .game-brand-logo-top{
    width:184px;
    height:50px;
    object-position:left center;
    filter:drop-shadow(0 6px 14px rgba(0,0,0,.28));
  }
  html[data-interface="modern"] .top-actions,
  html[data-interface="modern"] .top-actions.top-actions-compact{
    min-width:0;
    padding:10px 14px;
    gap:6px;
    align-content:center;
    justify-content:flex-end;
    background:#18191e;
  }
  html[data-interface="modern"] .shell{
    display:grid;
    grid-template-columns:252px minmax(0,1fr);
    width:min(1880px,calc(100% - 24px));
    margin:0 auto 24px;
    padding:0;
    gap:0;
  }
  html[data-interface="modern"] .side{
    position:sticky;
    top:82px;
    align-self:start;
    max-height:calc(100vh - 94px);
    min-height:calc(100vh - 94px);
    padding:13px 11px 16px;
    overflow-y:auto;
    border-top:0;
    border-right:1px solid var(--modern-border);
    border-radius:0 0 0 5px;
    background:var(--modern-sidebar);
    box-shadow:none;
  }
  html[data-interface="modern"] .content{
    min-width:0;
    min-height:calc(100vh - 94px);
    background:var(--modern-shell);
  }
  html[data-interface="modern"] #view.panel{
    min-height:calc(100vh - 94px);
    padding:clamp(14px,1.5vw,22px);
    border-top:0;
    border-left:0;
    border-radius:0 0 5px 0;
    border-color:var(--modern-border);
    background:var(--modern-shell);
    box-shadow:none;
  }
}

/* Barra superior */
html[data-interface="modern"] .top-actions .small-btn,
html[data-interface="modern"] .theme-switch{
  min-height:34px;
  padding:7px 10px;
  border:1px solid #30323b;
  border-radius:4px;
  color:#b7b8c0;
  background:#202127;
  box-shadow:none;
  font-size:9px;
  font-weight:720;
}
html[data-interface="modern"] .top-actions .small-btn:hover,
html[data-interface="modern"] .theme-switch:hover{
  color:#fff;
  border-color:#4a4d58;
  background:#282a31;
}
html[data-interface="modern"] .interface-preview-toggle{
  min-height:36px;
  padding:6px 11px;
  border-color:var(--modern-accent);
  border-radius:4px;
  color:#fff;
  background:linear-gradient(180deg,#ff842f,var(--modern-accent));
  box-shadow:0 7px 18px rgba(var(--modern-accent-rgb),.16);
}
html[data-interface="modern"] .interface-preview-toggle:hover{
  border-color:var(--modern-accent-hover);
  background:linear-gradient(180deg,#ff984e,#f97316);
}
html[data-interface="modern"] .interface-preview-toggle.is-active{
  color:#ffd9bf;
  border-color:#4a4d58;
  background:#25272e;
  box-shadow:none;
}
html[data-interface="modern"] .theme-switch-track{
  width:28px;
  height:16px;
  flex-basis:28px;
  border-color:#474a55;
  background:#111217;
}
html[data-interface="modern"] .theme-switch-thumb{width:10px;height:10px}
html[data-interface="modern"] .theme-switch[aria-checked="true"] .theme-switch-thumb{transform:translateX(12px)}

/* Panel lateral */
html[data-interface="modern"] .new-game,
html[data-interface="modern"] .status-card{
  margin-bottom:10px;
  padding:0;
  overflow:hidden;
  border:1px solid var(--modern-border);
  border-radius:4px;
  background:#1b1c21;
  box-shadow:none;
}
html[data-interface="modern"] .new-game-toggle{
  min-height:40px;
  padding:9px 12px;
  border:0;
  border-radius:0;
  color:#fff;
  background:linear-gradient(90deg,#f97316,#fb923c);
  font-size:10px;
  font-weight:780;
}
html[data-interface="modern"] .new-game-toggle:hover{
  color:#fff;
  background:linear-gradient(90deg,#fb7e26,#ffa15e);
}
html[data-interface="modern"] .status-card{
  position:relative;
  padding:14px 13px 13px;
  text-align:left;
}
html[data-interface="modern"] .status-card::before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:3px;
  background:var(--modern-accent);
}
html[data-interface="modern"] .status-card .label{margin:0 0 6px;color:#757781}
html[data-interface="modern"] .status-card h2{
  margin:0 0 10px;
  color:#fff;
  font-size:15px;
  font-weight:750;
}
html[data-interface="modern"] .status-card p{
  margin:5px 0;
  color:#a1a3ac;
  font-size:9px;
}
html[data-interface="modern"] .sidebar-nav{
  gap:2px;
  margin-top:8px;
}
html[data-interface="modern"] .sidebar-nav>button,
html[data-interface="modern"] .sidebar-nav .nav-group-toggle,
html[data-interface="modern"] .sidebar-nav .nav-group-items>button{
  border:0;
  border-left:3px solid transparent;
  border-radius:0;
  color:#9698a2;
  background:transparent;
  box-shadow:none;
}
html[data-interface="modern"] .sidebar-nav>button,
html[data-interface="modern"] .sidebar-nav .nav-group-toggle{
  min-height:38px;
  padding:8px 10px;
  font-size:10px;
  font-weight:720;
}
html[data-interface="modern"] .sidebar-nav .nav-group-items{
  margin:0;
  padding-left:6px;
  border-left:1px solid #292b32;
}
html[data-interface="modern"] .sidebar-nav .nav-group-items>button{
  min-height:31px;
  padding:6px 8px 6px 22px;
  color:#7f818c;
  font-size:9.5px;
}
html[data-interface="modern"] .sidebar-nav .nav-group-items>button::before{
  left:10px;
  width:4px;
  height:4px;
  background:#565862;
}
html[data-interface="modern"] .sidebar-nav>button:hover,
html[data-interface="modern"] .sidebar-nav .nav-group-toggle:hover,
html[data-interface="modern"] .sidebar-nav .nav-group-items>button:hover{
  color:#f4f4f5;
  border-left-color:#555761;
  background:#202127;
}
html[data-interface="modern"] .sidebar-nav>button.active,
html[data-interface="modern"] .sidebar-nav .nav-group-items>button.active{
  color:#fff;
  border-left-color:var(--modern-accent);
  background:linear-gradient(90deg,rgba(var(--modern-accent-rgb),.16),rgba(var(--modern-accent-rgb),.025));
  box-shadow:none;
}
html[data-interface="modern"] .sidebar-nav .nav-group.has-active>.nav-group-toggle{
  color:#e4e4e7;
  border-left-color:rgba(var(--modern-accent-rgb),.72);
  background:#1e1f25;
}
html[data-interface="modern"] .sidebar-nav .nav-group-items>button.active::before{
  background:var(--modern-accent);
  box-shadow:0 0 0 3px rgba(var(--modern-accent-rgb),.13);
}
html[data-interface="modern"] .sidebar-nav .nav-chevron{color:#666873}
html[data-interface="modern"] .sidebar-nav .sidebar-home-link::before{color:var(--modern-accent)}

/* Paneles, tarjetas y bloques informativos */
html[data-interface="modern"] .panel,
html[data-interface="modern"] .modal-panel{
  color:var(--modern-text);
  border-color:var(--modern-border);
  border-radius:5px;
  background:var(--modern-surface);
  box-shadow:none;
  backdrop-filter:none;
}
html[data-interface="modern"] :is(
  .card,
  .inner,
  .sticky-actions,
  .welcome-about,
  .save-slot-card,
  .office-main-card,
  .office-side-card,
  .manager-dressing-room-card,
  .player-profile-section,
  .career-stage-card,
  .club-profile-panel,
  .club-profile-summary-item,
  .club-fifa-ranking-row,
  .finance-monthly-card,
  .transfer-history-summary>div,
  .match-card,
  .empty-office-box,
  .office-mini-grid>div,
  .welcome-summary>div,
  .live-instruction-help div,
  .live-instruction-log div
){
  color:var(--modern-text);
  border-color:var(--modern-border);
  border-radius:4px;
  background:var(--modern-surface);
  box-shadow:none;
}
html[data-interface="modern"] .card{
  padding:14px;
}
html[data-interface="modern"] .card:hover{
  border-color:#393b45;
}
html[data-interface="modern"] .inner,
html[data-interface="modern"] .card.inner{background:#18191e}
html[data-interface="modern"] .section-title{
  margin-bottom:14px;
  padding-bottom:10px;
  border-bottom:1px solid var(--modern-border);
}
html[data-interface="modern"] .section-title h2,
html[data-interface="modern"] .section-title h3{margin:0}
html[data-interface="modern"] .metric{
  color:#fff;
  font-size:27px;
  font-weight:760;
}
html[data-interface="modern"] .office-mini-grid>div,
html[data-interface="modern"] .club-profile-summary-item{
  position:relative;
  overflow:hidden;
}
html[data-interface="modern"] .office-mini-grid>div::after,
html[data-interface="modern"] .club-profile-summary-item::after{
  content:"";
  position:absolute;
  inset:auto 0 0;
  height:2px;
  background:linear-gradient(90deg,var(--modern-accent),transparent 72%);
  opacity:.75;
}
html[data-interface="modern"] .next-match{
  border:1px solid #343640;
  border-radius:4px;
  background:
    linear-gradient(90deg,rgba(var(--modern-accent-rgb),.10),transparent 34%,rgba(255,255,255,.018)),
    #1a1b20;
}
html[data-interface="modern"] .team-name{color:#fff;font-weight:750}
html[data-interface="modern"] .vs{color:#6e707b}
html[data-interface="modern"] .notice{
  margin:0 0 10px;
  padding:10px 13px;
  border:1px solid rgba(var(--modern-accent-rgb),.38);
  border-radius:4px;
  color:#fed7aa;
  background:rgba(var(--modern-accent-rgb),.11);
  box-shadow:none;
}
html[data-interface="modern"] .empty{color:#777984}
html[data-interface="modern"] code{
  color:#ffedd5;
  border-color:#3d3f49;
  border-radius:3px;
  background:#121318;
}
html[data-interface="modern"] .pill{
  border:1px solid #343640;
  border-radius:3px;
  color:#c8c9cf;
  background:#24252b;
}
html[data-interface="modern"] .bar{height:7px;background:#292b32}
html[data-interface="modern"] .bar span{
  background:linear-gradient(90deg,var(--modern-accent),#f59e0b);
}
html[data-interface="modern"] .clickable:hover{
  transform:none;
  border-color:#444752;
  background:#212229;
}

/* Formularios y botones */
html[data-interface="modern"] select,
html[data-interface="modern"] input,
html[data-interface="modern"] textarea{
  color:#ececef;
  border:1px solid #353741;
  border-radius:4px;
  background:#15161b;
  box-shadow:none;
}
html[data-interface="modern"] select:focus,
html[data-interface="modern"] input:focus,
html[data-interface="modern"] textarea:focus{
  border-color:var(--modern-accent);
  box-shadow:0 0 0 2px rgba(var(--modern-accent-rgb),.12);
}
html[data-interface="modern"] .primary,
html[data-interface="modern"] .ghost{
  min-height:35px;
  padding:8px 13px;
  border-radius:4px;
  font-weight:740;
  box-shadow:none;
}
html[data-interface="modern"] .primary{
  color:#fff;
  border:1px solid #fb8534;
  background:linear-gradient(180deg,#ff8736,#e9660e);
}
html[data-interface="modern"] .primary:hover{
  border-color:#ffa15f;
  background:linear-gradient(180deg,#ff9954,#f97316);
}
html[data-interface="modern"] .ghost{
  color:#c1c2c8;
  border:1px solid #373943;
  background:#222329;
}
html[data-interface="modern"] .ghost:hover{
  color:#fff;
  border-color:#4a4d58;
  background:#292b32;
}
html[data-interface="modern"] .danger{color:#fca5a5}
html[data-interface="modern"] .danger:hover{border-color:#7f1d1d;background:#32191c}
html[data-interface="modern"] .subtabs{
  gap:4px;
  padding-bottom:8px;
  border-bottom:1px solid var(--modern-border);
}
html[data-interface="modern"] .subtabs button,
html[data-interface="modern"] .tabs button{
  border:1px solid transparent;
  border-radius:3px;
  color:#8f919b;
  background:transparent;
}
html[data-interface="modern"] .subtabs button:hover,
html[data-interface="modern"] .subtabs button.active,
html[data-interface="modern"] .tabs button:hover,
html[data-interface="modern"] .tabs button.active{
  color:#fff;
  border-color:rgba(var(--modern-accent-rgb),.36);
  background:rgba(var(--modern-accent-rgb),.12);
}

/* Tablas y rankings */
html[data-interface="modern"] .table-wrap{
  border:1px solid var(--modern-border);
  border-radius:4px;
  background:#17181d;
}
html[data-interface="modern"] table{
  color:#d7d8dd;
  background:#18191e;
}
html[data-interface="modern"] th{
  color:#a9abb4;
  border-bottom:1px solid #383a43;
  background:#202127;
  font-size:8px;
  font-weight:780;
  letter-spacing:.08em;
}
html[data-interface="modern"] td{
  border-bottom-color:#292b32;
}
html[data-interface="modern"] tbody tr:nth-child(even) td{background:rgba(255,255,255,.012)}
html[data-interface="modern"] tr:hover td{
  color:#fff;
  background:rgba(var(--modern-accent-rgb),.085);
}
html[data-interface="modern"] .pos,
html[data-interface="modern"] .rank-num{color:#fb923c}
html[data-interface="modern"] .stat-rank{
  border-bottom-color:#2c2e36;
}

/* Ventanas y estados flotantes */
html[data-interface="modern"] .modal-backdrop{
  background:rgba(5,6,9,.78);
  backdrop-filter:blur(5px);
}
html[data-interface="modern"] .modal-panel{
  border-color:#3b3d47;
  background:#191a20;
  box-shadow:0 28px 80px rgba(0,0,0,.54);
}
html[data-interface="modern"] .modal-close{
  color:#d4d4d8;
  border-color:#3c3e48;
  border-radius:4px;
  background:#24252b;
}
html[data-interface="modern"] .modal-close:hover{color:#fff;background:#30323a}
html[data-interface="modern"] .sticky-actions{
  border-color:#3b3d46;
  background:rgba(25,26,32,.96);
  backdrop-filter:blur(10px);
}
html[data-interface="modern"] .blocker{
  border-color:rgba(239,68,68,.34);
  background:linear-gradient(90deg,rgba(127,29,29,.22),rgba(120,53,15,.13));
}

/* Pie */
html[data-interface="modern"] .app-footer{
  width:min(1880px,calc(100% - 24px));
  margin:0 auto;
  padding:0 0 22px;
  color:#666873;
  border:0;
}
html[data-interface="modern"] .app-footer p{
  padding-top:12px;
  border-top:1px solid var(--modern-border);
}
html[data-interface="modern"] .app-footer a{color:#d97706}
html[data-interface="modern"] .app-footer a:hover{color:#fb923c}

/* Adaptación compacta y móvil */
@media (min-width:901px) and (max-width:1280px){
  html[data-interface="modern"] .topbar{
    grid-template-columns:220px minmax(0,1fr);
  }
  html[data-interface="modern"] .shell{
    grid-template-columns:220px minmax(0,1fr);
  }
  html[data-interface="modern"] .game-brand-logo-top{width:152px;height:46px}
  html[data-interface="modern"] .top-actions,
  html[data-interface="modern"] .top-actions.top-actions-compact{padding:8px 9px;gap:4px}
  html[data-interface="modern"] .top-actions .small-btn,
  html[data-interface="modern"] .theme-switch{min-height:31px;padding:6px 7px;font-size:8px}
  html[data-interface="modern"] .interface-preview-toggle{min-height:33px;padding:5px 8px}
  html[data-interface="modern"] .interface-preview-state{display:none}
  html[data-interface="modern"] .side{padding-inline:9px}
}

@media (max-width:900px){
  .interface-preview-toggle{
    grid-template-columns:auto 1fr;
    justify-content:start;
    width:100%;
  }
  html[data-interface="modern"] .topbar{
    width:100%;
    margin:0;
    border:0;
    border-bottom:1px solid var(--modern-border);
    border-radius:0;
    background:#18191e;
    box-shadow:0 10px 28px rgba(0,0,0,.26);
  }
  html[data-interface="modern"] .topbar-brand{
    min-height:60px;
    padding:7px 12px;
    border:0;
    background:#18191e;
  }
  html[data-interface="modern"] .game-brand-logo-top{width:148px;height:46px}
  html[data-interface="modern"] .top-actions,
  html[data-interface="modern"] .top-actions.top-actions-compact{
    padding:8px 10px 10px;
    gap:6px;
    border-top:1px solid var(--modern-border);
    background:#18191e;
  }
  html[data-interface="modern"] .mobile-top-button{
    border:1px solid #343640;
    border-radius:4px;
    color:#c7c8ce;
    background:#23242a;
  }
  html[data-interface="modern"] .shell{
    width:100%;
    margin:0;
    padding:10px;
  }
  html[data-interface="modern"] .side{
    border-radius:0;
    border-right:1px solid var(--modern-border);
    background:var(--modern-sidebar);
    box-shadow:22px 0 54px rgba(0,0,0,.38);
  }
  html[data-interface="modern"] .content{background:transparent}
  html[data-interface="modern"] #view.panel{
    min-height:auto;
    padding:12px;
    border:1px solid var(--modern-border);
    border-radius:4px;
    background:var(--modern-shell);
  }
  html[data-interface="modern"] .app-footer{
    width:100%;
    padding:0 12px 18px;
  }
  html[data-interface="modern"] .card{padding:12px}
  html[data-interface="modern"] .modal-panel{border-radius:4px}

}

@media (max-width:520px){
  html[data-interface="modern"] .top-actions .small-btn,
  html[data-interface="modern"] .theme-switch{border-radius:4px}
  html[data-interface="modern"] .grid.cols-2,
  html[data-interface="modern"] .grid.cols-3,
  html[data-interface="modern"] .grid.cols-4{grid-template-columns:1fr}
}

@media (prefers-reduced-motion:reduce){
  .interface-preview-toggle,
  html[data-interface="modern"] button{transition:none}
}
