@font-face {
    font-family: "Open Sans";
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url("../fonts/open-sans-latin.woff2") format("woff2");
}

:root {
    --color-yellow: #f5c518;
    --color-red: #e05252;
    --color-green: #4caf50;
    --color-gray: #9e9e9e;
    --color-primary: #005a9f;
    --color-primary-dark: #003d6b;
    --color-header-bg: #1b98d5;
    --color-accent-gold: #ffd300;
    --color-border: #ddd;
    --color-bg: #eef5fb;
    --color-text: #3a5368;
}

* { box-sizing: border-box; }

html {
    font-size: 18px;
}

body {
    font-family: "Open Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.login-box {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    width: 340px;
}

.login-logo-bar {
    background: linear-gradient(180deg, var(--color-header-bg), #1583ba);
    margin: -2rem -2rem 1.5rem;
    padding: 1.35rem 2rem;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: center;
}

.login-logo-img {
    height: 34px;
    width: auto;
}

.login-brand {
    margin: 0 0 1.5rem;
    font-size: 1.05rem;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-brand strong {
    color: var(--color-primary);
    font-weight: 700;
}

.login-box label {
    display: block;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.login-box input {
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.25rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

.topnav {
    background: linear-gradient(180deg, var(--color-header-bg), #1583ba);
    border-bottom: 1px solid #136f9e;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topnav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.topnav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.topnav-brand strong {
    color: var(--color-accent-gold);
    font-weight: 700;
}

.topnav-logo-img {
    height: 28px;
    width: auto;
    flex-shrink: 0;
}

.topnav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem;
    flex: 1;
    min-width: 0;
}

.topnav-links > a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    white-space: nowrap;
    transition: background-color 0.15s, color 0.15s;
}

.topnav-links > a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.topnav-links > a.active {
    background: #fff;
    color: var(--color-primary);
}

.topnav-dropdown {
    position: relative;
}

.topnav-dropdown-toggle {
    font-family: inherit;
    background: none;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.topnav-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.topnav-dropdown-toggle.active {
    background: #fff;
    color: var(--color-primary);
}

.topnav-dropdown-caret {
    font-size: 0.65em;
}

.topnav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    padding: 0.4rem;
    min-width: 190px;
    z-index: 20;
}

.topnav-dropdown.open .topnav-dropdown-menu {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.topnav-dropdown-menu a {
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 0.7rem;
    border-radius: 6px;
    white-space: nowrap;
}

.topnav-dropdown-menu a:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.topnav-dropdown-menu a.active {
    background: #e8f0fd;
    color: var(--color-primary);
}

.topnav-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-accent-gold);
    color: var(--color-primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-name {
    font-size: 0.85rem;
    color: #fff;
    white-space: nowrap;
}

.logout-link {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.82rem;
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    transition: background-color 0.15s, color 0.15s;
}

.logout-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    max-width: 480px;
}

.card label {
    display: block;
    margin-bottom: 1rem;
}

.card input, .card select {
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.25rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

button {
    cursor: pointer;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    transition: background-color 0.15s;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
}

.btn-secondary {
    background: #eee;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.section-toggle {
    margin-bottom: 1rem;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-error { background: #fdecea; color: #a02020; }
.alert-success { background: #e8f5e9; color: #2c6b2f; }
.alert-warning { background: #fff8e1; color: #8a6d00; }

.hint {
    font-size: 0.8rem;
    color: #777;
}

.vacation-balance-hint {
    font-size: 0.9rem;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.team-filter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.team-filter-label select {
    padding: 0.4rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

.legend {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.legend-item { display: flex; align-items: center; gap: 0.4rem; }

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot-yellow, .chip-yellow { background: var(--color-yellow); }
.dot-red, .chip-red { background: var(--color-red); }
.dot-green, .chip-green { background: var(--color-green); }
.dot-gray, .chip-gray { background: var(--color-gray); }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day-label {
    font-weight: 600;
    font-size: 0.8rem;
    text-align: center;
    color: #777;
    padding-bottom: 0.25rem;
}

.calendar-cell {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    min-height: 110px;
    padding: 0.5rem;
}

.calendar-cell.empty { background: transparent; border-color: transparent; }

.calendar-cell .day-number {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 0.25rem;
}

.calendar-cell-today {
    outline: 2px solid var(--color-primary-dark);
    outline-offset: -1px;
}

.calendar-cell-today .day-number {
    font-weight: 700;
    color: var(--color-primary-dark);
}

.calendar-cell-holiday {
    background: #fff8e1;
}

.holiday-label {
    font-size: 0.68rem;
    color: #8a6d00;
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-grid-mini .holiday-label {
    font-size: 0.6rem;
}

.chip {
    display: block;
    font-size: 0.75rem;
    color: #fff;
    border-radius: 3px;
    padding: 1px 4px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chip-gray { color: #fff; }

.data-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin-bottom: 2rem;
}

.data-table th, .data-table td {
    border: 1px solid var(--color-border);
    padding: 0.5rem;
    font-size: 0.85rem;
    text-align: left;
}

.data-table input, .data-table select {
    box-sizing: border-box;
    padding: 0.3rem;
}

.data-table input:not([type="checkbox"]):not(.vacation-days-input), .data-table select {
    min-width: 9rem;
}

.data-table input[type="checkbox"] {
    padding: 0;
}

.data-table .vacation-days-input {
    width: 4.5rem;
    min-width: 4.5rem;
}

.workdays-checkboxes {
    display: flex;
    gap: 0.4rem;
    flex-wrap: nowrap;
}

.workday-checkbox-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.68rem;
    color: #666;
    gap: 0.15rem;
}

.checkbox-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
}

.group-card {
    margin-bottom: 1rem;
    max-width: 760px;
}

.group-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.rename-group-form, .rule-edit-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.rename-group-form input {
    flex: 2 1 9rem;
    width: auto;
    min-width: 8rem;
    padding: 0.35rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

.rename-group-form select {
    flex: 1 1 9rem;
    width: auto;
    min-width: 0;
}

.rule-edit-form input, .rule-edit-form select {
    flex: 1 1 9rem;
    width: auto;
    margin-top: 0;
    padding: 0.35rem;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.chip-removable {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #eef1f6;
    border-radius: 12px;
    padding: 0.2rem 0.4rem 0.2rem 0.7rem;
    font-size: 0.8rem;
}

.chip-remove {
    background: none;
    border: none;
    color: #a02020;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.2rem;
}

.add-member-form {
    display: flex;
    gap: 0.5rem;
}

.add-member-form select {
    flex: 1;
    padding: 0.35rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

.request-card {
    max-width: 900px;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
}

.request-card-main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 220px;
}

.vacation-days-note {
    font-size: 0.82rem;
    color: #555;
}

.collision-detail {
    margin-top: 0.3rem;
}

.collision-detail-label {
    font-size: 0.78rem;
    color: #555;
    margin-left: 0.4rem;
}

.collision-detail ul {
    margin: 0.15rem 0 0.4rem 0;
    padding-left: 1.4rem;
    font-size: 0.8rem;
    color: #333;
}

.collision-detail li {
    margin-bottom: 0.1rem;
}

.comment-input {
    flex: 1;
    min-width: 160px;
    padding: 0.4rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

.request-card-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-approve {
    background: var(--color-green);
    color: #fff;
}

.btn-reject, .btn-danger {
    background: var(--color-red);
    color: #fff;
}

.btn-danger:hover {
    background: #c43f3f;
}

.danger-zone {
    border: 1px solid var(--color-red);
    max-width: 640px;
}

.danger-zone h2 {
    margin-top: 0;
    color: #a02020;
}

.calendar-preview {
    flex-basis: 100%;
    width: 100%;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
}

.calendar-preview-month {
    margin-bottom: 1rem;
}

.calendar-preview-title {
    font-size: 0.9rem;
    margin: 0 0 0.4rem 0;
}

.calendar-grid-mini .calendar-cell {
    min-height: 46px;
    padding: 0.2rem;
}

.calendar-grid-mini .chip {
    font-size: 0.68rem;
}

.calendar-cell-highlight {
    outline: 2px solid var(--color-primary);
    outline-offset: -1px;
}

.badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 0.3rem;
    color: #fff;
}

.badge-red { background: var(--color-red); }
.badge-yellow { background: var(--color-yellow); color: #4a3b00; }
.badge-green { background: var(--color-green); }
.badge-gray { background: var(--color-gray); }

.filter-card {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    max-width: none;
}

.filter-card label {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    margin-bottom: 0;
}

.filter-card input, .filter-card select {
    margin-top: 0.25rem;
    padding: 0.4rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

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

.edit-row td {
    background: #fbfbfd;
}

.edit-row input[type="date"] {
    display: block;
    margin-bottom: 0.3rem;
}

.inline-warning {
    display: inline-block;
    font-size: 0.75rem;
    padding: 1px 5px;
    border-radius: 3px;
    color: #fff;
    margin-right: 0.25rem;
}

.inline-warning-red { background: var(--color-red); }
.inline-warning-yellow { background: var(--color-yellow); color: #4a3b00; }

.guide-links {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.guide-links strong {
    color: var(--color-primary-dark);
}

.guide-links a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.guide-links a:hover {
    text-decoration: underline;
}

.prose {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem 2rem;
    max-width: 800px;
}

.prose h2 {
    color: var(--color-primary-dark);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.4rem;
    margin-top: 2rem;
}

.prose h2:first-child {
    margin-top: 0;
}

.prose p, .prose ul, .prose ol {
    margin: 0 0 1rem;
}

.prose ul, .prose ol {
    padding-left: 1.4rem;
}

.prose li {
    margin-bottom: 0.4rem;
}

.prose li > ul, .prose li > ol {
    margin-top: 0.4rem;
}

.prose code {
    background: #f0f3f7;
    border-radius: 3px;
    padding: 0.1rem 0.35rem;
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-size: 0.85em;
}

.prose .back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.prose details {
    margin-bottom: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.6rem 1rem;
}

.prose summary {
    font-weight: 600;
    cursor: pointer;
    color: var(--color-primary-dark);
}

.prose details p {
    margin: 0.6rem 0 0;
}

.stat-bar {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.stat-bar strong {
    color: var(--color-primary-dark);
}

.inline-form {
    display: flex;
    gap: 0.4rem;
    margin: 0;
}

.plain-list {
    margin: 0 0 1rem;
    padding-left: 1.2rem;
}

.checkbox-list-vertical {
    flex-direction: column;
    gap: 0.4rem;
}

/* Überschreibt ".card label" (display:block) und ".card input" (width:100%) */
.checkbox-list .checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.checkbox-list input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.group-sub-heading {
    margin: 1rem 0 0.4rem;
}

.optin-card {
    max-width: 720px;
}

.optin-card h2 {
    font-size: 1.05rem;
    margin: 1.25rem 0 0.5rem;
}

.optin-statement {
    background: #eef5fb;
    border-left: 4px solid var(--color-primary);
    padding: 0.85rem 1rem;
    border-radius: 4px;
    font-size: 1.05rem;
}

.optin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.25rem 0 0.75rem;
}

.optin-actions form {
    margin: 0;
}
