/* ══════════════════════════════════════════════════════════
   MoCo Service Center  |  Global Stylesheet
   CI: Orange #ff7a00 / Blue #081fff / Logo: /static/logo.png
   ══════════════════════════════════════════════════════════ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Design Tokens ── */
:root {
  /* Brand */
  --orange:       #ff7a00;
  --orange-light: #fff4e6;
  --orange-hover: #e86e00;
  --blue:         #081fff;
  --blue-dark:    #0615cc;
  --blue-light:   #e8ecff;

  /* Neutrals */
  --bg:           #f0f2f5;
  --surface:      #ffffff;
  --border:       #e2e5ea;
  --border-light: #f0f1f3;
  --text:         #1a1d21;
  --text-secondary: #5f6368;
  --text-muted:   #9aa0a6;

  /* Semantic */
  --success:      #0d9f4f;
  --success-bg:   #e6f7ed;
  --error:        #d93025;
  --error-bg:     #fce8e6;
  --warn:         #e37400;
  --warn-bg:      #fef3e0;

  /* Shadows */
  --shadow-sm:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:    0 4px 12px rgba(0,0,0,.07), 0 1px 3px rgba(0,0,0,.05);
  --shadow-lg:    0 8px 24px rgba(0,0,0,.09), 0 2px 6px rgba(0,0,0,.04);
  --shadow-header:0 2px 16px rgba(0,0,0,.08);

  /* Radius */
  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    14px;

  /* Transitions */
  --ease:         cubic-bezier(.4,0,.2,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════
   HEADER
   ═══════════════════════════════════ */
header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--surface);
  border-bottom: 3px solid var(--orange);
  padding: 0 3rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 80px;
  box-shadow: var(--shadow-header);
}

header img.logo {
  height: 50px;
  object-fit: contain;
  justify-self: start;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.10));
}

.header-center { text-align: center; }

.header-center .hc-brand {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -.5px;
  line-height: 1.15;
}
.header-center .hc-brand span { color: var(--orange); }

.header-center .hc-sub {
  font-size: .65rem;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  font-weight: 600;
}

.header-right {
  justify-self: end;
  text-align: right;
  font-size: .9rem;
  color: var(--text);
  line-height: 1.45;
  font-weight: 600;
  letter-spacing: 0.1px;
}
.header-right strong {
  color: var(--blue);
  font-weight: 700;
  display: block;
  font-size: 1rem;
  margin-bottom: .15rem;
}

/* ═══════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════ */
nav.page-nav {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  display: flex;
  align-items: stretch;
  box-shadow: 0 4px 16px rgba(8,31,255,.20);
  justify-content: center;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 2px;
  flex-wrap: wrap;
  max-width: 1340px;
  width: 100%;
  padding: 0 1rem;
}

nav.page-nav a {
  color: rgba(255,255,255,.92);
  text-decoration: none;
  padding: .95rem 1.6rem;
  font-size: .92rem;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  transition: all .2s var(--ease);
  position: relative;
  letter-spacing: .015em;
  text-shadow: 0 1px 2px rgba(0,0,0,.15);
  white-space: nowrap;
}
nav.page-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,.12);
  border-bottom-color: rgba(255,255,255,.35);
}
nav.page-nav a.active {
  color: #fff;
  border-bottom-color: var(--orange);
  background: rgba(255,255,255,.14);
  font-weight: 700;
}

/* Dropdown-Menü */
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}
.nav-dropdown > .nav-dropdown-toggle {
  cursor: pointer;
}
.nav-dropdown > .nav-submenu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .15s var(--ease), transform .15s var(--ease);
  z-index: 50;
  overflow: hidden;
}
.nav-dropdown:hover > .nav-submenu,
.nav-dropdown:focus-within > .nav-submenu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
nav.page-nav .nav-submenu a {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1rem;
  color: #1f2937;
  font-weight: 500;
  text-shadow: none;
  border-bottom: none;
  white-space: nowrap;
}
nav.page-nav .nav-submenu a:hover {
  background: #f3f4f6;
  color: var(--blue);
  border-bottom: none;
}
nav.page-nav .nav-submenu a.active {
  background: #eef2ff;
  color: var(--blue);
  border-bottom: none;
  font-weight: 700;
}

/* Nav-Gear (Einstellungen-Button) global deaktiviert –
   Einstellungen sind über den Settings-Drawer rechts erreichbar */
.nav-gear { display: none !important; }

/* ═══════════════════════════════════
   HERO / BREADCRUMB BAR
   ═══════════════════════════════════ */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  padding: .6rem 2.5rem;
  text-align: center;
  font-size: .76rem;
  font-weight: 500;
}
.hero strong { color: var(--blue); font-weight: 700; }

/* ═══════════════════════════════════
   MAIN CONTAINER
   ═══════════════════════════════════ */
main {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 2rem;
}

/* ── Section Label ── */
.section-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--blue);
  border-left: 3px solid var(--orange);
  padding-left: .6rem;
  margin-bottom: 1rem;
}

/* ═══════════════════════════════════
   DASHBOARD GRID
   ═══════════════════════════════════ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════
   PANEL (Card Component)
   ═══════════════════════════════════ */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow .25s var(--ease);
}
.panel:hover {
  box-shadow: var(--shadow-lg);
}

