:root {
    --ink: #1f2933;
    --muted: #64748b;
    --line: #d8dee8;
    --panel: #ffffff;
    --bg: #f5f7fb;
    --brand: #0f766e;
    --brand-dark: #115e59;
    --warn: #b45309;
    --ok: #15803d;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

* {
    box-sizing: border-box;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--bg);
}

a {
    color: var(--brand-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 5;
}

.topbar-inner,
.wrap {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar-inner {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--ink);
}

.nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.wrap {
    padding: 32px 0 56px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 36px;
    align-items: center;
    min-height: calc(100vh - 128px);
    padding-bottom: 44px;
}

.hero h1,
.page-title {
    font-size: clamp(2rem, 5vw, 4.6rem);
    line-height: 1.02;
    margin: 0 0 18px;
    letter-spacing: 0;
}

.lead {
    color: var(--muted);
    font-size: 1.12rem;
    line-height: 1.7;
    max-width: 680px;
}

.hero-visual {
    aspect-ratio: 4 / 5;
    border-radius: 8px;
    overflow: hidden;
    background:
        linear-gradient(130deg, rgba(15, 118, 110, 0.86), rgba(30, 64, 175, 0.68)),
        url("https://images.unsplash.com/photo-1512909006721-3d6018887383?auto=format&fit=crop&w=900&q=80");
    background-size: cover;
    background-position: center;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.18);
}

.actions,
.row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid var(--brand);
    border-radius: 6px;
    padding: 0 16px;
    background: var(--brand);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover,
button:hover {
    background: var(--brand-dark);
    text-decoration: none;
}

.btn:active,
button:active {
    transform: scale(0.98);
}

.flash {
    animation: slideIn 0.3s ease-out;
}

.btn.secondary,
button.secondary {
    background: #ffffff;
    color: var(--brand-dark);
}

.btn.danger {
    border-color: #b91c1c;
    background: #b91c1c;
}

.btn.compact {
    min-height: 34px;
    padding: 0 12px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.grid.gifts {
    grid-template-columns: repeat(2, 1fr);
}

.card,
.form-panel,
.table-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.card h2,
.card h3 {
    margin-top: 0;
}

.inline-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.inline-panel h2 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.meta,
.muted {
    color: var(--muted);
}

.pill {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    border-radius: 999px;
    padding: 0 10px;
    background: #e6f4f1;
    color: #0f766e;
    font-size: 0.85rem;
    font-weight: 700;
}

.pill.warn {
    background: #fff7ed;
    color: var(--warn);
}

.pill.ok {
    background: #ecfdf5;
    color: var(--ok);
}

form {
    display: grid;
    gap: 16px;
}

.two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    font: inherit;
    color: var(--ink);
    background: #ffffff;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.table-tools {
    margin-bottom: 14px;
    max-width: 420px;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    background: #f8fafc;
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    cursor: pointer;
}

.data-table tr:hover td {
    background: #f8fafc;
}

.flash {
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    background: #ffffff;
}

.flash.success {
    border-color: #86efac;
    background: #f0fdf4;
}

.flash.error {
    border-color: #fecaca;
    background: #fff1f2;
}

.gift {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 16px;
    padding: 14px !important;
}

.gift h2 {
    margin: 0 0 6px !important;
    font-size: 0.95rem;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.gift p {
    margin: 4px 0;
    font-size: 0.85rem;
    line-height: 1.4;
}

.gift .muted {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 8px !important;
}

.gift .price {
    font-size: 0.95rem;
}

.gift .actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.reserve-amount {
    min-width: 150px;
    font-size: 0.8rem;
}

.reserve-amount input {
    min-height: 32px;
    padding: 6px 8px;
}

.gift-content {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 8px;
}

.gift-meta {
    flex-grow: 1;
}

.list-info {
    padding: 16px 20px !important;
    margin-bottom: 12px;
}

.gift .btn,
.gift button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.8rem;
}

.gift img,
.gift .placeholder {
    width: 116px;
    height: 116px;
    object-fit: contain;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid var(--line);
}

.price {
    font-weight: 800;
    font-size: 1.1rem;
}

.footer-note {
    margin-top: 28px;
    color: var(--muted);
    font-size: 0.95rem;
}

