
/* =====================================================================
 IhlenWeb — app.css 

   ===================================================================== */

:root{
  /* Fargepalett: duse toner hvitt, gult, rødt, blått */
  --bg: #fbfbfc;            /* nesten hvit */
  --fg: #1f2937;            /* mørk gråblå tekst */
  --brand: #6ea8ff;         /* dus blå */
  --brand-600: #5b97f0;     /* hover blå */
  --brand-700: #3f7cd6;     /* aktiv blå */
  --yellow: #fde68a;        /* dus gul */
  --yellow-700: #fbbf24;    /* gul hover */
  --red: #fca5a5;           /* dus rød */
  --red-700: #f87171;       /* rød hover */
  --blue: #93c5fd;          /* lys blå */
  --blue-700: #60a5fa;      /* blå hover */
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(0,0,0,.06);
  --panel: #fffde7;         /* svak gul panelbakgrunn */
  --secondary: #b91c1c;      /* dyp rød for små markeringer */
}

html, body{
  background: var(--bg);
  color: var(--fg);
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 12px;            /* kompakt */
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container{
  max-width: 1900px;
  margin: 0 auto;
  padding: 0 14px;
  text-align: center;
}

/* ---------------------- Headings ---------------------- */
h1, h2, h3{
  text-align: center;
  margin: 10px 0 12px;
  font-weight: 600;
}
h1{ font-size: 32px;}
h2{ font-size: 18px;}
h3{ font-size: 14px;}
h4{ 
  text-align: center;
  margin: 4px;
  font-weight: 400;
  font-size: 11px; 
  color:var(--secondary);
}

/* ---------------------- Header/Footer ---------------------- */
.site-header, .site-footer { background: #fff; box-shadow: var(--shadow); }
.site-header .brand { display:inline-block; padding: 10px 0; color: inherit; text-decoration: none; }
.site-header .logo-text { font-weight: 700; letter-spacing: .3px; }
.site-footer { padding: 10px 0; color: var(--muted); font-size: 11px; }

/* ---------------------- Tabs menu (moved from inline) ---------------------- */
nav.tabs { margin:0; padding:0; border-bottom:1px solid var(--border); background:#fff; }
nav.tabs .tabs-list { list-style:none; margin:0; padding:0; display:flex; gap:0; align-items:flex-end; justify-content:center; }
nav.tabs .tab-item { margin:0; }
nav.tabs .tab-link { display:inline-block; padding:8px 14px; text-decoration:none; border:1px solid var(--border); border-bottom:none; background:#f6f8fa; border-top-left-radius:8px; border-top-right-radius:8px; color:inherit; }
nav.tabs .tab-link:hover { background:#eef2f6; }
nav.tabs .tab-link.is-active, nav.tabs .tab-link[aria-current="page"] { background:#fff; border-bottom:1px solid #fff; font-weight:600; }
@media (max-width:600px){ nav.tabs .tab-link { padding:7px 12px; font-size:13px; } }

/* ---------------------- Home buttons grid ---------------------- */
.home-main { padding: 18px 0 28px; }
.home-grid { display:grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 14px; max-width: 1000px; margin: 18px auto; }
@media (max-width:900px){ .home-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); } }
@media (max-width:480px){ .home-grid { grid-template-columns: 1fr; } }
.tile { display:flex; align-items:center; justify-content:center; min-height:90px; border-radius: var(--radius); box-shadow: var(--shadow); text-decoration:none; color:#111; font-weight:600; letter-spacing:.2px; }
.tile.blue { background: var(--blue); }
.tile.yellow { background: var(--yellow); }
.tile.red { background: var(--red); }
.tile.admin { background: var(--brand); color:#fff; }
.tile:hover { filter: brightness(0.98); }

/* Simple buttons used in admin */
.btn, .btn-small { display:inline-block; text-decoration:none; border-radius:8px; padding:8px 12px; border:1px solid var(--border); background:#fff; color:inherit; }
.btn:hover, .btn-small:hover { background:#f3f4f6; }
.btn.primary { background: var(--brand); color:#fff; border-color: transparent; }
.btn.primary:hover { background: var(--brand-600); }
.btn-small { font-size: 12px; padding:6px 10px; }

/* Tables minimal */
.table { width:100%; border-collapse:collapse; }
.table th, .table td { padding:8px 10px; border:1px solid var(--border); text-align:left; }
.table-striped tbody tr:nth-child(odd){ background:#fafafa; }
.table-responsive{ overflow:auto; }

/* Simple form layout */
.form label { display:flex; flex-direction:column; gap:4px; text-align:left; }
.form input[type=text] { padding:6px 8px; border:1px solid var(--border); border-radius:6px; }
.two-col { display:grid; grid-template-columns: repeat(2, minmax(160px, 1fr)); gap: 10px; }
.mt-3{ margin-top: 1rem; }
.lead{ color: var(--muted); }
.alert { padding:8px 12px; border-radius:8px; }
.alert.success { background:#e6fffa; }
.alert.danger { background:#fee2e2; }

/* ---------------------- Recipes layout ---------------------- */
.recipes-main { padding: 12px 0 20px; }
.recipes-layout { display:grid; grid-template-columns: 340px 1fr; gap: 14px; align-items:start; }
@media (max-width:1100px){ .recipes-layout{ grid-template-columns: 1fr; } }

.recipes-left { background:var(--panel); border:1px solid var(--border); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); text-align:left; }
.recipes-filter { display:grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 10px; }
.recipes-filter select, .recipes-filter input[type=text]{ padding:6px 8px; border:1px solid var(--border); border-radius:6px; }

.rec-list { max-height: 60vh; overflow:auto; border-top:1px solid var(--border); }
.rec-item { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 6px; border-bottom:1px solid var(--border); text-decoration:none; color:inherit; }
.rec-item:hover { background:#fafafa; }
.rec-item.is-active { background:#eef2ff; }
.rec-name { font-weight:600; }
.rec-meta { display:flex; gap:6px; color: var(--muted); font-size: 12px; }

.recipes-right { background:var(--panel); border:1px solid var(--border); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); text-align:left; }
.rec-header { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; border-bottom:1px solid var(--border); padding-bottom:8px; margin-bottom:10px; }
.rec-title { margin:0; font-size:20px; }
.rec-sub { color: var(--muted); font-size: 12px; margin-top:2px; }
.rec-actions { white-space:nowrap; }
.rec-body { display:grid; grid-template-columns: 1fr; gap: 14px; }
.rec-col h3 { margin: 8px 0 6px; font-size: 14px; font-weight: 600; }
.rec-text { background:#fff; border:1px solid var(--border); border-radius:8px; padding:10px; min-height:160px; white-space:pre-wrap; word-wrap:break-word; }
.rec-meta-grid { display:grid; grid-template-columns: repeat(3, minmax(100px, 1fr)); gap:10px; margin-top:10px; color:#111; }
@media (max-width:600px){ .rec-meta-grid { grid-template-columns: 1fr; } }

/* ---------------------- Print layout ---------------------- */
.print-wrap{max-width:800px;margin:0 auto;padding:10px 14px;color:#111;background:#fff}
.print-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.print-title{margin:0 0 6px;font-size:24px}
.print-sub{font-size:12px;color:#555;margin-bottom:10px}
.print-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.print-block pre{white-space:pre-wrap;font-family:inherit;font-size:12px;margin:6px 0}
.print-meta{margin-top:10px;font-size:12px}
@media print{ .no-print{display:none} body{background:#fff} }
