/* Content Manager — app stylesheet
   Restrained navy/slate palette, no external fonts/CDNs. */

:root {
  --navy-900: #0f1b2d; --navy-800: #16253c; --navy-700: #1f3350; --navy-600: #2b4368;
  --slate-500: #5b6b82; --slate-400: #7c8aa0; --slate-300: #aab4c4; --slate-200: #d3d9e2;
  --slate-100: #e8ebf0; --slate-50: #f5f7fa; --white: #ffffff;
  --blue-600: #2f5fd6; --blue-500: #3f6de0; --red-600: #c0392b; --red-50: #fbeae8;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, 0.06), 0 1px 1px rgba(15, 27, 45, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 27, 45, 0.08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px; line-height: 1.5; color: var(--navy-900); background: var(--slate-50);
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; color: var(--navy-900); }
h1 { font-size: 1.5rem; font-weight: 650; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 0.75em; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Top bar */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 1.25rem; background: var(--navy-900); color: var(--slate-100);
  box-shadow: var(--shadow-sm);
}
.brand { font-weight: 700; font-size: 1.05rem; color: var(--white); letter-spacing: 0.01em; }
.brand:hover { text-decoration: none; opacity: 0.9; }
.top nav { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.top nav a { color: var(--slate-300); padding: 0.4rem 0.7rem; border-radius: 6px; font-size: 0.9rem; font-weight: 500; }
.top nav a:hover { color: var(--white); text-decoration: none; background: rgba(255,255,255,0.08); }
.top nav a.on { color: var(--white); background: var(--navy-700); }
.top nav a.out { margin-left: 0.5rem; color: var(--slate-400); }
.top nav a.out:hover { color: var(--red-600); background: rgba(192,57,43,0.12); }

/* Layout */
.wrap { max-width: 1080px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.card {
  background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 1.25rem; margin-bottom: 1.25rem;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.grid .card { margin-bottom: 0; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: var(--white); font-size: 0.92rem; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--slate-100); vertical-align: middle; }
th {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--slate-500);
  font-weight: 600; background: var(--slate-50); border-bottom: 1px solid var(--slate-200);
}
tbody tr:hover { background: var(--slate-50); }

/* Badges */
.badge {
  display: inline-block; padding: 0.2rem 0.55rem; border-radius: 999px; font-size: 0.75rem;
  font-weight: 600; line-height: 1.4; white-space: nowrap; border: 1px solid transparent;
}
.badge-idea      { background: #eef1f6; color: var(--slate-500); border-color: var(--slate-200); }
.badge-planned   { background: #e6edfb; color: #2b4a9e; border-color: #c4d5f5; }
.badge-drafting  { background: #fdf0da; color: #9a6a12; border-color: #f6dfae; }
.badge-in_review { background: #f6e6fb; color: #7a2f9e; border-color: #ead0f5; }
.badge-scheduled { background: #dcf1f5; color: #206273; border-color: #b9e3ea; }
.badge-published { background: #e1f4e6; color: #1f7a3d; border-color: #bfe8c8; }
.badge-archived  { background: #f0f0f0; color: #6b6b6b; border-color: #dcdcdc; }

/* Calendar */
.cal {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--slate-200);
  border: 1px solid var(--slate-200); border-radius: var(--radius); overflow: hidden;
}
.cal .cal-head {
  background: var(--navy-800); color: var(--slate-200); font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em; padding: 0.4rem 0.5rem; text-align: center;
}
.cal .cal-day {
  background: var(--white); min-height: 96px; padding: 0.35rem;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.cal .cal-day.blank { background: var(--slate-50); }
.cal .cal-daynum { font-size: 0.78rem; font-weight: 600; color: var(--slate-500); }
.cal .cal-item {
  display: flex; align-items: center; gap: 0.3rem; font-size: 0.76rem; padding: 0.15rem 0.3rem;
  border-radius: 5px; background: var(--slate-50); color: var(--navy-800);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal .cal-item:hover { background: var(--slate-100); text-decoration: none; }
.cal .cal-item .badge { padding: 0; width: 8px; height: 8px; min-width: 8px; border-radius: 50%; }

/* Errors */
.err {
  color: var(--red-600); background: var(--red-50); border: 1px solid #f3c9c3;
  border-radius: 6px; padding: 0.5rem 0.75rem; font-size: 0.88rem; margin-bottom: 1rem;
}

/* Forms */
label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--slate-500); margin: 0.85rem 0 0.3rem; }
label:first-child { margin-top: 0; }
input, select, textarea, button { font: inherit; color: var(--navy-900); }
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="search"], select, textarea {
  width: 100%; padding: 0.5rem 0.65rem; border: 1px solid var(--slate-300); border-radius: 6px;
  background: var(--white); transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(63, 109, 224, 0.15);
}
textarea { resize: vertical; min-height: 120px; font-family: inherit; }
button {
  display: inline-flex; align-items: center; justify-content: center; padding: 0.5rem 1rem;
  border: 1px solid var(--blue-600); border-radius: 6px; background: var(--blue-600); color: var(--white);
  font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: background 0.15s ease, box-shadow 0.15s ease;
}
button:hover { background: var(--blue-500); }
button:active { background: var(--navy-700); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
button.secondary { background: var(--white); color: var(--navy-800); border-color: var(--slate-300); }
button.secondary:hover { background: var(--slate-50); }
button.danger { background: var(--red-600); border-color: var(--red-600); }
button.danger:hover { background: #a93124; }

/* Auth / login */
body.auth {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--navy-900); padding: 1.25rem;
}
body.auth .card { width: 100%; max-width: 360px; box-shadow: var(--shadow-md); }
body.auth h1 { text-align: center; font-size: 1.25rem; margin-bottom: 1rem; }
body.auth button { width: 100%; margin-top: 0.75rem; }

/* Responsive */
@media (max-width: 640px) {
  .top { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .top nav { width: 100%; }
  .wrap { padding: 1rem 0.85rem 2rem; }
  .grid { grid-template-columns: 1fr; }
  th, td { padding: 0.5rem; font-size: 0.85rem; }
  .cal { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cal .cal-day { min-height: 64px; padding: 0.2rem; }
  .cal .cal-head { font-size: 0.6rem; padding: 0.3rem 0.15rem; }
  .cal .cal-item { font-size: 0.65rem; }
}
