/* assets/css/hmc-v2.css */
:root{
    --hmc-bg:#f4f7fb;
    --hmc-surface:#ffffff;
    --hmc-border:#dbe2ea;
    --hmc-text:#142033;
    --hmc-muted:#6b778c;
    --hmc-dark:#1f2937;
    --hmc-primary:#2563eb;
    --hmc-success:#198754;
    --hmc-warning:#f4b400;
    --hmc-danger:#dc3545;
    --hmc-orange:#fd7e14;
    --hmc-shadow:0 12px 32px rgba(15,23,42,.08);
    --hmc-radius:18px;
    --hmc-sidebar-w:250px;
    --hmc-topbar-h:64px;
}

*,
*::before,
*::after{
    box-sizing:border-box;
}

html,
body{
    margin:0;
    padding:0;
    min-height:100%;
    overflow-x:hidden;
    overflow-y:auto;
    background:var(--hmc-bg);
    color:var(--hmc-text);
    font-family:'Inter', Arial, sans-serif;
}

body.hmc-body{
    display:flex;
    min-height:100vh;
    overflow-x:hidden;
    overflow-y:auto;
    background:var(--hmc-bg);
}

.material-symbols-rounded{
    font-variation-settings:'FILL' 0,'wght' 400,'GRAD' 0,'opsz' 24;
    vertical-align:middle;
}

/* =========================
   SIDEBAR
   ========================= */
.hmc-sidebar{
    width:var(--hmc-sidebar-w);
    background:#f8fafc;
    border-right:1px solid var(--hmc-border);
    padding:18px 14px;
    flex-shrink:0;
    overflow-y:auto;
    position:sticky;
    top:0;
    align-self:flex-start;
    height:100vh;
    z-index:100;
}

.hmc-sidebar-overlay{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);
    z-index:90;
}

.hmc-brand{
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:18px;
}

.hmc-brand__icon{
    width:44px;
    height:44px;
    border-radius:14px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:linear-gradient(135deg,#2563eb,#1d4ed8);
    color:#fff;
    box-shadow:var(--hmc-shadow);
}

.hmc-brand__title{
    font-weight:800;
    font-size:1rem;
    line-height:1.1;
}

.hmc-brand__subtitle{
    color:var(--hmc-muted);
    font-size:.84rem;
    margin-top:2px;
}

.hmc-sidebar-box{
    background:var(--hmc-surface);
    border:1px solid var(--hmc-border);
    border-radius:16px;
    padding:14px;
    margin-bottom:16px;
    box-shadow:0 8px 24px rgba(15,23,42,.04);
}

.hmc-sidebar-label{
    font-size:.78rem;
    color:var(--hmc-muted);
    margin-bottom:4px;
}

.hmc-sidebar-value{
    font-weight:700;
    font-size:1rem;
}

.hmc-sidebar-meta{
    color:var(--hmc-muted);
    font-size:.82rem;
    margin-top:4px;
}

.hmc-sidebar-section-title{
    font-size:.78rem;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.08em;
    color:var(--hmc-muted);
    margin:16px 0 10px;
}

.hmc-switcher{
    display:flex;
    flex-direction:column;
    gap:8px;
    margin-bottom:16px;
}

.hmc-switcher__item{
    display:flex;
    align-items:center;
    gap:8px;
    text-decoration:none;
    padding:10px 12px;
    border-radius:12px;
    border:1px solid var(--hmc-border);
    background:#fff;
    color:var(--hmc-text);
    font-size:.9rem;
    font-weight:600;
    transition:.2s ease;
}

.hmc-switcher__item:hover{
    border-color:#bfd0e7;
    transform:translateY(-1px);
}

.hmc-switcher__item.is-active{
    background:linear-gradient(135deg,#2563eb,#1d4ed8);
    color:#fff;
    border-color:#1d4ed8;
}

.hmc-sidebar-actions{
    margin-top:6px;
}

/* =========================
   APP + TOPBAR
   ========================= */
.hmc-app{
    flex:1;
    min-width:0;
    display:flex;
    flex-direction:column;
    min-height:100vh;
    overflow:visible;
}

.hmc-topbar{
    height:var(--hmc-topbar-h);
    background:var(--hmc-dark);
    border-bottom:1px solid rgba(255,255,255,.08);
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px 14px;
    position:sticky;
    top:0;
    z-index:80;
    flex-shrink:0;
}

.hmc-menu-btn{
    display:none;
    border:1px solid rgba(255,255,255,.22);
    background:transparent;
    color:#fff;
    border-radius:10px;
    width:42px;
    height:42px;
    align-items:center;
    justify-content:center;
}

.hmc-topnav{
    display:flex;
    gap:8px;
    overflow-x:auto;
    overflow-y:hidden;
    width:100%;
}

.hmc-topnav::-webkit-scrollbar{
    height:4px;
}

.hmc-topnav::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,.18);
    border-radius:999px;
}

