/* ================================================================
   MediaMosaic Rechnungsverwaltung – Stylesheet
   Markenfarben: #04C4D5  #FFA924  #F8FF38  #146582
   ================================================================ */

:root {
  --mm-teal:   #04C4D5;
  --mm-orange: #FFA924;
  --mm-yellow: #F8FF38;
  --mm-dark:   #146582;
  --mm-black:  #0a0a0a;
  --mm-bg:     #f4f5f7;
  --mm-sidebar-w: 230px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--mm-bg);
  color: #1a1a1a;
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

/* ── Farbstreifen ────────────────────────────────────────────── */
.mm-topbar-stripe {
  height: 4px;
  background: linear-gradient(90deg,
    var(--mm-teal) 0%, var(--mm-orange) 33%,
    var(--mm-yellow) 66%, var(--mm-dark) 100%);
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
}

/* ── Layout ──────────────────────────────────────────────────── */
.mm-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 4px;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.mm-sidebar {
  width: var(--mm-sidebar-w);
  background: var(--mm-black);
  position: fixed;
  top: 4px; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 900;
  overflow: hidden;
}

/* Mosaik-Muster unten in der Sidebar */
.mm-sidebar-mosaic {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 200px;
  opacity: 0.15;
  pointer-events: none;
}
.mm-sidebar-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}

