:root {
  --color-main: #007F7F;
  --color-accent: #484848;
  --color-secondary: #00CCB3;
  --color-bg: #FFF7DC;
  --color-typo: #FFF7DC;
}

body {
  font-family: 'Inter', 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-accent); /* Basic text color since FFF7DC is background */
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--color-main);
  margin-top: 0;
}

a {
  color: var(--color-main);
  text-decoration: none;
}
a:hover {
  color: var(--color-secondary);
}

/* Base button styles */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  font-weight: 600;
  text-align: center;
}

.btn-primary {
  background-color: var(--color-main);
  color: var(--color-typo); 
}
.btn-primary:hover {
  background-color: var(--color-secondary);
  color: var(--color-accent);
  box-shadow: 0 4px 12px rgba(0, 204, 179, 0.3);
}

.btn-accent {
  background-color: var(--color-accent);
  color: var(--color-bg);
}
.btn-accent:hover {
  opacity: 0.9;
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: var(--color-accent);
}
.btn-secondary:hover {
  background-color: var(--color-main);
  color: var(--color-typo);
}

/* Authentication Card */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  /* Soft gradient adding secondary color lightly over background */
  background: radial-gradient(circle at center, rgba(0,204,179,0.1) 0%, var(--color-bg) 100%);
}

.auth-card {
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(72, 72, 72, 0.1);
  width: 100%;
  max-width: 400px;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 14px;
  color: var(--color-accent);
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-main);
  box-shadow: 0 0 0 3px rgba(0, 127, 127, 0.15);
}

.form-error {
  color: #ff4d4d;
  font-size: 13px;
  margin-bottom: 15px;
  text-align: center;
}

/* Dashboard & Layout */
.navbar {
  background-color: var(--color-main);
  padding: 0 30px;
  height: 60px;
  display: flex;
  align-items: center;
  color: var(--color-typo);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  position: relative;
  z-index: 1000;
}

.navbar-left, .navbar-right {
  flex: 1;
  display: flex;
  align-items: center;
}

.navbar-right {
  justify-content: flex-end;
}

.navbar-center {
  flex: 2;
  display: flex;
  justify-content: center;
  align-items: center;
}

.navbar-logo {
  height: 35px;
}

.navbar-brand-centered {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-typo);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-decoration: none;
  transition: transform 0.2s;
}

.navbar-brand-centered:hover {
  transform: scale(1.05);
  color: #fff;
}

.menu-trigger {
  width: 45px;
  height: 45px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.2s;
  background-color: rgba(255, 255, 255, 0.1);
}

.menu-trigger:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.menu-icon {
  font-size: 24px;
  color: var(--color-typo);
}

.has-dropdown:hover .megamenu-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.megamenu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  min-width: 300px;
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
  display: flex;
  flex-direction: column;
  margin-top: 5px;
}

.megamenu-user-info {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  background: linear-gradient(135deg, var(--color-main) 0%, var(--color-secondary) 100%);
  border-radius: 12px;
  margin-bottom: 10px;
  color: white;
}

.user-avatar {
  font-size: 32px;
  background: rgba(255, 255, 255, 0.2);
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
}

.user-name {
  font-weight: 800;
  font-size: 16px;
}

.user-status {
  font-size: 12px;
  opacity: 0.9;
}

.megamenu-divider {
  height: 1px;
  background-color: #eee;
  margin: 5px 10px;
}

.megamenu-link {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 15px;
  border-radius: 10px;
  color: var(--color-accent) !important;
  transition: all 0.2s ease;
  text-decoration: none;
}

.megamenu-link:hover {
  background-color: #f5f5f5;
  transform: translateX(-5px);
  color: var(--color-main) !important;
}

.logout-link:hover {
  background-color: #fff1f1;
  color: #ff4d4d !important;
}

.megamenu-icon {
  font-size: 20px;
  width: 30px;
  display: flex;
  justify-content: center;
}

.megamenu-title {
  font-weight: bold;
  font-size: 15px;
}

.megamenu-subtitle {
  font-size: 12px;
  color: #888;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 40px 20px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid rgba(0, 127, 127, 0.1);
}

