/* ===== BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --navy:   #0d1f3c;
  --navy2:  #1a2a4a;
  --gold:   #c9a065;
  --white:  #ffffff;
  --light:  #f4f6fa;
  --border: #e2e8f0;
  --text:   #2d3748;
  --muted:  #718096;
  --success:#38a169;
  --danger: #e53e3e;
  --font:   'Open Sans', sans-serif;
}
body { font-family: var(--font); background: var(--light); color: var(--text); min-height: 100vh; }
.hidden { display: none !important; }

/* ===== LOGIN SCREEN ===== */
.login-screen {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: var(--white);
  border-radius: 12px;
  padding: 48px 40px;
  text-align: center;
  width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo i { font-size: 48px; color: var(--gold); margin-bottom: 16px; }
.login-logo h1 { font-size: 22px; color: var(--navy); font-weight: 700; margin-bottom: 4px; }
.login-logo p { font-size: 13px; color: var(--muted); margin-bottom: 32px; letter-spacing: 2px; text-transform: uppercase; }
.btn-google {
  width: 100%; padding: 13px 20px;
  background: var(--white); border: 2px solid var(--border);
  border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-size: 15px; font-weight: 600; color: var(--text);
  transition: all 0.25s;
}
.btn-google:hover { border-color: var(--gold); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.btn-google img { width: 22px; height: 22px; }
.login-note { font-size: 12px; color: var(--muted); margin-top: 20px; }

/* ===== ADMIN HEADER ===== */
.admin-header {
  background: var(--navy);
  padding: 0 28px;
  height: 64px;
  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.2);
}
.admin-header-left { display: flex; align-items: center; gap: 14px; }
.admin-header-left i { font-size: 24px; color: var(--gold); }
.admin-firm { display: block; font-size: 16px; font-weight: 700; color: var(--gold); line-height: 1.2; }
.admin-label { font-size: 10px; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 2px; }
.admin-header-right { display: flex; align-items: center; gap: 14px; }
.admin-avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--gold); object-fit: cover; }
.admin-name { font-size: 13px; color: rgba(255,255,255,0.75); }
.btn-logout {
  padding: 8px 16px; background: transparent;
  border: 1px solid rgba(255,255,255,0.25); border-radius: 6px;
  color: rgba(255,255,255,0.7); font-size: 13px; cursor: pointer;
  transition: all 0.2s; display: flex; align-items: center; gap: 6px;
}
.btn-logout:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5); color: var(--white); }

/* ===== TABS ===== */
.admin-tabs {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex; gap: 4px;
}
.tab-btn {
  padding: 16px 24px;
  background: none; border: none; border-bottom: 3px solid transparent;
  font-size: 14px; font-weight: 600; color: var(--muted);
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  transition: all 0.2s; margin-bottom: -1px;
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--gold); }
.tab-btn i { font-size: 15px; }

/* ===== BODY & PANELS ===== */
.admin-body { padding: 28px; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.admin-panel { display: grid; grid-template-columns: 420px 1fr; gap: 24px; align-items: start; }

.panel-card {
  background: var(--white);
  border-radius: 10px;
  padding: 28px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.07);
}
.panel-card h2 {
  font-size: 16px; font-weight: 700; color: var(--navy);
  margin-bottom: 22px; display: flex; align-items: center; gap: 8px;
}
.panel-card h2 i { color: var(--gold); }

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: 6px;
  font-family: var(--font); font-size: 14px; color: var(--text);
  transition: border-color 0.2s; outline: none;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--gold); }

