*{box-sizing:border-box}

:root{
    --bg:#071526;
    --panel:#0d2037;
    --panel2:#102945;
    --line:rgba(255,255,255,.09);
    --text:#f6f9ff;
    --muted:#8fa3ba;
    --blue:#4f8cff;
    --green:#3bd67d;
    --yellow:#ffbd38;
    --red:#ff6969;
}

html,body{
    margin:0;
    min-height:100%;
    background:
      radial-gradient(circle at 85% 0%,#173b67 0,transparent 28%),
      linear-gradient(180deg,#08192c,#06121f);
    color:var(--text);
    font-family:
      -apple-system,
      BlinkMacSystemFont,
      "SF Pro Display",
      "Segoe UI",
      sans-serif;
}

body{
    min-height:100vh;
    padding:
      max(22px,env(safe-area-inset-top))
      18px
      max(28px,env(safe-area-inset-bottom));
}

button,input{
    font:inherit;
}

button{
    cursor:pointer;
}

.hidden{
    display:none!important;
}

.shell{
    width:min(680px,100%);
    margin:auto;
}

.brand{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:22px;
}

.logo{
    height:38px;
    max-width:180px;
    object-fit:contain;
    object-position:left center;
}

.online{
    display:flex;
    gap:7px;
    align-items:center;
    font-size:11px;
    color:#a9b9ca;
}

.online i{
    width:9px;
    height:9px;
    border-radius:50%;
    background:var(--green);
    box-shadow:0 0 0 5px rgba(59,214,125,.12);
}

.card{
    border:1px solid var(--line);
    background:rgba(14,34,58,.88);
    backdrop-filter:blur(16px);
    border-radius:22px;
    box-shadow:0 18px 45px rgba(0,0,0,.18);
}

.login{
    padding:24px;
    margin-top:8vh;
}

.login h1{
    margin:0 0 8px;
    font-size:28px;
}

.login p{
    color:var(--muted);
    margin:0 0 22px;
    line-height:1.45;
}

.field{
    margin:13px 0;
}

.field label{
    display:block;
    font-size:11px;
    font-weight:800;
    color:#a7b7c8;
    margin-bottom:7px;
    text-transform:uppercase;
    letter-spacing:.05em;
}

.field input{
    width:100%;
    padding:14px 15px;
    border-radius:13px;
    border:1px solid rgba(255,255,255,.12);
    background:#071827;
    color:#fff;
    outline:none;
    font-size:16px;
}

.field input:focus{
    border-color:#4f8cff;
    box-shadow:0 0 0 3px rgba(79,140,255,.12);
}

.primary{
    width:100%;
    border:0;
    border-radius:13px;
    padding:14px 16px;
    background:linear-gradient(135deg,#3977f6,#5c95ff);
    color:#fff;
    font-weight:900;
    margin-top:8px;
}

.error{
    margin-top:14px;
    padding:11px 13px;
    border-radius:12px;
    color:#ffc3c3;
    background:rgba(255,105,105,.12);
    border:1px solid rgba(255,105,105,.23);
    font-size:12px;
}

.hero{
    position:relative;
    overflow:hidden;
    padding:22px;
    margin-bottom:14px;
    background:
      radial-gradient(circle at 100% 0%,rgba(90,151,255,.28),transparent 35%),
      linear-gradient(145deg,#102844,#173e6c);
}

.kicker{
    font-size:10px;
    text-transform:uppercase;
    letter-spacing:.09em;
    color:#9fb3ca;
    font-weight:900;
}

.hero h1{
    margin:8px 0 6px;
    font-size:27px;
}

.hero p{
    margin:0;
    color:#a9b9ca;
    font-size:12px;
}

.status{
    display:inline-flex;
    gap:7px;
    align-items:center;
    margin-top:15px;
    padding:7px 10px;
    border-radius:999px;
    background:rgba(59,214,125,.12);
    color:#8cf0b6;
    font-size:11px;
    font-weight:900;
}

.grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:11px;
}

.metric{
    padding:17px;
    min-height:130px;
}

.metric-icon{
    font-size:21px;
}

.metric-label{
    margin-top:17px;
    font-size:10px;
    color:var(--muted);
    text-transform:uppercase;
    font-weight:900;
    letter-spacing:.05em;
}

.metric-value{
    margin-top:5px;
    font-size:23px;
    font-weight:950;
}

.metric-sub{
    margin-top:5px;
    color:#92a4b7;
    font-size:10px;
    line-height:1.4;
}

.section{
    padding:18px;
    margin-top:11px;
}

.section h2{
    margin:0 0 13px;
    font-size:14px;
}

.row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:15px;
    padding:11px 0;
    border-bottom:1px solid var(--line);
}

.row:last-child{
    border-bottom:0;
}

.row span{
    color:#96a9bd;
    font-size:11px;
}

.row strong{
    font-size:12px;
    text-align:right;
}

.bottom{
    display:flex;
    gap:9px;
    margin-top:13px;
}

.secondary{
    flex:1;
    border:1px solid var(--line);
    background:#102640;
    color:#eaf3ff;
    padding:13px;
    border-radius:13px;
    font-size:12px;
    font-weight:900;
}

.logout{
    width:48px;
    border:1px solid var(--line);
    background:#102640;
    color:#fff;
    border-radius:13px;
}

.modal{
    position:fixed;
    inset:0;
    z-index:100;
    display:flex;
    align-items:flex-end;
    background:rgba(0,0,0,.56);
    backdrop-filter:blur(5px);
}

.sheet{
    width:100%;
    max-height:82vh;
    overflow:auto;
    padding:21px 18px max(24px,env(safe-area-inset-bottom));
    border-radius:25px 25px 0 0;
    background:#0b1c30;
    border-top:1px solid var(--line);
}

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

.sheet h2{
    margin:0;
    font-size:19px;
}

.close{
    width:36px;
    height:36px;
    border:1px solid var(--line);
    border-radius:11px;
    background:#142b45;
    color:#fff;
    font-size:20px;
}

.r2row{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:6px 12px;
    padding:13px 0;
    border-bottom:1px solid var(--line);
}

.r2row small{
    grid-column:1/-1;
    color:#7f93a8;
}

.install{
    margin:12px 0 0;
    padding:12px 14px;
    border-radius:14px;
    background:rgba(79,140,255,.1);
    border:1px solid rgba(79,140,255,.2);
    color:#b9d1ff;
    font-size:11px;
    line-height:1.45;
}

@media(max-width:370px){
    .grid{
        grid-template-columns:1fr;
    }
}

/* ==================================================
   ScoreGym Control · Tema claro global
   ================================================== */

:root{
    --bg:#f3f6fa;
    --panel:#ffffff;
    --panel2:#f8fafc;
    --line:rgba(20,45,75,.10);
    --text:#142235;
    --muted:#6f8093;
    --blue:#3977f6;
    --green:#20a765;
    --yellow:#d99000;
    --red:#d84f4f;
}

html,
body{
    background:
      radial-gradient(
        circle at 85% 0%,
        rgba(57,119,246,.10) 0,
        transparent 28%
      ),
      linear-gradient(
        180deg,
        #f7f9fc,
        #eef3f8
      );

    color:var(--text);
}

.brand{
    color:#142235;
}

.logo{
    filter:none;
}

.online{
    color:#718399;
}

.card{
    background:rgba(255,255,255,.96);
    border:1px solid rgba(20,45,75,.09);
    box-shadow:
      0 12px 30px rgba(25,45,70,.08);
}

.login{
    background:#ffffff;
}

.login h1{
    color:#142235;
}

.login p{
    color:#728398;
}

.field label{
    color:#66788c;
}

.field input{
    background:#f7f9fc;
    color:#142235;
    border:1px solid rgba(20,45,75,.14);
}

.field input::placeholder{
    color:#9aa8b7;
}

.field input:focus{
    background:#fff;
    border-color:#3977f6;
    box-shadow:
      0 0 0 3px rgba(57,119,246,.10);
}

.primary{
    background:
      linear-gradient(
        135deg,
        #3977f6,
        #5b90f6
      );
    color:#fff;
    box-shadow:
      0 8px 18px rgba(57,119,246,.18);
}

.error{
    color:#a83f3f;
    background:#fff1f1;
    border-color:#f2c7c7;
}

.hero{
    background:
      radial-gradient(
        circle at 100% 0%,
        rgba(57,119,246,.12),
        transparent 38%
      ),
      linear-gradient(
        145deg,
        #ffffff,
        #f1f6fc
      );

    border:1px solid rgba(20,45,75,.09);
}

.kicker{
    color:#718398;
}

.hero h1{
    color:#142235;
}

.hero p{
    color:#718398;
}

.status{
    background:#eaf8f1;
    color:#17844d;
    border:1px solid #ccebdc;
}

.metric{
    background:#ffffff;
    color:#142235;
}

.metric-label{
    color:#718398;
}

.metric-value{
    color:#142235;
}

.metric-sub{
    color:#8291a2;
}

.section{
    background:#ffffff;
}

.section h2{
    color:#142235;
}

.row{
    border-bottom:
      1px solid rgba(20,45,75,.08);
}

.row span{
    color:#718398;
}

.row strong{
    color:#142235;
}

.secondary{
    background:#ffffff;
    color:#21446f;
    border:1px solid rgba(20,45,75,.12);
    box-shadow:
      0 5px 14px rgba(30,50,70,.05);
}

.secondary:active{
    background:#f2f6fa;
}

.logout{
    background:#ffffff;
    color:#21446f;
    border:1px solid rgba(20,45,75,.12);
}

.logout:active{
    background:#f2f6fa;
}

.install{
    background:#edf4ff;
    border:1px solid #d5e4fb;
    color:#466688;
}

.modal{
    background:rgba(20,30,45,.35);
}

.sheet{
    background:#ffffff;
    color:#142235;
    border-top:1px solid rgba(20,45,75,.08);
    box-shadow:
      0 -18px 50px rgba(20,35,55,.18);
}

.sheet h2{
    color:#142235;
}

.close{
    background:#edf2f7;
    color:#18314f;
    border:1px solid rgba(20,45,75,.10);
}

.close:active{
    background:#dfe7f1;
}

.r2row{
    border-bottom:
      1px solid rgba(20,45,75,.08);
}

.r2row strong{
    color:#142235;
}

.r2row small{
    color:#75879a;
}

#r2Modal{
    background:rgba(20,30,45,.35);
}

#r2Modal .sheet{
    background:#ffffff;
    color:#142235;
}

