:root {
    --bg: #f3f5f8;
    --card: #ffffff;
    --ink: #0f172a;
    --muted: #6b7280;
    --muted-strong: #1f2937;

    /* Wallora Palette: Warm Yellow -> Cyan/Teal -> Dark Blue */
    --primary: #2dd4bf;
    /* Fallback Teal */
    --primary-strong: #0d9488;
    --accent: #f59e0b;
    /* Golden Yellow/Orange */

    /* Brand Gradient: Orange to Teal/Blue */
    --brand-gradient: linear-gradient(135deg, #f59e0b 0%, #2dd4bf 50%, #06b6d4 100%);
    --brand-gradient-hover: linear-gradient(135deg, #fbbf24 0%, #5eead4 50%, #22d3ee 100%);

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: #e2e8f0;
    --shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
    background: radial-gradient(circle at 10% 20%, rgba(245, 158, 11, 0.08), transparent 25%), radial-gradient(circle at 90% 10%, rgba(6, 182, 212, 0.08), transparent 25%), var(--bg);
    color: var(--ink);
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

.page-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #0f172a 0%, #0b1220 100%);
    color: #e2e8f0;
    padding: 28px 22px;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.15);
}

.brand {
    font-weight: 700;
    letter-spacing: 0.5px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-badge {
    padding: 6px 10px;
    background: rgba(45, 212, 191, 0.15);
    border-radius: 12px;
    color: #5eead4;
    font-weight: 600;
    font-size: 0.8rem;
}

.sidebar-note {
    color: #94a3b8;
    margin: 10px 0 20px;
    font-size: 0.9rem;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: #cbd5e1;
    border-radius: 12px;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-link i {
    width: 20px;
    text-align: center;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.nav-link.active {
    background: rgba(45, 212, 191, 0.12);
    color: #5eead4;
    border: 1px solid rgba(45, 212, 191, 0.25);
}

.nav-divider {
    margin: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-link.logout {
    color: #fca5a5;
}

.nav-link.logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.content {
    flex: 1;
    padding: 32px 40px;
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.hero h1 {
    margin: 4px 0;
    font-size: 2rem;
    color: var(--ink);
}

.eyebrow {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    font-weight: 600;
}

.lede {
    color: var(--muted);
    margin: 8px 0 0;
    max-width: 540px;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: transform 0.15s, box-shadow 0.15s, background 0.2s, color 0.2s;
    text-decoration: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: 0 10px 25px rgba(45, 212, 191, 0.25);
}

.btn-primary:hover {
    background: var(--brand-gradient-hover);
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(45, 212, 191, 0.35);
}

.btn-ghost {
    background: #e2e8f0;
    color: var(--muted-strong);
}

.btn-ghost:hover {
    background: #cbd5e1;
}

.btn-danger {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecdd3;
}

.btn-danger:hover {
    background: #fee2e2;
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    justify-content: center;
    padding: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-soft);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
}

.stat-icon.primary {
    background: var(--brand-gradient);
}

.stat-icon.success {
    background: linear-gradient(135deg, var(--success), #22c55e);
}

.stat-icon.accent {
    background: linear-gradient(135deg, var(--accent), #fb923c);
}

.stat-icon.warning {
    background: linear-gradient(135deg, var(--warning), #fbbf24);
}

.stat-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ink);
}

.stat-label {
    color: var(--muted);
    font-size: 0.9rem;
}

.stat-note {
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 2px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 18px;
    margin-bottom: 18px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--muted-strong);
    font-weight: 600;
    font-size: 0.85rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 10px;
    align-items: end;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-label {
    font-weight: 600;
    color: var(--muted-strong);
    font-size: 0.9rem;
}

.input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 0.95rem;
    background: #f8fafc;
    transition: border 0.2s, box-shadow 0.2s, background 0.2s;
}

.input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
    background: #fff;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.input-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.bulk-toolbar {
    display: none;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(249, 115, 22, 0.12));
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 14px;
}

.bulk-toolbar.active {
    display: flex;
    flex-wrap: wrap;
}

.selected-count {
    font-weight: 700;
    color: var(--ink);
}

.bulk-hint {
    color: var(--muted);
    font-size: 0.9rem;
}

.wallpaper-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.wallpaper-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    position: relative;
}

.wallpaper-card.inactive {
    opacity: 0.92;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px 4px;
}

.badge-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.78rem;
}

.badge-premium {
    background: #fef9c3;
    color: #92400e;
}

.badge-featured {
    background: #e0f2fe;
    color: #075985;
}

.badge-free {
    background: #ecfdf3;
    color: #166534;
}

.badge-status {
    background: #f1f5f9;
    color: var(--muted-strong);
}

.wallpaper-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.media {
    position: relative;
    height: 220px;
    overflow: hidden;
    margin: 0 14px;
    border-radius: var(--radius-md);
    background: #0f172a;
}

.media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.media:hover img {
    transform: scale(1.04);
}

.preview-btn {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: rgba(15, 23, 42, 0.55);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 12px;
    cursor: pointer;
    backdrop-filter: blur(6px);
}

.preview-btn:hover {
    background: rgba(14, 165, 233, 0.9);
    border-color: transparent;
}

.wallpaper-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.title-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.wallpaper-title {
    margin: 0;
    font-size: 1.05rem;
    color: var(--muted-strong);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
}

.status-dot.active {
    background: #ecfdf3;
    color: #15803d;
}

.status-dot.inactive {
    background: #f8fafc;
    color: #9ca3af;
}

.desc {
    color: var(--muted);
    font-size: 0.92rem;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.meta-row,
.stat-row,
.action-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.pill {
    padding: 7px 10px;
    border-radius: 10px;
    background: #f8fafc;
    color: var(--muted-strong);
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pill.dark {
    background: #0f172a;
    color: #e2e8f0;
}

.pill.accent {
    background: rgba(249, 115, 22, 0.12);
    color: #c2410c;
}

.pill.green {
    background: #ecfdf3;
    color: #15803d;
}

.meta-row .pill {
    background: #f1f5f9;
}

.stat-row {
    color: var(--muted);
}

.stat-row .pill {
    background: #f8fafc;
}

.action-row {
    margin-top: 4px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--muted-strong);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.15s;
}

.action-btn:hover {
    border-color: var(--primary);
    color: var(--primary-strong);
    box-shadow: 0 10px 20px rgba(14, 165, 233, 0.15);
}

.action-btn.danger {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.action-btn.danger:hover {
    background: #fef2f2;
}

.empty-card {
    text-align: center;
    padding: 50px 20px;
}

.empty-card h3 {
    margin: 10px 0 6px;
}

.empty-card p {
    color: var(--muted);
    margin: 0 0 16px;
}

.alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
}

.alert-success {
    background: #ecfdf3;
    color: #15803d;
    border-color: #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: var(--danger);
    border-color: #fecdd3;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0 10px;
}

.page-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--muted-strong);
    font-weight: 600;
}

