/* =========================================
   Basis
========================================= */
:root{
  --bg: #f3f4f6;
  --card: rgba(255,255,255,0.9);
  --text: #111827;
  --muted: rgba(0,0,0,0.55);
  --border: rgba(0,0,0,0.08);

  --primary: #16a34a;
  --primary-dark: #15803d;

  --secondary: #e5e7eb;
  --secondary-text: #111827;

  --danger: #ef4444;
}

*{ box-sizing:border-box; }

html, body{
  margin:0;
  padding:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

a{ color: inherit; text-decoration:none; }

/* =========================================
   Layout Shell
========================================= */
.app-shell{
  min-height: 100vh;
}

.app-main{
  padding: 18px 14px;
}

.app-container{
  max-width: 1100px;
  margin: 0 auto;
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.10);
}

/* =========================================
   Header / Navigation
========================================= */
.app-header{
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 14px 14px;
  background: linear-gradient(90deg,#1d4ed8,#22c55e);
  color: #fff;
  box-shadow: 0 14px 30px rgba(0,0,0,0.20);
}

.app-header-title{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight: 800;
  font-size: 1.15rem;
}

.app-header-badge{
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.28);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
}

.app-header-nav{
  display:flex;
  gap:12px;
  align-items:center;
  margin-top: 10px;
}

.app-header-nav a{
  color:#fff;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  font-weight: 700;
  font-size: 0.95rem;
}

.app-header-nav a:hover{
  background: rgba(255,255,255,0.20);
}

.app-header-toggle{
  display:none;
  margin-left:auto;
  border: 0;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 12px;
  width: 46px;
  height: 42px;
  cursor: pointer;
}

.app-header-toggle span{
  display:block;
  height: 2px;
  width: 20px;
  background:#fff;
  margin: 4px auto;
  border-radius: 2px;
}

/* =========================================
   Text / Sections
========================================= */
.section-title{
  font-weight: 900;
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.section-subtitle{
  color: rgba(0,0,0,0.62);
  margin-bottom: 10px;
}

.link-muted{
  color: rgba(0,0,0,0.55);
  font-size: 0.9rem;
}

/* =========================================
   Forms / Buttons
========================================= */
.form-group{ margin-bottom: 10px; }
label{ font-size: 0.85rem; color: rgba(0,0,0,0.65); font-weight: 700; }

input, select, textarea{
  width: 100%;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 1rem;
  outline: none;
  background: #fff;
}

textarea{ resize: vertical; }

.btn{
  display:inline-block;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 800;
  border: 0;
  cursor: pointer;
}

.btn-primary{
  background: var(--primary);
  color: #fff;
  box-shadow: 0 18px 30px rgba(34,197,94,0.25);
}
.btn-primary:hover{ background: var(--primary-dark); }

.btn-secondary{
  background: var(--secondary);
  color: var(--secondary-text);
}

.btn-danger{
  background: var(--danger);
  color:#fff;
}
.btn-danger:hover{ filter: brightness(0.95); }

.error{
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
}

/* =========================================
   Filter + Summe
========================================= */
.filter-row{
  display:flex;
  gap: 12px;
  align-items:flex-end;
  flex-wrap: wrap;
}

.filter-row > div{
  min-width: 180px;
  flex: 1;
}

.filter-actions{
  display:flex;
  gap:10px;
  min-width: 220px;
  flex: 0 0 auto;
}

.sum-box{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(34,197,94,0.25);
  background: rgba(34,197,94,0.08);
  font-weight: 900;
  color: #166534;
}

/* =========================================
   Tables
========================================= */
.table-wrapper{
  overflow:auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  background:#fff;
}

table{
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

thead th{
  text-align:left;
  padding: 10px 12px;
  background: rgba(0,0,0,0.04);
  border-bottom: 1px solid var(--border);
  font-weight: 900;
  letter-spacing: 0.02em;
}

tbody td{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  vertical-align: top;
}

/* =========================================
   Entries Cards (mobile view for user_entries.php)
========================================= */
.entries-cards { display: none; }
.entries-table { display: block; }

.entry-card{
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  margin: 10px 0;
  background: #fff;
  box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}

.entry-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom: 8px;
}

.entry-date{ font-weight: 900; font-size: 1.02rem; }
.entry-hours{
  font-weight: 900;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.25);
}

.entry-row{
  display:grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 6px 10px;
  align-items:center;
  font-size: 0.95rem;
  margin: 8px 0;
}

.entry-row span{ color: var(--muted); font-size: 0.85rem; }
.entry-row strong{ font-weight: 900; }

.entry-block{ margin-top: 8px; }
.entry-label{ font-size: 0.8rem; color: var(--muted); margin-bottom: 3px; font-weight: 800; }
.entry-value{ font-size: 0.95rem; line-height: 1.25rem; }

.entry-actions{
  display:flex;
  gap:10px;
  margin-top: 10px;
}
.entry-actions .btn{
  flex:1;
  text-align:center;
  padding: 12px;
}

/* =========================================
   Responsive
========================================= */
@media (max-width: 820px){
  .app-main{ padding: 14px 12px; }
  .card{ padding: 14px; }

  /* Burger menu */
  .app-header{
    display:flex;
    flex-wrap: wrap;
    align-items:center;
    gap:10px;
  }

  .app-header-title{
    flex: 1 1 auto;
    font-size: 1.05rem;
  }

  .app-header-toggle{
    display:inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .app-header-nav{
    width: 100%;
    display:none;
    margin-top: 10px;
    flex-direction: column;
    gap: 10px;
  }

  .app-header-nav.is-open{
    display:flex;
  }

  .app-header-nav a{
    width: 100%;
    text-align:center;
    padding: 12px 14px;
  }

  /* Filter stacking */
  .filter-row > div{
    min-width: 100%;
  }
  .filter-actions{
    width: 100%;
  }
  .filter-actions .btn{
    flex:1;
    text-align:center;
  }

  /* entries view: cards on mobile */
  .entries-cards { display:block; }
  .entries-table { display:none; }
}
