* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f5f5f5; padding: 20px; }
header { background: #2c3e50; color: white; padding: 20px; border-radius: 8px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; gap: 30px; }
.header-left { cursor: pointer; transition: opacity 0.2s; flex-shrink: 0; }
.header-left:hover { opacity: 0.9; }
h1 { font-size: 24px; margin: 0; }
.header-search { flex: 1; max-width: 500px; }
.breadcrumb { background: white; padding: 12px 20px; border-radius: 8px; margin-bottom: 15px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); font-size: 14px; color: #7f8c8d; }
.breadcrumb a { color: #3498db; text-decoration: none; cursor: pointer; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .separator { margin: 0 8px; color: #bdc3c7; }
.breadcrumb .current { color: #2c3e50; font-weight: 600; }
.search-container { position: relative; }
.search-container input { width: 100%; padding: 10px 15px; border: 2px solid rgba(255,255,255,0.3); border-radius: 4px; font-size: 14px; transition: all 0.2s; background: rgba(255,255,255,0.1); color: white; }
.search-container input::placeholder { color: rgba(255,255,255,0.7); }
.search-container input:focus { outline: none; border-color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.15); }
.unified-autocomplete { position: absolute; border: 1px solid #d4d4d4; border-top: none; z-index: 99; top: 100%; left: 0; right: 0; max-height: 400px; overflow-y: auto; background: white; box-shadow: 0 4px 6px rgba(0,0,0,0.1); margin-top: 2px; border-radius: 0 0 4px 4px; }
.autocomplete-group { padding: 8px 12px; background: #f8f9fa; font-weight: 600; font-size: 12px; color: #7f8c8d; text-transform: uppercase; border-bottom: 1px solid #e0e0e0; }
.autocomplete-item .item-type { display: inline-block; padding: 2px 6px; background: #3498db; color: white; font-size: 10px; border-radius: 3px; margin-right: 8px; font-weight: 600; }
.autocomplete-item .item-type.agency { background: #27ae60; }
.autocomplete-item .item-type.title { background: #e67e22; }
.loading { text-align: center; padding: 40px; color: #666; }
.error { background: #e74c3c; color: white; padding: 15px; border-radius: 8px; margin-bottom: 20px; }
.analytics { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 20px; }
.stat { background: #ecf0f1; padding: 15px; border-radius: 6px; }
.stat-label { font-size: 12px; color: #7f8c8d; text-transform: uppercase; margin-bottom: 5px; }
.stat-value { font-size: 28px; font-weight: bold; color: #2c3e50; }
.parts { margin-top: 20px; }
.part { background: #f8f9fa; padding: 15px; border-radius: 6px; margin-bottom: 10px; border-left: 4px solid #3498db; }
.part-header { font-weight: 600; margin-bottom: 8px; }
.part-stats { display: flex; gap: 20px; font-size: 14px; color: #666; }
.autocomplete-item { padding: 10px; cursor: pointer; border-bottom: 1px solid #e0e0e0; }
.autocomplete-item:hover { background-color: #f0f0f0; }
.autocomplete-item strong { color: #3498db; }
.autocomplete-item .agency-slug { font-size: 12px; color: #7f8c8d; margin-top: 4px; }
.agency-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.agency-table th { background: #34495e; color: white; padding: 12px; text-align: left; cursor: pointer; user-select: none; }
.agency-table th:hover { background: #2c3e50; }
.agency-table th.sortable::after { content: ' ⇅'; opacity: 0.5; }
.agency-table th.sorted-asc::after { content: ' ↑'; opacity: 1; }
.agency-table th.sorted-desc::after { content: ' ↓'; opacity: 1; }
.agency-table td { padding: 10px; border-bottom: 1px solid #ecf0f1; }
.agency-table tr:hover { background: #f8f9fa; }
.agency-name { font-weight: 600; color: #2c3e50; }
.agency-short { color: #7f8c8d; font-size: 14px; margin-left: 8px; }
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; padding: 15px; background: #f8f9fa; border-radius: 6px; }
.pagination-info { color: #7f8c8d; font-size: 14px; }
.pagination-controls { display: flex; gap: 10px; align-items: center; }
.pagination-controls button { padding: 8px 12px; background: #3498db; color: white; border: none; border-radius: 4px; cursor: pointer; }
.pagination-controls button:hover { background: #2980b9; }
.pagination-controls button:disabled { background: #bdc3c7; cursor: not-allowed; }
.pagination-controls .page-btn { min-width: 36px; background: #ecf0f1; color: #2c3e50; }
.pagination-controls .page-btn.active { background: #3498db; color: white; }
.pagination-controls .page-btn:hover:not(:disabled) { background: #bdc3c7; }
.pagination-controls .page-btn.active:hover { background: #2980b9; }
.pagination-controls select { padding: 8px; border: 1px solid #ddd; border-radius: 4px; }
.help-icon { display: inline-block; margin-left: 15px; cursor: pointer; width: 24px; height: 24px; background: rgba(255,255,255,0.2); border: 2px solid white; border-radius: 50%; text-align: center; line-height: 20px; font-weight: bold; font-size: 14px; transition: all 0.2s; }
.help-icon:hover { background: rgba(255,255,255,0.3); transform: scale(1.1); }
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); overflow: auto; }
.modal-content { background: white; margin: 3% auto; padding: 30px; border-radius: 8px; max-width: 800px; max-height: 90vh; box-shadow: 0 4px 20px rgba(0,0,0,0.3); overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; position: sticky; top: 0; background: white; z-index: 1; padding-bottom: 10px; border-bottom: 2px solid #ecf0f1; }
.modal-header h2 { margin: 0; color: #2c3e50; }
.close { color: #aaa; font-size: 28px; font-weight: bold; cursor: pointer; line-height: 20px; }
.close:hover { color: #000; }
.modal-body h3 { color: #3498db; margin-top: 20px; margin-bottom: 10px; font-size: 16px; }
.modal-body p { margin-bottom: 10px; line-height: 1.6; color: #555; }
.modal-body ul { margin-left: 20px; margin-bottom: 15px; }
.modal-body li { margin-bottom: 8px; line-height: 1.6; color: #555; }