/* Logo-Bereich */
.mm-sidebar-logo {
  padding: 22px 18px 14px;
  position: relative;
  z-index: 2;
}
.mm-logo-link {
  text-decoration: none;
  display: block;
}
.mm-logo-img {
  max-height: 40px;
  max-width: 180px;
  object-fit: contain;
}
.mm-logo-fallback {
  display: none;
  align-items: center;
  gap: 10px;
}
.mm-logo-icon {
  width: 36px; height: 36px;
  background: var(--mm-teal);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  color: var(--mm-black);
  flex-shrink: 0;
}
.mm-logo-text { display: flex; flex-direction: column; line-height: 1; }
.mm-logo-main { font-size: 12px; font-weight: 700; color: #fff; letter-spacing: 1px; }
.mm-logo-sub  { font-size: 8px; color: var(--mm-teal); letter-spacing: 3px; margin-top: 3px; }

.mm-sidebar-divider {
  height: 0.5px; background: #1e1e1e;
  margin: 0 18px 8px;
  position: relative; z-index: 2;
}

/* Navigation */
.mm-sidebar-nav {
  flex: 1; padding: 0 12px;
  position: relative; z-index: 2;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(4,196,213,0.25) transparent;
}
.mm-sidebar-nav::-webkit-scrollbar {
  width: 3px;
}
.mm-sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.mm-sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(4,196,213,0.25);
  border-radius: 99px;
}
.mm-sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(4,196,213,0.5);
}
.mm-nav-label {
  font-size: 9px; color: #444;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 10px 8px 5px;
}
.mm-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 7px;
  font-size: 13px; color: #666;
  text-decoration: none; margin-bottom: 2px;
  transition: all 0.15s;
}
.mm-nav-item:hover { color: #ccc; background: rgba(255,255,255,0.05); }
.mm-nav-item.active { background: rgba(4,196,213,0.12); color: var(--mm-teal); }
.mm-nav-item i { font-size: 15px; }

/* Bottom: Neue Rechnung + User */
.mm-sidebar-bottom {
  padding: 12px 14px 20px;
  position: relative; z-index: 2;
}
.mm-new-btn {
  display: block; text-align: center;
  background: var(--mm-orange);
  color: var(--mm-black) !important;
  font-weight: 600; font-size: 13px;
  padding: 10px 14px; border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s;
  margin-bottom: 10px;
}
.mm-new-btn:hover { background: #e8961f; }
.mm-user-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 7px;
  background: rgba(255,255,255,0.04);
  border: 0.5px solid #1e1e1e;
}
.mm-user-avatar {
  width: 28px; height: 28px;
  background: var(--mm-teal);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--mm-black);
  flex-shrink: 0;
}
.mm-user-name { font-size: 12px; color: #94a3b8; flex: 1; }
.mm-logout-btn { color: #555; font-size: 15px; transition: color 0.15s; }
.mm-logout-btn:hover { color: var(--mm-orange); }

/* ── Hauptbereich ────────────────────────────────────────────── */
.mm-main {
  margin-left: var(--mm-sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 4px);
}

/* Topbar */
.mm-topbar {
  background: #fff;
  border-bottom: 0.5px solid #e2e8f0;
  padding: 13px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 4px; z-index: 800;
}
.mm-topbar-title {
  font-size: 18px; font-weight: 600; color: #0a0a0a;
}
.mm-topbar-right {
  display: flex; align-items: center; gap: 10px;
}

/* Alerts */
.mm-alerts { padding: 0 26px; margin-top: 12px; }
.mm-alert { border-radius: 8px; font-size: 14px; }
.mm-alert.alert-success { border-left: 4px solid var(--mm-teal); }
.mm-alert.alert-warning { border-left: 4px solid var(--mm-orange); }
.mm-alert.alert-danger  { border-left: 4px solid #dc2626; }

/* Content */
.mm-content { padding: 20px 26px 60px; flex: 1; }

/* ── Karten ──────────────────────────────────────────────────── */
.card {
  border: 0.5px solid #e2e8f0 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  background: #fff;
}
.card-header {
  background: #fafafa !important;
  border-bottom: 0.5px solid #e8e8e8 !important;
  border-radius: 12px 12px 0 0 !important;
  font-weight: 600;
}

/* Stat-Karten */
.stat-card {
  background: #fff;
  border: 0.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.2rem;
}
.stat-card .label {
  font-size: 10px; color: #64748b;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.stat-card .value {
  font-size: 1.6rem; font-weight: 600; margin-top: 4px;
}
.stat-card .sub { font-size: 11px; color: #aaa; margin-top: 2px; }
.stat-card .value.teal   { color: var(--mm-teal); }
.stat-card .value.orange { color: var(--mm-orange); }
.stat-card .value.dark   { color: var(--mm-dark); }
.stat-card .value.red    { color: #dc2626; }

/* Status-Pillen */
.status-pill-card {
  background: #fff; border: 0.5px solid #e2e8f0;
  border-radius: 10px; padding: 10px 12px; text-align: center;
  cursor: pointer; text-decoration: none; display: block;
  transition: border-color 0.15s;
}
.status-pill-card:hover { border-color: var(--mm-teal); }
.status-pill-card .sp-label { font-size: 9px; color: #888; display: block; }
.status-pill-card .sp-count { font-size: 18px; font-weight: 600; color: #0a0a0a; }

/* ── Status-Badges ───────────────────────────────────────────── */
.badge-status {
  font-size: 11px; padding: 3px 9px;
  font-weight: 500; border-radius: 5px;
  white-space: nowrap;
}
.badge-entwurf   { background:#f1f5f9; color:#475569; }
.badge-geplant   { background:#dbeafe; color:#1d4ed8; }
.badge-versendet { background:#fef3c7; color:#92400e; }
.badge-offen     { background:#fee2e2; color:#991b1b; }
.badge-bezahlt   { background:#d1fae5; color:#065f46; }
.badge-storniert { background:#f1f5f9; color:#94a3b8; text-decoration:line-through; }

/* ── Tabellen ────────────────────────────────────────────────── */
.table thead th {
  background: #f8fafc !important;
  font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.4px; color: #64748b;
  border-bottom: 0.5px solid #e2e8f0 !important;
  font-weight: 600;
}
.table tbody tr { transition: background 0.1s; }
.table tbody tr:hover { background: #f8fafc !important; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary {
  background: var(--mm-teal) !important;
  border-color: var(--mm-teal) !important;
  color: #fff !important; border-radius: 7px;
}
.btn-primary:hover { background: #03afc0 !important; border-color: #03afc0 !important; }

.btn-success {
  background: var(--mm-dark) !important;
  border-color: var(--mm-dark) !important; border-radius: 7px;
}
.btn-success:hover { background: #0f5270 !important; }

.btn-outline-primary {
  color: var(--mm-teal) !important; border-color: var(--mm-teal) !important; border-radius: 7px;
}
.btn-outline-primary:hover {
  background: var(--mm-teal) !important; color: #fff !important;
}
.btn-outline-secondary { border-radius: 7px; }

/* ── Formulare ───────────────────────────────────────────────── */
.form-control:focus, .form-select:focus {
  border-color: var(--mm-teal);
  box-shadow: 0 0 0 0.2rem rgba(4,196,213,0.15);
}
.form-label { font-size: 13px; color: #475569; font-weight: 500; }

textarea.description-cell { min-height: 60px; }
.totals-box {
  background: #f8fafc; border-radius: 10px;
  padding: 1rem 1.25rem; border: 0.5px solid #e2e8f0;
}

/* ── Links ───────────────────────────────────────────────────── */
a { color: var(--mm-dark); }
a:hover { color: var(--mm-teal); }
.mm-link { color: var(--mm-teal); text-decoration: none; }
.mm-link:hover { color: var(--mm-dark); }

/* ── Breadcrumb ──────────────────────────────────────────────── */
.breadcrumb-item a { color: var(--mm-teal); text-decoration: none; }
.breadcrumb-item.active { color: #64748b; }

/* ── Login-Seite ─────────────────────────────────────────────── */
.mm-login-page {
  min-height: calc(100vh - 4px);
  background: var(--mm-black);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.mm-login-mosaic {
  position: absolute; inset: 0; opacity: 0.1; pointer-events: none;
}
.mm-login-mosaic img { width: 100%; height: 100%; object-fit: cover; }
.mm-login-card {
  background: #fff; border-radius: 16px;
  padding: 2.5rem 2rem; width: 380px;
  position: relative; z-index: 2;
  border: 0.5px solid #1e1e1e;
}
.mm-login-logo { text-align: center; margin-bottom: 1.5rem; }
.mm-login-logo img { max-height: 48px; max-width: 220px; object-fit: contain; }
.mm-login-logo .mm-logo-fallback { justify-content: center; display: flex; }

/* ── Overdue-Badge ───────────────────────────────────────────── */
.badge-overdue { background: #dc2626; color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 4px; }

/* ── Dropdown ────────────────────────────────────────────────── */
.dropdown-item:hover { background: rgba(4,196,213,0.08); color: var(--mm-dark); }