.hmc-topnav__item{
    display:inline-flex;
    align-items:center;
    gap:6px;
    text-decoration:none;
    color:#fff;
    border:1px solid rgba(255,255,255,.22);
    padding:8px 12px;
    border-radius:12px;
    font-size:.85rem;
    font-weight:600;
    white-space:nowrap;
    transition:.2s ease;
}

.hmc-topnav__item:hover{
    background:rgba(255,255,255,.08);
}

.hmc-topnav__item.is-active{
    background:#fff;
    color:var(--hmc-dark);
    border-color:#fff;
}

/* =========================
   CONTENT
   ========================= */
.hmc-content{
    flex:1;
    overflow:visible;
    min-height:calc(100vh - var(--hmc-topbar-h));
    padding:18px;
}

.hmc-page-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
    margin-bottom:16px;
}

.hmc-page-title{
    display:flex;
    align-items:center;
    gap:8px;
    margin:0;
    font-size:1.05rem;
    font-weight:800;
}

.hmc-page-subtitle{
    color:var(--hmc-muted);
    font-size:.9rem;
    margin-top:4px;
}

.hmc-card{
    background:var(--hmc-surface);
    border:1px solid var(--hmc-border);
    border-radius:var(--hmc-radius);
    box-shadow:var(--hmc-shadow);
    padding:18px;
}

.hmc-soft-box,
.hmc-muted-box{
    background:#f8fafc;
    border:1px solid var(--hmc-border);
    border-radius:16px;
    padding:14px;
}

.hmc-grid{
    display:grid;
    grid-template-columns:repeat(12, minmax(0,1fr));
    gap:16px;
}

.hmc-col-12{ grid-column:span 12; }
.hmc-col-8{ grid-column:span 8; }
.hmc-col-6{ grid-column:span 6; }
.hmc-col-4{ grid-column:span 4; }
.hmc-col-3{ grid-column:span 3; }

.hmc-stat{
    position:relative;
    overflow:hidden;
    background:#fff;
    border:1px solid var(--hmc-border);
    border-radius:16px;
    padding:16px;
    box-shadow:0 8px 24px rgba(15,23,42,.04);
}

.hmc-stat::before{
    content:'';
    position:absolute;
    left:0;
    top:0;
    bottom:0;
    width:4px;
    background:#2563eb;
}

.hmc-stat__label{
    color:var(--hmc-muted);
    font-size:.8rem;
    margin-bottom:4px;
}

.hmc-stat__value{
    font-weight:800;
    font-size:1.45rem;
    line-height:1.1;
}

.hmc-stat__sub{
    color:var(--hmc-muted);
    font-size:.76rem;
    margin-top:6px;
}