/* ===== UPLOAD AREA ===== */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: 8px; margin-bottom: 16px;
  cursor: pointer; transition: all 0.2s; overflow: hidden;
  min-height: 140px; display: flex; align-items: center; justify-content: center;
}
.upload-area:hover { border-color: var(--gold); background: #fffbf3; }
.upload-placeholder { text-align: center; padding: 32px 20px; color: var(--muted); }
.upload-placeholder i { font-size: 36px; color: var(--gold); margin-bottom: 10px; display: block; }
.upload-placeholder p { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.upload-placeholder span { font-size: 12px; }
.upload-preview { width: 100%; max-height: 220px; object-fit: contain; padding: 8px; }

/* ===== BLOG EDITOR ===== */
.editor-toolbar {
  background: var(--light); border: 1.5px solid var(--border);
  border-bottom: none; border-radius: 6px 6px 0 0;
  padding: 8px 10px; display: flex; align-items: center; gap: 4px;
}
.editor-toolbar button {
  width: 32px; height: 32px; border: none; background: none;
  border-radius: 4px; cursor: pointer; color: var(--text);
  font-size: 14px; transition: background 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.editor-toolbar button:hover { background: var(--border); }
.toolbar-sep { width: 1px; height: 20px; background: var(--border); margin: 0 6px; }
.blog-editor {
  min-height: 200px; padding: 14px;
  border: 1.5px solid var(--border); border-radius: 0 0 6px 6px;
  font-size: 14px; line-height: 1.8; outline: none;
  background: var(--white); color: var(--text);
}
.blog-editor:focus { border-color: var(--gold); }
.blog-editor:empty::before {
  content: attr(data-placeholder);
  color: #a0aec0; pointer-events: none;
}

/* ===== SUBMIT BUTTON ===== */
.btn-primary {
  width: 100%; padding: 13px;
  background: var(--gold); color: var(--navy);
  border: none; border-radius: 6px;
  font-size: 14px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.2s; margin-top: 6px; letter-spacing: 0.5px;
}
.btn-primary:hover { background: #e8c98a; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== ITEM LIST ===== */
.item-list { display: flex; flex-direction: column; gap: 12px; }
.loading-state { text-align: center; padding: 40px; color: var(--muted); font-size: 14px; }
.loading-state i { margin-right: 8px; }
.empty-state { text-align: center; padding: 40px; color: var(--muted); }
.empty-state i { font-size: 36px; color: var(--border); display: block; margin-bottom: 12px; }

.news-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--light);
}
.news-item-img { width: 80px; height: 60px; object-fit: cover; border-radius: 5px; flex-shrink: 0; }
.news-item-info { flex: 1; min-width: 0; }
.news-item-source { font-size: 11px; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; }
.news-item-caption { font-size: 13px; color: var(--text); margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-item-date { font-size: 11px; color: var(--muted); }
.blog-item-actions { display: flex; gap: 8px; flex-shrink: 0; }

.btn-edit {
  padding: 6px 12px; background: none;
  border: 1px solid #bee3f8; border-radius: 5px;
  color: #2b6cb0; font-size: 12px; cursor: pointer;
  transition: all 0.2s; display: flex; align-items: center; gap: 5px;
}
.btn-edit:hover { background: #ebf8ff; }

.btn-delete {
  padding: 6px 12px; background: none;
  border: 1px solid #fed7d7; border-radius: 5px;
  color: var(--danger); font-size: 12px; cursor: pointer;
  transition: all 0.2s; flex-shrink: 0; display: flex; align-items: center; gap: 5px;
}
.btn-delete:hover { background: #fff5f5; }

.btn-cancel {
  width: 100%; padding: 11px;
  background: none; border: 1.5px solid var(--border);
  border-radius: 6px; font-size: 14px; font-weight: 600;
  color: var(--muted); cursor: pointer; margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.2s;
}
.btn-cancel:hover { background: var(--light); color: var(--text); }

.blog-item {
  padding: 16px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--light);
}
.blog-item-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.blog-item-title { font-size: 15px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.blog-item-meta { font-size: 11px; color: var(--muted); }
.blog-item-excerpt { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.6; }

/* ===== PROGRESS BAR ===== */
.upload-progress {
  width: 100%; height: 4px; background: var(--border);
  border-radius: 2px; margin: 12px 0; overflow: hidden; display: none;
}
.upload-progress-bar { height: 100%; background: var(--gold); width: 0%; transition: width 0.3s; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 28px; right: 28px;
  padding: 14px 22px; border-radius: 8px;
  font-size: 14px; font-weight: 600; color: var(--white);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  z-index: 9999; opacity: 0;
  transition: opacity 0.3s;
}
.toast.show { opacity: 1; }
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .admin-panel { grid-template-columns: 1fr; }
  .admin-body { padding: 16px; }
  .admin-name { display: none; }
}
@media (max-width: 480px) {
  .login-card { padding: 32px 20px; }
  .tab-btn span { display: none; }
}
