
body {
    margin: 0;
    padding: 0;
    background: #f3f4f6;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.page {
    max-width: 1100px;
    margin: 32px auto 40px;
    padding: 0 16px;
    box-sizing: border-box;
}
header { margin-bottom: 18px; }
h1 { margin: 0 0 4px 0; font-size: 24px; }
.sub { margin: 0; font-size: 13px; color: #6b7280; }

.layout {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 16px;
    align-items: flex-start;
}
.card {
    background: #ffffff;
    border-radius: 14px;
    padding: 14px 16px 16px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
    box-sizing: border-box;
}
.card h2 { margin: 0 0 10px 0; font-size: 16px; }
.card h3 { margin: 0 0 8px 0; font-size: 14px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
    padding: 6px 4px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}
th { text-align: left; font-weight: 600; background: #f9fafb; }

input[type="text"], select {
    font-size: 13px;
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    box-sizing: border-box;
}

.input-emoji { width: 52px; text-align: center; }
.input-name  { width: 100%; }

.btn {
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}
.btn-primary { background: #111827; color: #f9fafb; }
.btn-primary:hover { background: #000; }
.btn-secondary { background: #e5e7eb; color: #111827; }
.btn-secondary:hover { background: #d1d5db; }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-danger:hover { background: #fecaca; }

.row-inline-form { display: flex; align-items: center; gap: 6px; }
.muted { font-size: 11px; color: #9ca3af; }
.pill-current {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #111827;
    color: #f9fafb;
    font-size: 11px;
    margin-left: 6px;
}
.category-list { max-height: 420px; overflow-y: auto; margin-top: 8px; }

/* --- Sub row toggle UX --- */
tr.js-sub-row { cursor: pointer; }
tr.js-sub-row:hover td { background: #f9fafb; }
tr.js-sub-row.is-open td { background: #eef2ff; }

.sub-row-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.chev {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f3f4f6;
    font-size: 12px;
    color: #111827;
    flex: 0 0 auto;
}
tr.js-sub-row.is-open .chev { background: #111827; color: #fff; }

.panel {
    padding: 10px 10px 12px;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin: 8px 0;
}
.panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.panel-title .t {
    font-weight: 600;
    font-size: 12px;
    color: #111827;
}
.panel table th { background: #fff; }
.panel .muted { margin: 6px 0 0; }