/* Nolio: Molio-inspired palette, square corners */
:root {
  --petrol: #315d6d;
  --petrol-dark: #244652;
  --orange: #de7852;
  --orange-dark: #c9643f;
  --sage: #afc197;
  --grey-light: #e7e7e8;
  --grey-dark: #424241;
  --white: #ffffff;
  --bg: #f5f5f4;
}

* { box-sizing: border-box; border-radius: 0; }

body {
  margin: 0;
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--grey-dark);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }
/* main.wrap (not main) so it beats .wrap's "padding: 0 16px" */
main.wrap { padding-top: 64px; padding-bottom: 64px; }
a { color: var(--petrol); }
h1, h2, h3 { color: var(--petrol); line-height: 1.2; margin: 0 0 8px; }
h1 { font-size: 2.2rem; font-weight: 700; }
h3 { font-size: 1.1rem; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }

/* Top bar */
.topbar { background: var(--petrol); color: var(--white); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { color: var(--white); font-weight: 700; font-size: 2.5rem; text-decoration: none; letter-spacing: -0.02em; }
.brand .dot { color: var(--orange); }
.nav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.nav a { color: var(--white); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--sage); }
.nav .who { color: var(--grey-light); font-size: 0.9rem; }
.nav .logout { border: 1px solid var(--white); padding: 4px 12px; }

.footer { background: var(--grey-dark); color: var(--grey-light); font-size: 0.85rem; padding: 16px 0; }

/* Building blocks */
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; color: var(--orange); font-weight: 700; margin: 0 0 8px; }
.muted { color: #6f6f6e; }
.small { font-size: 0.875rem; }
.hero { margin-bottom: 32px; border-left: 6px solid var(--orange); padding-left: 20px; }
.section-title { font-size: 1.25rem; margin: 24px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--sage); }

.card { display: block; background: var(--white); border: 1px solid var(--grey-light); padding: 20px; margin-bottom: 16px; text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--petrol); box-shadow: 4px 4px 0 var(--sage); }

.tag { display: inline-block; background: var(--sage); color: var(--grey-dark); font-size: 0.75rem; font-weight: 700; padding: 2px 8px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em; }

.btn { background: var(--orange); color: var(--white); border: 0; padding: 10px 22px; font: inherit; font-weight: 700; cursor: pointer; }
.btn:hover { background: var(--orange-dark); }
.btn-secondary { background: var(--petrol); }
.btn-secondary:hover { background: var(--petrol-dark); }

label { display: block; font-weight: 500; margin-bottom: 14px; }
input, textarea { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; border: 1px solid #bdbdbd; background: var(--white); color: var(--grey-dark); }
input:focus, textarea:focus { outline: 2px solid var(--petrol); outline-offset: -1px; }

.alert { background: #fbe4da; border-left: 4px solid var(--orange); padding: 8px 12px; }
.notice { background: #eef3e7; border-left: 4px solid var(--sage); padding: 8px 12px; }
.link-arrow { font-weight: 700; text-decoration: none; }

/* Layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.cards .card { margin-bottom: 0; }

/* Login */
.login { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; }
.login-intro h1 { font-size: 2.6rem; }
.login-card { padding: 32px; border-top: 6px solid var(--orange); }
.login-card .btn { width: 100%; }

/* Bulletin board */
.post-form textarea { margin: 0 0 12px; resize: vertical; }
.post-meta { font-size: 0.875rem; margin-bottom: 6px; }
.post-body { overflow-wrap: anywhere; }

/* Project */
.crumbs { font-size: 0.9rem; }
.project-detail { border-top: 6px solid var(--petrol); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 20px; margin: 16px 0; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.note { border-left: 4px solid var(--sage); }

/* Admin */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 8px; }
.stat { background: var(--petrol); color: var(--white); padding: 16px 20px; }
.stat span { display: block; font-size: 2rem; font-weight: 700; color: var(--white); }
.console { background: #1f2a2e; color: #d6e4c4; padding: 16px; overflow-x: auto; font-size: 0.85rem; white-space: pre-wrap; }
.table { width: 100%; border-collapse: collapse; background: var(--white); }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--grey-light); font-size: 0.9rem; }
.table th { background: var(--grey-light); }
.error-card { border-top: 6px solid var(--orange); max-width: 860px; }

/* Profile */
.preview-banner { border-left: 4px solid var(--orange); background: #fdf1ec; }
.preview-name { font-size: 1.3rem; font-weight: 700; color: var(--petrol); overflow-wrap: anywhere; }
.photo-card { text-align: center; }
.photo-placeholder { width: 96px; height: 96px; margin: 0 auto 16px; background: var(--petrol); color: var(--white); font-size: 2.5rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.photo-card .btn:disabled { background: #bdbdbd; cursor: not-allowed; }

/* Project files */
.file-row { display: flex; align-items: center; gap: 14px; }
.file-ext { flex: 0 0 auto; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
            background: var(--grey-dark); color: var(--white); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; }
.file-ext.pdf { background: #c0392b; }
.file-ext.png { background: var(--sage); color: var(--grey-dark); }
.file-ext.xlsx { background: #27795b; }
.file-ext.docx { background: #2a5699; }
.file-meta { flex: 1 1 auto; min-width: 0; }
.file-meta h3 { margin: 0 0 2px; font-size: 1rem; overflow-wrap: anywhere; }
.file-dl { flex: 0 0 auto; color: var(--orange); font-weight: 700; font-size: 1.2rem; }
a.file-row:hover .file-dl { color: var(--orange-dark); }

@media (max-width: 800px) {
  .grid-2, .login { grid-template-columns: 1fr; gap: 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  main.wrap { padding-top: 40px; padding-bottom: 40px; }
  h1, .login-intro h1 { font-size: 1.7rem; }
}