#r2Modal .sheet h2{
    color:#142235;
}

#r2Modal .close{
    background:#edf2f7;
    color:#18314f;
}

#r2Modal .r2row{
    border-bottom:
      1px solid rgba(20,45,75,.08);
}

#r2Modal .r2row strong{
    color:#142235;
}

#r2Modal .r2row small{
    color:#75879a;
}

body::selection{
    background:#cfe0ff;
    color:#142235;
}

/* ==================================================
   ScoreGym Control · iPhone / PWA
   ================================================== */

html{
    min-height:100%;
    background:#f3f6fa;
}

body{
    min-height:100dvh;
    overscroll-behavior-y:none;
    -webkit-tap-highlight-color:transparent;

    padding:
      max(18px,env(safe-area-inset-top))
      max(16px,env(safe-area-inset-right))
      max(24px,env(safe-area-inset-bottom))
      max(16px,env(safe-area-inset-left));
}

button,
input{
    -webkit-appearance:none;
}

button{
    touch-action:manipulation;
}

.brand{
    min-height:46px;
}

.logo{
    max-height:42px;
    max-width:190px;
}

.card{
    -webkit-backdrop-filter:blur(16px);
}

.metric{
    -webkit-user-select:none;
    user-select:none;
}

@media (display-mode: standalone){
    body{
        padding-top:max(12px,env(safe-area-inset-top));
    }

    .install{
        display:none;
    }
}

