* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: #f3f4f6; color: #1f2937; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: #18181b; }
.login-card { width: 100%; max-width: 390px; background: #fff; padding: 30px; border-radius: 10px; display: grid; gap: 14px; }
.login-card p { color: #6b7280; font-size: .92rem; }
.back-link { text-align: center; font-size: .88rem; color: #4b5563; margin-top: 6px; }

.admin-body { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: #18181b; color: #e5e7eb; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-brand { padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; }
.sidebar-brand small { color: #9ca3af; font-size: .78rem; }
.sidebar-nav { display: flex; flex-direction: column; padding: 12px; gap: 4px; flex: 1; }
.sidebar-nav a { padding: 10px 14px; border-radius: 6px; font-size: .92rem; display: flex; justify-content: space-between; align-items: center; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: #27272a; color: #fff; }
.badge { background: #d97706; color: #fff; font-size: .75rem; padding: 2px 7px; border-radius: 999px; }
.sidebar-footer { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; font-size: .88rem; }
.danger-link { color: #fca5a5; }

.main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { background: #fff; border-bottom: 1px solid #e5e7eb; padding: 14px 24px; display: flex; align-items: center; gap: 14px; }
.topbar h1 { font-size: 1.2rem; flex: 1; }
.admin-user { font-size: .88rem; color: #6b7280; }
.menu-btn { display: none; background: none; border: 1px solid #d1d5db; border-radius: 6px; padding: 4px 10px; font-size: 1.1rem; cursor: pointer; }

.content { padding: 24px; display: grid; gap: 22px; }
.panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 22px; }
.panel h2 { font-size: 1.08rem; margin-bottom: 14px; }
.form-grid { display: grid; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.two-col { display: grid; grid-template-columns: 1fr 1.3fr; gap: 22px; align-items: start; }

label { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; font-weight: 500; }
.checkbox-inline { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], input[type="date"], select, textarea {
    width: 100%; padding: 9px 11px; border: 1px solid #d1d5db; border-radius: 6px; font: inherit; background: #fff;
}
input[type="color"] { height: 42px; padding: 3px; border: 1px solid #d1d5db; border-radius: 6px; width: 100%; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 18px; border-radius: 6px; border: none; font-weight: 600; cursor: pointer; }
.btn-primary { background: #18181b; color: #fff; }
.btn-secondary { background: #e5e7eb; color: #1f2937; }
.btn-full { width: 100%; }
.btn-row { display: flex; gap: 10px; }
.btn-sm { padding: 5px 10px; font-size: .8rem; border-radius: 5px; border: 1px solid #d1d5db; background: #fff; cursor: pointer; }
.btn-sm.danger { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.stat-card span { font-size: .84rem; color: #6b7280; }
.stat-card strong { font-size: 1.6rem; }
.stat-card a { font-size: .82rem; color: #2563eb; margin-top: 4px; }

.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 10px 12px; border-bottom: 1px solid #e5e7eb; text-align: left; vertical-align: top; }
th { background: #f9fafb; font-weight: 600; }

.thumb-preview { margin-top: 10px; max-height: 120px; border-radius: 6px; border: 1px solid #e5e7eb; }
.admin-photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.admin-photo-card { border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; background: #fafafa; }
.admin-photo-card.is-hidden { opacity: .55; }
.admin-photo-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.admin-photo-body { padding: 10px; display: grid; gap: 6px; }
.photo-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-gold { background: #fef3c7; color: #92400e; font-size: .74rem; padding: 2px 7px; border-radius: 999px; }
.tag-neutral { background: #e5e7eb; color: #374151; font-size: .74rem; padding: 2px 7px; border-radius: 999px; }

.msg-card { border: 1px solid #e5e7eb; border-radius: 8px; padding: 14px; margin-bottom: 12px; display: grid; gap: 8px; }
.msg-unread { border-left: 4px solid #d97706; background: #fffbeb; }
.msg-head { display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.msg-meta { font-size: .86rem; color: #4b5563; }
.dep-item { padding: 12px 0; border-bottom: 1px solid #e5e7eb; display: grid; gap: 6px; }

.alert { padding: 12px 16px; border-radius: 6px; font-size: .9rem; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }

@media (max-width: 960px) {
    .stats-grid, .admin-photo-grid, .two-col { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
    .menu-btn { display: inline-flex; }
    .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 80; transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .stats-grid, .admin-photo-grid, .two-col, .grid-2, .grid-3 { grid-template-columns: 1fr; }
}