/* Search and Filtering */
.search-filters {
    margin-bottom: 24px;
}

.search-form {
    display: grid;
    gap: 16px;
}

.search-input-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.search-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.filter-select {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background-color: #ffffff;
    font-size: 0.95rem;
}

.filter-select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Statistics Panel */
.stats-panel {
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.05), rgba(30, 64, 175, 0.05));
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--brand-dark);
    line-height: 1.2;
}

.stat-percent {
    color: var(--ok);
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 0;
    font-size: 0.9rem;
    color: var(--muted);
    flex-wrap: wrap;
}

.breadcrumbs a {
    color: var(--brand-dark);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: var(--brand);
    text-decoration: underline;
}

.breadcrumb-sep {
    color: var(--line);
    font-weight: 300;
}

.breadcrumb-current {
    color: var(--ink);
    font-weight: 600;
}

/* Invitation Forms */
.invitation-form {
    display: grid;
    gap: 20px;
    max-width: 600px;
}

.invitation-info {
    margin-top: 40px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid var(--brand);
}

.invitation-info h3 {
    margin-top: 0;
    color: var(--brand-dark);
}

.invitation-info ul {
    margin: 0;
    padding-left: 20px;
}

/* Share Page */
.share-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.share-section {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
}

.share-section h2 {
    margin: 0 0 16px;
    font-size: 1.2rem;
    color: var(--ink);
}

/* QR Code */
.share-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

#qrcode {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--line);
}

#qrcode img {
    display: block;
    width: 100% !important;
    height: auto !important;
}

/* Share Link */
.share-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.share-url-input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: #f8fafc;
}

/* Social Buttons */
.share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid var(--line);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    background: white;
    color: var(--ink);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.share-btn.whatsapp {
    color: #25d366;
    border-color: #25d366;
}

.share-btn.whatsapp:hover {
    background: #f0fdf4;
}

.share-btn.facebook {
    color: #1877f2;
    border-color: #1877f2;
}

.share-btn.facebook:hover {
    background: #f0f9ff;
}

.share-btn.twitter {
    color: #000;
    border-color: #000;
}

.share-btn.twitter:hover {
    background: #f8fafc;
}

.share-btn.email {
    color: var(--brand-dark);
    border-color: var(--brand-dark);
}

.share-btn.email:hover {
    background: #f0fdf4;
}

/* Info Section */
.info-grid {
    display: grid;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 0.95rem;
}

.info-item strong {
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.8rem;
}

.info-item span {
    font-weight: 600;
    color: var(--ink);
}

/* Action Footer */
.action-footer {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 20px 0;
    border-top: 1px solid var(--line);
}

@media (max-width: 760px) {
    .share-container {
        grid-template-columns: 1fr;
    }

    .share-buttons {
        grid-template-columns: 1fr;
    }

    .share-input-group {
        flex-direction: column;
    }
}

/* Audit Logs */
.filters-section {
    margin-bottom: 24px;
}

.filter-form {
    display: grid;
    gap: 16px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.filter-row label {
    gap: 8px;
}

.filter-row select {
    width: 100%;
}

.filter-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

details {
    cursor: pointer;
}

details summary {
    color: var(--brand-dark);
    font-weight: 600;
    user-select: none;
}

details summary:hover {
    text-decoration: underline;
}

details[open] summary {
    color: var(--brand);
}

/* Profile Page */
.profile-form {
    max-width: 600px;
}

.avatar-section {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 24px;
    align-items: center;
}

.avatar-preview {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    border: 3px solid var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 3rem;
    line-height: 1;
}

.avatar-upload input[type="file"] {
    width: 100%;
}

.avatar-upload label {
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
}

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

.checkbox-label span {
    font-weight: 600;
}

.checkbox-label small {
    display: block;
    width: 100%;
    margin-top: 4px;
}

/* Profile Stats */
.profile-stats {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid var(--line);
}

.profile-stats h3 {
    margin-top: 0;
    margin-bottom: 16px;
    color: var(--ink);
}

.profile-stats .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

/* Public User Profile */
.user-profile-header {
    margin-bottom: 40px;
}

.user-profile-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 32px;
    padding: 32px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    align-items: start;
}

