* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #222;
    line-height: 1.5;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem;
}

.header {
    background: #1a1a2e;
    color: #fff;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header a {
    color: #fff;
    text-decoration: none;
    margin-left: 1rem;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    margin-left: 0 !important;
}

h1 {
    margin-top: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
}

.stat-label {
    font-size: 0.875rem;
    color: #666;
}

.action-list {
    list-style: none;
    padding: 0;
}

.action-list li {
    margin-bottom: 0.5rem;
}

.action-list a {
    display: block;
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: #1a1a2e;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.action-list a:hover {
    background: #eef;
}

.product-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.upload-form,
.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin: 1rem 0;
}

input[type="text"],
input[type="file"] {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

button {
    padding: 0.5rem 1rem;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background: #2d2d44;
}

.btn-secondary {
    background: #666;
}

.btn-danger {
    background: #c0392b;
}

.message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.message.success {
    background: #d4edda;
    color: #155724;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
}

.thumb {
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
}

.no-photo {
    width: 120px;
    height: 120px;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.875rem;
}

.search-results .product-card {
    display: flex;
    gap: 1rem;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.catalog-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.catalog-item img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #fafafa;
}

.catalog-item-body {
    padding: 1rem;
}

.catalog-item h2 {
    font-size: 1rem;
    margin: 0 0 0.5rem;
}

.price {
    font-weight: 700;
    color: #1a1a2e;
}

.pagination {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 2rem;
}

.pagination a {
    color: #1a1a2e;
}

.catalog-meta {
    color: #666;
    font-size: 0.875rem;
}

.catalog-downloads {
    background: #fff;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.catalog-downloads h2 {
    font-size: 1rem;
    margin: 0 0 0.75rem;
}

.catalog-downloads ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.catalog-downloads li {
    margin-bottom: 0.5rem;
}

.catalog-downloads li:last-child {
    margin-bottom: 0;
}

.catalog-downloads a {
    color: #1a1a2e;
    font-weight: 600;
}

.catalog-download-date {
    color: #666;
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.filter-tab {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #ddd;
    color: #1a1a2e;
    text-decoration: none;
    font-size: 0.875rem;
}

.filter-tab.active {
    background: #1a1a2e;
    border-color: #1a1a2e;
    color: #fff;
}

.stat-link {
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s ease;
}

.stat-link:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.catalog-item .no-photo {
    width: 100%;
    height: 200px;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.875rem;
}

.import-log-block {
    margin-bottom: 1.5rem;
}

.import-log-block h2 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.import-log {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    max-height: 420px;
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}
