* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'JetBrains Mono', 'SF Mono', Monaco, 'Courier New', monospace;
    background: #f5f5f5;
    color: #1a1a1a;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    margin-bottom: 16px;
}

h1 {
    font-size: 28px;
    font-weight: 600;
    color: #2196F3;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 14px;
    color: #666666;
}

/* Search Section */
.search-section {
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    padding: 16px 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.search-container {
    position: relative;
    margin-bottom: 8px;
}

#search-input {
    width: 100%;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    padding: 10px 36px 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: #f9f9f9;
    color: #1a1a1a;
    transition: all 0.2s;
}

#search-input:focus {
    outline: none;
    border-color: #0066cc;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

#search-input::placeholder {
    color: #999999;
}

button {
    background: #0066cc;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

button:hover {
    background: #0052a3;
}

button:active {
    transform: translateY(1px);
}

.clear-button {
    position: absolute;
    right: 8px;
    background: transparent !important;
    color: #999999;
    border: none;
    font-size: 24px;
    padding: 4px 8px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.clear-button:hover {
    background: transparent !important;
    color: #666666;
    transform: none;
}

.search-results {
    font-size: 12px;
    color: #666666;
    font-style: italic;
}

/* Search highlight */
.search-highlight {
    background: #ffeb3b;
    padding: 1px 2px;
    border-radius: 2px;
}

/* Controls Section */
.controls-section {
    padding: 0 4px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-count {
    font-size: 13px;
    color: #666666;
}

.button-group {
    display: flex;
    gap: 8px;
}

/* Table Container */
.table-container {
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    padding: 12px;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Category Tree */
.category-tree {
    min-height: 200px;
}

/* Category Rows */
.category-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 13px;
}

.category-row:last-child {
    border-bottom: none;
}

.category-row:hover {
    background: #f8f9fa;
}

.category-row.no-children {
    cursor: default;
}

.category-row.highlight-flash {
    animation: highlightFlash 2s ease-out;
}

@keyframes highlightFlash {
    0% {
        background: #fff3cd;
        box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.3);
    }
    100% {
        background: transparent;
        box-shadow: none;
    }
}

.expand-icon {
    width: 16px;
    color: #0066cc;
    font-size: 12px;
    user-select: none;
    flex-shrink: 0;
}

.expand-icon-spacer {
    width: 16px;
    display: inline-block;
    flex-shrink: 0;
}

.category-code {
    background: #e3f2fd;
    color: #0066cc;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
    font-size: 12px;
    flex-shrink: 0;
}

.category-name {
    flex: 1;
    color: #1a1a1a;
}

/* Loading/Error States */
.loading-state {
    text-align: center;
    padding: 40px;
    color: #666666;
    font-size: 14px;
}

.error-state {
    text-align: center;
    padding: 20px;
    color: #cc0000;
    background: #ffe6e6;
    border: 1px solid #ff4444;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 13px;
}

/* Back Link */
.back-link {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
}

.back-link a {
    color: #0066cc;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.back-link a:hover {
    color: #0052a3;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .container {
        max-width: 100%;
    }

    h1 {
        font-size: 24px;
    }

    .subtitle {
        font-size: 13px;
    }

    .controls-section {
        padding: 12px 16px;
    }

    .category-row {
        font-size: 12px;
        gap: 8px;
    }

    .category-code {
        min-width: 50px;
        font-size: 11px;
    }

    .table-container {
        max-height: 60vh;
    }
}
