/* Discover MMC — stile pulito stile bozze + dashboard MMC */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #fcf8f0;
  color: #1a1a1a;
  font-size: 15px;
  line-height: 1.5;
}
a { color: #b85c1e; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout app */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: #ffffff;
  border-right: 1px solid #e0dcd2;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar-header { padding: 20px; border-bottom: 1px solid #e0dcd2; }
.sidebar-header h1 { margin: 0 0 4px; font-size: 18px; font-weight: 600; color: #b85c1e; }
.sidebar-header .sub { font-size: 12px; color: #6b6b6b; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: #1a1a1a;
  font-size: 14px;
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: #f5f1e8; text-decoration: none; }
.sidebar-nav a.active {
  background: #f5e4d8;
  border-left-color: #b85c1e;
  color: #b85c1e;
  font-weight: 500;
}
.sidebar-nav .icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid #e0dcd2;
  font-size: 13px;
  color: #6b6b6b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.content { flex: 1; padding: 24px 32px; min-width: 0; }
.content-header h2 { margin: 0 0 18px; font-size: 24px; font-weight: 500; }
.content-body { max-width: 1100px; }

/* Flash */
.flash {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 18px;
  font-size: 14px;
}
.flash-ok, .flash-success { background: #dcf5e3; color: #16803d; border-left: 3px solid #16803d; }
.flash-error { background: #fde2e2; color: #b91c1c; border-left: 3px solid #b91c1c; }
.flash-info { background: #e0eaff; color: #1e3a8a; border-left: 3px solid #2563eb; }
.flash-warn { background: #fef0d9; color: #78350f; border-left: 3px solid #b45309; }

/* Card */
.card {
  background: #ffffff;
  border: 1px solid #e0dcd2;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 14px;
}
.card h3 { margin: 0 0 12px; font-size: 16px; font-weight: 500; }

/* Form */
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.col { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 4px; }
label { font-size: 13px; color: #6b6b6b; font-weight: 500; }
input[type="text"], input[type="password"], input[type="email"], input[type="date"], input[type="time"], input[type="url"],
select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #e0dcd2;
  border-radius: 6px;
  background: #ffffff;
  font-family: inherit;
  font-size: 14px;
  color: #1a1a1a;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #b85c1e;
  box-shadow: 0 0 0 3px #f5e4d8;
}
textarea { resize: vertical; min-height: 120px; line-height: 1.5; font-family: inherit; }
.textarea-large { min-height: 240px; }
.textarea-xl { min-height: 360px; font-family: ui-monospace, monospace; font-size: 13px; }

/* Buttons */
button, .btn {
  padding: 9px 16px;
  border: 1px solid #c8c3b6;
  background: #ffffff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  color: #1a1a1a;
  display: inline-block;
  text-decoration: none;
}
button:hover, .btn:hover { background: #f5f1e8; border-color: #b85c1e; text-decoration: none; }
.btn-primary, button.primary { background: #b85c1e; color: #fff; border-color: #b85c1e; }
.btn-primary:hover, button.primary:hover { background: #9d4d18; color: #fff; }
.btn-danger { color: #b91c1c; border-color: #fde2e2; }
.btn-danger:hover { background: #fde2e2; }
.btn-ghost { background: transparent; border-color: #e0dcd2; color: #6b6b6b; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* Pill */
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: #f5f1e8;
  color: #6b6b6b;
}
.pill.salute { background: #ffe2e2; color: #a01818; }
.pill.turismo { background: #d6e6ff; color: #1a4b8c; }
.pill.animali { background: #ffe8d3; color: #a14c0a; }
.pill.casa { background: #e3dafc; color: #432b8f; }
.pill.piante { background: #d4f0e1; color: #146636; }
.pill.cucina { background: #ffe9b3; color: #8a5a00; }
.pill.ia { background: #d6ecff; color: #1a5e8c; }
.pill-stato-bozza { background: #f5f1e8; color: #6b6b6b; }
.pill-stato-programmata, .pill-stato-caricato { background: #fef0d9; color: #78350f; }
.pill-stato-pubblicata, .pill-stato-pubblicato { background: #dcf5e3; color: #16803d; }
.pill-stato-archiviata { background: #e0dcd2; color: #999; }
.pill-stato-errore { background: #fde2e2; color: #b91c1c; }

/* Table */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #e0dcd2; }
th { background: #f5f1e8; font-weight: 500; color: #6b6b6b; font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px; }
tbody tr:hover { background: #fcf8f0; }
td.numeric { text-align: right; font-variant-numeric: tabular-nums; }

/* Metrics */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.metric {
  background: #ffffff;
  border: 1px solid #e0dcd2;
  border-radius: 8px;
  padding: 14px;
}
.metric .ml { font-size: 12px; color: #6b6b6b; text-transform: uppercase; letter-spacing: 0.3px; }
.metric .mv { font-size: 26px; font-weight: 500; margin-top: 6px; }

/* Login page */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #fcf8f0;
}
.login-card {
  background: #fff;
  border: 1px solid #e0dcd2;
  border-radius: 12px;
  padding: 36px 40px;
  width: 360px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}
.login-card h1 { margin: 0 0 6px; font-size: 22px; color: #b85c1e; }
.login-card .sub { color: #6b6b6b; font-size: 13px; margin-bottom: 24px; }
.login-card .col { margin-bottom: 14px; }
.login-card button { width: 100%; }

/* Utilities */
.text-muted { color: #6b6b6b; }
.text-small { font-size: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 24px; }
.actions { display: flex; gap: 8px; }
.spacer { flex: 1; }
.hidden { display: none; }
hr { border: none; border-top: 1px solid #e0dcd2; margin: 18px 0; }
pre.code-block {
  background: #1e1e1e;
  color: #e0e0e0;
  padding: 14px;
  border-radius: 6px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  overflow-x: auto;
  line-height: 1.5;
  max-height: 360px;
  overflow-y: auto;
}