.user-avatar-large {
    width: 160px;
    height: 160px;
    border-radius: 16px;
    overflow: hidden;
    background: white;
    border: 3px solid var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder-large {
    font-size: 4rem;
    line-height: 1;
}

.user-info {
    display: grid;
    gap: 12px;
}

.user-name {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    color: var(--ink);
}

.user-pseudo {
    margin: 0;
    color: var(--muted);
    font-size: 1.1rem;
}

.user-bio {
    margin: 8px 0;
    color: var(--ink);
    line-height: 1.6;
    max-width: 600px;
}

.user-location {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.user-stats .stat {
    display: grid;
    gap: 4px;
    text-align: center;
}

.user-stats .stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--brand-dark);
}

.user-stats .stat-label {
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
}

.user-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

@media (max-width: 760px) {
    .user-profile-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .user-avatar-large {
        width: 120px;
        height: 120px;
        margin: 0 auto;
    }

    .user-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .user-actions {
        flex-direction: column;
    }
}

/* Enhanced Dashboard */
.dashboard-lists {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.list-card {
    display: grid;
    gap: 12px;
    padding: 20px;
    background: var(--panel);
    border: 2px solid var(--line);
    border-radius: 10px;
    transition: all 0.2s;
}

.list-card:hover {
    border-color: var(--brand);
    box-shadow: 0 8px 20px rgba(15, 118, 110, 0.1);
    transform: translateY(-2px);
}

.list-card.urgent {
    border-color: var(--warn);
    background: #fffbf0;
}

.list-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 12px;
}

.list-card h3 {
    margin: 0;
    color: var(--ink);
    flex: 1;
}

.tag-urgent {
    background: var(--warn);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.list-description {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.list-preview-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    position: relative;
}

.list-preview-images img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
    background: #f8fafc;
}

.preview-more {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-weight: 600;
    border-radius: 6px;
}

.list-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.list-stats-inline {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
}

.list-stats-inline .stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: center;
}

.list-stats-inline .stat-label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    font-weight: 600;
}

.list-stats-inline .stat-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--brand-dark);
}

.list-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.list-actions .btn,
.list-actions .btn.secondary {
    flex: 1;
    min-height: 36px;
    font-size: 0.9rem;
}

/* Activity Timeline */
.activity-timeline {
    display: grid;
    gap: 16px;
}

.activity-item {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 20px;
    padding: 16px;
    background: var(--panel);
    border-left: 4px solid var(--brand);
    border-radius: 6px;
}

.activity-time {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-weight: 600;
    color: var(--brand-dark);
}

.activity-time small {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 400;
}

.activity-content h3 {
    margin: 0 0 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 1rem;
}

.activity-content details {
    margin-top: 12px;
}

@media (max-width: 760px) {
    .activity-item {
        grid-template-columns: 1fr;
    }

    .activity-time {
        flex-direction: row;
        justify-content: space-between;
    }
}

@media (max-width: 760px) {
    .hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .hero-visual {
        aspect-ratio: 16 / 10;
    }

    .two,
    .gift {
        grid-template-columns: 1fr;
    }

    .grid.gifts {
        grid-template-columns: 1fr;
    }

    .gift img,
    .gift .placeholder {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 10;
    }
}

/* Invitation Form Styles */
.invitation-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.invitation-input-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.invitation-input-section label {
    font-weight: 600;
    color: var(--ink);
    font-size: 0.95rem;
}

.input-group {
    display: flex;
    gap: 8px;
}

.input-group input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--ink);
    background: var(--panel);
}

.input-group input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.input-group .btn {
    padding: 10px 18px;
    white-space: nowrap;
}

#email-error {
    color: #dc2626;
    font-size: 0.85rem;
    display: block;
    min-height: 1.2em;
}

.error-text {
    color: #dc2626;
}

/* Email List Section */
.invitation-list-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.invitation-list-section label {
    font-weight: 600;
    color: var(--ink);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.count-badge {
    display: inline-block;
    background: var(--brand);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.email-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.email-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 6px;
    animation: fadeIn 0.3s ease;
}

.email-item .email-text {
    flex: 1;
    font-size: 0.95rem;
    color: var(--ink);
    word-break: break-all;
}

.btn-remove {
    background: none;
    border: none;
    color: #dc2626;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    transition: background-color 0.2s;
}

.btn-remove:hover {
    background: rgba(220, 38, 38, 0.1);
}

/* Message Section */
.invitation-message-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.invitation-message-section label {
    font-weight: 600;
    color: var(--ink);
    font-size: 0.95rem;
}

.invitation-message-section textarea {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--ink);
    background: var(--panel);
    resize: vertical;
    min-height: 100px;
}

