:root {
  --ink: #343333;
  --muted: #767270;
  --paper: #f7f6f4;
  --surface: #ffffff;
  --line: #dedbd8;
  --line-soft: #efedeb;
  --teal: #007f79;
  --teal-dark: #005650;
  --teal-soft: #d8f7f4;
  --rose: #ffb6b9;
  --blue: #006fbe;
  --blue-soft: #e0f3ff;
  --yellow: #ffd400;
  --shadow: 0 3px 10px rgba(35, 32, 31, .22);
  font-family: "Work Sans", Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 1024px; background: var(--paper); font-size: 16px; letter-spacing: .15px; }
button, input, select { font: inherit; }
button, a, input, select { outline-color: #00a4a0; outline-offset: 2px; }
button { cursor: pointer; font-weight: 600; }

.topbar { position: fixed; z-index: 50; top: 0; left: 0; right: 0; height: 70px; background: #292929; color: white; display: flex; align-items: center; justify-content: space-between; padding: 0 32px 0 23px; }
.brand { display: flex; align-items: center; width: 110px; height: 48px; }
.brand-logo { width: 110px; height: 48px; object-fit: contain; }
.account { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.avatar { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--yellow); }
.account-icon, .top-chevron { display: block; width: 20px; height: 20px; }

.shell { display: grid; grid-template-columns: 64px 1fr; min-height: calc(100vh - 70px); margin-top: 70px; }
.sidenav { position: fixed; z-index: 40; top: 70px; bottom: 0; left: 0; width: 64px; height: calc(100vh - 70px); background: white; border-right: 1px solid #eee; display: flex; flex-direction: column; align-items: center; padding-top: 18px; gap: 5px; }
.nav-icon { width: 40px; height: 40px; display: grid; place-items: center; background: transparent; border: 0; border-bottom: 1px solid transparent; }
.nav-icon img { display: block; width: 20px; height: 20px; }
.nav-icon img.nav-icon-24 { width: 24px; height: 24px; }
.nav-divider { width: 40px; border-top: 1px solid var(--line); margin: 1px 0; }
.nav-spacer { flex: 1; }
.main { grid-column: 2; padding: 32px; min-width: 0; }
.breadcrumbs { display: flex; align-items: center; gap: 16px; font-size: 13px; margin-bottom: 28px; }
.link-button { border: 0; background: none; padding: 0; color: var(--teal); text-decoration: underline; }
.district-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.district-title { display: flex; align-items: center; gap: 8px; }
.district-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--rose); display: grid; place-items: center; margin-right: 0; }
.district-icon img { width: 32px; height: 32px; display: block; }
h1 { font-size: 28px; line-height: 40px; margin: 0; letter-spacing: .1px; font-weight: 600; }
.district-subtitle { color: var(--muted); margin-top: 1px; font-size: 14px; letter-spacing: .7px; }
.tag { display: inline-flex; align-items: center; justify-content: center; background: var(--teal); color: #fff; height: 27px; min-width: 54px; padding: 0 10px; border-radius: 14px; font-size: 12px; }
.status-tag { margin-left: 4px; font-size: 14px; height: 32px; border-radius: 18px; }
.btn { height: 40px; border-radius: 8px; padding: 0 16px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 9px; white-space: nowrap; }
.btn:hover { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.btn-primary { color: #fff; background: var(--teal); border-color: var(--teal); }
.btn-primary:hover { background: var(--teal-dark); }
.btn-outline { color: var(--teal); border-color: var(--teal); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }
.config-btn { min-width: 179px; color: var(--teal); border-color: var(--teal); font-size: 16px; }
.config-icon { width: 24px; height: 24px; }
.breadcrumb-icon { width: 20px; height: 20px; }

.tabs { height: 45px; display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tab { height: 44px; padding: 0 17px; border: 0; background: transparent; color: #6f6b69; font-weight: 500; }
.tab.active { color: var(--teal); border-bottom: 4px solid var(--teal); font-weight: 600; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.toolbar-left { display: flex; gap: 16px; }
.filter-select { appearance: none; -webkit-appearance: none; height: 40px; border: 1px solid #707070; border-radius: 8px; padding: 0 40px 0 8px; background: #fff right 8px center / 24px 24px no-repeat url("./assets/figma/arrow-drop-down.svg"); color: #78726d; font-size: 16px; font-weight: 400; line-height: 24px; letter-spacing: 0; }
.filter-select-association { width: 177px; }
.filter-select-level { width: 89px; }
.search-wrap { position: relative; width: 300px; }
.search-wrap input { width: 100%; height: 41px; border: 1px solid #777; border-radius: 8px; padding: 0 46px 0 8px; background: white; }
.search-wrap::after { content: ""; position: absolute; right: 8px; top: 8px; width: 24px; height: 24px; background: center / 24px 24px no-repeat url("./assets/figma/search.svg"); pointer-events: none; }
.button-chevron { width: 20px; height: 20px; display: block; margin-left: 3px; }
select { height: 40px; border: 1px solid #777; border-radius: 8px; background: white; padding: 0 36px 0 8px; color: var(--muted); }

.detail-title { display: flex; align-items: center; gap: 8px; margin: 0 0 15px; font-size: 20px; line-height: 40px; }
.detail-title strong { font-size: 20px; }
.back-btn { width: 44px; height: 40px; border: 1px solid var(--line); background: white; border-radius: 8px; display: grid; place-items: center; margin-right: 0; padding: 8px 10px; }
.back-btn img { width: 24px; height: 24px; display: block; }

.table-card { background: white; border-radius: 8px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { background: var(--teal-dark); color: white; height: 48px; padding: 0 12px; text-align: left; font-weight: 600; border-right: 1px solid #d9ecea; }
th:last-child { border-right: 0; }
td { min-height: 68px; height: 68px; padding: 10px 11px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); vertical-align: middle; line-height: 24px; overflow: hidden; text-overflow: ellipsis; }
tr:last-child td { border-bottom: 0; }
.sort { float: right; font-size: 0; width: 20px; height: 20px; background: center / 20px 20px no-repeat url("./assets/figma/sort.svg"); }
.product-name { color: var(--teal); font-weight: 600; }
.row-trigger { border: 0; background: none; color: var(--teal); font-weight: 600; font-size: 16px; padding: 0; }
.row-chevron-icon { display: inline-block; width: 20px; height: 20px; margin-right: 12px; vertical-align: middle; transition: transform .15s; }
.row-chevron-icon.open { transform: rotate(180deg); }
.round-action { width: 24px; height: 24px; border: 0; background: transparent; display: grid; place-items: center; float: right; padding: 0; }
.round-action img { width: 24px; height: 24px; display: block; }
.association-toggle { display: inline-flex; align-items: center; }
.action-buttons { display: flex; gap: 15px; align-items: center; }
.icon-action { width: 24px; height: 24px; border: 0; background: transparent; padding: 0; }
.icon-action img { display: block; width: 24px; height: 24px; }
.check { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; margin: 0; border: 0; background: transparent; display: inline-grid; place-items: center; position: relative; vertical-align: middle; cursor: pointer; }
.check::before { content: ""; width: 18px; height: 18px; box-sizing: border-box; border: 2px solid #2d2d2d; border-radius: 2px; background: #fff; }
.check:checked::before { background: var(--teal); border-color: var(--teal); }
.check:checked::after { content: ""; position: absolute; width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }
th .check::before { border-color: #fff; background: transparent; }
th .check:checked::before { border-color: #fff; background: #fff; }
th .check:checked::after { border-color: var(--teal); }
.child-wrap { padding: 12px !important; background: #f7f5f2; border: 1px solid #fff; height: auto !important; }
.child-table { border: 0; border-radius: 8px; overflow: hidden; }
.child-table td { height: 68px; }
.child-table tbody tr, .child-table tbody td { background: #fff; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.pagination-row { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; }
.entries { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.entries select { width: 65px; }
.pagination { display: flex; }
.page { width: 39px; height: 40px; background: white; color: var(--teal); border: 1px solid #00aaa5; border-right: 0; }
.page:first-child { border-radius: 8px 0 0 8px; }
.page:last-child { border-radius: 0 8px 8px 0; border-right: 1px solid #00aaa5; }
.page.active { background: var(--teal); color: white; }

.bulkbar { position: fixed; z-index: 20; bottom: 0; left: 64px; right: 0; height: 60px; background: var(--teal-dark); color: white; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; font-weight: 700; }
.bulk-actions { display: flex; align-items: center; gap: 16px; }
.bulkbar .btn { color: #064b47; border: 0; background: #c9f5f1; }
.bulkbar .deselect { border: 0; background: none; color: white; font-size: 12px; letter-spacing: .3px; font-weight: 600; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(27, 27, 27, .48); display: grid; place-items: center; padding: 24px; }
.modal { width: 600px; border-radius: 8px; background: white; box-shadow: var(--shadow); overflow: hidden; }
.modal-head { height: 88px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 20px; margin: 0; }
.modal-close { width: 40px; height: 40px; border: 0; background: none; padding: 8px; }
.modal-close img { width: 24px; height: 24px; display: block; }
.modal-body { padding: 24px; line-height: 21px; }
.modal-body p { margin: 0 0 24px; }
.modal-body ul { margin: 0 0 24px; padding-left: 22px; }
.field { display: block; margin-top: 20px; }
.field span { display: block; font-size: 14px; margin-bottom: 9px; }
.field input, .field select { width: 100%; height: 41px; border: 1px solid #777; border-radius: 8px; padding: 0 8px; background: white; }
.field select:disabled { background: #f2f1f0; color: #aaa; border-color: #d7d4d1; }
.modal-actions { height: 88px; padding: 0 24px; background: #f7f6f4; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.notice { min-height: 72px; display: flex; align-items: center; gap: 12px; padding: 12px; margin-top: 20px; border: 1px solid #0085d3; background: var(--blue-soft); color: #0070c5; border-radius: 8px; line-height: 24px; }
.info-icon { min-width: 20px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #0678c8; color: white; font-weight: 700; font-size: 13px; }

.toast { position: fixed; z-index: 200; top: 86px; right: 24px; background: #fff; border-left: 5px solid var(--teal); border-radius: 6px; box-shadow: var(--shadow); padding: 16px 20px; font-weight: 700; animation: slide-in .2s ease-out; }
@keyframes slide-in { from { transform: translateX(25px); opacity: 0; } }

.empty { padding: 48px; text-align: center; color: var(--muted); }
@media (max-width: 1100px) { .main { padding: 24px; } th, td { padding-left: 8px; padding-right: 8px; } }
