/* LT Intelligence Buchhaltung – Modernes Design (Schwarz/Cream/Beige) */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --color-text:        #1A1A1A;
  --color-text-soft:   #4A4A4A;
  --color-text-muted:  #8A8580;
  --color-text-faint:  #B8B3AC;

  --color-bg:          #F7F4EE;   /* warmer Cream-Hintergrund */
  --color-card:        #FFFFFF;
  --color-card-soft:   #FBF9F4;
  --color-row-alt:     #F5F2EC;

  --color-border:      #E8E2D5;
  --color-border-soft: #F0EBE0;

  --color-accent:      #C9A875;   /* Beige/Gold */
  --color-accent-deep: #A8895D;
  --color-accent-soft: #F2E9D8;

  --color-success:     #2F6F4F;
  --color-success-bg:  #E5F0EA;
  --color-warning:     #B8763E;
  --color-warning-bg:  #FBF0E2;
  --color-danger:      #B33A3A;
  --color-danger-bg:   #FBE7E7;

  --shadow-sm: 0 1px 2px rgba(26,26,26,0.04);
  --shadow-md: 0 4px 16px rgba(26,26,26,0.06);
  --shadow-lg: 0 16px 40px rgba(26,26,26,0.10);

  --radius:    14px;
  --radius-lg: 20px;
  --radius-sm: 8px;

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 240px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', Monaco, Consolas, monospace;
}

@import url('https://rsms.me/inter/inter.css');

* { font-family: var(--font-sans); }
html, body { height: 100%; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}
.hidden { display: none !important; }
button { font-family: inherit; font-size: 14px; cursor: pointer; }
input, textarea, select {
  font-family: inherit; font-size: 14px;
  padding: 11px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: white;
  width: 100%;
  color: var(--color-text);
  transition: all var(--transition);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-text);
  box-shadow: 0 0 0 3px rgba(26,26,26,0.06);
}
label {
  display: block;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
label > input, label > textarea, label > select { margin-top: 6px; text-transform: none; letter-spacing: 0; }

/* ============ LOGO ============ */
.logo-mark {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}
.logo-mark.small { width: 32px; height: 32px; }
.logo-mark svg { width: 100%; height: 100%; }

/* ============ LOGIN ============ */
.login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 800px 600px at 30% 20%, rgba(201,168,117,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 700px 500px at 70% 80%, rgba(26,26,26,0.04) 0%, transparent 60%),
    var(--color-bg);
  padding: 24px;
}
.login-card {
  background: var(--color-card);
  padding: 48px 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--color-border-soft);
}
.logo-block {
  text-align: center;
  margin-bottom: 36px;
}
.logo-block .logo-mark {
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
}
.logo-block h1 {
  color: var(--color-text);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.5px;
}
.subtitle {
  color: var(--color-text-muted);
  font-size: 13px;
  margin-top: 6px;
  letter-spacing: 0.2px;
}

/* ============ BUTTONS ============ */
.btn-primary {
  background: var(--color-text);
  color: white; border: none;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  letter-spacing: 0.2px;
  transition: all var(--transition);
}
.btn-primary:hover {
  background: #000;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}
.btn-block { width: 100%; padding: 14px; margin-top: 16px; }
.btn-secondary {
  background: white;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all var(--transition);
}
.btn-secondary:hover {
  border-color: var(--color-text);
  background: var(--color-card-soft);
}
.btn-accent {
  background: var(--color-accent);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all var(--transition);
}
.btn-accent:hover {
  background: var(--color-accent-deep);
}
.btn-danger {
  background: var(--color-danger); color: white; border: none;
  padding: 9px 16px; border-radius: var(--radius-sm); font-weight: 500;
}
.btn-text {
  background: none; border: none; color: var(--color-text-muted);
  text-decoration: underline; cursor: pointer; font-size: 13px;
}
.error {
  color: var(--color-danger);
  font-size: 13px;
  margin-top: 10px;
  min-height: 18px;
}

/* ============ MAIN LAYOUT ============ */
.main-screen { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-card);
  border-right: 1px solid var(--color-border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}
.sidebar-header {
  padding: 22px 18px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--color-border-soft);
}
.sidebar-title {
  font-weight: 600;
  color: var(--color-text);
  font-size: 16px;
  letter-spacing: -0.3px;
}
.close-sidebar {
  margin-left: auto;
  background: none; border: none;
  font-size: 24px; line-height: 1; color: var(--color-text-muted);
  display: none;
}
.nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.nav-item {
  display: block;
  padding: 11px 14px;
  color: var(--color-text-soft);
  text-decoration: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 3px;
  transition: all var(--transition);
  font-weight: 500;
  font-size: 14px;
}
.nav-item:hover {
  background: var(--color-card-soft);
  color: var(--color-text);
}
.nav-item.active {
  background: var(--color-text);
  color: white;
  font-weight: 500;
}
.sidebar-footer {
  padding: 18px 16px;
  border-top: 1px solid var(--color-border-soft);
  background: var(--color-card-soft);
}
.user-info { margin-bottom: 8px; }
.user-name { font-weight: 600; font-size: 13px; color: var(--color-text); }
.user-email { color: var(--color-text-muted); font-size: 12px; }