.invitation-message-section textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

/* Action Buttons */
#action-buttons {
    display: flex;
    gap: 8px;
}

#send-btn {
    flex: 0 0 auto;
}

#send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .input-group {
        flex-direction: column;
    }

    .input-group .btn {
        width: 100%;
    }

    #action-buttons {
        flex-direction: column;
    }
}

/* Gift Sources Display */
.sources-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0;
}

.source-item {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 8px;
    background: var(--bg);
    border-radius: 6px;
    border: 1px solid var(--line);
    font-size: 0.9rem;
}

.source-item .source-name {
    font-weight: 600;
    color: var(--ink);
    flex: 0 0 auto;
}

.source-item .pill {
    flex: 0 0 auto;
}

.source-item .price,
.source-item .source-price {
    font-weight: 600;
    color: var(--brand);
    flex: 0 0 auto;
}

.source-item .meta {
    font-size: 0.85rem;
    color: var(--muted);
    flex: 0 0 auto;
}

.source-address {
    width: 100%;
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--line);
    white-space: pre-wrap;
}

/* Details tag styling */
.sources-details {
    margin: 8px 0;
}

.sources-details summary {
    cursor: pointer;
    color: var(--brand);
    font-weight: 600;
    user-select: none;
    padding: 6px 0;
    transition: color 0.2s;
}

.sources-details summary:hover {
    color: var(--brand-dark);
}

.sources-details[open] summary {
    margin-bottom: 8px;
}

.sources-details .sources-list {
    margin-top: 8px;
}

@media (max-width: 600px) {
    .source-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .source-item .pill,
    .source-item .price,
    .source-item .source-price,
    .source-item .meta {
        display: block;
    }
}

/* Gift Edit - Sources Section */
.sources-section {
    margin-top: 32px;
    border-top: 2px solid var(--line);
    padding-top: 24px;
}

.sources-section h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.source-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    background: var(--brand);
    color: white;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.source-form-wrapper {
    margin-bottom: 24px;
    animation: slideIn 0.3s ease-out;
}

.source-form-wrapper .form-panel {
    margin: 0;
}

.source-form {
    display: grid;
    gap: 16px;
}

.source-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

.source-form-trigger,
.source-form-submit,
.source-form-cancel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.source-form-cancel {
    background: #e5e7eb;
    color: var(--ink);
    border-color: #d1d5db;
}

.source-form-cancel:hover {
    background: #d1d5db;
}

.source-form-submit:disabled,
.source-form-trigger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.source-form-submit:disabled::after,
.source-form-trigger:disabled::after {
    content: "...";
    animation: pulse 1s infinite;
}

.table-panel {
    animation: fadeIn 0.3s ease-out;
}

.source-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.source-edit-btn,
.source-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Table styling for sources */
.data-table tr:hover td {
    background: #f8fafc;
    transition: background-color 0.2s;
}

.data-table .source-actions button {
    font-size: 0.8rem;
    padding: 6px 10px;
    min-height: 32px;
}

@media (max-width: 760px) {
    .sources-section {
        margin-top: 24px;
        padding-top: 16px;
    }

    .data-table {
        min-width: 100%;
        font-size: 0.85rem;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }

    .source-actions {
        flex-direction: column;
        gap: 4px;
    }

    .source-actions button {
        width: 100%;
    }

    .two {
        grid-template-columns: 1fr;
    }
}

/* Visual refresh */
:root {
    --ink: #25313f;
    --muted: #6b7788;
    --line: #dde5ed;
    --panel: #ffffff;
    --bg: #f7f3ed;
    --brand: #19756c;
    --brand-dark: #0f5f58;
    --accent: #d97745;
    --accent-soft: #fff1e8;
    --warn: #b45309;
    --ok: #16845f;
    --danger: #b42318;
    --shadow-sm: 0 8px 24px rgba(35, 49, 63, 0.07);
    --shadow-md: 0 18px 48px rgba(35, 49, 63, 0.11);
    --radius: 8px;
}

