:root{
  --ink:#15120d;--black:#0b0a08;--black2:#17140f;--ivory:#f7f2e8;--paper:#fffdf8;--muted:#7c7468;
  --gold:#d9a51d;--gold2:#f0c454;--gold-soft:#fff6d8;--line:#e8dfcf;--danger:#a93636;--ok:#277043;
  --warn:#b56c08;--shadow:0 18px 55px rgba(31,22,5,.12);--radius:18px
}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);background:#f4efe5}button,input,select,textarea{font:inherit}.hidden{display:none!important}.muted{color:var(--muted)}
body{background:radial-gradient(circle at 100% 0,rgba(217,165,29,.08),transparent 28%),#f5f0e6}.eyebrow{font-size:.68rem;letter-spacing:.19em;text-transform:uppercase;color:#9b7412;font-weight:850;margin-bottom:8px}
.btn{border:0;border-radius:11px;padding:10px 14px;font-weight:800;cursor:pointer;transition:transform .08s,box-shadow .15s,opacity .15s,background .15s}.btn:active{transform:translateY(1px)}.btn:disabled{opacity:.42;cursor:not-allowed}.btn-primary{background:linear-gradient(135deg,#11100d,#272116);color:#fff;box-shadow:0 8px 22px rgba(17,13,4,.16)}.btn-primary:hover{box-shadow:0 11px 28px rgba(17,13,4,.22)}.btn-dark{background:#0c0b09;color:#fff}.btn-light{background:rgba(255,255,255,.86);border:1px solid #ded4c3;color:#1e1a14}.btn-danger{background:#fff0ef;color:var(--danger);border:1px solid #e8b9b5}.btn-block{width:100%}.btn-gold-outline{background:transparent;border:1px solid rgba(217,165,29,.65);color:#7b5b0c}.text-btn{border:0;background:transparent;color:#8b6610;font-weight:800;cursor:pointer;padding:4px 0}
.login-shell{min-height:100vh;display:grid;place-items:center;position:relative;overflow:hidden;padding:28px;background:linear-gradient(145deg,#090806 0%,#12100c 48%,#060605 100%)}.login-shell:before{content:"";position:absolute;inset:0;opacity:.14;background-image:radial-gradient(circle at center,transparent 0 35%,#d9a51d 35.5% 36%,transparent 36.5%),linear-gradient(45deg,transparent 49.5%,rgba(217,165,29,.15) 50%,transparent 50.5%);background-size:190px 190px,92px 92px}.login-ornament{position:absolute;border:1px solid rgba(217,165,29,.18);border-radius:50%;width:520px;height:520px}.login-ornament-a{left:-280px;top:-250px}.login-ornament-b{right:-300px;bottom:-290px}.login-card{position:relative;z-index:2;width:min(460px,100%);background:rgba(255,253,248,.97);border:1px solid rgba(217,165,29,.25);box-shadow:0 32px 80px rgba(0,0,0,.34);border-radius:28px;padding:34px 42px 30px}.brand-lockup{text-align:center}.logo-crop{overflow:hidden;margin-inline:auto}.logo-crop img{width:100%;height:auto;display:block}.logo-crop-login{width:220px;height:230px}.production-word{text-align:center;letter-spacing:.42em;font-size:.74rem;font-weight:700;margin-top:2px;color:#6f6659}.login-divider{display:flex;align-items:center;gap:11px;margin:20px 0 13px}.login-divider span{height:1px;flex:1;background:#dfd3bd}.login-divider b{font-size:.62rem;letter-spacing:.18em;color:#a27b1a}.login-card h1{font-family:Georgia,"Times New Roman",serif;text-align:center;margin:0;font-size:2rem;font-weight:500}.login-copy{text-align:center;line-height:1.55;margin:8px 0 0}.stack{display:grid;gap:15px;margin-top:24px}label>span{display:block;font-size:.78rem;font-weight:800;margin-bottom:7px;color:#514a3e}input,select,textarea{width:100%;border:1px solid #d8cfbf;background:#fffdf9;border-radius:12px;padding:12px 13px;outline:none;transition:.15s;color:#1b1813}input:focus,select:focus,textarea:focus{border-color:#d4a51f;box-shadow:0 0 0 3px rgba(217,165,29,.16)}.password-wrap{display:flex;gap:8px}.password-wrap input{flex:1}.eye-btn{border:1px solid #d8cfbf;background:#fff;border-radius:12px;padding:0 12px;cursor:pointer}.security-note{font-size:.72rem;line-height:1.55;color:#81786a;margin:20px 0 0;padding-top:17px;border-top:1px solid #eadfcd;text-align:center}.install-btn{margin-top:10px}.install-hint{margin-top:10px;border-radius:10px;background:#fff6dc;padding:10px 12px;font-size:.76rem;color:#71570f;line-height:1.5;text-align:center}
.topbar{position:fixed;z-index:40;top:0;left:0;right:0;height:70px;background:rgba(255,253,248,.94);backdrop-filter:blur(15px);border-bottom:1px solid #e7dfd2;display:flex;align-items:center;justify-content:space-between;padding:0 18px;box-shadow:0 5px 25px rgba(47,32,8,.04)}.topbar-left,.topbar-right{display:flex;align-items:center;gap:12px}.hamburger-btn{width:43px;height:43px;border:1px solid #ded5c6;background:#fffdf8;border-radius:12px;display:flex;flex-direction:column;justify-content:center;gap:4px;padding:0 11px;cursor:pointer}.hamburger-btn span{display:block;height:2px;background:#16130e;border-radius:2px}.header-brand{display:flex;align-items:center;gap:3px}.logo-crop-header{width:86px;height:90px;transform:scale(.72);transform-origin:left center;margin-right:-20px}.header-production{font-size:.6rem;letter-spacing:.26em;color:#84620d;font-weight:850}.user-email{font-size:.78rem;color:#736b5f;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.role-badge{background:#fff4cc;border:1px solid #ead394;color:#6d510b;border-radius:999px;padding:6px 10px;font-size:.68rem;font-weight:850;text-transform:uppercase;letter-spacing:.07em}.notification-btn{position:relative;width:40px;height:40px;border:1px solid #e0d5c2;background:#fff;border-radius:12px;cursor:pointer}.bell{font-size:1.1rem;color:#8f6a0c}.notification-count{position:absolute;right:-5px;top:-6px;background:#a32626;color:#fff;border:2px solid #fff;border-radius:999px;min-width:20px;height:20px;padding:0 4px;display:grid;place-items:center;font-size:.64rem;font-weight:900}
.sidebar{position:fixed;z-index:50;top:0;bottom:0;left:0;width:290px;background:linear-gradient(180deg,#0b0a08,#15120d);color:#fff;padding:16px 13px;display:flex;flex-direction:column;transform:translateX(-103%);transition:transform .22s ease;box-shadow:24px 0 55px rgba(0,0,0,.25)}.sidebar.open{transform:none}.sidebar-head{height:54px;display:flex;align-items:center;justify-content:space-between;padding:0 8px 12px;border-bottom:1px solid rgba(255,255,255,.08)}.sidebar-brand{font-family:Georgia,serif;letter-spacing:.14em;font-size:.84rem}.sidebar-brand span{display:block;font-family:Inter,sans-serif;font-size:.52rem;color:#d9a51d;letter-spacing:.28em;margin-top:4px}.sidebar-close{width:36px;height:36px;border:1px solid rgba(255,255,255,.12);border-radius:10px;background:rgba(255,255,255,.05);color:#fff;font-size:23px;cursor:pointer}.sidebar-section{font-size:.62rem;letter-spacing:.16em;text-transform:uppercase;color:#897e69;padding:20px 11px 8px}.nav-item{display:flex;align-items:center;gap:10px;width:100%;border:0;background:transparent;color:#c8c0b4;text-align:left;border-radius:11px;padding:11px 12px;margin:2px 0;font-weight:750;cursor:pointer}.nav-item:hover,.nav-item.active{background:linear-gradient(90deg,rgba(217,165,29,.18),rgba(217,165,29,.06));color:#fff}.nav-icon{width:20px;text-align:center;color:#d9a51d}.nav-count{margin-left:auto;background:#a72b2b;border-radius:999px;padding:2px 7px;color:#fff;font-size:.65rem}.nav-logout{margin-top:3px;color:#e0b9b4}.sidebar-foot{margin-top:auto;border-top:1px solid rgba(255,255,255,.08);padding:14px 10px 4px;display:grid;gap:9px}.sidebar-foot>div{display:flex;justify-content:space-between;color:#8e8577;font-size:.69rem}.sidebar-foot strong{color:#d8c99c}.backdrop{position:fixed;z-index:45;inset:0;background:rgba(5,4,3,.38);backdrop-filter:blur(5px)}
.main{padding:98px 24px 42px;max-width:1800px;margin:0 auto}.panel{max-width:1660px;margin:0 auto}.page-head{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;margin-bottom:18px}.page-head h2{font-family:Georgia,"Times New Roman",serif;font-weight:500;font-size:1.85rem;margin:0 0 5px}.page-head p{margin:0}.premium-head{padding:8px 0 2px}.actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.dashboard-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px}.dashboard-metric{background:linear-gradient(145deg,#fffdf8,#fbf6ec);border:1px solid #e7ddcc;border-radius:16px;padding:16px;position:relative;overflow:hidden}.dashboard-metric:after{content:"";position:absolute;width:70px;height:70px;border:1px solid rgba(217,165,29,.18);border-radius:50%;right:-22px;bottom:-28px}.dashboard-metric span{font-size:.72rem;color:#756d61}.dashboard-metric strong{display:block;font-family:Georgia,serif;font-size:1.65rem;margin-top:7px}.dashboard-metric.alert strong{color:#a33b26}.dashboard-grid{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(320px,.75fr);gap:14px}.premium-card{background:#fffdf9;border:1px solid #e6dccb;border-radius:16px;box-shadow:0 8px 28px rgba(42,30,7,.04);padding:17px}.card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:13px}.card-head h3{font-family:Georgia,serif;font-weight:500;margin:0;font-size:1.12rem}.card-head p{margin:4px 0 0;color:#837a6d;font-size:.76rem}.priority-list,.mini-notifications,.notifications-list,.work-queue{display:grid;gap:8px}.priority-item,.mini-notification,.notification-card,.work-row{border:1px solid #eadfcd;background:#fff;border-radius:12px;padding:11px 12px}.priority-item{display:flex;justify-content:space-between;align-items:center;gap:12px}.priority-main b{display:block;font-size:.86rem}.priority-main span{font-size:.72rem;color:#777064}.timer-badge{display:inline-flex;align-items:center;border-radius:999px;padding:5px 8px;font-size:.67rem;font-weight:850;white-space:nowrap}.timer-ok{background:#e9f5ec;color:#23643a}.timer-warn{background:#fff3d1;color:#84600b}.timer-delay{background:#ffe5df;color:#9a3121}.timer-muted{background:#f0eee9;color:#70695e}.timer-done{background:#e8f1ff;color:#365c8a}
.metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:14px}.metric{background:#fffdf9;border:1px solid #e6ddce;border-radius:14px;padding:14px 16px}.metric span{display:block;color:#82796c;font-size:.7rem;margin-bottom:7px}.metric strong{font-family:Georgia,serif;font-size:1.25rem}.toolbar{display:flex;gap:10px;justify-content:space-between;margin-bottom:12px}.searchbox{position:relative;display:flex;align-items:center;width:min(560px,100%);background:#fffdf9;border:1px solid #e2d9ca;border-radius:12px;padding-left:12px}.searchbox input{border:0;box-shadow:none;padding-right:36px;background:transparent}.clear-search{position:absolute;right:6px;border:0;background:transparent;font-size:18px;color:#81786b;cursor:pointer}.select{max-width:140px}
.smart-table-wrap{background:#fffdf9;border:1px solid #e3dacb;border-radius:15px;overflow:hidden}.smart-table{border-collapse:collapse;width:100%;table-layout:fixed;font-size:.78rem}.smart-table th,.smart-table td{padding:11px 9px;border-bottom:1px solid #eee5d8;text-align:left;vertical-align:middle;overflow:hidden;text-overflow:ellipsis}.smart-table th{background:#15120d;color:#f7efd8;font-size:.68rem;letter-spacing:.02em}.smart-table th:first-child{border-left:3px solid #d9a51d}.smart-table tbody tr{cursor:pointer;transition:.13s}.smart-table tbody tr:hover{background:#fff8e6}.smart-table td:first-child{font-weight:850;color:#785c12}.summary-sub{display:block;font-size:.67rem;color:#82796c;margin-top:3px}.empty{padding:42px;text-align:center;color:#80776a}.pagination{display:flex;align-items:center;justify-content:center;gap:14px;margin-top:14px}.mobile-cards{display:none}.dropdown{position:relative}.dropdown-menu{position:absolute;right:0;top:calc(100% + 6px);z-index:35;background:#fffdf9;border:1px solid #e2d8c8;box-shadow:var(--shadow);border-radius:12px;overflow:hidden;min-width:155px}.dropdown-menu button{display:block;width:100%;text-align:left;padding:10px 12px;border:0;background:#fffdf9;cursor:pointer}.dropdown-menu button:hover{background:#fff7e3}
.stage-dashboard-grid,.kpi-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:15px}.stage-kpi-card,.kpi-card{background:#fffdf9;border:1px solid #e5dac8;border-radius:15px;padding:15px}.stage-kpi-card h3,.kpi-card h3{font-size:.87rem;margin:0 0 10px}.stage-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.stage-stat{background:#f8f3e9;border-radius:9px;padding:8px}.stage-stat span{display:block;font-size:.62rem;color:#877d6e}.stage-stat b{font-size:.95rem}.kpi-bar{height:7px;background:#eee7d9;border-radius:999px;overflow:hidden;margin-top:10px}.kpi-bar>span{display:block;height:100%;background:linear-gradient(90deg,#a87b0b,#e0b232);border-radius:999px}.work-row{display:grid;grid-template-columns:1.1fr 1fr 1fr auto;gap:10px;align-items:center}.work-row b{font-size:.8rem}.work-row span{font-size:.72rem;color:#786f62}
.notifications-list{max-width:1000px}.notification-card{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:flex-start}.notification-dot{width:9px;height:9px;border-radius:50%;background:#d9a51d;margin-top:5px}.notification-card.read .notification-dot{background:#d3cec4}.notification-card h4{margin:0;font-size:.86rem}.notification-card p{margin:4px 0;color:#756d61;font-size:.76rem}.notification-card time{font-size:.67rem;color:#978e81}.notification-actions{display:flex;gap:6px}.nav-count{}
.audit-empty{background:#fffdf9;border:1px dashed #d8cdbb;border-radius:14px;padding:34px;text-align:center;color:#7f7669}.audit-list{display:grid;gap:10px}.audit-item{background:#fffdf9;border:1px solid #e5dac8;border-radius:14px;padding:14px}.audit-top{display:flex;justify-content:space-between;gap:12px}.audit-changes{margin-top:10px;display:grid;gap:6px}.audit-change{background:#f8f3e9;border-radius:8px;padding:8px 10px;font-size:.78rem}.old{color:#9b3434}.new{color:#376227}
.access-users{display:grid;gap:10px}.access-user-card{background:#fffdf9;border:1px solid #e4dac8;border-radius:15px;padding:14px;display:grid;grid-template-columns:minmax(220px,1.25fr) repeat(3,minmax(100px,.55fr)) auto;gap:12px;align-items:center}.access-user-card.master{border-color:#dab65a;background:linear-gradient(90deg,#fff9e9,#fffdf9)}.access-user-main b{display:block}.access-user-main span{display:block;color:#7a7267;font-size:.72rem;margin-top:3px}.access-pill{font-size:.69rem;border:1px solid #e1d6c4;border-radius:999px;padding:5px 8px;width:max-content}.access-pill.active{background:#eaf5ed;color:#24643b}.access-pill.inactive{background:#f4e6e4;color:#8f3329}.master-shield{color:#8b6710;font-weight:900;font-size:.72rem}
.security-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.security-card{background:#fffdf9;border:1px solid #e2d8c7;border-radius:15px;padding:20px}.security-card h3{font-family:Georgia,serif;font-weight:500;margin-top:0}
.modal{position:fixed;z-index:80;inset:0;display:grid;place-items:center;padding:18px}.modal-backdrop{position:absolute;inset:0;background:rgba(8,6,3,.58);backdrop-filter:blur(6px)}.modal-card{position:relative;width:min(1120px,100%);max-height:94vh;overflow:auto;background:#fffdf9;border-radius:19px;box-shadow:0 30px 80px rgba(0,0,0,.3);border:1px solid rgba(217,165,29,.25)}.modal-head{position:sticky;top:0;z-index:4;background:rgba(255,253,249,.97);backdrop-filter:blur(10px);display:flex;justify-content:space-between;padding:18px 20px;border-bottom:1px solid #e7ddcd}.modal-head h3{font-family:Georgia,serif;font-weight:500;margin:0;font-size:1.4rem}.modal-close{border:1px solid #e1d7c6;background:#fff;width:36px;height:36px;border-radius:10px;font-size:22px;cursor:pointer}.order-form-body{padding:18px 20px;display:grid;gap:18px}.form-section{border:1px solid #e6dccb;border-radius:14px;overflow:hidden}.form-section-head{padding:11px 13px;background:#15120d;color:#f8eed4;display:flex;justify-content:space-between;align-items:center}.form-section-head h4{margin:0;font-size:.8rem;letter-spacing:.05em}.form-section-body{padding:14px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.form-field.readonly input{background:#f2ede3;color:#71695e}.form-field small{display:block;color:#8a8175;font-size:.65rem;margin-top:5px}.modal-actions{display:flex;align-items:center;gap:8px;padding:14px 20px;border-top:1px solid #e6dccb;position:sticky;bottom:0;background:#fffdf9;z-index:4}.spacer{flex:1}
.production-stage-list{display:grid;gap:10px}.production-stage{border:1px solid #e4d9c7;border-radius:13px;background:#fff;overflow:hidden}.production-stage-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;background:#faf5eb;border-bottom:1px solid #eadfce}.production-stage-head h5{margin:0;font-size:.82rem}.stage-fields{display:grid;grid-template-columns:1fr 1.4fr minmax(150px,.7fr);gap:10px;padding:12px}.stage-extra{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:0 12px 12px}.assigned-days-wrap{display:flex;align-items:end;gap:7px}.assigned-days-wrap label{max-width:150px}.stage-complete-btn{border:1px solid #d8cfbf;background:#fff;border-radius:10px;padding:9px 11px;font-weight:800;cursor:pointer}.stage-complete-btn.complete{background:#eaf5ed;border-color:#b8d8c2;color:#28643d}.timer-locked{font-size:.68rem;color:#877b69}.stage-name-field{grid-column:span 1}
.access-modal-card{max-width:780px}.access-form{padding:18px}.access-form-top{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:14px}.switch-row{display:flex;align-items:center;justify-content:space-between;border:1px solid #e1d7c6;border-radius:12px;padding:11px 12px}.switch-row>span{margin:0}.switch-row input{width:auto}.permission-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.permission-item{display:flex;align-items:center;gap:10px;border:1px solid #e3d8c6;border-radius:12px;padding:11px;cursor:pointer}.permission-item input{width:auto}.permission-item b{display:block;font-size:.78rem}.permission-item small{color:#83796c;font-size:.65rem}.access-note{margin-top:13px;background:#fff5d8;color:#73590f;border-radius:10px;padding:10px 12px;font-size:.72rem;line-height:1.5}
.busy{position:fixed;z-index:100;inset:0;background:rgba(255,253,248,.72);backdrop-filter:blur(4px);display:grid;place-items:center}.busy-card{background:#0f0d09;color:#fff;border:1px solid rgba(217,165,29,.35);border-radius:15px;padding:17px 20px;display:flex;align-items:center;gap:13px;box-shadow:var(--shadow)}.busy-card span{display:block;font-size:.68rem;color:#cfc5b5;margin-top:3px}.spinner{width:22px;height:22px;border:3px solid rgba(255,255,255,.25);border-top-color:#d9a51d;border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.toast{position:fixed;z-index:110;right:18px;top:82px;max-width:400px;background:#15120d;color:#fff;border:1px solid rgba(217,165,29,.35);border-radius:12px;padding:12px 15px;box-shadow:var(--shadow);opacity:0;pointer-events:none;transform:translateY(-8px);transition:.2s}.toast.show{opacity:1;transform:none}.toast.error{background:#771f1f;border-color:#b76868}
@media(max-width:1180px){.dashboard-metrics{grid-template-columns:repeat(2,1fr)}.dashboard-grid{grid-template-columns:1fr}.stage-dashboard-grid,.kpi-grid{grid-template-columns:repeat(2,1fr)}.access-user-card{grid-template-columns:1fr 1fr 1fr auto}.access-user-card .access-user-main{grid-column:1/-1}.form-section-body{grid-template-columns:repeat(3,1fr)}}
@media(max-width:900px){.topbar{padding:0 10px}.user-email,.desktop-action{display:none}.main{padding:88px 12px 30px}.page-head{flex-direction:column}.actions{width:100%;justify-content:flex-start}.metrics{grid-template-columns:1fr 1fr}.metric:last-child{grid-column:1/-1}.toolbar{flex-direction:column}.select{max-width:none}.smart-table-wrap{display:none}.mobile-cards{display:grid;gap:9px}.mobile-card{background:#fffdf9;border:1px solid #e3d9c8;border-radius:14px;padding:13px}.mobile-card-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;margin-bottom:10px}.mobile-card-title b{display:block;color:#74580e}.mobile-card-title span{font-size:.72rem;color:#766e62}.mobile-card-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.mobile-field{background:#f8f3ea;border-radius:9px;padding:8px}.mobile-field span{display:block;font-size:.62rem;color:#857c70;margin-bottom:3px}.mobile-field strong{font-size:.77rem;word-break:break-word}.stage-dashboard-grid,.kpi-grid{grid-template-columns:1fr 1fr}.work-row{grid-template-columns:1fr 1fr}.form-section-body{grid-template-columns:1fr 1fr}.stage-fields{grid-template-columns:1fr 1fr}.stage-fields>*:nth-child(3){grid-column:1/-1}.security-grid{grid-template-columns:1fr}.logo-crop-header{width:72px;margin-right:-24px}.header-production{display:none}}
@media(max-width:600px){.login-card{padding:28px 22px;border-radius:22px}.logo-crop-login{width:190px;height:198px}.topbar-right .role-badge{display:none}.dashboard-metrics,.metrics,.stage-dashboard-grid,.kpi-grid{grid-template-columns:1fr}.metric:last-child{grid-column:auto}.mobile-card-grid{grid-template-columns:1fr}.form-section-body,.stage-fields,.access-form-top,.permission-grid{grid-template-columns:1fr}.stage-fields>*:nth-child(3){grid-column:auto}.access-user-card{grid-template-columns:1fr auto}.access-user-card .access-user-main{grid-column:1/-1}.page-head h2{font-size:1.55rem}.notification-card{grid-template-columns:auto 1fr}.notification-actions{grid-column:2}.topbar{height:64px}.main{padding-top:82px}.sidebar{width:min(88vw,310px)}.dashboard-main-card{padding:13px}.work-row{grid-template-columns:1fr}.modal{padding:7px}.modal-card{border-radius:16px;max-height:97vh}.modal-head,.order-form-body,.modal-actions{padding-left:13px;padding-right:13px}}


/* v3: department-wise Excel M:AE production workflow */
.department-orders-view{display:grid;gap:14px}
.department-view-note{display:flex;align-items:center;justify-content:space-between;background:linear-gradient(90deg,#fff8e4,#fffdf9);border:1px solid #e7d6a6;border-radius:14px;padding:12px 15px;margin-bottom:2px}
.department-view-note b{display:block;font-family:Georgia,serif;font-size:1rem;font-weight:500}
.department-view-note span{display:block;color:#776c5d;font-size:.72rem;margin-top:3px}
.department-table-stack{display:grid;gap:14px;margin-bottom:16px}
.department-table-card{background:#fffdf9;border:1px solid #e2d6c3;border-radius:16px;overflow:hidden;box-shadow:0 6px 20px rgba(50,34,8,.035)}
.department-table-head{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 14px;background:linear-gradient(90deg,#16120d,#282017);color:#fff8e8}
.department-table-head-left{display:flex;align-items:center;gap:10px;min-width:0}
.department-table-head h3{font-family:Georgia,serif;font-size:1rem;font-weight:500;margin:0}
.excel-range{font-size:.62rem;letter-spacing:.12em;border:1px solid rgba(230,178,52,.4);color:#eac154;border-radius:999px;padding:4px 7px;white-space:nowrap}
.department-table-head .dept-count{font-size:.67rem;color:#d8cfbd;white-space:nowrap}
.department-table-scroll{width:100%;overflow:hidden}
.department-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:.76rem}
.department-table th{background:#f6efdf;color:#4c3c17;border-bottom:1px solid #e3d7c4;padding:9px 9px;text-align:left;font-size:.68rem;letter-spacing:.02em}
.department-table td{padding:9px;border-bottom:1px solid #eee5d6;vertical-align:middle;white-space:normal;overflow-wrap:anywhere}
.department-table tbody tr:last-child td{border-bottom:0}
.department-table tbody tr:hover{background:#fffaf0}
.department-table .col-job{width:14%}.department-table .col-date{width:13%}.department-table .col-item{width:22%}.department-table .col-name{width:14%}.department-table .col-days{width:11%}.department-table .col-timer{width:16%}.department-table .col-action{width:10%}
.department-table .job-link{font-weight:900;color:#805e06;cursor:pointer;text-decoration:none}
.department-table .task-secondary{display:block;color:#8a8172;font-size:.66rem;margin-top:2px}
.department-section-head{display:flex;justify-content:space-between;align-items:end;margin:18px 0 10px}
.department-section-head h3{font-family:Georgia,serif;font-weight:500;font-size:1.2rem;margin:2px 0}
.department-empty{padding:22px;text-align:center;color:#82786b;font-size:.78rem}
.department-mobile-list{display:none}

/* Make the order production workspace use the entire modal width */
.order-modal-card{width:min(1380px,calc(100vw - 22px));max-height:96vh}
.production-stage-list{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.production-stage{min-width:0}
.stage-fields{grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);align-items:end}
.stage-fields .stage-name-field{grid-column:1/-1}
.stage-extra{align-items:flex-end}
.assigned-days-wrap{flex:1;min-width:0}
.assigned-days-wrap label{max-width:120px;min-width:90px}
.production-workflow-section .form-section-body{padding:14px}
.production-stage-head{min-height:44px}

/* Access control must always show useful state */
.access-panel-toolbar{display:flex;gap:8px}
.access-status{margin:0 0 12px;border:1px solid #e6d4a6;background:#fff8e6;color:#6e5513;border-radius:12px;padding:10px 12px;font-size:.75rem}
.access-status.error{border-color:#e6b9b3;background:#fff0ee;color:#8b2c25}
.access-users:empty::before{content:"No users loaded. Refresh Access Control or check the server configuration.";display:block;border:1px dashed #dbcdb7;border-radius:14px;padding:28px;text-align:center;color:#817568;background:#fffdf9}
.new-user-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:14px}
.field-help{display:block;color:#877d70;font-size:.65rem;line-height:1.45;margin-top:6px}

/* Compact, responsive production workspace */
@media(max-width:1180px){
  .production-stage-list{grid-template-columns:repeat(2,minmax(0,1fr))}
  .department-table{font-size:.73rem}
  .department-table .col-job{width:15%}.department-table .col-item{width:21%}
}
@media(max-width:900px){
  .production-stage-list{grid-template-columns:1fr}
  .department-table-scroll{display:none}
  .department-mobile-list{display:grid;gap:8px;padding:10px}
  .dept-mobile-row{border:1px solid #e4d8c6;border-radius:12px;background:#fff;padding:11px}
  .dept-mobile-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
  .dept-mobile-head b{color:#77580a}
  .dept-mobile-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}
  .dept-mobile-field{background:#f8f2e7;border-radius:8px;padding:7px}
  .dept-mobile-field span{display:block;color:#8a8072;font-size:.6rem;margin-bottom:2px}
  .dept-mobile-field strong{display:block;font-size:.74rem;overflow-wrap:anywhere}
  .new-user-grid{grid-template-columns:1fr}
}
@media(max-width:600px){
  .department-view-note{padding:10px 11px}
  .department-table-head{padding:10px 11px}
  .dept-mobile-grid{grid-template-columns:1fr}
  .order-modal-card{width:100%;height:100%;max-height:100vh;border-radius:0}
  .modal{padding:0}
  .production-stage-list{gap:9px}
}
