@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #0d1117;
  --card-bg: rgba(22, 27, 34, 0.7);
  --card-border: rgba(48, 54, 61, 0.6);
  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --accent: #ff9500;
  --accent-glow: rgba(255, 149, 0, 0.15);
  --primary-gradient: linear-gradient(135deg, #ff7a00, #ffb800);
  --success-bg: rgba(46, 160, 67, 0.15);
  --success-border: rgba(46, 160, 67, 0.4);
  --success-text: #3fb950;
  --error-bg: rgba(248, 81, 73, 0.15);
  --error-border: rgba(248, 81, 73, 0.4);
  --error-text: #ff7b72;
}

/* Base resets */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  position: relative;
  padding-bottom: 28px;
  background: radial-gradient(circle at 10% 20%, rgba(88, 166, 255, 0.08) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(124, 92, 255, 0.06) 0%, transparent 45%),
              var(--bg);
  color: var(--text-primary);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: #ffb84d;
}

/* Main Spaltendesign (Flexbox) */
.main-layout {
  display: flex;
  max-width: 1100px;
  margin: 12px auto;
  gap: 16px;
  padding: 0 16px;
  align-items: flex-start;
}

.layout-left {
  flex: 3;
  min-width: 0;
}

.layout-right {
  flex: 2;
  min-width: 320px;
}

@media (max-width: 900px) {
  .main-layout {
    flex-direction: column;
    align-items: stretch;
  }
  .layout-right {
    min-width: 100%;
  }
}

/* Navigation Container */
.nav-container {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  max-width: min(1100px, calc(100% - 32px));
  margin: 16px auto !important;
}

.nav-container h2 {
  margin: 0 0 4px 0 !important;
  font-size: 16px !important;
}

.nav-container p {
  margin: 0 0 6px 0 !important;
  font-size: 13px !important;
  color: var(--text-secondary);
}

#kleiner {
  font-size: 12px !important;
  padding: 6px 0 0 0 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

#kleiner a, 
#kleiner strong a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 10px;
  margin: 0 2px;
  border-radius: 16px;
  display: inline-block;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  transition: all 0.15s ease;
}

#kleiner a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

#kleiner strong a {
  color: var(--text-primary) !important;
  background: var(--primary-gradient);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(88, 166, 255, 0.2);
}

/* Containers & Tables */
table:not(.DynarchCalendar):not(.DynarchCalendar table) {
  width: min(1100px, calc(100% - 32px)) !important;
  margin: 16px auto !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
}

/* Header style for table first row */
table tr:first-child h2, 
table tr:first-child h3 {
  margin: 8px 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: linear-gradient(to right, #ffffff, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Table cells styling */
td:not(.DynarchCalendar td) {
  padding: 8px 12px !important; /* Compact cell paddings */
  vertical-align: middle;
  border-bottom: 1px solid rgba(48, 54, 61, 0.25);
  font-size: 12.5px;
}

/* Remove border on the last row */
tr:last-child td {
  border-bottom: none;
}

/* Spacing and alignments */
td div[align="right"] {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 12px;
}

/* Inputs, Textareas, Selects */
input[type="text"],
input[type="password"],
select,
textarea {
  width: 100%;
  max-width: 520px;
  background: rgba(22, 27, 34, 0.6);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 7px 10px; /* Tighter padding for input elements */
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
  transition: all 0.15s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(22, 27, 34, 0.8);
}

textarea {
  max-width: 520px;
  min-height: 80px; /* Compact height */
  resize: vertical;
  line-height: 1.4;
}

/* Buttons */
input[type="submit"],
input[type="button"],
button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  border-radius: 16px;
  padding: 6px 14px; /* Tighter padding for buttons */
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

input[type="submit"]:hover,
input[type="button"]:hover,
button:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--text-secondary);
  transform: translateY(-0.5px);
}

/* Primary Button (Speichern/Login) */
input[type="submit"]#Speichern,
input[type="button"]#Speichern {
  background: var(--primary-gradient);
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(255, 122, 0, 0.2);
}

input[type="submit"]#Speichern:hover,
input[type="button"]#Speichern:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 122, 0, 0.3);
}

/* Logout Button */
#logout input[type="submit"] {
  background: rgba(248, 81, 73, 0.08);
  border: 1px solid rgba(248, 81, 73, 0.25);
  color: #ff7b72;
}

#logout input[type="submit"]:hover {
  background: rgba(248, 81, 73, 0.15);
  border-color: #ff7b72;
}

/* Delete Button */
#loeschenknopf {
  background: rgba(248, 81, 73, 0.12) !important;
  border: 1px solid rgba(248, 81, 73, 0.25) !important;
  color: #ff7b72 !important;
  border-radius: 16px !important;
  padding: 6px 14px !important;
}

#loeschenknopf:hover {
  background: rgba(248, 81, 73, 0.2) !important;
  border-color: #ff7b72 !important;
}

/* Status Banners */
.status-container {
  width: min(1100px, calc(100% - 32px));
  margin: 12px auto 0 auto;
}

.status-container p,
p.ok,
.ok {
  margin: 0;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  display: block;
}

