*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f4f6f9; color: #1a1a2e; min-height: 100vh; }

/* NAV */
.nav { background: #0a1628; padding: 6px 24px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 12px rgba(0,0,0,0.3); }
.nav-logo { display: flex; align-items: center; cursor: pointer; }
.nav-logo svg { height: 58px; width: auto; }
.nav-btn { background: transparent; border: 1px solid rgba(255,255,255,0.25); color: #e8f4fd; padding: 7px 16px; border-radius: 8px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: background 0.15s; }
.nav-btn:hover { background: rgba(255,255,255,0.1); }

/* VIEWS */
.view { display: none; }
.view.active { display: block; }

/* HERO */
.hero { background: linear-gradient(135deg, #0a1628 0%, #142240 100%); padding: 52px 24px 40px; text-align: center; }
.hero h1 { font-size: 30px; font-weight: 700; color: #e8f4fd; margin-bottom: 10px; }
.hero p { color: #8ab4d4; font-size: 15px; }
.hero-accent { width: 48px; height: 3px; background: #4da6ff; margin: 18px auto 0; border-radius: 2px; }

/* GRID */
.articles-grid { padding: 28px 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; max-width: 1100px; margin: 0 auto; }
.loading { grid-column: 1/-1; text-align: center; padding: 60px; color: #94a3b8; font-size: 15px; }

/* CARD */
.article-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; cursor: pointer; transition: box-shadow 0.15s, transform 0.15s; }
.article-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); transform: translateY(-2px); }
.card-img { width: 100%; height: 160px; object-fit: cover; display: block; }
.card-img-placeholder { width: 100%; height: 160px; background: #0a1628; display: flex; align-items: center; justify-content: center; }
.card-body { padding: 14px 16px 18px; }
.card-cat { font-size: 11px; font-weight: 700; color: #4da6ff; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.card-title { font-size: 15px; font-weight: 600; color: #1a1a2e; margin-bottom: 8px; line-height: 1.4; }
.card-date { font-size: 12px; color: #94a3b8; }

.empty-state { grid-column: 1/-1; text-align: center; padding: 80px 24px; color: #94a3b8; }
.empty-state svg { margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 15px; }
.empty-state small { font-size: 13px; margin-top: 6px; display: block; }

/* DETAIL */
.detail-wrap { padding: 32px 20px 60px; max-width: 740px; margin: 0 auto; }
.back-btn { background: transparent; border: none; color: #64748b; font-size: 14px; cursor: pointer; padding: 0; margin-bottom: 24px; display: flex; align-items: center; gap: 6px; }
.back-btn:hover { color: #1a1a2e; }
.detail-cat { font-size: 11px; font-weight: 700; color: #4da6ff; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.detail-title { font-size: 26px; font-weight: 700; color: #1a1a2e; margin-bottom: 10px; line-height: 1.3; }
.detail-date { font-size: 13px; color: #94a3b8; margin-bottom: 24px; }
.detail-cover { width: 100%; border-radius: 10px; margin-bottom: 24px; overflow: hidden; }
.detail-cover img { width: 100%; display: block; border-radius: 10px; }
.detail-cover-placeholder { background: #0a1628; height: 200px; display: flex; align-items: center; justify-content: center; border-radius: 10px; margin-bottom: 24px; }
.detail-content { font-size: 16px; color: #334155; line-height: 1.85; white-space: pre-wrap; }
.detail-content p + p { margin-top: 1em; }
.detail-gallery { margin-top: 28px; }
.detail-gallery h3 { font-size: 13px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gallery-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; border: 1px solid #e2e8f0; }
.gallery-video-wrap { border-radius: 8px; overflow: hidden; background: #000; }
.gallery-video { width: 100%; border-radius: 8px; display: block; max-height: 300px; }

/* LOGIN */
.login-wrap { display: flex; align-items: center; justify-content: center; padding: 80px 24px; min-height: 60vh; }
.login-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 36px; width: 100%; max-width: 380px; text-align: center; box-shadow: 0 4px 24px rgba(0,0,0,0.06); }
.login-icon { width: 56px; height: 56px; background: #e8f4fd; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.login-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; color: #1a1a2e; }
.login-card p { font-size: 13px; color: #94a3b8; margin-bottom: 24px; }
.login-card input { width: 100%; padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 14px; margin-bottom: 12px; outline: none; font-family: inherit; }
.login-card input:focus { border-color: #4da6ff; box-shadow: 0 0 0 3px rgba(77,166,255,0.15); }
.btn-login { width: 100%; padding: 11px; background: #0a1628; color: #e8f4fd; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn-login:hover { background: #142240; }
.login-error { font-size: 13px; color: #ef4444; margin-top: 10px; min-height: 18px; }
.btn-back-login { background: transparent; border: none; color: #94a3b8; font-size: 13px; cursor: pointer; margin-top: 14px; font-family: inherit; }
.btn-back-login:hover { color: #64748b; }

/* ADMIN */
.admin-wrap { padding: 28px 20px 60px; max-width: 740px; margin: 0 auto; }
.admin-header { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; padding-bottom: 18px; border-bottom: 1px solid #e2e8f0; flex-wrap: wrap; }
.admin-header h2 { font-size: 20px; font-weight: 700; color: #1a1a2e; }
.admin-badge { font-size: 11px; background: #dcfce7; color: #16a34a; padding: 3px 10px; border-radius: 20px; font-weight: 700; }
.admin-header-actions { margin-left: auto; display: flex; gap: 8px; }
.btn-secondary { background: transparent; border: 1px solid #e2e8f0; color: #64748b; padding: 7px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; font-family: inherit; }
.btn-secondary:hover { background: #f8fafc; }

.form-group { margin-bottom: 18px; }
.form-label { font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 7px; display: block; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 14px; font-family: inherit; color: #1a1a2e; outline: none; background: #fff; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: #4da6ff; box-shadow: 0 0 0 3px rgba(77,166,255,0.12); }
.form-textarea { min-height: 180px; resize: vertical; line-height: 1.6; }

.upload-zone { border: 2px dashed #cbd5e1; border-radius: 10px; padding: 24px; text-align: center; cursor: pointer; background: #f8fafc; transition: border-color 0.15s, background 0.15s; }
.upload-zone:hover { border-color: #4da6ff; background: #f0f8ff; }
.upload-zone p { font-size: 14px; color: #64748b; margin-top: 8px; }
.upload-zone small { font-size: 12px; color: #94a3b8; }
.upload-zone input { display: none; }

.photo-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.photo-thumb { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; border: 1px solid #e2e8f0; display: block; }
.media-thumb-wrap { position: relative; width: 72px; }
.media-remove-btn { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: #ef4444; color: #fff; border: none; cursor: pointer; font-size: 12px; line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0; }
.media-type-badge { position: absolute; bottom: 4px; left: 4px; background: rgba(0,0,0,0.7); color: #fff; font-size: 9px; font-weight: 700; padding: 2px 4px; border-radius: 3px; }
.media-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn-add-more { background: #f0f8ff; border: 1px solid #4da6ff; color: #4da6ff; padding: 6px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; font-family: inherit; }
.btn-add-more:hover { background: #e0f0ff; }
.btn-clear-media { background: transparent; border: 1px solid #fecaca; color: #dc2626; padding: 6px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; font-family: inherit; }
.btn-clear-media:hover { background: #fee2e2; }
.media-count { font-size: 13px; color: #64748b; }

.ai-note { font-size: 12px; color: #94a3b8; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.ai-dot { width: 6px; height: 6px; border-radius: 50%; background: #4da6ff; flex-shrink: 0; }

.btn-publish { width: 100%; padding: 13px; background: #0a1628; color: #e8f4fd; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; font-family: inherit; transition: background 0.15s; }
.btn-publish:hover { background: #142240; }
.btn-publish:disabled { opacity: 0.5; cursor: not-allowed; }

.status-msg { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; display: none; align-items: center; gap: 8px; }
.status-msg.success { background: #dcfce7; color: #15803d; display: flex; }
.status-msg.error   { background: #fee2e2; color: #dc2626; display: flex; }

.admin-list { margin-top: 32px; }
.admin-list h3 { font-size: 13px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; }
.admin-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.admin-row:last-child { border-bottom: none; }
.admin-row-info { flex: 1; min-width: 0; }
.admin-row-info h4 { font-size: 14px; font-weight: 600; color: #1a1a2e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-row-info p  { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.btn-delete { background: transparent; border: 1px solid #fecaca; color: #dc2626; padding: 5px 12px; border-radius: 8px; font-size: 12px; cursor: pointer; flex-shrink: 0; font-family: inherit; }
.btn-delete:hover { background: #fee2e2; }

footer { background: #0a1628; color: #8ab4d4; text-align: center; padding: 24px 20px; font-size: 12px; margin-top: 40px; }
.footer-main { margin-bottom: 8px; color: #8ab4d4; }
.footer-main strong { color: #4da6ff; }
.footer-main a { color: #4da6ff; text-decoration: none; }
.footer-main a:hover { text-decoration: underline; }
.footer-links a { color: #4da6ff; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .hero h1 { font-size: 22px; }
  .articles-grid { padding: 16px; gap: 14px; }
  .detail-wrap, .admin-wrap { padding: 16px 14px 40px; }
  .admin-header { gap: 8px; }
  .admin-header-actions { flex-wrap: wrap; }
}