* {
    transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(25, 117, 108, 0.08), transparent 34rem),
        linear-gradient(180deg, #fbfaf7 0, var(--bg) 44rem);
    color: var(--ink);
    font-size: 16px;
    line-height: 1.55;
}

a {
    color: var(--brand-dark);
}

a:hover {
    color: var(--brand);
}

.topbar {
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid rgba(221, 229, 237, 0.9);
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 26px rgba(35, 49, 63, 0.05);
}

.topbar-inner,
.wrap {
    width: min(1180px, calc(100% - 36px));
}

.topbar-inner {
    min-height: 70px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 1.16rem;
    letter-spacing: 0;
}

.brand::before {
    content: "";
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background:
        linear-gradient(90deg, transparent 45%, rgba(255, 255, 255, 0.65) 45% 55%, transparent 55%),
        linear-gradient(0deg, transparent 45%, rgba(255, 255, 255, 0.65) 45% 55%, transparent 55%),
        linear-gradient(135deg, var(--brand), var(--accent));
    box-shadow: 0 8px 18px rgba(25, 117, 108, 0.22);
}

.nav {
    gap: 8px;
}

.nav a:not(.btn) {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    border-radius: 6px;
    padding: 0 10px;
    color: #435161;
    font-weight: 650;
}

.nav a:not(.btn):hover {
    background: #eef7f5;
    color: var(--brand-dark);
    text-decoration: none;
}

.wrap {
    padding: 34px 0 64px;
}

.hero {
    min-height: calc(100vh - 140px);
    gap: 42px;
}

.hero h1,
.page-title {
    max-width: 980px;
    font-size: clamp(2rem, 4.3vw, 3.7rem);
    line-height: 1.06;
    color: #1f2a37;
}

.hero .lead,
.lead {
    color: #5e6d7e;
}

