/* ===== CARD ===== */

.card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}

.card .card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:14px 16px;
  background:var(--surface2);
  border-bottom:1px solid var(--border);
}

.card .card-head .h-title{
  font-weight:900;
  color:var(--text);
  display:flex;
  align-items:center;
  gap:10px;
}

.card .card-head .h-title .pill{
  font-size:12px;
  font-weight:900;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--chip);
  color:var(--chipText);
}

.card .card-body{
  padding:16px;
}

/* ===== GRID ===== */

.f-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:12px;
}

.f-grid .full{
  grid-column:1/-1;
}

@media(max-width:1200px){
  .f-grid{grid-template-columns:repeat(2,1fr)}
}

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

/* ===== FORM ===== */

.field label{
  display:block;
  margin-bottom:8px;
  font-size:12px;
  font-weight:700;
  color:var(--muted);
}

.field input,
.field select,
.field textarea{
  width:100%;
  height:44px;
  padding:0 12px;
  border-radius:var(--radius);
  border:1px solid var(--border);
  background:var(--surface);
  color:var(--text);
  outline:none;
  font-family:"Malgun Gothic","맑은 고딕",sans-serif;
}

.field textarea{
  height:120px;
  padding:10px 12px;
  resize:vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus{
  border-color:var(--accent);
}

.helper{
  margin-top:8px;
  font-size:12px;
  color:var(--muted);
}


/* ===== TABLE ===== */

.tbl-wrap{
  overflow:auto;
  border-radius:var(--radius);
  border:1px solid var(--border);
}

.tbl{
  width:100%;
  border-collapse:collapse;
  min-width:980px;
}

.tbl th,
.tbl td{
  padding:12px 12px;
  border-bottom:1px solid var(--border);
  font-size:13px;
  white-space:nowrap;
}

.tbl th{
  position:sticky;
  top:0;
  background:var(--surface2);
  color:var(--muted);
  font-weight:900;
  z-index:2;
}

.tbl td{
  color:var(--text);
}

.tbl tr:hover td{
  background:var(--surface2);
}

.tbl td.actions{
  display:flex;
  gap:8px;
}

/* ===== CHIP ===== */

.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--chip);
  color:var(--chipText);
  font-size:12px;
  font-weight:900;
}

.chip.dot:before{
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--muted);
}

.chip.dot.ok:before{ background:var(--success); }
.chip.dot.warn:before{ background:var(--warning); }
.chip.dot.bad:before{ background:var(--danger); }

/* ===== FILTER ===== */

.filters{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.filters .grow{
  flex:1;
  min-width:240px;
}

@media(max-width:768px){
  .filters{
    flex-direction:column;
    align-items:stretch;
  }
  .filters .btnx{
    width:100%;
    height:44px;
  }
}

/* ===== EMPTY STATE ===== */

.empty{
  padding:26px;
  border:1px dashed var(--border);
  border-radius:var(--radius);
  background:var(--surface2);
  color:var(--muted);
  text-align:center;
  font-size:13px;
}

/* ===== MATRIX ===== */

.matrix{
  width:100%;
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:auto;
}

.matrix table{
  width:100%;
  min-width:900px;
  border-collapse:collapse;
}

.matrix th,
.matrix td{
  padding:12px 12px;
  border-bottom:1px solid var(--border);
}

.matrix th{
  background:var(--surface2);
  color:var(--muted);
  font-weight:900;
  text-align:left;
}

.matrix td{
  color:var(--text);
}

/* ===== MODAL ===== */

.modal{
  position:fixed;
  inset:0;
  z-index:4000;
  display:none;
  align-items:center;
  justify-content:center;
}

.modal.show{
  display:flex;
}

.modal .backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.5);
}

.modal .dialog{
  position:relative;
  width:min(720px,calc(100% - 24px));
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}

.modal .m-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 16px;
  background:var(--surface2);
  border-bottom:1px solid var(--border);
}

.modal .m-head .t{
  font-weight:900;
  color:var(--text);
}

.modal .m-body{
  padding:16px;
}

.modal .m-foot{
  padding:14px 16px;
  border-top:1px solid var(--border);
  display:flex;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}

.modal .x{
  width:40px;
  height:40px;
  border-radius:var(--radius);
  border:1px solid var(--border);
  background:var(--surface2);
  color:var(--text);
  cursor:pointer;
}