*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --bg: #0f172a; --bg-card: #1e293b; --bg-hover: #334155;
    --text: #e2e8f0; --text-muted: #94a3b8;
    --primary: #3b82f6; --primary-hover: #2563eb;
    --danger: #ef4444; --danger-hover: #dc2626;
    --success: #22c55e; --warning: #f59e0b;
    --border: #334155; --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4);
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh;
}
.flash-container { position: fixed; top: 20px; right: 20px; z-index: 1000; max-width: 400px; }
.flash {
    padding: 14px 20px; border-radius: var(--radius); margin-bottom: 10px;
    font-size: 14px; animation: slideIn 0.3s ease; box-shadow: var(--shadow-lg);
}
.flash-success { background: rgba(34,197,94,0.15); border-left: 4px solid var(--success); color: #86efac; }
.flash-danger { background: rgba(239,68,68,0.15); border-left: 4px solid var(--danger); color: #fca5a5; }
.flash-warning { background: rgba(245,158,11,0.15); border-left: 4px solid var(--warning); color: #fcd34d; }
.flash-info { background: rgba(59,130,246,0.15); border-left: 4px solid var(--primary); color: #93c5fd; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 20px; border: none; border-radius: 8px;
    font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-copy { background: transparent; border: 1px solid var(--border); color: var(--text-muted); padding: 4px 8px; border-radius: 6px; cursor: pointer; font-size: 16px; }
.btn-copy:hover { background: var(--bg-hover); }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--text-muted); font-weight: 500; }
.form-group input[type="text"], .form-group input[type="password"], .form-group input[type="url"], .form-group input[type="file"], .form-group textarea {
    width: 100%; padding: 12px 14px; background: var(--bg); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-size: 14px; transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.form-group input[type="checkbox"] { margin-right: 8px; accent-color: var(--primary); }
.landing { display: flex; align-items: center; justify-content: center; min-height: 100vh; text-align: center; padding: 40px; }
.landing-content h1 { font-size: 48px; margin-bottom: 16px; background: linear-gradient(135deg, #3b82f6, #8b5cf6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.landing-content p { font-size: 18px; color: var(--text-muted); margin-bottom: 8px; }
.landing-content .hint { font-size: 14px; color: #64748b; margin-bottom: 32px; }
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 40px; }
.login-box { background: var(--bg-card); padding: 40px; border-radius: var(--radius); width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); }
.login-box h2 { text-align: center; margin-bottom: 28px; font-size: 22px; }
.admin-nav { display: flex; align-items: center; justify-content: space-between; padding: 0 32px; height: 60px; background: var(--bg-card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.admin-nav-brand a { font-size: 18px; font-weight: 700; color: var(--text); text-decoration: none; }
.admin-nav-links { display: flex; gap: 8px; }
.admin-nav-links a { padding: 8px 16px; border-radius: 8px; color: var(--text-muted); text-decoration: none; font-size: 14px; transition: all 0.2s; }
.admin-nav-links a:hover { background: var(--bg-hover); color: var(--text); }
.admin-nav-links .nav-logout:hover { background: rgba(239,68,68,0.15); color: #fca5a5; }
.admin-container { max-width: 1400px; margin: 0 auto; padding: 32px; }
.admin-container h1 { font-size: 28px; margin-bottom: 24px; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-table th, .admin-table td { padding: 14px 18px; text-align: left; font-size: 14px; }
.admin-table th { background: rgba(59,130,246,0.08); color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 12px; letter-spacing: 0.5px; }
.admin-table tr { border-bottom: 1px solid var(--border); }
.admin-table tr:last-child { border-bottom: none; }
.admin-table tr:hover { background: var(--bg-hover); }
.table-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.link-token { color: var(--primary); text-decoration: none; font-family: monospace; font-size: 13px; }
.link-token:hover { text-decoration: underline; }
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.empty-state p { font-size: 18px; margin-bottom: 20px; }
.upload-zone { max-width: 600px; }
.drop-zone { position: relative; border: 2px dashed var(--border); border-radius: var(--radius); padding: 60px 40px; text-align: center; transition: all 0.3s; cursor: pointer; background: var(--bg-card); }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--primary); background: rgba(59,130,246,0.05); }
.drop-zone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-zone-text p { font-size: 16px; color: var(--text); margin-bottom: 8px; }
.drop-zone-text .hint { font-size: 13px; color: var(--text-muted); }
.file-info { margin: 16px 0; font-size: 14px; color: var(--text-muted); min-height: 20px; }
.banners-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 24px; }
.banner-card { background: var(--bg-card); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.banner-card h3 { margin-bottom: 20px; font-size: 18px; }
.banner-preview { width: 100%; max-height: 200px; object-fit: contain; border-radius: 8px; background: var(--bg); margin-bottom: 12px; }
.banner-preview.empty { height: 120px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 14px; border: 2px dashed var(--border); }
.photo-viewer { display: grid; grid-template-columns: 200px 1fr 200px; gap: 20px; min-height: 100vh; padding: 20px; align-items: start; }
.banner-zone { position: sticky; top: 80px; min-height: 300px; background: var(--bg-card); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.banner-zone img { max-width: 100%; border-radius: 8px; }
.banner-placeholder { color: var(--text-muted); font-size: 13px; padding: 40px 10px; }
.photo-main { display: flex; flex-direction: column; align-items: center; padding: 20px 0; }
.photo-container { background: var(--bg-card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-lg); max-width: 100%; }
.photo-image { max-width: 100%; max-height: 80vh; object-fit: contain; border-radius: 8px; display: block; }
.photo-meta { margin-top: 16px; display: flex; gap: 20px; color: var(--text-muted); font-size: 13px; }
@media (max-width: 900px) {
    .photo-viewer { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
    .banner-zone { position: static; min-height: 120px; }
    .admin-nav { flex-direction: column; height: auto; padding: 12px; gap: 8px; }
    .admin-nav-links { flex-wrap: wrap; justify-content: center; }
    .banners-grid { grid-template-columns: 1fr; }
}