.ok,
p.ok {
  background: var(--success-bg) !important;
  border: 1px solid var(--success-border) !important;
  color: var(--success-text) !important;
}

.error,
p.error {
  background: var(--error-bg) !important;
  border: 1px solid var(--error-border) !important;
  color: var(--error-text) !important;
}

/* Listing table styles (zeigen.php & zeigenalle.php) */
table.list-view {
  margin-top: 12px !important;
}

table.list-view tr:first-child td {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 2px solid var(--card-border);
  font-weight: bold;
}

table.list-view tr:not(:first-child):hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Stats styling (report.php) */
.stats-badge {
  background: rgba(88, 166, 255, 0.08);
  border: 1px solid rgba(88, 166, 255, 0.15);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 600;
  display: inline-block;
  font-size: 11.5px;
}

/* "Heute eingetragen" listing in sidebar */
.heute-container {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.heute-container h3 {
  margin: 0 0 12px 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-primary);
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 8px;
}

.heute-row {
  padding: 8px 0;
  border-bottom: 1px solid rgba(48, 54, 61, 0.2);
  font-size: 12px;
}

.heute-row:last-child {
  border-bottom: none;
}

.heute-meta {
  color: var(--text-secondary);
}

.heute-taetigkeit {
  font-weight: 500;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.9);
}

/* Calendar styling overrides to match dark mode */
.DynarchCalendar,
.DynarchCalendar *,
.DynarchCalendar-topBar,
.DynarchCalendar-bottomBar,
.DynarchCalendar-title,
.DynarchCalendar-menu {
  background-image: none !important;
}

.DynarchCalendar {
  background: #161b22 !important;
  border: 1px solid #30363d !important;
  color: #f0f6fc !important;
  font-family: inherit !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
}

.DynarchCalendar table {
  background: #161b22 !important;
  width: auto !important;
  margin: 0 !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.DynarchCalendar td {
  border: none !important;
  padding: 3px 4px !important;
}

.DynarchCalendar-topBar,
.DynarchCalendar-bottomBar {
  background: #21262d !important;
  border-color: #30363d !important;
}

.DynarchCalendar-dayNames div, 
.DynarchCalendar-day, 
.DynarchCalendar-weekNumber {
  color: #c9d1d9 !important;
}

.DynarchCalendar-day-othermonth {
  color: #484f58 !important;
}

.DynarchCalendar-weekend {
  color: #ff7b72 !important;
}

.DynarchCalendar-day-today {
  color: #58a6ff !important;
  font-weight: bold !important;
}

.DynarchCalendar-day-selected {
  background-color: var(--accent) !important;
  color: #ffffff !important;
  border-radius: 4px !important;
}

.DynarchCalendar-hover-date {
  background-color: rgba(255, 149, 0, 0.2) !important;
  color: #ffffff !important;
  border: 1px solid var(--accent) !important;
}

.DynarchCalendar-menu {
  background-color: #161b22 !important;
  opacity: 1 !important;
}

.DynarchCalendar-title div {
  color: #f0f6fc !important;
  text-shadow: none !important;
}

.DynarchCalendar-dayNames div {
  text-shadow: none !important;
}

/* Vorauswahl-Text Links */
a[href^="javascript:taetfuell"] {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 149, 0, 0.4);
  padding-bottom: 1px;
  margin-right: 4px;
  transition: all 0.15s ease;
}

a[href^="javascript:taetfuell"]:hover {
  color: #79c0ff;
  border-bottom-style: solid;
}

/* Responsive styles */
@media (max-width: 768px) {
  td {
    padding: 8px 10px !important;
  }
  input[type="text"],
  input[type="password"],
  select,
  textarea {
    max-width: 100%;
  }
}

/* Center login form vertically and horizontally */
body.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
}

.login-wrapper {
  width: 100%;
  max-width: 480px;
}

/* Absolute positioned footer at bottom center */
.app-footer {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 8px !important;
  color: var(--text-secondary);
  margin: 0;
  pointer-events: none;
}

/* Stats Page specific styles */
.stats-pills {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px auto;
  max-width: 1100px;
  padding: 0 16px;
}

.stats-pills a {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.stats-pills a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.stats-pills a.active {
  background: var(--primary-gradient);
  color: var(--text-primary) !important;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(255, 122, 0, 0.25);
  font-weight: 600;
}

.stats-grid {
  display: flex;
  max-width: 1100px;
  margin: 16px auto;
  gap: 20px;
  padding: 0 16px;
  align-items: stretch;
}

.stats-left {
  flex: 3;
  min-width: 0;
}

.stats-right {
  flex: 2;
  min-width: 320px;
}

@media (max-width: 900px) {
  .stats-grid {
    flex-direction: column;
  }
  .stats-right {
    min-width: 100%;
  }
}

.stats-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  height: 100%;
}

.stats-card h3 {
  margin-top: 0 !important;
  font-size: 15px !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.stats-overview-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  max-width: 1100px;
  margin: 16px auto;
  padding: 0 16px;
}

.overview-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.overview-val {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 4px;
}

.overview-lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}