:root{
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: rgba(17, 24, 39, 0.10);
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
  --primary: #2563eb;
  --primary-hover: #1d4ed8;

  --green-bg: rgba(34, 197, 94, 0.12);
  --green: #16a34a;

  --amber-bg: rgba(245, 158, 11, 0.15);
  --amber: #b45309;

  --red-bg: rgba(239, 68, 68, 0.12);
  --red: #dc2626;

  --gray-bg: rgba(107, 114, 128, 0.14);
  --gray: #374151;
}

* { box-sizing: border-box; }
body{
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: var(--bg);
  color: var(--text);
}

.page{
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px;
}

.topbar{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

h1{
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.muted{ color: var(--muted); font-size: 13px; }

.controls{
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.control{
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
}

.control label{
  font-size: 12px;
  color: var(--muted);
}

.control input,
.control select{
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  outline: none;
}

.control input:focus,
.control select:focus{
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.btn{
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

.btn:hover{ box-shadow: 0 8px 20px rgba(17,24,39,.08); }

.btn-primary{
  border-color: transparent;
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover{ background: var(--primary-hover); }

.statebar{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 12px 0 16px;
  box-shadow: 0 8px 24px rgba(17,24,39,.06);
}

.cards{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1020px){
  .cards{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px){
  .cards{ grid-template-columns: 1fr; }
  .control{ min-width: 100%; }
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(17,24,39,.06);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover{
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(17,24,39,.10);
}

.card__top{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.card__srn{
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 14px;
  word-break: break-word;
}

.card__meta{
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metaBox{
  border: 1px dashed rgba(17,24,39,.14);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255,255,255,.7);
}

.metaBox .k{ font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.metaBox .v{ font-weight: 800; font-size: 14px; }

.pill{
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid rgba(17,24,39,.08);
}
.pill--green{ background: var(--green-bg); color: var(--green); }
.pill--amber{ background: var(--amber-bg); color: var(--amber); }
.pill--red{ background: var(--red-bg); color: var(--red); }
.pill--gray{ background: var(--gray-bg); color: var(--gray); }

.empty{
  margin-top: 18px;
  display: flex;
  justify-content: center;
}
.empty__box{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  width: min(520px, 100%);
  box-shadow: 0 10px 24px rgba(17,24,39,.06);
  text-align: center;
}
.empty__title{ font-weight: 900; }
.empty__desc{ margin-top: 8px; color: var(--muted); font-size: 13px; }

.hidden{ display: none !important; }

/* Modal */
.modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,.45);
  z-index: 50;
}

.modal{
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(1150px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  z-index: 60;
}

.modal__header{
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.modal__title{ font-weight: 900; letter-spacing: -0.02em; }
.modal__subtitle{ margin-top: 4px; color: var(--muted); font-size: 12px; }

.icon-btn{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-weight: 900;
}

.modal__content{ padding: 14px 16px 6px; }

.modal__meta{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.table-wrap{
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.table{
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table thead th{
  background: rgba(17,24,39,.03);
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table tbody td{
  padding: 10px 10px;
  border-bottom: 1px solid rgba(17,24,39,.06);
  vertical-align: top;
}

.modal__footer{
  padding: 12px 16px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.srf-input{
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  min-width: 280px;
}