.hero-visual {
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.row {
    margin-bottom: 18px;
}

.actions {
    gap: 10px;
}

.btn,
button {
    min-height: 42px;
    border-radius: 7px;
    border-color: var(--brand);
    padding: 0 16px;
    background: linear-gradient(180deg, #21847b, var(--brand-dark));
    box-shadow: 0 6px 14px rgba(25, 117, 108, 0.17);
    letter-spacing: 0;
}

.btn:hover,
button:hover {
    background: linear-gradient(180deg, #1a7770, #0d524d);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(25, 117, 108, 0.2);
}

.btn:active,
button:active {
    transform: translateY(0);
}

.btn.secondary,
button.secondary,
.source-form-cancel {
    background: #ffffff;
    border-color: #cbd8e2;
    color: var(--brand-dark);
    box-shadow: none;
}

.btn.secondary:hover,
button.secondary:hover,
.source-form-cancel:hover {
    background: #f3faf8;
    border-color: #a9c9c3;
    box-shadow: 0 6px 16px rgba(35, 49, 63, 0.06);
}

.btn.danger,
button.danger {
    border-color: var(--danger);
    background: linear-gradient(180deg, #c9342a, var(--danger));
}

.btn.compact {
    min-height: 34px;
    padding: 0 12px;
}

.card,
.form-panel,
.table-panel,
.share-section,
.inline-panel {
    border: 1px solid rgba(213, 224, 233, 0.95);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-sm);
}

.card,
.form-panel,
.table-panel {
    padding: 22px;
}

.card:hover {
    border-color: #c7dad6;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card h2,
.card h3,
.share-section h2,
.inline-panel h2 {
    color: #1f2a37;
}

.muted,
.meta {
    color: var(--muted);
}

.pill {
    min-height: 28px;
    border: 1px solid rgba(25, 117, 108, 0.14);
    border-radius: 999px;
    background: #eaf7f4;
    color: var(--brand-dark);
    font-size: 0.78rem;
    letter-spacing: 0;
}

.pill.warn {
    border-color: rgba(180, 83, 9, 0.18);
    background: #fff5eb;
}

.pill.ok {
    border-color: rgba(22, 132, 95, 0.18);
    background: #eefbf5;
}

label {
    color: #344151;
    font-size: 0.93rem;
}

input,
textarea,
select {
    border-color: #cfdae5;
    border-radius: 7px;
    background: #fffefd;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(25, 117, 108, 0.11);
}

.flash {
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.flash.success {
    border-color: #9bd7bf;
    background: #effaf5;
}

.flash.error {
    border-color: #f3b7b2;
    background: #fff4f2;
}

.breadcrumbs {
    margin-bottom: 16px;
    padding: 0;
    font-size: 0.88rem;
}

.breadcrumbs a {
    color: #607083;
}

.breadcrumb-current {
    color: #263241;
}

.grid {
    gap: 20px;
}

.grid.gifts {
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.gift {
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 18px;
    padding: 16px !important;
}

.gift h2 {
    font-size: 1.04rem;
}

.gift p {
    color: #526071;
}

.gift img,
.gift .placeholder {
    width: 132px;
    height: 132px;
    border-color: #dbe5ed;
    background: linear-gradient(180deg, #ffffff, #f7fafb);
}

.gift .price,
.price {
    color: var(--brand-dark);
}

.gift .actions {
    align-items: center;
}

.reserve-amount {
    color: #405063;
}

.list-info {
    border-left: 4px solid var(--brand);
}

.search-filters {
    margin-bottom: 22px;
}

.search-controls {
    display: grid;
    gap: 14px;
}

.filter-row {
    gap: 12px;
}

.stats-panel {
    border-color: rgba(25, 117, 108, 0.16);
    background: linear-gradient(135deg, rgba(25, 117, 108, 0.08), rgba(217, 119, 69, 0.08));
}

.stat-item {
    border-color: #e1e8ee;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.stat-label {
    letter-spacing: 0;
}

.stat-value {
    color: var(--brand-dark);
}

.table-panel {
    overflow: auto;
}

.data-table {
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    background: #f2f7f6;
    color: #5b6877;
    letter-spacing: 0;
}

.data-table th:first-child {
    border-top-left-radius: 7px;
}

.data-table th:last-child {
    border-top-right-radius: 7px;
}

.data-table td {
    background: #ffffff;
}

.data-table tr:hover td {
    background: #fbf7f1;
}

.share-container {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.share-section {
    padding: 24px;
}

#qrcode {
    width: fit-content;
    max-width: 100%;
    padding: 14px;
    border-radius: var(--radius);
    box-shadow: inset 0 0 0 6px #f8fafc;
}

#qrcode canvas,
#qrcode img {
    display: block;
    max-width: 256px;
    width: 100% !important;
    height: auto !important;
}

.share-input-group {
    align-items: stretch;
}

.share-url-input {
    background: #fbfaf7;
    color: #324153;
}

.share-btn {
    border-radius: 7px;
    background: #fffefd;
}

.share-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.info-item {
    border: 1px solid #e2e9ef;
    background: #fbfaf7;
}

.source-form-wrapper {
    animation: fadeIn 0.22s ease-out;
}

.source-count {
    background: linear-gradient(180deg, var(--brand), var(--brand-dark));
}

@media (max-width: 900px) {
    .topbar-inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 0;
    }

    .nav {
        width: 100%;
    }

    .hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .hero-visual {
        max-height: 420px;
    }
}

@media (max-width: 760px) {
    .topbar-inner,
    .wrap {
        width: min(100% - 24px, 1180px);
    }

    .wrap {
        padding-top: 24px;
    }

    .page-title,
    .hero h1 {
        font-size: 2rem;
    }

    .grid.gifts {
        grid-template-columns: 1fr;
    }

    .gift {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 12px;
    }

    .gift img,
    .gift .placeholder {
        width: 96px;
        height: 96px;
    }

    .card,
    .form-panel,
    .table-panel,
    .share-section {
        padding: 16px;
    }

    .share-container {
        grid-template-columns: minmax(0, 1fr);
    }

    .share-input-group,
    .actions,
    .row {
        align-items: stretch;
    }

    .actions .btn,
    .actions button {
        flex: 1 1 auto;
    }
}

@media (max-width: 520px) {
    .nav a:not(.btn),
    .nav .btn {
        flex: 1 1 auto;
    }

    .gift {
        grid-template-columns: 1fr;
    }

    .gift img,
    .gift .placeholder {
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 3;
    }

    .share-buttons {
        grid-template-columns: 1fr;
    }
}
