:root {
  --bg: #0f172a;
  --panel: #111827;
  --card: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  /* --muted: #94a3b8; */
  --muted: #f1f5f9;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --success-bg: rgba(34, 197, 94, 0.12);
  --success: #22c55e;
  --radius: 12px;
  --sidebar-width: 240px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  /* background: var(--bg); */
  background: #FFF6E0;
  color: var(--text);
  line-height: 1.45;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.875rem;
}

/* Login */
/* .login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse at top, rgba(99, 102, 241, 0.22), transparent 55%),
    var(--bg);
} */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background:#ff6b35;
}

/* .login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.login-card h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
} */

.login-card {
  width: 100%;
  max-width: 400px;
  background: #FFF6E0;
  border: 2px solid #ff5757;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(255, 87, 87, 0.25);
}

.login-card h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  color: #ff5757;
}

/* Layout */
.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  /* background: var(--panel); */
  background: #ff5757;
  border-right: 1px solid #ff6b35;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 1.25rem 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-bottom: 1px solid #ff6b35;
  color: #FFF6E0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  gap: 0.35rem;
  flex: 1;
}

/* .nav-item {
  display: block;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  color: var(--muted);
} */

.nav-item {
  display: block;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  color: #FFF6E0;
  transition: all 0.25s ease;
}

/* .nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.22);
  color: var(--text);
} */

.nav-item:hover {
  background: #ff6b35;
  color: #FFF6E0;
}

.nav-item.active {
  background: #1F4419;
  color: #FFF6E0;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* .topbar {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(17, 24, 39, 0.6);
} */

.topbar {
  padding: 1rem 1.5rem;
  border-bottom: 2px solid #ff6b35;
  background: #FFF6E0;
}

/* .topbar h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
} */

.topbar h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1F4419;
}

.content {
  padding: 1.25rem 1.5rem 2rem;
  flex: 1;
}

/* Cards */
/* .card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
} */

.card {
  background: #ff5757;
  border: 1px solid #ff5757;
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.card-title {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.grid.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat.stat {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table th,
.table td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.th-thumb {
  width: 56px;
}

.th-actions {
  width: 170px;
  text-align: right;
}

.td-thumb img,
.th-thumb img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  vertical-align: middle;
}

.thumb-placeholder {
  display: inline-block;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.actions {
  white-space: nowrap;
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
}

/* Forms */
.field {
  display: block;
  margin-bottom: 1rem;
}

/* .field > span:first-child {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--muted);
} */

.field > span:first-child {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #ff5757;
}

/* .field input:not([type="checkbox"]),
.field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f172a;
  color: var(--text);
  font: inherit;
} */

.field input:not([type="checkbox"]),
.field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #ff5757;
  background: #ffffff;
  color: #333333;
  font: inherit;
}

/* .field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
} */

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: #ff5757;
  box-shadow: 0 0 0 3px rgba(255, 87, 87, 0.2);
}

.req {
  color: var(--danger);
}

.help {
  margin-top: 0.35rem;
}

/* Buttons */
.btn {
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

/* .btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
} */

.btn-primary {
  background: #ff5757;
  color: #ffffff;
}

.btn-primary:hover {
  background: #e8402f;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
  background: transparent;
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.btn-danger:hover {
  background: var(--danger-bg);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
  margin-top: 1rem;
}

.btn-icon {
  background: transparent;
  border: none;
  /* color: var(--muted); */
  color:#1F4419;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
}

.btn-icon:hover {
  /* color: var(--text); */
  color:#1F4419;
}

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.alert-success {
  background: var(--success-bg);
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.alert-error {
  background: var(--danger-bg);
  border-color: rgba(239, 68, 68, 0.35);
  /* color: #fecaca; */
  color: #1F4419;
}

/* Modal / post popup */
.post-modal-root:not(.is-open) {
  display: none !important;
}

.post-modal-root.is-open {
  display: block;
}

.post-modal-screen {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  border: none;
  appearance: none;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: 200;
  cursor: pointer;
  color: transparent;
}

.post-modal-dialog {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 2rem 1rem;
  pointer-events: none;
}

.post-modal-dialog .modal-panel {
  pointer-events: auto;
  margin-top: 0;
}

.modal-panel {
  width: min(720px, 100%);
  /* background: var(--card); */
  background: #ff5757;
  border: 1px solid #ff5757;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  /* border-bottom: 1px solid var(--border); */
  border-bottom: 2px solid #ff6b35;
  background: #FFF6E0;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #1F4419;
}

.modal-body {
  padding: 1.25rem;
  display: block;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  /* justify-content: flex-end; */
  justify-content: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.hidden {
  display: none !important;
}

.field-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.field-row input[type='checkbox'] {
  width: auto;
  margin-top: 0.2rem;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-published {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.badge-draft {
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
  border: 1px solid var(--border);
}

.image-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.image-grid--picks {
  margin-top: 0.75rem;
}

.img-pick-tile {
  position: relative;
  flex-shrink: 0;
  width: 110px;
}

.img-pick-tile img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
  vertical-align: middle;
}

.img-pick-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.img-pick-remove:hover {
  background: var(--danger);
}

.existing-img {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  max-width: 120px;
}

.existing-img-visual img {
  width: 110px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.existing-img-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.remove-cb {
  width: auto;
}

/* TinyMCE skin overrides (basic) */
.tox-tinymce {
  border-radius: 8px !important;
}

@media (max-width: 900px) {
  .app {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .sidebar-nav {
    flex-direction: row;
    flex: 1;
  }

  .sidebar-footer {
    border-top: none;
    border-left: 1px solid var(--border);
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
  }
}
