* { box-sizing: border-box; }
body { font-family: "Segoe UI", Arial, sans-serif; margin: 0; background: #f2f4f7; color: #1c2733; }
header.app { background: #123255; color: #fff; padding: 10px 18px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
header.app h1 { font-size: 18px; margin: 0; }
header.app a { color: #cfe3ff; text-decoration: none; font-weight: 600; }
header.app a:hover { color: #fff; }
.wrap { max-width: 1150px; margin: 16px auto; padding: 0 12px; }
.card { background: #fff; border: 1px solid #dce1e8; border-radius: 8px; padding: 14px 16px; margin-bottom: 16px; }
h2 { font-size: 15px; margin: 0 0 8px; }
table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th, table.list td { border-bottom: 1px solid #e6e9ee; padding: 6px 8px; text-align: left; vertical-align: top; }
table.list th { background: #f6f8fa; }
.btn { background: #1f6feb; color: #fff; border: 0; border-radius: 6px; padding: 8px 14px; font-weight: 600; cursor: pointer; }
.btn.gray { background: #57606a; } .btn.green { background: #1a7f37; } .btn.red { background: #cf222e; }
input[type=text], input[type=number], input[type=password], input[type=file], textarea, select { padding: 7px 9px; border: 1px solid #c9d1d9; border-radius: 6px; font: inherit; background: #fff; }
input[type=text], input[type=number], input[type=password] { width: 100%; }
textarea { width: 100%; min-height: 84px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label.f { display: block; font-size: 12px; font-weight: 700; color: #57606a; margin: 8px 0 4px; }
label.opt { display: block; margin: 5px 0; font-size: 14px; }
.flash { background: #e6ffec; border: 1px solid #9be3ae; padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; }
.actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.searchrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.searchrow input[type=text] { max-width: 420px; }
.upload { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: #6e7781; font-size: 12px; }
.danger { color: #cf222e; }
.row-actions a { margin-right: 8px; text-decoration: none; }
.badge { background: #e7f0ff; color: #1f6feb; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; }
.chk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px 12px; }
.chk-grid label.opt { margin: 2px 0; font-size: 13px; }
.item-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.item-tools input[type=text] { max-width: 360px; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
#itemsTable tbody tr, #itemTable tbody tr { cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; vertical-align: middle; }
/* Sortable column headers */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable::after { content: "↕"; opacity: .35; margin-left: 5px; font-size: 11px; }
th.sortable:hover { background: #eef2f7; }
th.sort-asc::after  { content: "▲"; opacity: 1; }
th.sort-desc::after { content: "▼"; opacity: 1; }
@media (max-width: 760px) {
  .grid2 { grid-template-columns: 1fr; }
  .chk-grid { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 10px 12px; }
  .btn { padding: 10px 14px; font-size: 14px; }
  input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; }
  .actions { gap: 8px; }
  .item-tools { gap: 8px; }
}