body.pwa-standalone .install{
    display:none;
}

/* ==================================================
   ScoreGym Control · tarjetas de detalle
   ================================================== */

.detail-card{
    appearance:none;
    -webkit-appearance:none;
    font-family:inherit;
    cursor:pointer;
}

.detail-card:active{
    transform:scale(.985);
}

button.metric{
    width:100%;
    color:#142235;
    text-align:left;
}

.backup-card{
    grid-column:1/-1;
    width:100%;
    margin-top:11px;
    padding:16px 18px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    text-align:left;
    color:#142235;
}

.backup-card > div:first-child{
    display:flex;
    align-items:center;
    gap:14px;
}

.backup-card .metric-icon{
    margin:0;
}

.backup-card .metric-label{
    margin:0 0 4px;
}

.backup-title{
    font-size:15px;
    font-weight:900;
    color:#142235;
}

.backup-arrow{
    font-size:30px;
    line-height:1;
    color:#8fa0b3;
}

.detail-row{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:10px;
    padding:13px 0;
    border-bottom:1px solid rgba(20,45,75,.08);
}

.detail-row:last-child{
    border-bottom:0;
}

.detail-row span{
    color:#718398;
    font-size:12px;
}

.detail-row strong{
    color:#142235;
    font-size:12px;
    text-align:right;
    max-width:190px;
    overflow-wrap:anywhere;
}

.detail-ok{
    color:#17844d!important;
}

.detail-warning{
    color:#b77500!important;
}

.detail-danger{
    color:#c34848!important;
}

.detail-note{
    margin-top:15px;
    padding:12px 14px;
    border-radius:13px;
    background:#f0f5fb;
    color:#62758a;
    font-size:11px;
    line-height:1.45;
}

/* ==================================================
   ScoreGym Control · Web Push
   ================================================== */

.notifications-card{
    margin-top:11px;
}

.push-button{
    margin-top:13px;
}

.push-button.is-active{
    background:#eef3f8;
    color:#496176;
    border:1px solid rgba(20,45,75,.12);
    box-shadow:none;
}
