/* ==========================================================
   DMS Finance – sitewide stylesheet
   Link on every page:  <link rel="stylesheet" href="style.css">
   (place AFTER any inline <style>; no HTML changes needed)
   ========================================================== */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap");

:root{
  --navy:#0b1f4b; --blue:#2f4bff; --violet:#6600cc; --ink:#1d2540;
  --muted:#5a6580; --bg:#f5f7fc; --card:#fff; --line:#e3e8f4;
  --radius:16px; --shadow:0 10px 30px rgba(11,31,75,.08);
}

/* ---------- Base ---------- */
html{scroll-behavior:smooth}
body{
  font-family:Inter,system-ui,sans-serif !important;
  color:var(--ink) !important; background:var(--bg) !important;
  line-height:1.65; margin:0; padding:0;
}
body *{font-family:inherit !important}
font{font-size:1rem !important;color:inherit !important}
small{font-size:.9em}
img{max-width:100%;height:auto;border:0}
a{color:var(--blue) !important;text-decoration:none;font-weight:500}
a:hover{text-decoration:underline}
a:focus-visible{outline:2px solid var(--blue);outline-offset:2px}

h1,h2,h3,h4{font-family:"Plus Jakarta Sans",Inter,sans-serif !important;color:var(--navy);line-height:1.25}
h1{font-size:1.1rem;margin:0;padding:10px 24px;background:var(--navy);font-weight:700}
h1 font{color:#fff !important;font-size:inherit !important}
h2{font-size:1.5rem;margin:1.2em 0 .5em}
h3{font-size:1.15rem;margin:1em 0 .4em}
p{margin:0 0 1em}
hr{border:0;height:1px;background:var(--line);margin:28px 0;width:100% !important}

/* ---------- Page wrapper ---------- */
body > div{max-width:1160px;margin:0 auto;padding:0 24px}
body > div > div{text-align:left}
h1{max-width:none}

/* ---------- Header: logo banner (first table) ---------- */
body > div > table:first-of-type{width:100% !important;height:auto !important;background:#fff;border-bottom:1px solid var(--line)}
body > div > table:first-of-type td{background:#fff !important;height:auto !important;padding:16px 0 8px}
body > div > table:first-of-type img{width:auto !important;height:auto !important;max-height:56px;border-radius:10px;display:block}

/* ---------- Header: navigation (second table) ---------- */
body > div > table:nth-of-type(2){width:100% !important;height:auto !important;background:#fff !important;border-bottom:1px solid var(--line);margin:0 !important}
body > div > table:nth-of-type(2) td{height:auto !important;background:transparent !important;padding:6px 0 14px;vertical-align:middle}
/* sitemap + flags cells */
body > div > table:nth-of-type(2) td:nth-child(1),
body > div > table:nth-of-type(2) td:nth-child(2){padding-right:12px;white-space:nowrap}
body > div > table:nth-of-type(2) td:nth-child(1){order:2}
/* nav cell becomes a flex row of pills */
body > div > table:nth-of-type(2) td:nth-child(3){display:flex;flex-wrap:wrap;gap:4px;align-items:center}
body > div > table:nth-of-type(2) td:nth-child(3) img[src*="ubergang"]{display:none}

/* Replace legacy button images with text pills (matched by file name) */
body > div > table:nth-of-type(2) td:nth-child(3) img{display:none !important}
body > div > table:nth-of-type(2) td:nth-child(3) a,
body > div > table:nth-of-type(2) td:nth-child(3) span:has(> img[src="d.1.1.gif"]){
  display:inline-flex;align-items:center;padding:10px 18px;border-radius:10px;
  color:var(--navy) !important;font-weight:600;font-size:.95rem;transition:background .2s,color .2s;text-decoration:none;
}
body > div > table:nth-of-type(2) td:nth-child(3) a:hover{background:var(--bg);text-decoration:none}
body > div > table:nth-of-type(2) td:nth-child(3) a:has(> img[src="d.2.1.gif"])::after{content:"Businessberatung"}
body > div > table:nth-of-type(2) td:nth-child(3) a:has(> img[src="d.3.1.gif"])::after{content:"Finanzierungsberatung"}
body > div > table:nth-of-type(2) td:nth-child(3) a:has(> img[src="r.5.1.gif"])::after{content:"Internet-Plattform"}
body > div > table:nth-of-type(2) td:nth-child(3) a:has(> img[src="d.5.1.gif"])::after{content:"Impressum + Kontakt"}
body > div > table:nth-of-type(2) td:nth-child(3) span:has(> img[src="d.1.1.gif"])::after{content:"Home";background:var(--navy);color:#fff;padding:10px 18px;border-radius:10px;margin:-10px -18px}
/* Current page: add class="current" to the active link if desired */
body > div > table:nth-of-type(2) a.current{background:var(--navy);color:#fff !important}

/* Sitemap + language switch */
body > div > table:nth-of-type(2) td:nth-child(1) img{width:auto !important;height:20px !important;opacity:.7}
body > div > table:nth-of-type(2) td:nth-child(2) img{width:auto !important;height:20px !important;border-radius:3px;vertical-align:middle}

/* ---------- Content area ---------- */
/* Any table below the header becomes a clean layout grid */
body > div > div table{width:100% !important;height:auto !important;border-spacing:0;border-collapse:separate}
body > div > div > div > table{border-spacing:24px;margin-top:24px}
td{vertical-align:top}
td[style*="text-align: justify"]{text-align:left !important;padding:8px 4px}

/* Sidebar boxes */
td[style*="245, 245, 245"],
td[style*="244, 244, 244"],
table[style*="245, 245, 245"]{background:var(--card) !important;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}
td[style*="102, 0, 204"]{background:var(--violet) !important;padding:14px 18px !important;height:auto !important}
td[style*="102, 0, 204"] *{color:#fff !important;font-size:.9rem !important;font-weight:600}
td[style*="248, 248, 248"]{background:var(--card) !important;text-align:center;padding:12px 18px !important;height:auto !important}
td[style*="244, 244, 244"]{padding:14px 18px;margin-top:12px;border-radius:var(--radius)}

/* Lists */
ul{list-style:none;margin:12px 0;padding:0 0 0 4px}
ul ul{margin:10px 0 10px 12px}
li{position:relative;padding:0 0 0 26px;margin:0 0 10px}
li::before{content:"";position:absolute;left:0;top:.65em;width:10px;height:10px;border-radius:50%;background:var(--blue);opacity:.8}

/* Generic tables inside content (data tables) */
td,th{padding:8px}
table[border="1"]{border:1px solid var(--line) !important;border-radius:var(--radius);border-collapse:separate;overflow:hidden;background:var(--card)}
table[border="1"] td,table[border="1"] th{border:1px solid var(--line) !important}
th{background:var(--navy);color:#fff;text-align:left}

/* Forms (contact pages) */
input,textarea,select{font:inherit;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#fff;max-width:100%}
input:focus,textarea:focus,select:focus{outline:2px solid var(--blue);border-color:transparent}
input[type=submit],input[type=button],button{background:var(--navy);color:#fff;border:0;border-radius:999px;padding:11px 24px;font-weight:600;cursor:pointer}
input[type=submit]:hover,button:hover{background:var(--blue)}

/* ---------- Footer / counters ---------- */
body > div > div > div:last-child{
  margin-top:32px;padding:28px 0;text-align:center;
}
body > div > div > div:last-child a img{border-radius:6px;opacity:.9;transition:opacity .2s;margin:4px}
body > div > div > div:last-child a img:hover{opacity:1}
p[style*="text-align: center"]{color:var(--muted);font-size:.85rem}

/* ---------- Responsive ---------- */
@media (max-width:900px){
  body > div{padding:0 16px}
  body > div > div > div > table,
  body > div > div > div > table tbody,
  body > div > div > div > table tr,
  body > div > div > div > table > tbody > tr > td{display:block;width:100% !important}
  body > div > table:nth-of-type(2) tr{display:flex;flex-wrap:wrap}
  body > div > table:nth-of-type(2) td:nth-child(3){order:3;width:100%}
}
