*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, sans-serif;
  color: #1a1a2e; min-height: 100vh;
  background: linear-gradient(rgba(255,255,255,.72), rgba(255,255,255,.72)),
              url('https://www.rae-wandscher.de/media/raw-14.jpg') center center / cover fixed;
}

/* Header */
header { background: #1a1a2e; color: white; padding: .9rem 1.5rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.header-left { display: flex; align-items: center; gap: .6rem; }
.header-left .back { color: #a0aec0; text-decoration: none; font-size: .88rem; }
.header-left .back:hover { color: white; }
.header-left .sep { color: #4a5568; }
.header-left .brand { font-size: 1rem; font-weight: 600; }
nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
nav a { color: #a0aec0; text-decoration: none; padding: .35rem .7rem; border-radius: 6px; font-size: .88rem; transition: background .15s; }
nav a:hover { background: rgba(255,255,255,.1); color: white; }
nav a.active { background: rgba(255,255,255,.15); color: white; }
nav .nav-user { margin-left: .5rem; border-left: 1px solid #4a5568; padding-left: .75rem; color: #718096; font-size: .82rem; }
nav .nav-user:hover { color: white; }

/* Layout */
main { padding: 1.5rem; }
.page-wrap { max-width: 1100px; margin: 0 auto; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 720px) { .two-col { grid-template-columns: 1fr; } }

/* Panel */
.panel { background: white; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 1.5rem; margin-bottom: 1.25rem; }
.panel h2 { font-size: .95rem; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: #4a5568; margin-bottom: 1.25rem; padding-bottom: .65rem; border-bottom: 2px solid #e2e8f0; }

/* Forms */
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .85rem; font-weight: 600; color: #2d3748; margin-bottom: .3rem; }
.field input[type="text"], .field input[type="email"], .field input[type="date"],
.field select, .field textarea {
  width: 100%; padding: .45rem .7rem; border: 1.5px solid #e2e8f0; border-radius: 8px;
  font-size: .9rem; color: #1a1a2e; font-family: inherit; transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: #4299e1; }
.field textarea { resize: vertical; }
.comment-input { width: 180px; padding: .3rem .5rem; border: 1.5px solid #e2e8f0; border-radius: 6px; font-size: .82rem; }
.multi-select { width: 100%; font-size: .82rem; border: 1.5px solid #e2e8f0; border-radius: 6px; }

/* Buttons */
.btn { display: inline-block; padding: .45rem 1rem; border-radius: 8px; font-size: .88rem; font-weight: 600; border: none; cursor: pointer; text-decoration: none; transition: background .15s; }
.btn-primary { background: #1a1a2e; color: white; }
.btn-primary:hover { background: #2d3748; }
.btn-ok { background: #48bb78; color: white; }
.btn-ok:hover { background: #38a169; }
.btn-danger { background: #f56565; color: white; }
.btn-danger:hover { background: #e53e3e; }
.btn-ghost { background: transparent; border: 1.5px solid #e2e8f0; color: #4a5568; }
.btn-ghost:hover { background: #f7fafc; }
.btn-link { background: none; border: none; color: #4299e1; cursor: pointer; font-size: .85rem; padding: 0; text-decoration: underline; }
.btn-link.danger { color: #f56565; }
.btn-link:hover { color: #2b6cb0; }

/* Alerts */
.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .88rem; line-height: 1.5; }
.alert-ok    { background: #f0fff4; border-left: 3px solid #48bb78; color: #276749; }
.alert-error { background: #fff5f5; border-left: 3px solid #f56565; color: #9b2c2c; }
.alert-info  { background: #ebf8ff; border-left: 3px solid #4299e1; color: #2c5282; }
.alert-info a { color: #2b6cb0; font-weight: 600; }
.magic-link-box code { display: block; margin: .5rem 0; word-break: break-all; background: #f7fafc; padding: .5rem; border-radius: 6px; font-size: .82rem; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table th { text-align: left; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: #a0aec0; padding: .4rem .5rem; border-bottom: 2px solid #e2e8f0; }
.data-table td { padding: .6rem .5rem; border-bottom: 1px solid #f0f4f8; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.note-cell { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #718096; }
.email-cell { color: #718096; font-size: .82rem; }
.inline-form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.approver-form { display: flex; gap: .3rem; align-items: center; }

/* Badges */
.badge { display: inline-block; font-size: .72rem; font-weight: 700; border-radius: 99px; padding: 2px 8px; }
.badge-pending  { background: #fefcbf; color: #744210; }
.badge-approved { background: #f0fff4; color: #276749; }
.badge-rejected { background: #fff5f5; color: #9b2c2c; }
.badge-role-admin    { background: #e9d8fd; color: #553c9a; }
.badge-role-approver { background: #bee3f8; color: #2c5282; }
.badge-role-employee { background: #e2e8f0; color: #4a5568; }
.count-badge { background: #f56565; color: white; border-radius: 99px; font-size: .72rem; padding: 1px 7px; }

/* Calendar */
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.cal-header h2 { font-size: 1.25rem; font-weight: 700; }
.months-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.month-block { background: white; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 1rem; }
.month-title { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: #4a5568; margin-bottom: .6rem; text-align: center; }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.day-head { text-align: center; font-size: .65rem; font-weight: 700; color: #a0aec0; padding: 2px 0; }
.day-cell { text-align: center; font-size: .75rem; padding: 3px 2px; border-radius: 4px; cursor: default; position: relative; min-height: 22px; line-height: 16px; }
.day-cell.empty { background: none; }
.day-cell.weekend { color: #a0aec0; }
.day-cell.today { outline: 2px solid #4299e1; font-weight: 700; }
.multi-badge { position: absolute; top: -3px; right: -3px; background: rgba(0,0,0,.5); color: white; font-size: .55rem; border-radius: 99px; width: 14px; height: 14px; line-height: 14px; text-align: center; }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-bottom: 1.25rem; padding: .75rem 1rem; background: white; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.legend-item { display: flex; align-items: center; gap: .4rem; font-size: .82rem; }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }

/* Login */
.login-wrap { max-width: 400px; margin: 4rem auto; }
.login-wrap h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: .5rem; }
.login-sub { color: #718096; margin-bottom: 1.25rem; }
.login-hint { font-size: .85rem; color: #718096; line-height: 1.6; margin-top: 1rem; }

/* Misc */
.empty-hint { color: #a0aec0; font-size: .88rem; }
.days-hint { font-size: .82rem; color: #276749; font-weight: 600; }
.error-text { font-size: .82rem; color: #e53e3e; }

footer { text-align: center; padding: 1.5rem; font-size: .78rem; color: #a0aec0; }
