* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0a0a;
    color: #fff;
    min-height: 100vh;
    line-height: 1.6;
}

/* ── Layout ─────────────────────────────────────────────── */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.admin-nav {
    width: 220px;
    background: #0d0d0d;
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.admin-logo {
    padding: 28px 24px 24px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.admin-logo span {
    color: #ff7300;
}

.admin-nav ul {
    list-style: none;
    padding: 16px 0;
    flex: 1;
}

.admin-nav ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.admin-nav ul li a:hover {
    color: #fff;
    background: rgba(255,255,255,0.04);
    border-left-color: rgba(255,115,0,0.4);
}

.admin-nav ul li a.active {
    color: #ff7300;
    background: rgba(255,115,0,0.08);
    border-left-color: #ff7300;
    font-weight: 600;
}

.admin-nav-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-nav-footer a {
    color: rgba(255,255,255,0.3);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.admin-nav-footer a:hover {
    color: rgba(255,255,255,0.7);
}

/* ── Main Content ────────────────────────────────────────── */
.admin-content {
    margin-left: 220px;
    padding: 40px 48px;
    flex: 1;
    min-height: 100vh;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 36px;
}

.admin-topbar h2 {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    line-height: 1;
    margin-bottom: 4px;
}

.admin-subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.35);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-orange {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 24px;
    background: #ff7300;
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: all 0.2s ease;
}

.btn-orange:hover {
    background: #ff8c1a;
    transform: translateY(-1px);
}

.btn-orange:disabled {
    background: rgba(255,115,0,0.3);
    color: rgba(0,0,0,0.5);
    cursor: not-allowed;
    transform: none;
}

.btn-ghost-sm {
    padding: 9px 18px;
    background: transparent;
    color: rgba(255,255,255,0.6);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-ghost-sm:hover {
    border-color: rgba(255,255,255,0.3);
    color: #fff;
}

.btn-danger-sm {
    padding: 9px 18px;
    background: rgba(255,60,60,0.15);
    color: #ff4444;
    border: 1px solid rgba(255,60,60,0.3);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-danger-sm:hover {
    background: rgba(255,60,60,0.25);
}

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    background: rgba(74,222,128,0.1);
    color: #4ade80;
    border: 1px solid rgba(74,222,128,0.25);
}

.alert-error {
    background: rgba(255,68,68,0.1);
    color: #ff4444;
    border: 1px solid rgba(255,68,68,0.25);
}

/* ── Dashboard Stats ─────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.stat-card {
    background: #111;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: border-color 0.2s;
}

.stat-card:hover {
    border-color: rgba(255,115,0,0.3);
}

.stat-icon {
    font-size: 28px;
}

.stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.35);
    margin-bottom: 4px;
}

.stat-number {
    font-size: 28px;
    font-weight: 900;
    color: #ff7300;
    letter-spacing: -1px;
    line-height: 1;
}

/* ── Dashboard Sections ──────────────────────────────────── */
.dash-section {
    margin-bottom: 40px;
}

.dash-section-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.35);
    margin-bottom: 16px;
}

.category-overview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cat-overview-card {
    background: #111;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.cat-overview-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.cat-overview-count {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
}

.recent-photos {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.recent-photo {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}

.recent-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-photo span {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: rgba(255,255,255,0.8);
    font-size: 10px;
    padding: 12px 6px 5px;
    text-align: center;
}

/* ── Toolbar ─────────────────────────────────────────────── */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    background: transparent;
    color: rgba(255,255,255,0.5);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}

.filter-btn.active {
    background: rgba(255,115,0,0.12);
    border-color: rgba(255,115,0,0.4);
    color: #ff7300;
    font-weight: 700;
}

.filter-count {
    background: rgba(255,255,255,0.08);
    border-radius: 50px;
    padding: 1px 7px;
    font-size: 11px;
}

.filter-btn.active .filter-count {
    background: rgba(255,115,0,0.2);
    color: #ff7300;
}

.bulk-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,115,0,0.08);
    border: 1px solid rgba(255,115,0,0.2);
    border-radius: 8px;
    padding: 8px 16px;
}

.selected-count {
    font-size: 13px;
    font-weight: 600;
    color: #ff7300;
    white-space: nowrap;
}

/* ── Photo Grid ──────────────────────────────────────────── */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.photo-card {
    position: relative;
    background: #111;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
    cursor: default;
}

.photo-card:hover {
    border-color: rgba(255,255,255,0.12);
}

.photo-card.selected {
    border-color: #ff7300;
}

.photo-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
    transition: transform 0.3s;
}

.photo-card:hover img {
    transform: scale(1.03);
}

/* Select checkbox overlay */
.photo-select {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    cursor: pointer;
}

.checkbox {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid rgba(255,255,255,0.5);
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}

.checkbox.checked {
    background: #ff7300;
    border-color: #ff7300;
}

.checkbox.checked::after {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 12px;
    font-weight: 700;
    height: 100%;
}

.photo-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #111;
}

.photo-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ff7300;
    cursor: pointer;
    transition: color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.photo-cat-badge:hover {
    color: #ff8c1a;
}

.btn-delete-icon {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.25);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.btn-delete-icon:hover {
    color: #ff4444;
    background: rgba(255,60,60,0.15);
}

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 100px 40px;
    color: rgba(255,255,255,0.3);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: rgba(255,255,255,0.4);
}

.empty-state p {
    font-size: 14px;
}

/* ── Modals ──────────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: 999;
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
}

.modal-box {
    background: #141414;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-box-sm {
    max-width: 380px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    font-family: inherit;
}

.modal-close:hover { color: #fff; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* ── Upload Drop Zone ────────────────────────────────────── */
.drop-zone {
    border: 2px dashed rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
    min-height: 160px;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #ff7300;
    background: rgba(255,115,0,0.04);
}

.drop-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.drop-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.drop-sub {
    font-size: 13px;
    color: rgba(255,255,255,0.35);
}

.file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}

.preview-thumb {
    width: 64px;
    height: 64px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid rgba(255,115,0,0.3);
}

.preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ── Form Fields ─────────────────────────────────────────── */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
}

.form-field select,
.form-field input[type="text"],
.form-field input[type="password"] {
    padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-field select:focus,
.form-field input:focus {
    outline: none;
    border-color: #ff7300;
}

/* ── Lightbox ────────────────────────────────────────────── */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.lightbox.open {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    font-size: 36px;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    transition: color 0.2s;
}

.lightbox-close:hover { color: #fff; }

/* ── Login Page ──────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 60% 40%, rgba(120,40,0,0.2) 0%, transparent 60%), #0a0a0a;
    padding: 20px;
}

.login-box {
    background: #111;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h1 {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.login-box h1 span { color: #ff7300; }

.login-box h2 {
    font-size: 14px;
    font-weight: 400;
    color: rgba(255,255,255,0.35);
    margin-bottom: 36px;
}

.form-group {
    text-align: left;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #ff7300;
}

.btn-primary {
    width: 100%;
    padding: 13px;
    background: #ff7300;
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    margin-top: 4px;
}

.btn-primary:hover {
    background: #ff8c1a;
    transform: translateY(-1px);
}

.back-link {
    display: block;
    margin-top: 20px;
    font-size: 13px;
    color: rgba(255,255,255,0.3);
    text-decoration: none;
    transition: color 0.2s;
}

.back-link:hover { color: rgba(255,255,255,0.6); }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,115,0,0.4); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .admin-nav { display: none; }
    .admin-content { margin-left: 0; padding: 24px 20px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .recent-photos { grid-template-columns: repeat(4, 1fr); }
    .upload-options { grid-template-columns: 1fr; }
}
