/* =====================================================
   ADE Zeiterfassung – Stylesheet
   Matches ADE Engineering website design
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Variables ── */
:root {
  --primary:        #4361EE;
  --primary-dark:   #3730A3;
  --primary-light:  #EEF2FF;
  --accent:         #06B6D4;
  --gradient:       linear-gradient(135deg, #4361EE 0%, #06B6D4 100%);
  --text:           #0F172A;
  --text-muted:     #64748B;
  --bg:             #F8FAFC;
  --bg-card:        #FFFFFF;
  --border:         #E2E8F0;
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.07);
  --shadow:         0 4px 20px rgba(67,97,238,0.10);
  --radius:         10px;
  --radius-lg:      14px;
  --nav-bg:         rgba(255,255,255,0.95);
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  transition: background .2s, color .2s;
}

/* ── Navbar ── */
.navbar {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  padding: .75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.brand-label {
  font-weight: 600;
  font-size: .95rem;
  color: var(--text);
  letter-spacing: -.01em;
}

.navbar-nav .nav-link {
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 500;
  padding: .45rem .75rem;
  border-radius: 7px;
  transition: all .18s;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-user {
  font-size: .88rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Page Header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: .75rem;
}
.page-title { font-size: 1.5rem; font-weight: 700; margin: 0; color: var(--text); }
.page-sub   { color: var(--text-muted); font-size: .95rem; margin: 0; }

/* ── Card ── */
.card-ade {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-ade-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.card-ade-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

/* ── Stats ── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s;
}
.stat-card:hover { box-shadow: var(--shadow); }
.stat-icon {
  width: 46px; height: 46px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-label { font-size: .78rem; font-weight: 600; text-transform: uppercase;
              letter-spacing: .04em; color: var(--text-muted); }
.stat-value { font-size: 1.55rem; font-weight: 700; color: var(--text); line-height: 1.2; }

/* ── Table ── */
.table-ade {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.table-ade thead th {
  padding: .75rem 1rem;
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table-ade tbody td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.table-ade tbody tr:last-child td { border-bottom: none; }
.table-ade tbody tr:hover { background: var(--primary-light); }
.table-ade tfoot .total-row td {
  padding: .85rem 1rem;
  background: var(--bg);
  border-top: 2px solid var(--border);
  font-size: .9rem;
}

/* ── Report table fitting ── */
.report-table {
  table-layout: fixed;
  min-width: 860px;
}

.report-table .col-date        { width: 14%; }
.report-table .col-from        { width: 8%; }
.report-table .col-to          { width: 8%; }
.report-table .col-break       { width: 9%; }
.report-table .col-customer    { width: 23%; }
.report-table .col-activity    { width: 12%; }
.report-table .col-description { width: 16%; }
.report-table .col-net         { width: 10%; }

.report-table td.col-date,
.report-table td.col-from,
.report-table td.col-to,
.report-table td.col-break,
.report-table td.col-net {
  white-space: nowrap;
}

.report-table td.col-net {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.report-table td.col-customer,
.report-table td.col-activity,
.report-table td.col-description {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.fit-text { font-size: .88rem; line-height: 1.25; }
.fit-text-sm { font-size: .8rem; }
.fit-text-xs { font-size: .72rem; }

/* ── Date chip ── */
.date-chip {
  display: inline-block;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Activity badge ── */
.badge-activity {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  padding: .2rem .65rem;
  font-size: .78rem;
  font-weight: 600;
}

/* ── Buttons ── */
.btn-primary {
  background: var(--gradient);
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
  transition: opacity .18s, transform .12s;
}
.btn-primary:hover { opacity: .9; transform: translateY(-1px); color: #fff; }
.btn-primary:active { transform: translateY(0); }

.btn-outline-primary {
  border-color: var(--primary);
  color: var(--primary);
  border-radius: 8px;
  font-weight: 500;
}
.btn-outline-primary:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-secondary {
  border-color: var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  font-weight: 500;
}
.btn-outline-secondary:hover { background: var(--bg); color: var(--text); }

.btn-outline-danger { border-radius: 8px; font-weight: 500; }

.btn-xs {
  padding: .2rem .45rem;
  font-size: .78rem;
  line-height: 1.4;
  border-radius: 6px;
}
.btn-xxs {
  padding: .1rem .25rem;
  font-size: .75rem;
  line-height: 1;
}

/* ── Form controls ── */
.form-control, .form-select {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text);
  border-radius: 8px;
  font-size: .9rem;
  transition: border-color .18s, box-shadow .18s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,97,238,.12);
  background: var(--bg-card);
  color: var(--text);
}
.input-group-text {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text-muted);
}
.form-label { font-weight: 500; font-size: .88rem; color: var(--text); }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

/* ── Project Items ── */
.project-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem 0;
  border-bottom: 1px solid var(--border);
}
.project-item:last-child { border-bottom: none; }
.project-dot {
  width: 7px; height: 7px;
  background: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Report Preview ── */
.report-preview { max-width: 800px; }

.gesamtzeit-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.gesamtzeit-icon {
  width: 44px; height: 44px;
  background: var(--text);
  color: var(--bg-card);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.gesamtzeit-value {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

/* ── Duration preview ── */
.duration-preview {
  padding: .5rem .75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
}

.week-day-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: .5rem;
  min-height: 150px;
  display: flex;
  flex-direction: column;
}

.week-day-list {
  flex: 1;
  overflow: auto;
  max-height: 180px;
}

.week-day-empty {
  font-size: .78rem;
  color: var(--text-muted);
  padding: .4rem;
}

.week-day-entry {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .35rem .45rem;
  margin-bottom: .35rem;
  background: var(--bg);
}

.week-day-entry-time {
  font-size: .75rem;
  font-weight: 700;
  color: var(--text);
}

.week-day-entry-meta {
  font-size: .72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Login page ── */
.login-page {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-wrap { width: 100%; max-width: 420px; padding: 1.5rem; }
.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-logo { text-align: center; margin-bottom: 1.25rem; }
.login-title {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: .25rem;
}
.login-sub {
  text-align: center;
  color: #64748B;
  font-size: .88rem;
  margin-bottom: 1.5rem;
}

/* ── Error Page ── */
.error-page {
  text-align: center;
  padding: 6rem 1rem;
}
.error-code {
  font-size: 7rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: .5rem;
}

/* ── Alerts ── */
.alert { border-radius: 8px; border: none; font-size: .9rem; }
.alert-success { background: #ECFDF5; color: #065F46; }
.alert-danger   { background: #FEF2F2; color: #991B1B; }
.alert-warning  { background: #FFFBEB; color: #92400E; }
.alert-info     { background: #EFF6FF; color: #1E40AF; }

/* ── Language Toggle (matches adeengineering.com) ── */
.lang-toggle { display: flex; gap: 4px; }
.lang-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .2s;
}
.lang-btn:hover { border-color: var(--primary); color: var(--primary); }
.lang-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