.hmc-selector{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.hmc-selector__item{
    position:relative;
}

.hmc-selector__item input{
    position:absolute;
    opacity:0;
    pointer-events:none;
}

.hmc-selector__item label{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:84px;
    padding:10px 14px;
    border-radius:14px;
    border:1px solid var(--hmc-border);
    background:#fff;
    font-weight:700;
    cursor:pointer;
    transition:.2s ease;
}

.hmc-selector__item input:checked + label{
    background:var(--hmc-dark);
    color:#fff;
    border-color:var(--hmc-dark);
}

.hmc-form-label{
    font-size:.88rem;
    font-weight:700;
    margin-bottom:8px;
    display:block;
}

.hmc-table-wrap{
    width:100%;
    overflow:auto;
    border-radius:16px;
    border:1px solid var(--hmc-border);
    background:#fff;
}

.hmc-table{
    width:100%;
    border-collapse:collapse;
    min-width:760px;
}

.hmc-table th{
    background:#1f2937;
    color:#fff;
    font-size:.82rem;
    padding:12px 10px;
    text-align:center;
    white-space:nowrap;
}

.hmc-table td{
    padding:12px 10px;
    text-align:center;
    border-top:1px solid #e8edf4;
    vertical-align:middle;
}

.hmc-table tbody tr:hover{
    background:#f8fbff;
}

.hmc-chip{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:6px 10px;
    border-radius:999px;
    border:1px solid var(--hmc-border);
    background:#fff;
    font-size:.78rem;
    font-weight:700;
}

.hmc-chip.is-active{
    background:#fee2e2;
    border-color:#fecaca;
    color:#b91c1c;
}

.hmc-code{
    font-family:Consolas, Monaco, monospace;
    font-size:.82rem;
    background:#f8fafc;
    border:1px solid var(--hmc-border);
    border-radius:12px;
    padding:10px 12px;
    word-break:break-word;
}

/* =========================
   CLASSIC CENTERED STYLE
   ========================= */
.hmc-centered-panel{
    max-width:1180px;
    margin:0 auto;
}

.hmc-classic-title{
    margin:0 0 8px;
    text-align:center;
    font-size:clamp(2rem, 3vw, 3.1rem);
    font-weight:800;
    line-height:1.08;
}

.hmc-classic-subtitle{
    margin:0 0 16px;
    text-align:center;
    font-size:clamp(1.15rem, 1.6vw, 1.7rem);
    font-weight:700;
    line-height:1.2;
}

.hmc-inline-radio-row{
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:10px 18px;
    margin-bottom:20px;
}

.hmc-inline-radio-row label{
    display:inline-flex;
    align-items:center;
    gap:6px;
    font-size:.96rem;
    font-weight:500;
    cursor:pointer;
}

.hmc-slot-pills{
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:8px;
    margin-bottom:22px;
}

.hmc-slot-pills .hmc-selector__item label{
    min-width:78px;
    padding:8px 12px;
    border-radius:10px;
    font-weight:600;
}

.hmc-classic-table-wrap{
    max-width:1100px;
    margin:0 auto;
    overflow-x:auto;
    overflow-y:hidden;
    border:1px solid var(--hmc-border);
    border-radius:18px;
    background:#fff;
}

.hmc-classic-table{
    width:100%;
    min-width:860px;
    border-collapse:collapse;
    background:#fff;
}

.hmc-classic-table th,
.hmc-classic-table td{
    border:1px solid #dfe5ec;
    padding:12px 10px;
    text-align:center;
    vertical-align:middle;
    font-size:.92rem;
}

.hmc-classic-table th{
    background:#f1f5f9;
    color:#111827;
    font-weight:700;
    white-space:nowrap;
}

.hmc-classic-table td{
    background:#fff;
}

.hmc-classic-table tbody tr:hover td{
    background:#f8fbff;
}

.hmc-status-selected{
    color:#198754;
    font-weight:700;
}

.hmc-status-not-selected{
    color:#6b7280;
    font-weight:500;
}

.hmc-save-row{
    text-align:center;
    margin-top:22px;
}

.hmc-compact-input{
    max-width:92px;
    margin:0 auto;
    text-align:center;
}

.hmc-row-disabled{
    opacity:.62;
}

.hmc-inline-note{
    text-align:center;
    color:var(--hmc-muted);
    font-size:.9rem;
    margin-top:10px;
}

/* =========================
   LOGIN
   ========================= */
.hmc-login{
    min-height:100vh;
    background:
        radial-gradient(circle at top left, rgba(37,99,235,.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(29,78,216,.16), transparent 25%),
        linear-gradient(135deg,#0f172a 0%,#1e293b 100%);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
}

.hmc-login__wrap{
    width:min(1080px, 100%);
    display:grid;
    grid-template-columns:1.1fr .9fr;
    gap:22px;
    align-items:stretch;
}

.hmc-login__panel,
.hmc-login__card{
    background:rgba(255,255,255,.96);
    border:1px solid rgba(255,255,255,.45);
    border-radius:28px;
    box-shadow:0 20px 50px rgba(0,0,0,.24);
    backdrop-filter:blur(12px);
}

.hmc-login__panel{
    padding:30px;
    color:var(--hmc-text);
}

.hmc-login__card{
    padding:28px;
}

.hmc-login__headline{
    font-size:2rem;
    font-weight:800;
    margin:0 0 8px;
}

.hmc-login__lead{
    color:var(--hmc-muted);
    font-size:1rem;
    margin:0 0 24px;
}

.hmc-device-chips{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.hmc-device-chip{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:10px 14px;
    border-radius:14px;
    border:1px solid var(--hmc-border);
    background:#fff;
    font-weight:700;
}

.hmc-device-chip.is-active{
    background:#eff6ff;
    border-color:#93c5fd;
    color:#1d4ed8;
}

.hmc-login-logo{
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:14px;
}

.hmc-login-logo__icon{
    width:52px;
    height:52px;
    border-radius:16px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:linear-gradient(135deg,#2563eb,#1d4ed8);
    color:#fff;
    box-shadow:var(--hmc-shadow);
}

.hmc-login-card__title{
    font-size:1.55rem;
    font-weight:800;
    margin:0 0 6px;
}

.hmc-login-card__subtitle{
    color:var(--hmc-muted);
    margin:0 0 20px;
}

.hmc-login-footer{
    text-align:center;
    color:var(--hmc-muted);
    font-size:.85rem;
    margin-top:18px;
}

.hmc-auto-hide{
    animation:hmcFadeOut 5s forwards;
}

@keyframes hmcFadeOut{
    0%,80%{ opacity:1; transform:translateY(0); }
    100%{ opacity:0; transform:translateY(-6px); }
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width:1100px){
    .hmc-col-8,
    .hmc-col-6,
    .hmc-col-4,
    .hmc-col-3{
        grid-column:span 12;
    }

    .hmc-login__wrap{
        grid-template-columns:1fr;
    }
}

@media (max-width:768px){
    body.hmc-body{
        display:block;
        min-height:100vh;
        overflow-x:hidden;
        overflow-y:auto;
    }

    .hmc-sidebar{
        position:fixed;
        top:0;
        left:0;
        bottom:0;
        height:auto;
        width:260px;
        transform:translateX(-100%);
        box-shadow:0 24px 60px rgba(0,0,0,.25);
        z-index:100;
    }

    .hmc-sidebar.is-open{
        transform:translateX(0);
    }

    .hmc-sidebar-overlay.is-open{
        display:block;
    }

    .hmc-menu-btn{
        display:inline-flex;
    }

    .hmc-app{
        display:block;
        min-height:auto;
        overflow:visible;
    }

    .hmc-topbar{
        position:sticky;
        top:0;
    }

    .hmc-content{
        min-height:auto;
        overflow:visible;
        padding:14px;
    }

    .hmc-login__panel,
    .hmc-login__card{
        border-radius:24px;
        padding:22px;
    }

    .hmc-login__headline{
        font-size:1.6rem;
    }

    .hmc-classic-title{
        font-size:1.95rem;
    }

    .hmc-classic-subtitle{
        font-size:1.2rem;
    }

    .hmc-classic-table-wrap{
        border-radius:14px;
    }

    .hmc-classic-table th,
    .hmc-classic-table td{
        padding:10px 8px;
        font-size:.88rem;
    }
}

@media (max-width:480px){
    .hmc-topnav__item{
        padding:8px 10px;
        font-size:.8rem;
    }

    .hmc-selector__item label{
        min-width:72px;
        padding:9px 12px;
    }

    .hmc-stat__value{
        font-size:1.2rem;
    }

    .hmc-slot-pills .hmc-selector__item label{
        min-width:70px;
        padding:8px 10px;
        font-size:.84rem;
    }

    .hmc-inline-radio-row{
        gap:8px 12px;
    }

    .hmc-inline-radio-row label{
        font-size:.88rem;
    }
}