:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-elevated: #020617;
  --bg-panel: rgba(15, 23, 42, 0.9);
  --border-soft: #111827;
  --border-strong: #1f2937;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --accent: #a0c213;
  --accent-soft: rgba(160, 194, 19, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at top, #0b1120, #020617 60%),
    radial-gradient(circle at bottom right, #020617, #000000);
  color: var(--text-main);
}

/* APP SHELL */

.app-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.8rem 1.6rem 2.4rem;
}

/* HEADER */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.logo {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 1rem;
  background: radial-gradient(circle at top left, #1e293b, #020617);
  border: 1px solid #1f2937;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.app-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
}

.app-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* LINK CHIP */

.chip-link {
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  text-decoration: none;
  background: radial-gradient(circle at top, #020617, #020617);
}

.chip-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* MAIN LAYOUT */

.app-main {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr 1.1fr;
  gap: 1.2rem;
}

/* PANELS */

.panel {
  background: var(--bg-panel);
  border-radius: 1.1rem;
  border: 1px solid var(--border-soft);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.85);
  padding: 0.9rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.6rem;
}

.panel-header h2 {
  font-size: 0.9rem;
  margin: 0;
}

.panel-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* FORM */

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.3rem;
}

.field {
  display: flex;
  flex-direction: column;
}

.field-row {
  display: flex;
  gap: 0.6rem;
}

.field-row .field {
  flex: 1;
}

label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.18rem;
}

.hint {
  font-size: 0.7rem;
  color: #6b7280;
  margin-left: 0.25rem;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 0.75rem;
  border: 1px solid #111827;
  background: #020617;
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background 0.15s ease;
}

input:hover,
textarea:hover,
select:hover {
  border-color: #1f2937;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
  background: #020617;
}

textarea {
  resize: vertical;
  min-height: 4.4rem;
}

.form-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.2rem;
}

/* BUTTONS */

.btn-primary {
  border: none;
  cursor: pointer;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: radial-gradient(circle at top, #e5ff5f, var(--accent));
  color: #020617;
  font-weight: 600;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 10px 30px rgba(163, 230, 53, 0.4);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: wait;
  box-shadow: none;
}

.btn-icon {
  font-size: 0.9rem;
}

/* ALERT */

.alert {
  margin: 0 0 0.6rem;
  border-radius: 0.7rem;
  font-size: 0.75rem;
  padding: 0.35rem 0.6rem;
  display: none;
}

.alert-error {
  background: #450a0a;
  color: #fecaca;
  border: 1px solid #7f1d1d;
}

/* PREVIEW & LIST */

.preview-container {
  margin-top: 0.4rem;
  min-height: 150px;
}

/* CARD STYLE (style launcher) */

.news-card {
  background: var(--bg-elevated);
  border-radius: 1.4rem;
  border: 1px solid #020617;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.9);
  padding: 0.85rem 0.9rem 0.9rem;
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

.news-icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #020617;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.news-main {
  flex: 1;
  min-width: 0;
}

.news-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.7rem;
}

.news-title {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 0.08rem;
}

.news-meta {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.news-meta span + span::before {
  content: " • ";
  margin: 0 0.2rem;
}

.badge-category {
  font-size: 0.7rem;
  padding: 0.16rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #1f2937;
  text-transform: uppercase;
  color: var(--text-muted);
}

.news-desc {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #d1d5db;
}

.news-bottom {
  margin-top: 0.55rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-read {
  font-size: 0.72rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #1f2937;
  background: #020617;
  color: var(--text-main);
}

/* delete */

.delete {
  font-size: 0.7rem;
  color: #fca5a5;
  cursor: pointer;
}

.delete:hover {
  text-decoration: underline;
}

/* LISTE NEWS */

.news-list {
  margin-top: 0.4rem;
  max-height: 66vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.empty {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* RESPONSIVE */

@media (max-width: 1180px) {
  .app-main {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }

  .panel-list {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .app-main {
    grid-template-columns: 1fr;
  }

  .panel-list {
    grid-column: auto;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
