/* ── Admin layout ────────────────────────────────────────────────────────── */
.admin-layout {
    display: flex;
    min-height: calc(100vh - var(--nav-h));
}

.admin-sidebar {
    width: 200px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 0;
}

.admin-sidebar a {
    display: block;
    padding: 10px 20px;
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: color 0.15s, background 0.15s;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
    color: var(--text);
    background: var(--surface2);
}

.admin-content {
    flex: 1;
    padding: 28px 32px;
    min-width: 0;
}

.admin-content h1 {
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: 24px;
}

/* ── Table ───────────────────────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    text-align: left;
    padding: 8px 12px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface2); }

/* ── Badge ───────────────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-green  { background: rgba(39,174,96,0.2);  color: #27ae60; }
.badge-red    { background: rgba(192,57,43,0.2);  color: #e74c3c; }
.badge-yellow { background: rgba(241,196,15,0.2); color: #f1c40f; }
.badge-grey   { background: var(--surface2);       color: var(--text-muted); }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 20px;
    justify-content: center;
}
.pagination button {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.15s;
}
.pagination button:hover { border-color: var(--text-muted); color: var(--text); }
.pagination button.active { border-color: var(--accent); color: var(--accent); }
.pagination button:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal h2 { font-size: 1.125rem; margin-bottom: 20px; }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

/* ── Stats grid ──────────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; color: var(--accent); }
.stat-card .stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* ── Admin photo grid ────────────────────────────────────────────────────── */
.admin-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.admin-photo-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.admin-photo-card img {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
}

.admin-photo-card .photo-meta {
    padding: 8px;
    font-size: 0.75rem;
}

.admin-photo-card .photo-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.admin-photo-card .photo-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.unpublished-overlay {
    position: absolute;
    top: 6px;
    left: 6px;
}

/* ── Thumbnail ───────────────────────────────────────────────────────────── */
.thumb-sm {
    width: 48px;
    height: 32px;
    object-fit: cover;
    border-radius: 3px;
    background: var(--surface2);
}

/* ── Loading spinner ─────────────────────────────────────────────────────── */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