.page-btn.active {
    background: var(--brand-gradient);
    color: #fff;
    border: none;
}

.page-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.page-btn:hover {
    border-color: var(--primary);
    color: var(--primary-strong);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 18px;
    max-width: 880px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: var(--shadow);
}

.modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.modal-title {
    margin: 0;
    font-size: 1.2rem;
}

.modal-close {
    border: none;
    background: #f1f5f9;
    border-radius: 12px;
    width: 40px;
    height: 40px;
    cursor: pointer;
}

.modal-body {
    padding: 20px 22px 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px 14px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
}

.form-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}
.file-upload {
    position: relative;
    display: flex;
    gap: 12px;
    align-items: center;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.file-upload:hover {
    border-color: var(--primary);
    background: #f1f5f9;
}

.file-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(45, 212, 191, 0.12);
    color: var(--primary-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.upload-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.upload-title {
    font-weight: 700;
    color: var(--muted-strong);
}

.upload-hint {
    color: var(--muted);
    font-size: 0.9rem;
}

.upload-file {
    color: var(--primary-strong);
    font-weight: 600;
    font-size: 0.92rem;
}

.input-hint {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.image-preview {
    width: 100%;
    height: 220px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8fafc;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-preview.empty {
    color: var(--muted);
}

/* Preview Modal */
.preview-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.preview-modal.active {
    display: flex;
}

.preview-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.preview-close {
    position: absolute;
    top: 26px;
    right: 26px;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
}

@media (max-width: 900px) {
    .sidebar {
        display: none;
    }

    .content {
        padding: 22px;
    }

    .hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .wallpaper-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    color: var(--muted-strong);
}

th {
    color: var(--muted);
    font-weight: 700;
}

.table-striped tbody tr:nth-child(odd) {
    background: #f8fafc;
}

/* Badges / tags */
.tag {
    padding: 6px 10px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tag-active {
    background: #ecfdf3;
    color: #15803d;
}

.tag-muted {
    background: #f8fafc;
    color: var(--muted-strong);
}

.tag-warning {
    background: #fef9c3;
    color: #92400e;
}

.tag-danger {
    background: #fef2f2;
    color: #b91c1c;
}

/* Utility */
.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
