/* Basic styling for the Wishlist application */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --bg: #f2f5fb;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #475569;
    --border: #e2e8f0;
    --success: #16a34a;
    --warning: #f59e0b;
    --info: #0ea5e9;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at 20% 20%, #e7edfb, #f7f9fd 35%), var(--bg);
    color: var(--text);
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}

header {
    background: linear-gradient(120deg, var(--primary), #3b82f6);
    color: #fff;
    padding: 18px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 10;
}

header h1 {
    margin: 0;
    font-size: 22px;
    letter-spacing: 0.2px;
}

header nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.container {
    max-width: 1200px;
    margin: 28px auto 56px auto;
    padding: 0 18px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    box-shadow: var(--shadow);
}

.card + .card {
    margin-top: 16px;
}

.card h2 {
    margin: 0 0 12px 0;
    font-size: 19px;
    letter-spacing: 0.2px;
}

form {
    display: grid;
    gap: 12px;
}

form.inline-form {
    display: inline-flex;
}

input[type="text"],
input[type="url"],
input[type="email"],
input[type="password"],
input[type="file"],
input[type="date"],
input[type="number"],
textarea,
select {
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    width: 100%;
    background: #f8fafc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background: #fff;
}

textarea {
    font-family: inherit;
    resize: vertical;
}

input[type="date"].date-input {
    background: linear-gradient(180deg, #f8fafc, #ffffff);
    padding-right: 40px;
    position: relative;
}

input[type="date"].date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
}

input[type="date"].date-input::-webkit-datetime-edit-fields-wrapper {
    letter-spacing: 0.4px;
}

button,
.button-link {
    padding: 11px 16px;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

button.secondary {
    background: #e2e8f0;
    color: var(--text);
    box-shadow: none;
}

button:hover,
.button-link:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

button:active,
.button-link:active {
    transform: translateY(0);
}

.button-link {
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.shortcut-manual summary {
    cursor: pointer;
    font-weight: 600;
    padding: 8px 0;
}

#ios {
    scroll-margin-top: 90px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 14px;
}

thead {
    background: #f8fafc;
}

tbody tr:hover {
    background: #f1f5f9;
}

.flex {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.product {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    display: grid;
    align-content: start;
    gap: 10px;
    position: relative;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.product .image-wrap {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.product .image-wrap a {
    display: block;
}

.product img {
    display: block;
    width: 100%;
    height: 190px;
    object-fit: contain;
    object-position: center;
    background: #f8fafc;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.1px;
}

.badge.success { background: linear-gradient(90deg, #16a34a, #22c55e); }
.badge.warning { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.badge.info { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.badge.muted { background: var(--muted); }

.muted {
    color: var(--muted);
    font-size: 14px;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.product.is-reserved {
    filter: grayscale(0.5);
}

.product.is-inactive {
    border-color: #94a3b8;
    border-style: dashed;
}

.product-settings-status {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.product-settings {
    min-width: 0;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    display: grid;
    gap: 12px;
}

.product-settings legend {
    padding: 0 5px;
    font-size: 14px;
    font-weight: 600;
}

.product-settings select {
    min-width: 0;
}

.product-settings .help-text {
    margin: 0;
}

.reservation-status {
    display: grid;
    gap: 6px;
}

.reservation-picker {
    width: 100%;
}

.reservation-picker summary {
    padding: 11px 16px;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    text-align: center;
}

.reservation-picker summary::-webkit-details-marker {
    display: none;
}

.reservation-picker summary:hover {
    background: var(--primary-dark);
}

.reservation-picker summary:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

.reservation-picker[open] summary {
    margin-bottom: 12px;
}

.order-editor {
    padding: 14px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #eef2ff;
}

.order-editor p {
    margin: 0;
}

.product-order-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.order-target-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.order-target {
    width: auto;
    min-width: 62px;
    padding: 8px;
    min-height: 44px;
}

.product-order-controls button {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
}

.product-grid.is-reordering > .product {
    cursor: grab;
    border-style: dashed;
    align-content: start;
}

.product-grid.is-reordering > .product > .image-wrap,
.product-grid.is-reordering > .product > .badge,
.product-grid.is-reordering > .product > .product-quantity,
.product-grid.is-reordering > .product > .reservation-status,
.product-grid.is-reordering > .product > .product-name a,
.product-grid.is-reordering > .product > .product-name br {
    display: none;
}

.product-grid.is-reordering > .product.is-dragging {
    opacity: 0.45;
    cursor: grabbing;
}

.product-grid.is-reordering > .product > .actions {
    display: none;
}

.product-grid.is-reordering > .product > .card {
    display: none !important;
}

.product-grid.is-reordering > .product a {
    pointer-events: none;
}

button:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

.product.is-reserved::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(148, 163, 184, 0.45);
    pointer-events: none;
}

.error {
    color: #b91c1c;
    font-weight: 600;
}

.success-text {
    color: #15803d;
    font-weight: 600;
}

.top-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.wishlist-controls {
    display: flex;
    margin-left: auto;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 100%;
}

.wishlist-controls .filters-form {
    max-width: 100%;
    justify-content: flex-end;
}

.wishlist-controls .pill-toggle {
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.wishlist-controls .pill-toggle select {
    width: auto;
    max-width: 100%;
}

.pill-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #eef2ff;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.checkbox {
    transform: scale(1.1);
}

.link-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding-left: 18px;
}

/* Small helper for alert-like cards */
.card.error {
    border-color: #fecdd3;
    background: #fff1f2;
    box-shadow: none;
}

.card.success-text {
    border-color: #bbf7d0;
    background: #ecfdf3;
    box-shadow: none;
}

.filters-form {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    background: #f8fafc;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.pill-toggle select {
    border: none;
    background: transparent;
    font-weight: 700;
    color: var(--text);
    padding: 6px 8px;
    border-radius: 8px;
    min-width: 140px;
}

.pill-toggle select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.person-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.person-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    display: grid;
    gap: 10px;
    justify-items: center;
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.person-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    border-color: #cbd5e1;
}

.person-link {
    text-decoration: none;
    color: inherit;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    color: var(--muted);
    font-size: 12px;
}

.person-name {
    font-weight: 700;
    font-size: 16px;
}

.person-meta {
    font-size: 14px;
}

.person-action {
    background: #eef2ff;
    color: #1d4ed8;
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.person-header-card {
    padding: 18px;
}

.person-header-row {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
}

.person-header-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.person-header-name {
    font-size: 20px;
    font-weight: 800;
}

.person-header-date {
    color: var(--muted);
    font-weight: 600;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-inline {
    max-width: 320px;
}

.help-text {
    color: var(--muted);
    font-size: 13px;
}

.image-picker {
    margin-top: 8px;
    display: grid;
    gap: 8px;
}

.image-option-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
}

.image-option {
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 4px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.1s ease;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.image-option img {
    width: 100%;
    height: 80px;
    object-fit: contain;
    object-position: center;
    border-radius: 8px;
    display: block;
}

.image-option:hover {
    border-color: var(--border);
    transform: translateY(-1px);
}

.image-option.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.friends-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    overflow-wrap: anywhere;
}

.friends-row p {
    margin: 6px 0 0;
}

.friends-actions {
    align-items: center;
    max-width: 100%;
}

.friends-actions form,
.friends-actions button {
    max-width: 100%;
}

.friends-invite-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.friends-invite-form .field-group {
    flex: 1 1 240px;
}

.friends-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 9px;
    color: white;
    background: var(--primary);
    font-size: 13px;
}

.friends-error { color: #b91c1c; border-color: #fecdd3; }
.friends-success { color: #15803d; border-color: #bbf7d0; }
.friends-list-link { padding: 10px 4px; font-weight: 600; }

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin: 16px 0;
}

.status-metric {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
    min-width: 0;
}

.status-label { font-size: 14px; color: var(--muted); }
.status-value { display: block; font-size: 25px; font-weight: 700; margin: 7px 0; }
.status-note { font-size: 13px; color: var(--muted); line-height: 1.5; }
.status-metric .status-note { display: block; }
.status-note.error-text { color: #b91c1c; }
.status-table-wrap { overflow-x: auto; }
.status-traffic-table { min-width: 600px; }

@media (max-width: 640px) {
    header { padding: 14px 18px; flex-wrap: wrap; }
    header nav { flex-wrap: wrap; }
    .friends-actions { width: 100%; }
    .friends-invite-form > button { width: 100%; }
    .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .status-metric { padding: 12px; }
    .status-value { font-size: 21px; }
}

@media (max-width: 480px) {
    .server-status-grid { grid-template-columns: 1fr; }
}

.site-footer { max-width: 1200px; margin: 0 auto; padding: 0 18px 28px; color: var(--muted); font-size: 14px; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.legal-content { max-width: 850px; line-height: 1.6; }
.legal-draft { padding: 14px; border: 1px solid #fcd34d; border-radius: 10px; background: #fffbeb; }
.legal-details { display: grid; grid-template-columns: minmax(150px, 1fr) 2fr; gap: 10px 20px; }
.legal-details dt { font-weight: 600; }
.legal-details dd { margin: 0; overflow-wrap: anywhere; }
.auth-container { max-width: 760px; }
.auth-remember { justify-self: start; max-width: 100%; border-radius: 12px; }
.auth-name-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.account-link-notice { margin: 16px 0; padding: 14px; border: 1px solid #bfdbfe; border-radius: 10px; background: #eff6ff; }
.my-reservations-section-heading,.my-reservations-heading,.my-reservations-group-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.my-reservations-section-heading { margin-bottom: 18px; }
.my-reservations-section-heading h2,.my-reservations-group-heading h2 { margin: 0; }
.my-reservations-heading { margin-bottom: 22px; }
.my-reservations-heading h2 { margin: 0 0 8px; font-size: 25px; }
.my-reservations-heading p { margin: 0; max-width: 680px; line-height: 1.6; }
.my-reservations-secondary.button-link { background: #eaf0fe; color: var(--primary-dark); box-shadow: none; }
.my-reservations-secondary.button-link:hover { background: #dbe7ff; }
.my-reservations-nav .button-link { background: #fff; color: var(--primary-dark); box-shadow: none; }
.my-reservations-summary { grid-template-columns: repeat(3,minmax(0,1fr)); margin-bottom: 22px; }
.my-reservations-summary .status-value { overflow-wrap: anywhere; }
.my-reservations-group-heading { padding-bottom: 16px; }
.my-reservations-group-heading h2 { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.my-reservations-group-heading>span { font-size: 14px; }
.my-reservations-list { display: grid; }
.my-reservation-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(140px,auto) auto; gap: 16px 24px; align-items: center; padding: 20px 0; border-top: 1px solid var(--border); }
.my-reservation-product { display: flex; align-items: center; gap: 12px; min-width: 0; }
.my-reservation-product>div { min-width: 0; }
.my-reservation-product h3 { margin: 0 0 6px; font-size: 16px; overflow-wrap: anywhere; }
.my-reservation-product>div>span { font-size: 14px; }
.my-reservation-check { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #e7f6ec; color: #15803d; font-weight: 700; flex-shrink: 0; }
.my-reservation-price { display: grid; gap: 5px; text-align: right; min-width: 0; }
.my-reservation-price strong { font-size: 17px; overflow-wrap: anywhere; }
.my-reservation-price span { font-size: 13px; }
.my-reservation-row>.button-link { font-size: 13px; }
.my-reservations-notice { margin-bottom: 16px; border-color: #fde68a; background: #fffbeb; }
.my-reservations-notice p { margin: 8px 0 0; line-height: 1.6; }
.my-reservations-empty { text-align: center; padding: 36px 22px; }
.my-reservations-empty p { line-height: 1.7; margin-bottom: 24px; }
.my-reservations-footnote { font-size: 14px; line-height: 1.6; margin-top: 20px; }
.product[id^="produkt-"] { scroll-margin-top: 150px; }
@media (max-width: 800px) {
    .my-reservation-row { grid-template-columns: minmax(0,1fr) minmax(100px,auto); gap: 12px; }
    .my-reservation-row>.button-link { grid-column: 1 / -1; justify-self: start; margin-left: 46px; }
}
@media (max-width: 480px) {
    .my-reservations-summary { grid-template-columns: 1fr; }
    .my-reservations-summary .status-metric { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 14px; align-items: center; }
    .my-reservations-summary .status-value { margin: 0; grid-column: 2; grid-row: 1 / 3; font-size: 23px; }
    .my-reservations-summary .status-note { grid-column: 1; font-size: 12px; }
    .my-reservations-heading h2 { font-size: 22px; }
    .my-reservations-group.card { padding: 18px 14px; }
    .my-reservation-product h3 { font-size: 15px; }
    .my-reservation-product>div>span { font-size: 12px; }
    .my-reservation-price strong { font-size: 15px; }
    .my-reservation-price span { font-size: 11px; }
    .my-reservation-row>.button-link { margin-left: 0; }
}
@media (max-width: 480px) {
    .legal-details, .auth-name-grid { grid-template-columns: 1fr; }
    .legal-details { gap: 6px; }
    .legal-details dd { margin-bottom: 10px; }
}
