:root {
    --dark: #111827;
    --dark-2: #1f2937;
    --light-bg: #f4f6fb;
    --border: #e5e7eb;
}

* { box-sizing: border-box; }
body { background: var(--light-bg); color: #111827; }

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top left, rgba(13,110,253,.22), transparent 30%), linear-gradient(135deg, #111827, #1f2937);
    padding: 24px;
}
.login-card {
    width: min(440px, 100%);
    border: 0;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,.28);
}
.login-logo { width: 72px; height: 72px; object-fit: contain; }

.admin-wrapper { min-height: 100vh; display: flex; }
.sidebar {
    width: 280px;
    background: var(--dark);
    color: #fff;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-logo { width: 46px; height: 46px; object-fit: contain; background: #fff; border-radius: 12px; padding: 4px; }
.sidebar-brand span { display: block; font-size: 12px; color: #cbd5e1; }
.sidebar-nav { padding: 18px; display: grid; gap: 8px; }
.sidebar-nav a {
    color: #d1d5db;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: .2s ease;
}
.sidebar-nav a:hover,
.sidebar-nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-footer { margin-top: auto; padding: 18px; border-top: 1px solid rgba(255,255,255,.08); }

.main-content { margin-left: 280px; min-height: 100vh; width: calc(100% - 280px); }
.topbar { background: var(--dark-2); padding: 14px 24px; position: sticky; top: 0; z-index: 1020; box-shadow: 0 4px 20px rgba(0,0,0,.12); }
.content-area { padding: 24px; }

.stat-card {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(17,24,39,.08);
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(13,110,253,.12);
    color: #0d6efd;
    font-size: 24px;
}

.card, .table-card { border: 0; border-radius: 18px; box-shadow: 0 10px 30px rgba(17,24,39,.08); }
.table thead th { background: #f8fafc; color: #475569; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.table td { vertical-align: middle; }
.thumb { width: 70px; height: 58px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.qr-thumb { width: 58px; height: 58px; object-fit: contain; border-radius: 10px; border: 1px solid var(--border); background: #fff; padding: 4px; }
.action-buttons .btn { margin: 2px; }

.preview-box {
    border: 2px dashed #cbd5e1;
    border-radius: 18px;
    min-height: 220px;
    background: #f8fafc;
    display: grid;
    place-items: center;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.preview-box:hover { border-color: #94a3b8; }
.preview-box.dragover { border-color: #0d6efd; background: #eaf2ff; }
.preview-box img { max-width: 100%; max-height: 320px; object-fit: contain; }

.public-header { background: var(--dark); color: #fff; padding: 22px 0; }
.public-logo { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 14px; padding: 5px; }
.public-image { width: 100%; max-height: 620px; object-fit: contain; background: #f8fafc; border-radius: 18px; border: 1px solid var(--border); }
.info-label { color: #64748b; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.info-value { font-weight: 600; word-break: break-word; }
.copy-input { font-size: 13px; }

.print-label {
    width: 530px;
    max-width: 100%;
    margin: 0 auto;
    padding: 18px;
    border: 1px solid #111;
    background: #fff;
    color: #111;
}
.print-label img.logo { width: 54px; height: 54px; object-fit: contain; }
.print-label img.qr { width: 230px; height: 230px; object-fit: contain; }

.upload-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, .72);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: upload-overlay-fade .15s ease-out;
}
.upload-overlay-box {
    background: #fff;
    border-radius: 18px;
    padding: 36px 40px;
    text-align: center;
    width: min(360px, 90vw);
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.upload-overlay-icon {
    font-size: 2.2rem;
    color: #0d6efd;
    margin-bottom: 10px;
    animation: upload-overlay-bounce 1.1s ease-in-out infinite;
}
.upload-overlay-title { font-weight: 600; font-size: 1.05rem; margin-bottom: 14px; color: var(--dark); }
.upload-overlay-progress { height: 10px; border-radius: 999px; background: var(--light-bg); }
.upload-overlay-subtitle { margin-top: 12px; font-size: .8rem; color: #6b7280; }
@keyframes upload-overlay-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes upload-overlay-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; }
    .content-area { padding: 16px; }
}

@media print {
    .no-print { display: none !important; }
    body { background: #fff !important; }
    .print-label { border: none; width: 100%; }
}
