@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');
:root {
    --bg: #f6f7fb;
    --panel: #ffffff;
    --border: #e5e7eb;
    --text: #0f172a;
    --muted: #6b7280;
    --accent: #111827;
    --radius: 14px;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { color: var(--accent); text-decoration: none; }

.auth {
    display: grid;
    place-items: center;
    min-height: 100vh;
}
.auth-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    width: min(400px, 90vw);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}
.auth-card h1 { margin-top: 0; margin-bottom: 12px; }
.auth-card form { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
}
textarea { resize: vertical; }
button {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-weight: 600;
    cursor: pointer;
}
.alert {
    background: #fef2f2;
    color: #b91c1c;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #fecaca;
    margin-bottom: 10px;
}
.alert.success {
    background: #ecfdf3;
    color: #15803d;
    border-color: #bbf7d0;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}
.admin-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
    padding: 16px;
}
.right-col {
    display: grid;
    gap: 16px;
}
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
}
.card.wide { grid-column: span 2; }
.card.full { grid-column: span 2; }
.stack { display: grid; gap: 10px; margin-bottom: 14px; }
.list { display: grid; gap: 8px; }
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
}
.danger { background: #b91c1c; }
.muted { color: var(--muted); }
.link { font-weight: 600; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.grid-2 .full { grid-column: span 2; }
.image-sort {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.image-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    background: #f9fafb;
    display: grid;
    gap: 6px;
}
.image-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}
.image-actions {
    display: flex;
    gap: 6px;
}
.ghost {
    background: #f3f4f6;
    color: #111;
    border: 1px solid var(--border);
}

.table {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.table-head, .table-row {
    display: grid;
    grid-template-columns: 80px 1fr 1fr 120px 120px 160px;
    padding: 10px 12px;
    align-items: center;
}
.table-head { background: #f9fafb; font-weight: 600; }
.table-row:nth-child(every 2) { background: #fff; }
.actions { display: flex; gap: 10px; align-items: center; }

@media (max-width: 980px) {
    .admin-grid { grid-template-columns: 1fr; }
    .card.wide, .card.full { grid-column: span 1; }
    .table-head, .table-row { grid-template-columns: 60px 1fr 1fr 80px 80px 140px; }
}
@media (max-width: 720px) {
    .table-head, .table-row { grid-template-columns: 1fr; gap: 6px; }
    .actions { justify-content: flex-start; }
}
