/* Agentursoftware – Layout und Komponenten auf Basis von MDB 9 */
:root {
  --ag-accent: #1f8a70;
  --ag-sidebar-w: 236px;
  --ag-bg: #f4f6f8;
  --ag-border: #e3e7eb;
  --ag-text-muted: #6c757d;
  --mdb-primary: var(--ag-accent);
  --mdb-primary-rgb: 31, 138, 112;
  --mdb-link-color: var(--ag-accent);
  --mdb-link-hover-color: color-mix(in srgb, var(--ag-accent) 75%, #000);
}
body { background: var(--ag-bg); font-size: 0.9rem; color: #1f2933; }
a { color: var(--ag-accent); }
.btn-primary { --mdb-btn-bg: var(--ag-accent); --mdb-btn-hover-bg: color-mix(in srgb, var(--ag-accent) 88%, #000); --mdb-btn-focus-bg: var(--mdb-btn-hover-bg); --mdb-btn-active-bg: color-mix(in srgb, var(--ag-accent) 80%, #000); background-color: var(--ag-accent); }
.btn-outline-primary { --mdb-btn-color: var(--ag-accent); border-color: var(--ag-accent); color: var(--ag-accent); }
.btn-outline-primary:hover, .btn-check:checked + .btn-outline-primary { background: var(--ag-accent); color: #fff; border-color: var(--ag-accent); }
.nav-pills .nav-link { font-size: 0.82rem; padding: 0.45rem 0.9rem; margin: 0 0.15rem; border-radius: 999px; text-transform: none; background: transparent; box-shadow: none; color: #4a5560; }
.nav-pills .nav-link.active { background: var(--ag-accent); color: #fff; box-shadow: none; }
.form-control:focus, .form-select:focus { border-color: var(--ag-accent); box-shadow: inset 0 0 0 1px var(--ag-accent); }
.form-check-input:checked { background-color: var(--ag-accent); border-color: var(--ag-accent); }
.form-check-input[type=checkbox]:checked:focus, .form-check-input:checked:focus { background-color: var(--ag-accent); }
.form-label { font-size: 0.8rem; font-weight: 500; color: #4a5560; margin-bottom: 0.25rem; }
.card { box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06); border: 1px solid var(--ag-border); border-radius: 0.6rem; }
.card-header { background: #fff; border-bottom: 1px solid var(--ag-border); padding: 0.75rem 1rem; }
.table > :not(caption) > * > * { padding: 0.6rem 0.75rem; }
.table thead th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ag-text-muted); font-weight: 600; background: #fafbfc; }
.table tfoot td { background: #fafbfc; }
tr[data-ag-href] { cursor: pointer; }
.badge { font-weight: 600; }
.ag-badge { font-size: 0.72rem; }

/* Grundgerüst */
.ag-shell { display: flex; min-height: 100vh; }
.ag-sidebar { width: var(--ag-sidebar-w); flex: 0 0 var(--ag-sidebar-w); background: #fff; border-right: 1px solid var(--ag-border); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 0.75rem; z-index: 1040; }
.ag-brand { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.5rem 1rem; color: #111; font-weight: 700; text-decoration: none; }
.ag-brand__logo { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; background: var(--ag-accent); color: #fff; }
.ag-brand__logo--lg { width: 56px; height: 56px; border-radius: 14px; font-size: 1.5rem; }
.ag-brand__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-nav { display: flex; flex-direction: column; gap: 2px; }
.ag-nav__link { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.75rem; border-radius: 0.5rem; color: #3b4652; text-decoration: none; font-weight: 500; }
.ag-nav__link i { color: #8a95a1; width: 1.2rem; }
.ag-nav__link:hover { background: #f1f4f6; color: #111; }
.ag-nav__link.active { background: color-mix(in srgb, var(--ag-accent) 12%, #fff); color: var(--ag-accent); }
.ag-nav__link.active i { color: var(--ag-accent); }
.ag-nav__sep { height: 1px; background: var(--ag-border); margin: 0.6rem 0.4rem; }
.ag-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ag-topbar { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: 1rem; height: 60px; padding: 0 1.5rem; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--ag-border); }
.ag-search { position: relative; flex: 1; max-width: 520px; }
.ag-search i { position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); color: #9aa5b1; }
.ag-search .form-control { padding-left: 2.2rem; background: #f4f6f8; border-color: transparent; border-radius: 999px; }
.ag-topbar__right { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.ag-user { color: #3b4652; text-transform: none; }
.ag-content { padding: 1.5rem; max-width: 1500px; width: 100%; }
.ag-pagehead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; }
.ag-title { font-size: 1.45rem; font-weight: 700; margin: 0; }
.ag-toolbar { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.breadcrumb { font-size: 0.8rem; }
.ag-flash { margin-bottom: 1rem; }
.ag-burger { color: #3b4652; padding: 0.25rem 0.5rem; }

@media (max-width: 991.98px) {
  .ag-sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform 0.2s; box-shadow: 0 0 40px rgba(0, 0, 0, 0.15); }
  .ag-sidebar.open { transform: none; }
  .ag-content { padding: 1rem; }
  .ag-topbar { padding: 0 0.75rem; }
}

/* Login */
.ag-login { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, color-mix(in srgb, var(--ag-accent) 14%, #fff), var(--ag-bg)); }
.ag-login__box { width: 100%; max-width: 400px; padding: 1rem; }

/* Bausteine */
.ag-kpi { text-decoration: none; color: inherit; transition: box-shadow 0.15s, transform 0.15s; }
a.ag-kpi:hover { box-shadow: 0 6px 18px rgba(16, 24, 40, 0.1); transform: translateY(-1px); color: inherit; }
.ag-kpi .card-body { position: relative; padding: 1rem 1.1rem; }
.ag-kpi__icon { position: absolute; right: 1rem; top: 1rem; font-size: 1.2rem; opacity: 0.85; }
.ag-kpi__label { font-size: 0.75rem; color: var(--ag-text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.ag-kpi__value { font-size: 1.45rem; font-weight: 700; margin-top: 0.2rem; white-space: nowrap; }
.ag-kpi__sub { font-size: 0.78rem; color: var(--ag-text-muted); margin-top: 0.15rem; }
.ag-empty { text-align: center; padding: 2rem 1rem; color: var(--ag-text-muted); }
.ag-empty i { font-size: 2rem; opacity: 0.4; margin-bottom: 0.6rem; }
.ag-empty p { max-width: 520px; margin: 0 auto 0.8rem; }
.ag-filterbar { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; align-items: center; }
.ag-filterbar .nav-pills .nav-link { margin: 0; }
.ag-filterbar__search { min-width: 220px; }
.ag-avatar { width: 46px; height: 46px; border-radius: 50%; background: color-mix(in srgb, var(--ag-accent) 14%, #fff); color: var(--ag-accent); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.ag-facts li { display: flex; gap: 0.5rem; align-items: baseline; margin-bottom: 0.3rem; }
.ag-facts i { color: #9aa5b1; }
.ag-note { background: #fffbea; border: 1px solid #f5e6a8; border-radius: 0.4rem; padding: 0.5rem 0.7rem; }
.ag-dl { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; }
.ag-dl dt { font-weight: 500; color: var(--ag-text-muted); }
.ag-dl dd { margin: 0; text-align: right; }
.ag-log .list-group-item { padding: 0.5rem 1rem; }
.ag-sticky { position: sticky; top: 76px; }
.ag-chip { border-radius: 999px; text-transform: none; padding: 0.2rem 0.7rem; font-size: 0.78rem; }
.ag-daterow td { background: #f6f8fa; font-weight: 600; font-size: 0.78rem; color: #4a5560; }

/* Diagramm */
.ag-chart { width: 100%; height: auto; }
.ag-chart__grid { stroke: #edf0f2; stroke-width: 1; }
.ag-chart__axis { font-size: 11px; fill: #8a95a1; }
.ag-chart__in { fill: var(--ag-accent); }
.ag-chart__out { fill: #f0a35e; }
.ag-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; }
.ag-dot--in { background: var(--ag-accent); }
.ag-dot--out { background: #f0a35e; }

/* Berichte */
.ag-report td, .ag-report th { white-space: nowrap; }
.ag-report__head td { background: #f6f8fa; font-weight: 700; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.05em; color: #4a5560; }
.ag-report__total td { font-weight: 700; font-size: 1.05rem; border-top: 2px solid #1f2933; background: #fafbfc; }

/* Dokumente */
.ag-postable td { vertical-align: top; }
.ag-postable .form-control, .ag-postable .form-select { font-size: 0.85rem; }
.ag-pos__handle { width: 22px; padding-left: 0.5rem !important; padding-right: 0 !important; }
.ag-pos__handle .btn { display: block; line-height: 1; color: #9aa5b1; }
.ag-pos__num { width: 110px; }
.ag-pos__unit { width: 95px; }
.ag-pos__ust { width: 88px; }
.ag-pos__sum { width: 110px; font-weight: 600; padding-top: 0.95rem !important; white-space: nowrap; }
.ag-pos--text td { background: #fafbfc; }
.ag-postable textarea { resize: vertical; min-height: 31px; }
.ag-totals { min-width: 280px; }
.ag-totals td { padding: 0.2rem 0 0.2rem 1.5rem; text-align: right; white-space: nowrap; }
.ag-totals td:first-child { text-align: left; padding-left: 0; color: var(--ag-text-muted); }
.ag-totals tr.ag-totals__sum td { font-weight: 700; font-size: 1.1rem; color: #111; border-top: 1px solid #1f2933; padding-top: 0.4rem; }
.ag-preview__frame { width: 100%; height: calc(100vh - 170px); min-height: 640px; border: 0; border-radius: 0.6rem; display: block; background: #525659; }

/* Zeiterfassung */
.ag-timer--running { border-color: #f1aeb5; background: #fff6f7; }
.ag-timer__clock { font-size: 2.2rem; font-weight: 700; font-variant-numeric: tabular-nums; color: #dc3545; min-width: 150px; }
.ag-timer-badge { font-variant-numeric: tabular-nums; }

/* Belege */
.ag-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 2px dashed #cfd6dd; border-radius: 0.6rem; padding: 2rem 1rem; color: var(--ag-text-muted); cursor: pointer; transition: all 0.15s; }
.ag-drop:hover, .ag-drop.is-over { border-color: var(--ag-accent); color: var(--ag-accent); background: color-mix(in srgb, var(--ag-accent) 6%, #fff); }
.ag-drop.has-file { border-style: solid; border-color: var(--ag-accent); color: #111; }
.ag-beleg-frame { width: 100%; height: 520px; border: 1px solid var(--ag-border); border-radius: 0.4rem; margin-bottom: 0.5rem; }

/* Hilfe */
.ag-helpbtn { color: #6c7a89; padding: 0.25rem 0.4rem; }
.ag-helpbtn:hover { color: var(--ag-accent); }
.ag-help-nav .list-group-item { border: 0; padding: 0.5rem 1rem; font-size: 0.86rem; }
.ag-help-nav .list-group-item.active { background: color-mix(in srgb, var(--ag-accent) 12%, #fff); color: var(--ag-accent); font-weight: 600; }
.ag-help-nav .list-group-item.active i { color: var(--ag-accent); }
.ag-help { font-size: 0.92rem; line-height: 1.6; max-width: 860px; }
.ag-help h2 { font-size: 1.15rem; font-weight: 700; margin: 1.8rem 0 0.6rem; scroll-margin-top: 80px; }
.ag-help h2.h4 { margin-top: 0; font-size: 1.35rem; }
.ag-help h3 { font-size: 1rem; font-weight: 700; margin: 1.3rem 0 0.4rem; scroll-margin-top: 80px; }
.ag-help ul, .ag-help ol { padding-left: 1.3rem; }
.ag-help li { margin-bottom: 0.25rem; }
.ag-help code { background: #f1f4f6; color: #b02a5b; padding: 0.05rem 0.35rem; border-radius: 4px; font-size: 0.85em; }
.ag-help blockquote { border-left: 4px solid var(--ag-accent); background: color-mix(in srgb, var(--ag-accent) 6%, #fff); padding: 0.6rem 1rem; margin: 1rem 0; border-radius: 0 6px 6px 0; }
.ag-help blockquote p:last-child { margin-bottom: 0; }
.ag-help table { width: auto; margin: 0.8rem 0 1.2rem; }
.ag-help-toc { background: #f6f8fa; border-radius: 8px; padding: 0.7rem 1rem; margin-bottom: 1rem; display: inline-block; min-width: 260px; }
.ag-help-toc ul { list-style: none; padding: 0; margin: 0; }
.ag-help-toc li { margin: 0.15rem 0; }
.ag-help-toc a { font-size: 0.85rem; }
mark { background: #fff3b0; padding: 0 0.1rem; }
.ag-help-toc ul ul { padding-left: 0.9rem; }

/* Mehrfachauswahl */
.ag-check { width: 2.2rem; padding-right: 0 !important; cursor: default; }
.ag-bulkbar { display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 1rem; background: color-mix(in srgb, var(--ag-accent) 10%, #fff); border-bottom: 1px solid var(--ag-border); position: sticky; top: 60px; z-index: 5; }
.ag-bulkbar[hidden] { display: none; }
