/* === ADMIN LAYOUT === */
.admin-body { background: var(--bg); }
.login-screen {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: var(--bg);
}
.login-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 3rem;
  width: 100%; max-width: 400px; text-align: center;
}
.login-icon { font-size: 3rem; margin-bottom: 1rem; color: var(--accent); }
.login-card h2 { margin-bottom: 0.25rem; }
.login-card > p { color: var(--text-muted); margin-bottom: 2rem; }
.error-msg { color: var(--danger); font-size: 0.85rem; margin-top: 1rem; }

.admin-dashboard { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 260px;
  background: #16161a;
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0;
  z-index: 100;
}
.sidebar-header {
  padding: 1.25rem 1.5rem; display: flex; align-items: center; gap: 0.75rem;
  font-weight: 700; font-size: 1.05rem; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-header .logo-icon { color: var(--accent-light); }
.sidebar-nav { flex: 1; padding: 0.75rem 0.75rem; overflow-y: auto; }
.sidebar-section-label {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.25); text-transform: uppercase;
  padding: 0.9rem 1rem 0.35rem; margin-top: 0.25rem;
}
.sidebar-section-label:first-child { padding-top: 0.25rem; }
.sidebar-link {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 1rem; border-radius: 8px;
  color: rgba(255,255,255,0.55); font-size: 0.875rem; margin-bottom: 0.15rem;
  transition: all var(--transition);
}
.sidebar-link:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.9); }
.sidebar-link.active { background: rgba(139,105,20,0.25); color: var(--accent-light); }
.sidebar-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 0.68rem; font-weight: 700; border-radius: 10px;
  padding: 0.1rem 0.45rem; min-width: 18px; text-align: center;
}
.sidebar-footer {
  padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.85rem; color: rgba(255,255,255,0.4);
}

.admin-main {
  flex: 1; margin-left: 260px; padding: 2rem;
  min-height: 100vh;
}

.admin-sidebar-toggle {
  display: none; position: fixed; top: 1rem; left: 1rem;
  z-index: 200; background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); font-size: 1.5rem; padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm); cursor: pointer;
}

/* === ADMIN COMPONENTS === */
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem;
}
.admin-header h1 { font-size: 1.8rem; font-weight: 700; }

.admin-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem; margin-bottom: 1.5rem;
}
.admin-card h3 { margin-bottom: 1rem; font-size: 1.1rem; }

.admin-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem; margin-bottom: 2rem;
}

.dash-stat {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  transition: box-shadow var(--transition);
}
.dash-stat:hover { box-shadow: var(--shadow); }
.dash-stat-icon { font-size: 1.75rem; }
.dash-stat-number { font-size: 1.8rem; font-weight: 800; color: var(--accent); line-height: 1; }
.dash-stat-label { color: var(--text-muted); font-size: 0.82rem; margin-top: 2px; }

.dash-quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 1rem 0.75rem; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; font-family: var(--font);
  font-size: 0.82rem; color: var(--text-muted); transition: all var(--transition);
  text-align: center;
}
.dash-quick-btn span:first-child { font-size: 1.5rem; }
.dash-quick-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); box-shadow: var(--shadow-sm); }

/* === DATA TABLE === */
.data-table { width: 100%; }
.data-table th { position: sticky; top: 0; }
.data-table .actions { white-space: nowrap; }
.data-table .actions button { margin-left: 0.5rem; }

/* === FORM === */
.form-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

/* === EDITOR === */
.editor-toolbar {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.75rem; background: var(--bg-surface);
  border: 1px solid var(--border); border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.editor-toolbar button {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); padding: 0.4rem 0.75rem; border-radius: 4px;
  cursor: pointer; font-size: 0.85rem; transition: all var(--transition);
}
.editor-toolbar button:hover {
  border-color: var(--accent); color: var(--accent);
}
.editor-content {
  min-height: 300px; padding: 1rem;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  color: var(--text); font-family: var(--font); font-size: 0.95rem;
  line-height: 1.6; white-space: pre-wrap;
}
.editor-content:focus { outline: none; border-color: var(--accent); }

/* === PHOTO UPLOAD === */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 3rem; text-align: center; cursor: pointer;
  transition: all var(--transition); margin-bottom: 1rem;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent); background: var(--accent-dim);
}
.upload-zone-icon { font-size: 2.5rem; margin-bottom: 0.5rem; opacity: 0.5; }
.upload-zone p { color: var(--text-muted); }

.upload-preview {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem; margin-bottom: 1.5rem;
}
.upload-preview-item {
  position: relative; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border);
}
.upload-preview-item img {
  width: 100%; height: 100px; object-fit: cover;
}
.upload-preview-item .remove-btn {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,0.7); color: white;
  border: none; border-radius: 50%; width: 24px; height: 24px;
  cursor: pointer; font-size: 0.8rem;
}

/* === VOICE DICTATION === */
.dictation-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border-radius: 50px;
  font-weight: 600; cursor: pointer; font-family: var(--font);
  transition: all var(--transition);
}
.dictation-btn.inactive {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
}
.dictation-btn.recording {
  background: var(--danger); border: 1px solid var(--danger); color: white;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(231, 76, 60, 0); }
}

