html,body{background:#f4f5f7;color:#1f2937;font-family:Pretendard,"Pretendard Variable",system-ui,-apple-system,sans-serif;-webkit-font-smoothing:antialiased}
body{overflow-x:hidden}
.num{font-variant-numeric:tabular-nums}
svg.ic{width:18px;height:18px;flex:none}

/* 공통 버튼 (대시보드 계열) */
.btn{display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 15px;border:1px solid #d9dde3;border-radius:8px;background:#fff;color:#222;font-size:15px;font-weight:500;white-space:nowrap;cursor:pointer;transition:background .12s,border-color .12s}
.btn:hover{background:#f6f7f9}
.btn-primary{background:#1468f0;border-color:#1468f0;color:#fff;font-weight:600}
.btn-primary:hover{background:#0f5ad6}
.btn-sm{height:30px;padding:0 10px;font-size:13px;gap:5px;border-radius:6px}
.btn-danger{color:#dc2626;border-color:#f3c4c4}
.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:44px;height:40px;border:1px solid #d9dde3;border-radius:8px;background:#fff;cursor:pointer}
.icon-btn:hover{background:#f6f7f9}
.chip{display:inline-flex;align-items:center;gap:9px;height:40px;padding:0 17px;border:1px solid #d9dde3;border-radius:6px;background:#fff;color:#333;font-size:15px;white-space:nowrap;cursor:pointer}
.chip:hover{background:#f6f7f9}
.chip.on{background:#1468f0;border-color:#1468f0;color:#fff;font-weight:600}
.field{height:40px;border:1px solid #d9dde3;border-radius:6px;background:#fff;font-size:15px;color:#222;padding:0 12px;outline:none;min-width:0}
.field:focus{border-color:#1468f0;box-shadow:0 0 0 3px rgba(20,104,240,.12)}
select.field{appearance:none;-webkit-appearance:none;padding-right:36px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;background-size:16px;cursor:pointer}

/* 재고 스프레드시트 표 */
.sheet-wrap{border:1px solid #dfe3e8;border-radius:6px;background:#fff;overflow:auto;max-height:calc(100vh - 270px);min-height:320px}
.sheet{border-collapse:separate;border-spacing:0;width:100%;min-width:1180px}
.sheet th,.sheet td{border-right:1px solid #e6e9ee;border-bottom:1px solid #e6e9ee;text-align:center;white-space:nowrap}
.sheet th:last-child,.sheet td:last-child{border-right:0}
.sheet thead th{position:sticky;top:0;z-index:2;height:56px;font-size:16.5px;font-weight:500;color:#222;padding:0 10px;background:#f7f8fa;min-width:84px}
.sheet tbody tr{color:#333}
.sheet tbody td{height:54px;font-size:17px;padding:0 10px}
.sheet tbody tr{cursor:pointer}
.sheet tbody tr:hover td{background-color:#f8fafd}
.sheet tbody tr:hover td.c-total{background-color:#e9f1fd}
.sheet tfoot td{position:sticky;bottom:0;z-index:2;height:52px;background:#f2f5f9;font-size:17.5px;font-weight:700;color:#222;border-top:1px solid #dfe3e8;border-bottom:0}
.sheet .c-brand{text-align:left;padding-left:14px;min-width:150px;position:sticky;left:0;z-index:1;background:#fff}
.sheet thead .c-brand{z-index:3;text-align:center;background:#f7f8fa}
.sheet tfoot .c-brand{z-index:3;text-align:center;background:#f2f5f9}
.sheet tbody tr:hover td.c-brand{background:#f8fafd}
.sheet td.c-total{background:#f3f7fe;color:#1a5fd8;font-weight:700;font-size:19.5px}
.sheet tfoot td.c-total{background:#e8f0fc;color:#1a5fd8;font-size:20px}
.sheet td.c-avail{color:#1a5fd8;font-weight:600;font-size:18px}
.sheet tfoot td.c-avail{color:#1a5fd8;font-weight:500}
.h-total{background:#e8f0fc!important}.h-center{background:#eef7f1!important}.h-on{background:#e9f1fb!important}.h-off{background:#eff0fb!important}
.h-safe{background:#fdf6e7!important}.h-avail{background:#ebf6ed!important}.h-res{background:#fcecef!important}.h-inc{background:#f2eefa!important}.h-st{background:#f4f5f7!important}
.brand-ic{width:24px;height:24px;flex:none}

.badge{display:inline-flex;align-items:center;justify-content:center;min-width:48px;height:27px;padding:0 8px;border-radius:5px;font-size:13.5px;font-weight:600;border:1px solid}
.b-ok{background:#ecf8ef;color:#1f8a3e;border-color:#c8ebd2}
.b-low{background:#fff3e8;color:#e0700d;border-color:#fbd7b5}
.b-hold{background:#f6f7f9;color:#4b5563;border-color:#dcdfe4}
.b-inc{background:#ecf3ff;color:#1a5fd8;border-color:#c5dafc}
.b-in{background:#ecf3ff;color:#1a5fd8;border-color:#c5dafc}
.b-out{background:#fff1f1;color:#d93636;border-color:#f7caca}

.sw{position:relative;display:inline-block;width:38px;height:24px;border-radius:999px;background:#d5d9df;border:0;cursor:pointer;transition:background .15s;flex:none}
.sw::after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .15s}
.sw.on{background:#1468f0}
.sw.on::after{transform:translateX(14px)}

/* 일반 표 (상세·권한·창고 화면) */
.grid-t{border-collapse:separate;border-spacing:0;width:100%}
.grid-t th{background:#f7f8fa;font-weight:500;font-size:14px;color:#374151;height:44px;padding:0 12px;border-bottom:1px solid #e6e9ee;white-space:nowrap;text-align:center}
.grid-t tbody tr{color:#333}
.grid-t td{height:48px;padding:0 12px;border-bottom:1px solid #eef0f3;font-size:14.5px;white-space:nowrap;text-align:center}
.grid-t tr:last-child td{border-bottom:0}
.card{background:#fff;border:1px solid #e3e6ea;border-radius:10px}

/* 상품 관리 화면 (빨간 계열) */
.pm{background:#fff;color:#222}
.pm .pbtn{display:inline-flex;align-items:center;gap:7px;height:36px;padding:0 6px;font-size:14px;color:#333;background:none;border:0;cursor:pointer;white-space:nowrap}
.pm .pbtn:hover{color:#000}
.pm .red{background:#e5262b;color:#fff;border-radius:6px;height:36px;padding:0 18px;font-weight:600;font-size:15px;display:inline-flex;align-items:center;gap:7px;border:0;cursor:pointer;white-space:nowrap}
.pm .red:hover{background:#cf1f24}
.pm .seg{display:inline-flex;border:1px solid #d9dde3;border-radius:6px;overflow:hidden}
.pm .seg button{height:34px;padding:0 18px;font-size:14px;color:#333;background:#fff;border-left:1px solid #d9dde3;cursor:pointer;white-space:nowrap}
.pm .seg button:first-child{border-left:0}
.pm .seg button.on{background:#e5262b;color:#fff;font-weight:600}
.pm .pf{height:36px;border:1px solid #d9dde3;border-radius:5px;padding:0 12px;font-size:14px;background:#fff;outline:none;min-width:0}
.pm .pf:focus{border-color:#e5262b}
.pm select.pf{appearance:none;-webkit-appearance:none;padding-right:32px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;background-size:14px;cursor:pointer}
.pt-wrap{border:1px solid #e1e4e8;border-radius:6px;overflow-x:auto}
.pt{border-collapse:collapse;width:100%;min-width:1380px}
.pt th{background:#f4f5f7;font-weight:500;font-size:13px;color:#333;height:36px;border-bottom:1px solid #e1e4e8;white-space:nowrap;padding:0 6px}
.pt tbody tr{color:#333}
.pt td{font-size:13px;height:31px;text-align:center;border-bottom:1px solid #eceef1;white-space:nowrap;padding:0 6px}
.pt tbody tr:hover td{background:#fafbfc}
.pt tr:last-child td{border-bottom:0}
.pt input[type=checkbox]{width:16px;height:16px;accent-color:#e5262b;cursor:pointer}
.pg{display:inline-flex;align-items:center;justify-content:center;min-width:33px;height:33px;padding:0 6px;border:1px solid #d9dde3;border-radius:4px;background:#fff;font-size:14px;color:#333;cursor:pointer}
.pg.on{background:#e5262b;border-color:#e5262b;color:#fff;font-weight:600}
.pg[disabled]{opacity:.4;cursor:default}
.act-ic{display:inline-flex;padding:4px;border-radius:4px;color:#555;cursor:pointer;background:none;border:0}
.act-ic:hover{background:#f1f2f4}

/* 모달·드로어·드롭다운 */
.ovl{position:fixed;inset:0;z-index:50;background:rgba(17,24,39,.45);display:flex;align-items:flex-start;justify-content:center;overflow-y:auto;padding:48px 16px}
.mdl{background:#fff;border-radius:14px;width:100%;max-width:520px;box-shadow:0 24px 60px rgba(0,0,0,.25)}
.mdl .lb{display:block;font-size:13.5px;font-weight:600;color:#374151;margin-bottom:6px}
.mdl .field{width:100%}
.drawer-bg{position:fixed;inset:0;z-index:40;background:rgba(17,24,39,.35)}
.drawer{position:fixed;top:0;left:0;bottom:0;z-index:41;width:270px;max-width:85vw;background:#fff;box-shadow:8px 0 30px rgba(0,0,0,.15);padding:20px 14px}
.nav-a{display:flex;align-items:center;gap:10px;padding:11px 12px;border-radius:8px;font-size:15px;color:#333}
.nav-a:hover{background:#f3f5f8}
.nav-a.on{background:#eaf1fe;color:#1468f0;font-weight:600}
.menu-bg{position:fixed;inset:0;z-index:30}
.menu{position:absolute;right:0;top:calc(100% + 8px);z-index:31;background:#fff;border:1px solid #e3e6ea;border-radius:10px;box-shadow:0 12px 32px rgba(0,0,0,.12);min-width:260px;padding:6px}
.seg-t{display:inline-flex;background:#f1f3f6;border-radius:8px;padding:3px}
.seg-t button{height:34px;padding:0 18px;border-radius:6px;font-size:14px;color:#4b5563;cursor:pointer}
.seg-t button.on{background:#fff;color:#111;font-weight:600;box-shadow:0 1px 3px rgba(0,0,0,.1)}

@media (max-width:640px){
  .sheet-wrap{max-height:none}
  .sheet thead th{font-size:14px;height:46px}
  .sheet tbody td{font-size:14.5px;height:46px}
  .sheet td.c-total{font-size:16px}
  .sheet .c-brand{min-width:120px}
  .btn{height:36px;padding:0 11px;font-size:14px}
  .chip{height:36px;padding:0 12px;font-size:14px}
}

/* 사라진 알림이 아래 버튼 클릭을 막지 않도록 */
#demo-toast{pointer-events:none}
