* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #f5f7fa;
    color: #222;
}

.top-bar {
    background-color: #111827;
    color: #fff;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-bar__nav a {
    color: #fff;
    margin-left: 1rem;
    text-decoration: none;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    width: 100%;
}

.card {
    background-color: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}


.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    align-items: stretch;
    margin-bottom: 1.5rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.card-grid .card {
    margin-bottom: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-grid .card > form {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-grid .card > form > *:last-child {
    margin-top: auto;
}

.card-grid .card .embed-snippet {
    flex: 1;
    margin-bottom: 1rem;
}

.card-grid .card .button[data-copy] {
    align-self: flex-start;
}

button,
input[type="submit"],
.button {
    background-color: #2563eb;
    color: #fff;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 0.95rem;
    text-align: center;
}

button.secondary,
.button.secondary {
    background-color: #6b7280;
}

.button.danger {
    background-color: #dc2626;
}

.button.ghost {
    background-color: transparent;
    color: #2563eb;
    border: 1px solid #2563eb;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table th,
.table td {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.table th:last-child,
.table td:last-child {
    text-align: right;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert--success {
    background-color: #dcfce7;
    color: #166534;
}

.alert--error {
    background-color: #fee2e2;
    color: #991b1b;
}

.footer {
    text-align: center;
    padding: 1rem;
    color: #6b7280;
}

.embed-snippet {
    font-family: Consolas, Monaco, monospace;
    background-color: #111827;
    color: #f8fafc;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
}

.logo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.logo-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.logo-card__top {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
}

.logo-card__top label {
    flex: 1;
    min-width: 180px;
}

.logo-card__body {
    display: grid;
    grid-template-columns: minmax(160px, 200px) minmax(0, 1fr);
    gap: 1rem;
}

.logo-card__preview {
    text-align: center;
}

.logo-card__preview img {
    max-height: 70px;
    max-width: 160px;
    object-fit: contain;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.5rem;
    background: #f9fafb;
}

.logo-card__filename {
    display: block;
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.35rem;
    word-break: break-all;
}

.logo-card__fields label {
    display: block;
    margin-bottom: 0.75rem;
}

.logo-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.logo-card__footer .button {
    min-width: 120px;
    text-align: center;
}

.logo-card__actions {
    display: flex;
    gap: 0.5rem;
}

.logo-card__hint {
    font-size: 0.85rem;
    color: #64748b;
}

.logo-table img {
    width: 120px;
    height: 70px;
    object-fit: contain;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    padding: 0.35rem;
}

.logo-table__preview {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.logo-table input[type="text"],
.logo-table input[type="number"],
.logo-table input[type="file"] {
    margin-bottom: 0;
}

.logo-table__hint {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.logo-sort-input {
    width: 72px;
    min-width: 72px;
    text-align: center;
    margin-bottom: 0;
}

.logo-card label span,
.logo-create label span {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.4rem;
}

.logo-card input[type="text"],
.logo-card input[type="number"],
.logo-card input[type="file"],
.logo-card textarea,
.logo-card select,
.logo-create input[type="text"],
.logo-create input[type="number"],
.logo-create input[type="file"],
.logo-create textarea,
.logo-create select {
    margin-bottom: 0;
}

.logo-create {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem 1.5rem;
    align-items: end;
}

.logo-create button {
    justify-self: flex-start;
}

.table-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
}

.table-actions .button,
.table-actions button {
    padding: 0.65rem 1rem;
    min-width: 88px;
}

.table td:last-child .table-actions {
    justify-content: flex-end;
    margin-left: auto;
}

.status-pill {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
}

.status-pill--active {
    background-color: #dcfce7;
    color: #166534;
}

.status-pill--inactive {
    background-color: #fee2e2;
    color: #991b1b;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}

.analytics-metric {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.9rem 1rem;
    background: #f8fafc;
}

.analytics-metric__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.analytics-metric__value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
}

.analytics-metric__hint {
    display: block;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 0.35rem;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}


.chart-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.02);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chart-card h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: #0f172a;
}

.chart-card__canvas {
    position: relative;
    height: clamp(220px, 32vw, 360px);
}

.chart-card__canvas canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

@media (max-width: 640px) {
    .logo-card__body {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1280px;
    }

    .card {
        padding: 2rem;
    }

    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem;
    }

    .logo-grid {
        grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
        gap: 2rem;
    }

    .logo-card__body {
        grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
    }
}