/* === GAME RECORDER === */
.chess-board-container {
  max-width: 480px; margin: 0 auto;
}
.move-list {
  display: grid; grid-template-columns: 40px 1fr 1fr;
  gap: 0.25rem; font-family: monospace;
  max-height: 400px; overflow-y: auto;
  padding: 1rem; background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.move-list .move-number { color: var(--text-dim); font-weight: 600; }
.move-list .move {
  padding: 0.25rem 0.5rem; border-radius: 4px; cursor: pointer;
}
.move-list .move:hover { background: var(--accent-dim); }
.move-list .move.current { background: var(--accent-dim); color: var(--accent); }
.move-input-row {
  display: flex; gap: 0.5rem; margin-top: 1rem;
}
.move-input-row input { flex: 1; }

.validation-ok { color: var(--success); font-size: 0.85rem; }
.validation-error { color: var(--danger); font-size: 0.85rem; }

/* === MODAL === */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7); display: none;
  align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); width: 100%; max-width: 700px;
  max-height: 90vh; overflow-y: auto; padding: 2rem;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.modal-header h2 { font-size: 1.3rem; }
.modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.5rem; cursor: pointer;
}

/* === TAGS === */
.tag {
  display: inline-block; padding: 0.2rem 0.6rem;
  border-radius: 4px; font-size: 0.75rem; font-weight: 600;
}
.tag-published { background: rgba(76, 175, 80, 0.15); color: var(--success); }
.tag-draft { background: rgba(255, 193, 7, 0.15); color: #ffc107; }
.tag-review { background: rgba(33, 150, 243, 0.15); color: #2196f3; }
.tag-author { background: rgba(156, 39, 176, 0.15); color: #ce93d8; }
.tag-editor { background: rgba(33, 150, 243, 0.15); color: #64b5f6; }
.tag-admin { background: rgba(76, 175, 80, 0.15); color: var(--success); }

/* === QUILL EDITOR OVERRIDES (dark theme) === */
.ql-toolbar.ql-snow {
  background: var(--bg-surface);
  border-color: var(--border) !important;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.ql-container.ql-snow {
  border-color: var(--border) !important;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--bg-surface);
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
}
.ql-editor {
  min-height: 300px;
  color: var(--text);
  line-height: 1.6;
}
.ql-editor.ql-blank::before {
  color: var(--text-dim);
  font-style: italic;
}
.ql-snow .ql-stroke { stroke: var(--text-muted) !important; }
.ql-snow .ql-fill { fill: var(--text-muted) !important; }
.ql-snow .ql-picker-label { color: var(--text-muted) !important; }
.ql-snow .ql-picker-options {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
}
.ql-snow .ql-picker-item { color: var(--text) !important; }
.ql-snow .ql-picker-item:hover { color: var(--accent) !important; }
.ql-snow .ql-active .ql-stroke { stroke: var(--accent) !important; }
.ql-snow .ql-active .ql-fill { fill: var(--accent) !important; }
.ql-snow .ql-active { color: var(--accent) !important; }
.ql-snow button:hover .ql-stroke { stroke: var(--accent) !important; }
.ql-snow button:hover .ql-fill { fill: var(--accent) !important; }
.ql-tooltip {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow) !important;
}
.ql-tooltip input[type=text] {
  background: var(--bg-surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
.ql-tooltip a { color: var(--accent) !important; }

/* === ARTICLE FILTERS === */
.article-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.article-filters select {
  min-width: 160px;
}

/* === ARTICLE LOCK WARNING === */
.lock-warning {
  background: rgba(255, 152, 0, 0.12);
  border: 1px solid rgba(255, 152, 0, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  color: #ffb74d;
  font-size: 0.9rem;
}

/* === ARTICLE STATUS WORKFLOW === */
.status-workflow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.status-workflow .status-step {
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.status-workflow .status-step.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.status-workflow .status-arrow {
  color: var(--text-dim);
}

/* === ARTICLE META === */
.article-meta-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* === AI ASSISTANT === */
.ai-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 0.5rem 0;
}
.ai-step {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem; border-radius: 50px;
  font-size: 0.85rem; font-weight: 500;
  color: var(--text-dim); background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.ai-step.active {
  color: var(--accent); border-color: var(--accent);
  background: var(--accent-dim);
}
.ai-step-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--border); color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
}
.ai-step.active .ai-step-num {
  background: var(--accent); color: var(--bg);
}
.ai-step-arrow { color: var(--text-dim); font-size: 1.2rem; }
@media (max-width: 600px) {
  .ai-steps { flex-wrap: wrap; }
  .ai-step-arrow { display: none; }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition);
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; padding: 1rem; padding-top: 4rem; }
  .admin-sidebar-toggle { display: block; }
}

/* === TOAST === */
.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 2000; display: flex; flex-direction: column; gap: 0.5rem;
}
.toast {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem 1.5rem;
  font-size: 0.9rem; box-shadow: var(--shadow);
  animation: slideIn 0.3s ease-out;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