.content {
  flex: 1; margin-left: var(--sidebar-width);
  display: flex; flex-direction: column;
  min-width: 0;
}
.topbar {
  background: var(--color-card);
  padding: 18px 28px;
  display: flex; align-items: center; gap: 16px;
  border-bottom: 1px solid var(--color-border-soft);
  position: sticky; top: 0; z-index: 50;
}
.menu-btn {
  display: none;
  background: none; border: none;
  font-size: 22px;
  color: var(--color-text);
}
.topbar h2 {
  font-size: 22px;
  font-weight: 600;
  flex: 1;
  letter-spacing: -0.3px;
}
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.page { padding: 28px; }

/* ============ CARDS ============ */
.card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid var(--color-border-soft);
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--color-text);
  letter-spacing: -0.2px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  border: 1px solid var(--color-border-soft);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--color-text);
  opacity: 0;
  transition: opacity var(--transition);
}
.stat-card:hover::before { opacity: 1; }
.stat-label {
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  margin-bottom: 10px;
}
.stat-value {
  font-size: 30px;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.8px;
  font-feature-settings: 'tnum';
}
.stat-meta {
  font-size: 12px;
  color: var(--color-text-faint);
  margin-top: 6px;
}
.stat-card.success::before { background: var(--color-success); opacity: 1; }
.stat-card.success .stat-value { color: var(--color-success); }
.stat-card.warning::before { background: var(--color-warning); opacity: 1; }
.stat-card.warning .stat-value { color: var(--color-warning); }
.stat-card.danger::before  { background: var(--color-danger); opacity: 1; }
.stat-card.danger .stat-value { color: var(--color-danger); }
.stat-card.accent::before { background: var(--color-accent); opacity: 1; }

/* ============ TABELLEN ============ */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
thead th {
  text-align: left;
  padding: 12px 16px;
  background: transparent;
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border-soft);
  color: var(--color-text);
}
tbody tr { transition: background var(--transition); cursor: pointer; }
tbody tr:hover { background: var(--color-card-soft); }
tbody tr:last-child td { border-bottom: none; }

/* ============ BADGES ============ */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-danger  { background: var(--color-danger-bg);  color: var(--color-danger); }
.badge-info    { background: rgba(26,26,26,0.06);     color: var(--color-text); }
.badge-muted   { background: var(--color-row-alt);    color: var(--color-text-muted); }
.badge-accent  { background: var(--color-accent-soft); color: var(--color-accent-deep); }

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26,26,26,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn var(--transition);
}
.modal {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border-soft);
}
.modal-title {
  font-size: 20px;
  font-weight: 600;
  flex: 1;
  letter-spacing: -0.3px;
}
.modal-close {
  background: none; border: none;
  font-size: 26px; line-height: 1; color: var(--color-text-muted);
  width: 32px; height: 32px;
  border-radius: 50%;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--color-card-soft); color: var(--color-text); }
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 28px; padding-top: 18px;
  border-top: 1px solid var(--color-border-soft);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
.form-grid .full { grid-column: 1 / -1; }

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: var(--color-text);
  color: white;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all 0.3s;
  max-width: 380px;
  font-weight: 500;
  letter-spacing: 0.1px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: var(--color-success); }
.toast.error   { background: var(--color-danger); }
.toast.warning { background: var(--color-warning); }

/* ============ EMPTY STATE ============ */
.empty {
  padding: 72px 24px;
  text-align: center;
  color: var(--color-text-muted);
}
.empty-icon { font-size: 56px; margin-bottom: 18px; opacity: 0.6; }
.empty-title { font-size: 18px; font-weight: 600; color: var(--color-text); margin-bottom: 8px; letter-spacing: -0.2px; }
.empty-text { font-size: 14px; margin-bottom: 24px; max-width: 360px; margin-left: auto; margin-right: auto; }

/* ============ LOADING ============ */
.loading {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(26,26,26,0.15);
  border-top-color: var(--color-text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 18px; align-items: center;
}
.search-input {
  flex: 1; min-width: 220px;
}

/* ============ MOBILE ============ */
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    z-index: 200;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .close-sidebar { display: block; }
  .content { margin-left: 0; }
  .menu-btn { display: block; }
  .topbar h2 { font-size: 18px; }
  .page { padding: 18px; }
  .stat-value { font-size: 24px; }
  .form-grid { grid-template-columns: 1fr; }
  thead th, tbody td { padding: 10px; font-size: 13px; }
  .modal { padding: 22px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 10px; }
}

.divider { height: 1px; background: var(--color-border-soft); margin: 18px 0; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-end { display: flex; gap: 10px; justify-content: flex-end; }
.spacer { flex: 1; }
.muted { color: var(--color-text-muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 18px; }
.mt-2 { margin-top: 18px; }

.amount {
  font-family: var(--font-mono);
  font-weight: 500;
  font-feature-settings: 'tnum';
  letter-spacing: -0.2px;
}
.amount.positive { color: var(--color-success); }
.amount.negative { color: var(--color-danger); }
