:root{--green:#16845b;--green-dark:#106a49;--ink:#17251f;--muted:#7b8982;--line:#e7ede9;--bg:#f5f8f6}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif}
.layout{min-height:100vh}
.sidebar{position:fixed;inset:0 auto 0 0;width:250px;background:#fff;border-right:1px solid var(--line);padding:27px 18px;display:flex;flex-direction:column;z-index:2}
.side-brand{display:flex;align-items:center;gap:11px;padding:0 8px 38px}
.side-brand strong{display:block;font-size:19px;letter-spacing:-.5px}
.side-brand small{display:block;font-size:9px;letter-spacing:2px;color:var(--muted);margin-top:3px}
.brand-mark{width:54px;height:54px;border-radius:17px;background:linear-gradient(145deg,#1ba875,#08734d);color:#fff;display:grid;place-items:center;font-size:29px;font-weight:800;box-shadow:0 8px 20px #16845b30}
.brand-mark.small{width:40px;height:40px;border-radius:13px;font-size:22px}
.nav-label,.eyebrow{font-size:10px;letter-spacing:1.7px;font-weight:800;color:#8b9891}
.nav-label{padding:0 10px 13px}
.nav-item{display:flex;gap:12px;align-items:center;text-decoration:none;color:#617069;padding:13px 12px;border-radius:10px;font-size:13px;margin-bottom:5px}
.nav-item.active{background:#eaf6f0;color:var(--green-dark);font-weight:700}
.sidebar-bottom{margin-top:auto}
.user-mini{display:flex;gap:10px;align-items:center;border-top:1px solid var(--line);padding:18px 5px 13px}
.avatar{width:35px;height:35px;border-radius:50%;display:grid;place-items:center;background:#e2f3ea;color:var(--green);font-weight:800}
.user-mini strong,.user-mini small{display:block}
.user-mini strong{font-size:12px}
.user-mini small{font-size:10px;color:var(--muted);margin-top:3px}
.logout-button{width:100%;border:0;background:#f5f7f6;padding:11px;border-radius:9px;color:#66736c;cursor:pointer}
.main{margin-left:250px;padding:32px 38px;max-width:1700px}
.topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}
h1{font-size:27px;letter-spacing:-1px;margin:7px 0 0}
.top-status{font-size:12px;color:#617069;background:#fff;border:1px solid var(--line);padding:10px 13px;border-radius:30px}
.top-status span{display:inline-block;width:7px;height:7px;background:#20ad72;border-radius:50%;margin-right:7px}
.welcome{background:linear-gradient(110deg,#116f4d,#19996a);border-radius:17px;padding:27px 30px;color:#fff;display:flex;justify-content:space-between;align-items:center;overflow:hidden}
.eyebrow.light{color:#b7e4cf}
.welcome h2{font-size:23px;margin:9px 0}
.welcome p{font-size:13px;color:#d5eee1;margin:0}
.welcome-icon{font-size:90px;line-height:1;color:#ffffff24;padding-right:20px}
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px;margin:21px 0 30px}
.stat-card,.machine-card,.panel{background:#fff;border:1px solid var(--line);border-radius:14px}
.stat-card{padding:17px 18px}
.stat-top{display:flex;justify-content:space-between;color:#718078;font-size:12px}
.stat-top span{color:var(--green);font-size:17px}
.stat-card>strong{display:block;font-size:27px;letter-spacing:-1px;margin:13px 0 3px}
.stat-card strong i{font-size:12px;font-style:normal;color:var(--muted);font-weight:500}
.stat-card>small,.machine-specs small{color:var(--muted);font-size:10px}
.section{margin-bottom:27px}
.section-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}
.section-heading h2{font-size:17px;margin:0 0 5px}
.section-heading p{font-size:11px;color:var(--muted);margin:0}
.count{font-size:11px;color:var(--green);background:#eaf6f0;border-radius:20px;padding:7px 11px}
.machine-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px}
.machine-card{padding:16px}
.machine-head{display:flex;justify-content:space-between;align-items:center}
.machine-symbol{width:31px;height:31px;background:#edf7f1;color:var(--green);border-radius:9px;display:grid;place-items:center}
.status{font-size:9px;border-radius:20px;padding:6px 8px}
.status-active{background:#e8f7ef;color:#16845b}
.status-stopped{background:#f0f2f1;color:#69756e}
.status-maintenance{background:#fff3df;color:#a46b17}
.machine-card h3{font-size:14px;margin:14px 0}
.machine-specs{display:flex;gap:24px;border-top:1px solid var(--line);padding-top:12px}
.machine-specs small,.machine-specs strong{display:block}
.machine-specs strong{font-size:11px;margin-top:4px}
.bottom-grid{display:grid;grid-template-columns:1fr 1fr;gap:15px}
.panel{padding:19px}
.order-line{display:flex;justify-content:space-between;padding:11px 0;border-top:1px solid var(--line);font-size:12px;color:#68766e}
.order-line strong{color:var(--ink)}
.big-number{font-size:30px;font-weight:750;margin:20px 0 5px}
.big-number small{font-size:13px;color:var(--muted)}
.muted{color:var(--muted);font-size:11px}
footer{text-align:center;color:#9aa59f;font-size:10px;padding:30px 0 10px}
.login-page{min-height:100vh;display:grid;place-items:center;padding:20px;background:radial-gradient(circle at 50% 20%,#e4f4eb,#f5f8f6 55%)}
.login-card{width:min(100%,410px);background:#fff;padding:38px;border:1px solid var(--line);border-radius:20px;box-shadow:0 20px 70px #173e2a12}
.login-card .brand-mark{margin-bottom:22px}
.login-card h1{font-size:31px;margin:8px 0}
.login-card>p{margin:8px 0 25px}
.login-card label{display:block;font-size:11px;font-weight:700;margin:16px 0 7px}
.login-card input{width:100%;border:1px solid #dfe7e2;border-radius:9px;padding:13px;font-size:13px;outline:none}
.login-card input:focus{border-color:var(--green);box-shadow:0 0 0 3px #16845b15}
.login-card button[type=submit]{width:100%;border:0;border-radius:9px;background:var(--green);color:white;padding:14px;font-weight:700;margin-top:22px;cursor:pointer}
.alert{background:#fff0ef;color:#b33b32;padding:11px;border-radius:8px;font-size:12px}
.login-foot{border-top:1px solid var(--line);margin-top:25px;padding-top:17px;color:#9aa59f;font-size:10px;text-align:center}
@media(max-width:1100px){.machine-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.sidebar{position:relative;width:auto;height:auto;padding:13px 15px}.side-brand{padding:0}.nav-label,.nav-item,.sidebar-bottom{display:none}.main{margin:0;padding:22px 15px}.topbar{align-items:flex-start;gap:10px}.top-status{font-size:0}.top-status span{margin:0}.welcome{padding:22px}.welcome h2{font-size:19px}.welcome-icon{font-size:55px}.stats{gap:9px}.stat-card{padding:13px}.stat-card>strong{font-size:22px}.machine-grid{gap:9px}.machine-card{padding:12px}.machine-specs{gap:10px}.bottom-grid{grid-template-columns:1fr}}

/* Расширенные карточки производственного оборудования */
.machine-card-wide{min-width:0}
.machine-parameters{display:grid;grid-template-columns:1fr 1fr;gap:10px;background:#f5f8f6;border-radius:9px;padding:11px;margin:12px 0}
.machine-parameters small,.machine-parameters strong{display:block}
.machine-parameters small,.machine-detail small,.machine-remaining small,.downtime-box small{font-size:10px;color:#829087}
.machine-parameters strong{font-size:14px;margin-top:5px;overflow-wrap:anywhere}
.machine-detail{padding:9px 0;border-top:1px solid var(--line)}
.machine-detail small,.machine-detail strong,.machine-detail span{display:block}
.machine-detail strong{font-size:12px;margin-top:4px}
.machine-detail span{font-size:11px;line-height:1.5;margin-top:4px;color:#526158;overflow-wrap:anywhere}
.machine-remaining{margin-top:10px;padding:11px;background:#eaf6f0;border-radius:9px}
.machine-remaining small,.machine-remaining strong{display:block}
.machine-remaining strong{font-size:17px;color:#116f4d;margin-top:4px}
.downtime-box{margin-top:12px;padding:12px;background:#fff2ed;border:1px solid #f5d8cd;border-radius:9px}
.downtime-box strong,.downtime-box span{display:block}
.downtime-box strong{font-size:12px;color:#a6442d;margin-top:5px}
.downtime-box span{font-size:11px;line-height:1.45;color:#805b50;margin-top:5px}
.downtime-box small:last-child{display:block;margin-top:8px}
@media(max-width:1100px){.machine-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.machine-grid{grid-template-columns:1fr}}

/* Статистика брака по дневной и ночной сменам */
.scrap-section{margin:28px 0}
.scrap-shift-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}
.scrap-panel{background:#fff;border:1px solid var(--line);border-radius:14px;padding:19px;min-width:0}
.scrap-panel-head{display:flex;justify-content:space-between;align-items:center}
.scrap-panel-head h3{font-size:16px;margin:0 0 5px}
.scrap-panel-head small{font-size:10px;color:var(--muted)}
.scrap-icon{width:36px;height:36px;border-radius:11px;background:#eaf6f0;color:var(--green);display:grid;place-items:center;font-size:19px}
.scrap-total{font-size:31px;font-weight:800;letter-spacing:-1px;margin-top:19px}
.scrap-total small{font-size:13px;color:var(--muted);font-weight:500}
.scrap-total-label{font-size:10px;color:var(--muted);margin-top:2px}
.scrap-metrics{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:17px 0}
.scrap-metrics>div{background:#f5f8f6;border-radius:9px;padding:11px;min-width:0}
.scrap-metrics small,.scrap-metrics strong{display:block}
.scrap-metrics small{font-size:10px;color:var(--muted)}
.scrap-metrics strong{font-size:13px;margin-top:6px;overflow-wrap:anywhere}
.scrap-machine-title{font-size:11px;font-weight:750;margin:18px 0 8px}
.scrap-machine-row{display:flex;justify-content:space-between;gap:10px;padding:8px 0;border-top:1px solid var(--line);font-size:11px}
.scrap-machine-row strong{white-space:nowrap}
.scrap-empty{font-size:10px;color:var(--muted);background:#f5f8f6;padding:10px;border-radius:8px;margin-top:12px}
@media(max-width:700px){.scrap-shift-grid{grid-template-columns:1fr}}

/* Календарь производственных смен */
.schedule-section{margin:28px 0}
.schedule-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px}
.schedule-day{background:#fff;border:1px solid var(--line);border-radius:13px;padding:15px;min-width:0}
.schedule-day-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:13px}
.schedule-day-head strong,.schedule-day-head small{display:block}
.schedule-day-head strong{font-size:15px}
.schedule-day-head small{font-size:10px;color:var(--muted);margin-top:4px}
.schedule-today{font-size:10px;color:#16845b;background:#e8f7ef;padding:6px 9px;border-radius:20px}
.schedule-shift{padding:11px 0;border-top:1px solid var(--line)}
.schedule-shift-head{display:flex;justify-content:space-between;gap:8px;align-items:center;margin-bottom:9px}
.schedule-shift-head strong{font-size:11px}
.schedule-shift-head small{font-size:10px;color:var(--muted);white-space:nowrap}
.schedule-worker{background:#f3f8f5;border-radius:7px;padding:8px 9px;margin-top:5px}
.schedule-worker span,.schedule-worker small{display:block}
.schedule-worker span{font-size:12px;font-weight:700}
.schedule-worker small{font-size:10px;color:#738178;margin-top:4px;line-height:1.4}
.schedule-no-workers{font-size:10px;color:#9aa59f;padding:7px 0}
.schedule-off{border-top:1px solid var(--line);padding-top:10px;margin-top:3px}
.schedule-off>strong{font-size:10px;color:#a46b17}
.schedule-off>div{margin-top:7px;background:#fff7e9;border-radius:7px;padding:8px}
.schedule-off span,.schedule-off small{display:block}
.schedule-off span{font-size:11px;font-weight:700}
.schedule-off small{font-size:10px;color:#8e7858;margin-top:3px;line-height:1.4}
@media(max-width:1100px){.schedule-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.schedule-grid{grid-template-columns:1fr}}

/* Отдельная страница графика смен */
.schedule-intro{display:flex;justify-content:space-between;align-items:center;gap:15px;background:#fff;border:1px solid var(--line);border-radius:14px;padding:20px;margin:20px 0}
.schedule-intro h2{font-size:18px;margin:0 0 6px}
.schedule-intro p{font-size:12px;color:var(--muted);margin:0}
.schedule-intro>span{font-size:11px;color:var(--green);background:#eaf6f0;padding:8px 12px;border-radius:20px;white-space:nowrap}
.schedule-back{font-size:12px;text-decoration:none;color:var(--green);font-weight:700}
@media(max-width:700px){
  .schedule-intro{align-items:flex-start;flex-direction:column}
  .sidebar .nav-label{display:block}
  .sidebar .nav-item{display:flex}
  .sidebar{gap:3px}
  .sidebar .nav-item{padding:9px 10px;font-size:12px}
}

/* Granulation page */
.production-success{padding:14px 18px;margin:18px 0;background:#e8f7ee;color:#187343;border:1px solid #c8ead5;border-radius:12px}
.production-person{display:flex;justify-content:space-between;align-items:center;gap:20px;background:#fff;border:1px solid #e8eee9;border-radius:18px;padding:24px;margin:22px 0}
.production-person h2{margin:8px 0;font-size:26px}
.production-person p{margin:0;color:#748078}
.production-hours{font-size:30px;font-weight:750;color:#16834b;text-align:right}
.production-hours small{display:block;font-size:12px;color:#748078;font-weight:500}
.production-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;background:#fff;border:1px solid #e8eee9;border-radius:16px;padding:22px}
.production-form label{display:flex;flex-direction:column;gap:7px;font-size:13px;font-weight:650;color:#46534b}
.production-form input,.production-form select{width:100%;min-height:44px;border:1px solid #dfe7e1;border-radius:10px;padding:10px 12px;background:#fff;color:#26352b;font:inherit}
.production-form .production-notes{grid-column:1/-1}
.production-form button{min-height:44px;border:0;border-radius:10px;background:#16834b;color:#fff;font-weight:700;padding:0 20px;cursor:pointer}
.production-calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:10px}
.production-calendar-day{display:flex;flex-direction:column;gap:7px;padding:14px;background:#fff;border:1px solid #e8eee9;border-radius:12px;min-width:0}
.production-calendar-day small{color:#748078}
.production-working,.production-off,.material-tag{display:inline-block;padding:5px 8px;border-radius:7px;font-size:11px;font-weight:700}
.production-working{background:#e8f7ee;color:#187343}
.production-off{background:#f1f3f2;color:#77817a}
.material-tag{background:#edf5ef;color:#26734a}
.table-wrap{overflow-x:auto;background:#fff;border:1px solid #e8eee9;border-radius:14px}
.production-table{width:100%;border-collapse:collapse;min-width:600px}
.production-table th,.production-table td{padding:13px 15px;text-align:left;border-bottom:1px solid #edf0ed;font-size:13px}
.production-table th{color:#77817a;font-weight:650;background:#fafcfb}
@media(max-width:700px){.production-form{grid-template-columns:1fr}.production-form .production-notes{grid-column:auto}.production-calendar{grid-template-columns:repeat(2,minmax(0,1fr))}.production-person{align-items:flex-start;flex-direction:column}.production-hours{text-align:left}}

/* Breakdown register */
.breakdown-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.breakdown-card{background:#fff;border:1px solid #f0dede;border-radius:15px;padding:19px}
.breakdown-card-head{display:flex;justify-content:space-between;align-items:center;gap:12px}
.breakdown-card-head strong{font-size:17px}
.breakdown-open{background:#fff0ed;color:#b64232;padding:6px 10px;border-radius:8px;font-size:11px;font-weight:750}
.breakdown-type{margin-top:15px;color:#b64232;font-weight:700;font-size:13px}
.breakdown-card p{color:#536057;line-height:1.5;margin:9px 0 16px}
.breakdown-meta{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;padding-top:12px;border-top:1px solid #edf0ed;color:#77817a;font-size:12px}
.breakdown-meta strong{color:#b64232}
.breakdown-close-form{margin-top:16px}
.breakdown-close-form button{width:100%;min-height:42px;border:0;border-radius:9px;background:#16834b;color:#fff;font-weight:700;cursor:pointer}
.breakdown-empty{padding:24px;background:#fff;border:1px solid #e8eee9;border-radius:14px;color:#647168}
@media(max-width:700px){.breakdown-grid{grid-template-columns:1fr}}

/* PolyPak Cris System login banner */
.login-banner {
    display:block;
    width:100%;
    height:auto;
    aspect-ratio: 1200 / 360;
    object-fit:cover;
    border-radius:14px;
    margin:18px 0;
    border:1px solid #e2eee5;
}

/* Исправление мобильной навигации PolyPak */
@media(max-width:700px){
    .sidebar{
        position:relative;
        width:100%;
        height:auto;
        padding:13px 15px;
        border-right:0;
        border-bottom:1px solid var(--line);
    }

    .side-brand{
        padding:0 8px 12px;
    }

    .nav-label{
        display:none;
    }

    .sidebar nav{
        display:flex;
        gap:6px;
        overflow-x:auto;
        padding:3px 0 8px;
        scrollbar-width:thin;
    }

    .sidebar .nav-item{
        display:flex;
        flex:0 0 auto;
        white-space:nowrap;
        padding:10px 12px;
        margin:0;
        background:#f5f8f6;
    }

    .sidebar .nav-item.active{
        background:#eaf6f0;
    }

    .sidebar-bottom{
        display:block;
        margin-top:5px;
    }

    .main{
        margin:0;
        padding:22px 15px;
    }
}