.panel-header {
  padding: 1rem 1.5rem .85rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  background: linear-gradient(180deg, #fafbfc 0%, var(--surface) 100%);
}
.panel-header h2 {
  font-size: .88rem;
  color: var(--text);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .45rem;
}

.panel-body {
  padding: 0;
  flex: 1;
  overflow: hidden;
}

/* ── Panel Footer ── */
.panel-footer {
  padding: .7rem 1.5rem;
  border-top: 1px solid var(--border);
  text-align: right;
  background: #fafbfc;
}
.panel-footer a {
  font-size: .72rem;
  color: var(--orange);
  text-decoration: none;
  font-weight: 600;
  transition: color .15s var(--ease);
}
.panel-footer a:hover {
  color: var(--orange-hover);
  text-decoration: none;
}

/* ═══════════════════════════════════
   SUMMARY BAR (KPI Metrics)
   ═══════════════════════════════════ */
.summary-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}
.summary-item {
  flex: 1;
  padding: .75rem .6rem;
  text-align: center;
  border-right: 1px solid var(--border);
  transition: background .15s var(--ease);
}
.summary-item:last-child { border-right: none; }
.summary-item:hover { background: rgba(8,31,255,.02); }

.summary-item .si-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -.3px;
}
.summary-item .si-value.warn   { color: var(--warn); }
.summary-item .si-value.danger { color: var(--error); }

.summary-item .si-label {
  font-size: .6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-top: .2rem;
  font-weight: 600;
}

/* ═══════════════════════════════════
   TABLE
   ═══════════════════════════════════ */
.scroll-table {
  overflow-y: auto;
  max-height: 480px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .74rem;
}

thead th {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  padding: .55rem .8rem;
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 600;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}
thead th:first-child { border-radius: 0; }
thead th:last-child  { border-radius: 0; }

tbody td {
  padding: .5rem .8rem;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: .74rem;
}
tbody tr { transition: background .12s var(--ease); }
tbody tr:nth-child(even) td { background: #f8f9fb; }
tbody tr:hover td { background: var(--orange-light); }

/* ═══════════════════════════════════
   BADGES
   ═══════════════════════════════════ */
.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 20px;
  font-size: .62rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .02em;
}
.badge-offen {
  background: var(--warn-bg);
  color: var(--warn);
}
.badge-bezahlt {
  background: var(--success-bg);
  color: var(--success);
}
.badge-ueberfaellig {
  background: var(--error-bg);
  color: var(--error);
}
.badge-unread {
  background: var(--blue-light);
  color: var(--blue);
}
.badge-datev {
  background: #f0f1f3;
  color: var(--text-secondary);
}
.badge-autotask {
  background: var(--blue-light);
  color: var(--blue);
}

/* ═══════════════════════════════════
   EMPTY / ERROR / LOADING STATES
   ═══════════════════════════════════ */
.panel-msg {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .82rem;
}
.panel-msg .msg-icon {
  font-size: 2.2rem;
  margin-bottom: .6rem;
  opacity: .7;
}
.panel-msg a {
  color: var(--orange);
  text-decoration: none;
  font-weight: 600;
}
.panel-msg a:hover { text-decoration: underline; }
.panel-msg small {
  color: var(--error);
  font-size: .72rem;
}

/* ═══════════════════════════════════
   FOOTER
   ═══════════════════════════════════ */
footer {
  text-align: center;
  padding: 1.5rem;
  font-size: .7rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  font-weight: 500;
}
footer strong { color: var(--orange); font-weight: 700; }

/* ═══════════════════════════════════
   BUTTONS (Shared)
   ═══════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s var(--ease);
  border: 1px solid transparent;
  text-decoration: none;
}
.btn-primary {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}
.btn-primary:hover {
  background: var(--orange-hover);
  box-shadow: 0 2px 8px rgba(255,122,0,.25);
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: #f5f6fa;
  border-color: #ccc;
}
.btn-blue {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.btn-blue:hover {
  background: var(--blue-dark);
  box-shadow: 0 2px 8px rgba(8,31,255,.25);
}
.btn-sm {
  padding: .32rem .7rem;
  font-size: .68rem;
}
.btn-danger {
  background: var(--error);
  color: #fff;
  border-color: var(--error);
}
.btn-danger:hover {
  background: #c02a1e;
}

/* ═══════════════════════════════════
   FORM INPUTS (Shared)
   ═══════════════════════════════════ */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
  font-family: inherit;
  font-size: .78rem;
  padding: .45rem .7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(8,31,255,.1);
}

/* ═══════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #c5c8ce;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: #a0a4ab; }

/* ═══════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════ */
@media (max-width: 700px) {
  header { padding: 0 1rem; height: 60px; }
  header img.logo { height: 36px; }
  .header-center .hc-brand { font-size: 1.1rem; }
  .header-center .hc-sub { display: none; }
  nav.page-nav a { padding: .7rem 1rem; font-size: .82rem; }
  .nav-gear { padding: 0 1rem; font-size: .82rem; }
  main { padding: 0 .8rem; }
}
