*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --navy: #0d1b2e; --gold: #c9a84c; --white: #fff;
  --gray-100: #f4f4f6; --gray-300: #ddd; --gray-500: #888; --gray-700: #555;
  --text: #1c1b22; --radius: 6px;
  --font: 'Inter', system-ui, sans-serif;
}
html, body { height: 100%; font-family: var(--font); color: var(--text); background: var(--gray-100); font-size: 15px; line-height: 1.6; }
a { color: var(--gold); text-decoration: none; }
h1, h2, h3 { font-weight: 600; line-height: 1.3; }

/* Login */
.admin-login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy); }
.login-card { background: var(--white); border-radius: 12px; padding: 2.5rem; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.login-brand { text-align: center; margin-bottom: 2rem; }
.login-brand p { color: var(--gray-500); font-size: 0.85rem; margin-top: 0.25rem; }
.logo-name { font-family: Georgia, serif; font-size: 1.8rem; font-weight: 700; color: var(--navy); }
.logo-speaks { font-family: Georgia, serif; font-size: 1.8rem; font-weight: 400; color: var(--gold); }
.login-form .form-group { margin-bottom: 1.1rem; }

/* Layout */
.admin-wrap { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px; flex-shrink: 0; background: var(--navy);
  display: flex; flex-direction: column; padding: 1.5rem 0;
  position: sticky; top: 0; height: 100vh;
}
.admin-brand { padding: 0 1.25rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.admin-brand .logo-name, .admin-brand .logo-speaks { font-size: 1.2rem; font-family: Georgia, serif; }
.admin-nav { display: flex; flex-direction: column; padding: 1rem 0; flex: 1; }
.admin-nav a { color: rgba(255,255,255,0.65); padding: 0.7rem 1.25rem; font-size: 0.9rem; transition: 0.15s; text-decoration: none; }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,0.08); color: var(--white); }
.admin-logout { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,0.1); }
.btn-link { background: none; border: none; color: rgba(255,255,255,0.4); font-size: 0.85rem; cursor: pointer; padding: 0; font-family: var(--font); }
.btn-link:hover { color: rgba(255,255,255,0.8); }

.admin-main { flex: 1; padding: 2rem 2.5rem; overflow-x: hidden; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.admin-header h1 { font-size: 1.4rem; }

/* Buttons */
.btn { display: inline-block; padding: 0.6rem 1.25rem; border-radius: var(--radius); font-family: var(--font); font-size: 0.9rem; font-weight: 600; cursor: pointer; border: 1.5px solid transparent; text-decoration: none; transition: all 0.15s; }
.btn-primary { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.btn-primary:hover { background: #dab94e; }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--gray-300); }
.btn-outline:hover { border-color: var(--navy); }
.btn-ghost { background: transparent; color: var(--gray-500); border-color: var(--gray-300); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--gray-700); margin-bottom: 0.35rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 0.6rem 0.9rem; border: 1.5px solid var(--gray-300); border-radius: var(--radius);
  font-family: var(--font); font-size: 0.9rem; color: var(--text); background: var(--white);
  outline: none; transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--gold); }
.title-input { font-size: 1.2rem; font-weight: 600; }
.label-note { color: var(--gray-500); font-weight: 400; }
.char-count { font-size: 0.78rem; color: var(--gray-500); margin-top: 0.25rem; }
.required { color: #dc2626; }

/* Alerts */
.alert { padding: 0.85rem 1rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-size: 0.9rem; }
.alert--success { background: #d1fae5; border: 1px solid #6ee7b7; color: #065f46; }
.alert--error { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }

/* Table */
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,0.07); }
.admin-table th { background: var(--gray-100); padding: 0.75rem 1rem; text-align: left; font-size: 0.8rem; font-weight: 600; color: var(--gray-700); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--gray-300); }
.admin-table td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--gray-100); font-size: 0.9rem; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table code { font-size: 0.8rem; background: var(--gray-100); padding: 0.2rem 0.4rem; border-radius: 3px; color: var(--gray-700); }
.table-actions { display: flex; gap: 0.4rem; align-items: center; }

.status-badge { display: inline-block; padding: 0.25rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.status-badge--pub { background: #d1fae5; color: #065f46; }
.status-badge--draft { background: #fef3c7; color: #92400e; }

/* Editor layout */
.editor-layout { display: grid; grid-template-columns: 1fr 280px; gap: 2rem; align-items: start; }
.editor-panel { background: var(--white); border: 1px solid var(--gray-300); border-radius: 10px; padding: 1.25rem; margin-bottom: 1rem; }
.editor-panel h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-500); margin-bottom: 1rem; font-weight: 600; }
.editor-actions { margin-top: 1rem; }

/* Quill editor */
.quill-editor { background: var(--white); min-height: 380px; }
.ql-container { font-family: var(--font); font-size: 0.95rem; }
.ql-editor { min-height: 340px; line-height: 1.7; }
.ql-toolbar { border-radius: var(--radius) var(--radius) 0 0 !important; }
.ql-container { border-radius: 0 0 var(--radius) var(--radius) !important; }

/* Slug field */
.slug-wrap { display: flex; align-items: center; border: 1.5px solid var(--gray-300); border-radius: var(--radius); overflow: hidden; }
.slug-prefix { background: var(--gray-100); padding: 0.6rem 0.75rem; font-size: 0.8rem; color: var(--gray-500); white-space: nowrap; border-right: 1px solid var(--gray-300); }
.slug-wrap input { border: none !important; border-radius: 0 !important; flex: 1; }
.slug-wrap input:focus { outline: none; }

/* Toggle */
.toggle-label { display: flex; align-items: center; gap: 0.75rem; cursor: pointer; }
.toggle-label input { display: none; }
.toggle-track { width: 42px; height: 22px; background: var(--gray-300); border-radius: 999px; position: relative; transition: background 0.2s; }
.toggle-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: var(--white); border-radius: 50%; transition: transform 0.2s; }
.toggle-label input:checked + .toggle-track { background: var(--gold); }
.toggle-label input:checked + .toggle-track::after { transform: translateX(20px); }

.empty-state { text-align: center; padding: 3rem; color: var(--gray-500); background: var(--white); border-radius: 10px; }