/* Tables */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(72, 72, 72, 0.05);
  overflow: hidden;
  margin-bottom: 30px;
}

.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}

th {
  background-color: var(--color-main);
  color: var(--color-typo);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tr:hover td {
  background-color: #fafafa;
}

/* Specific styling */
.amount-in {
  color: var(--color-main);
  font-weight: bold;
}

.amount-out {
  color: var(--color-accent);
  font-weight: bold;
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}

.badge-success {
  background-color: rgba(0, 204, 179, 0.2);
  color: var(--color-main);
}

.badge-danger {
  background-color: rgba(255, 77, 77, 0.1);
  color: #ff4d4d;
}

/* Filters */
.filter-bar {
  display: flex;
  gap: 15px;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(72, 72, 72, 0.05);
  margin-bottom: 30px;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-group label {
  font-size: 13px;
  font-weight: bold;
  color: var(--color-accent);
  margin-bottom: 6px;
}

.filter-group select,
.filter-group input[type="text"] {
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  font-size: 14px;
  min-width: 150px;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--color-main);
}

/* Quick Utilities */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 10px; }
.gap-3 { gap: 15px; }
.mt-3 { margin-top: 15px; }
.mb-3 { margin-bottom: 15px; }
.text-center { text-align: center; }

/* Konto Modal (HeidelHub Design) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-heidelhub {
  background: white;
  width: 90%;
  max-width: 400px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

.modal-header {
  background-color: var(--color-main);
  color: var(--color-typo);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}

.modal-header .close-btn {
  background: none;
  border: none;
  color: var(--color-typo);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.modal-search {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 15px;
  box-sizing: border-box;
}

.modal-search:focus {
  outline: none;
  border-color: var(--color-main);
}

.konto-list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;
  border: 1px solid #eee;
  border-radius: 6px;
}

.konto-item {
  padding: 12px 15px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.konto-item:last-child {
  border-bottom: none;
}

.konto-item:hover {
  background-color: rgba(0, 204, 179, 0.1);
}

.konto-item-id {
  font-weight: bold;
  color: var(--color-main);
  margin-right: 15px;
}

.konto-item-name {
  color: var(--color-accent);
  font-size: 14px;
  text-align: right;
  flex: 1;
}

.konto-badge {
  display: inline-block;
  padding: 6px 12px;
  background-color: var(--color-bg);
  border: 1px solid var(--color-main);
  color: var(--color-main);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  min-width: 60px;
  transition: all 0.2s;
}

.konto-badge:hover {
  background-color: var(--color-main);
  color: var(--color-typo);
}

.konto-badge.empty {
  background-color: #f8f9fa;
  border-color: #ddd;
  color: #888;
}

.konto-badge.empty:hover {
  border-color: var(--color-main);
  color: var(--color-main);
}
/* File Upload UI */
.file-upload-wrapper {
  position: relative;
  width: 100%;
}

.file-upload-input {
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  z-index: -1;
}

.file-upload-label {
  display: block;
  padding: 10px 14px;
  background-color: white;
  border: 1px dashed #bbb;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-accent);
  text-align: left;
  transition: all 0.2s;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
}

.file-upload-label:hover {
  border-color: var(--color-main);
  background-color: #fafafa;
}

/* Years Grid Layout */
.years-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
  margin-top: 20px;
}

.year-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 15px rgba(72, 72, 72, 0.08);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid #f0f0f0;
}

.year-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(72, 72, 72, 0.12);
}

.year-card h3 {
  font-size: 28px;
  margin-bottom: 20px;
  text-align: center;
  border-bottom: 2px solid rgba(0, 127, 127, 0.1);
  padding-bottom: 10px;
}

.year-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 25px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
}

.stat-label {
  color: var(--color-accent);
  font-weight: 500;
}

.stat-value {
  font-weight: 700;
  color: var(--color-main);
}

.year-actions {
  margin-top: auto;
  display: flex;
  gap: 12px;
}

.year-actions .btn {
  flex: 1;
}

.btn-danger {
  background-color: #ff4d4d;
  color: white;
}

.btn-danger:hover {
  background-color: #e60000;
  box-shadow: 0 4px 12px rgba(255, 77, 77, 0.3);
}
