:root {
    --primary-color: #c45e52;
    --secondary-color: #8b6748;
    --success-color: #9ba888;
    --warning-color: #d47366;
    --danger-color: #a74639;
    --info-color: #b8c5a0;
    --text-primary: #5c3d2e;
    --text-secondary: #8b6748;
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f0;
    --border-color: #e8d5bc;
    --shadow-sm: 0 1px 2px 0 rgba(92, 61, 46, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(92, 61, 46, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(92, 61, 46, 0.1);
}

* {
    box-sizing: border-box;
}

.manage-container {
    width: 100%;
    max-width: 100vw;
    margin: 0 auto;
    padding: 15px;
    min-height: calc(100vh - 200px);
    background: linear-gradient(to bottom,
        var(--elegant-dark) 0%,
        var(--elegant-brown) 50%,
        var(--elegant-dark) 100%
    );
    border-radius: 0;
    position: relative;
    box-sizing: border-box;
}

.manage-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(212,175,55,0.02) 10px, rgba(212,175,55,0.02) 20px);
    pointer-events: none;
    border-radius: 12px;
}

.manage-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(42,24,16,0.9) 0%, rgba(61,40,24,0.85) 100%);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    border: 2px solid var(--gold);
    position: relative;
    z-index: 1;
}

.manage-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gold);
    margin: 0;
    font-family: 'Georgia', serif;
    position: relative;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.5);
}

.manage-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, var(--gold), transparent);
    box-shadow: 0 0 10px rgba(212,175,55,0.4);
}

.manage-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.search-input {
    padding: 12px 18px 12px 45px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    width: 100%;
    transition: all 0.3s;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(196, 94, 82, 0.1);
}

.filter-btn {
    padding: 12px 24px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.filter-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}

.filters-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-select,
.filter-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: white;
    width: 100%;
}

.btn-apply-filters,
.btn-clear-filters {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-apply-filters {
    background: var(--primary-color);
    color: white;
}

.btn-apply-filters:hover {
    background: var(--danger-color);
}

.btn-clear-filters {
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-clear-filters:hover {
    background: var(--bg-secondary);
}

.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

.alert-info {
    background: #d4dfc8;
    color: #5c3d2e;
    border-left: 4px solid var(--info-color);
}

.alert-success {
    background: #d4dfc8;
    color: #5c3d2e;
    border-left: 4px solid var(--success-color);
}

.alert-error {
    background: #f5e5e0;
    color: #a74639;
    border-left: 4px solid var(--danger-color);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.table-container {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(92, 61, 46, 0.08);
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
}

.reservations-table {
    width: 100%;
    min-width: 950px;
    border-collapse: collapse;
}

.reservations-table thead {
    background: var(--bg-secondary);
}

.reservations-table th {
    padding: 12px 8px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 3px solid var(--primary-color);
    background: linear-gradient(135deg, var(--bg-secondary), #f0ece4);
}

.reservations-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s;
}

.reservations-table tbody tr:hover {
    background: var(--bg-secondary);
    transform: scale(1.005);
    box-shadow: 0 2px 8px rgba(92, 61, 46, 0.1);
}

.reservations-table tbody tr:last-child {
    border-bottom: none;
}

.reservations-table td {
    padding: 12px 8px;
    font-size: 13px;
    color: var(--text-primary);
    vertical-align: middle;
}

.cell-id {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 13px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-badge {
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
}

.user-badge.registered {
    background: #d4dfc8;
    color: #5c3d2e;
    border-color: #9ba888;
}

.user-badge.guest {
    background: #f5e5e0;
    color: #8b6748;
    border-color: #d47366;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
    border: 1px solid;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-pending {
    background: #fff8f0;
    color: #8b6748;
    border-color: #e8d5bc;
}

.status-confirmed {
    background: #d4dfc8;
    color: #5c3d2e;
    border-color: #9ba888;
}

.status-cancelled {
    background: #ffe5e5;
    color: #a74639;
    border-color: #d47366;
}

.status-completed {
    background: #e8d5bc;
    color: #5c3d2e;
    border-color: #b8956d;
}

.note-preview {
    color: var(--text-secondary);
    font-size: 13px;
    display: block;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
}

.cell-note {
    max-width: 160px;
    min-width: 80px;
}

.btn-view-note {
    background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 100%);
    border: 2px solid #f59e0b;
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #92400e;
    width: 32px;
    height: 32px;
}

.btn-view-note:hover {
    background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    color: #78350f;
}

.btn-view-note:active {
    transform: translateY(0);
}

.btn-view-note svg,
.btn-view-note i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.no-note {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 13px;
}

.cell-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    padding: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    min-width: 36px;
    min-height: 36px;
}

.btn-action svg,
.btn-action i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-edit {
    background: var(--primary-color);
    color: white;
}

.btn-edit:hover {
    background: var(--danger-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(196, 94, 82, 0.3);
}

.btn-delete {
    background: white;
    color: #a74639;
    border: 1.5px solid #d47366;
}

.btn-delete:hover {
    background: #d47366;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(212, 115, 102, 0.3);
}

.no-data {
    text-align: center;
    padding: 48px !important;
    color: var(--text-secondary);
    font-style: italic;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(196, 94, 82, 0.1);
}

.form-input:read-only {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

.modal-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.btn-cancel,
.btn-save {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel {
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-cancel:hover {
    background: var(--bg-secondary);
}

.btn-save {
    background: var(--primary-color);
    color: white;
}

.btn-save:hover {
    background: var(--danger-color);
}

.modal-small .modal-content {
    max-width: 450px;
}

.modal-header-danger {
    background-color: #f5e5e0;
    border-bottom: 2px solid var(--danger-color);
}

.modal-header-danger h2 {
    color: var(--danger-color);
}

.warning-text {
    color: #8b6748;
    background-color: #f5f5f0;
    border: 1px solid #e8d5bc;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 14px;
}

.btn-delete-confirm {
    background-color: var(--danger-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-delete-confirm:hover {
    background-color: var(--warning-color);
}

.verification-badge {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.verification-badge i {
    width: 14px;
    height: 14px;
}

.verification-pending {
    background: #fff8f0;
    color: #8b6748;
    border-color: #e8d5bc;
}

.verification-confirmed {
    background: #d4dfc8;
    color: #5c3d2e;
    border-color: #9ba888;
}

.verification-auto {
    background: #e7f3ff;
    color: #2563eb;
    border-color: #93c5fd;
}

.verification-method {
    width: 12px;
    height: 12px;
    opacity: 0.7;
    margin-left: 2px;
}

.btn-verify {
    background: #22c55e;
    color: white;
    border: none;
}

.btn-verify:hover {
    background: #16a34a;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.3);
}

.btn-verify i {
    width: 16px;
    height: 16px;
}

.cell-verification {
    min-width: 140px;
}

.modal-header-verify {
    background-color: #e7f3ff;
    border-bottom: 2px solid #2563eb;
}

.modal-header-verify h2 {
    color: #2563eb;
}

.modal-verify-info {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

.btn-verify-confirm {
    background-color: #2563eb;
}

.btn-verify-confirm:hover {
    background-color: #1d4ed8;
}

.modal-header-note {
    background-color: #fef3c7;
    border-bottom: 2px solid #f59e0b;
}

.modal-header-note h2 {
    color: #d97706;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header-note i {
    width: 24px;
    height: 24px;
}

.note-content-box {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #fcd34d;
    border-radius: 12px;
    padding: 20px;
    font-size: 15px;
    line-height: 1.6;
    color: #92400e;
    white-space: pre-wrap;
    word-wrap: break-word;
    min-height: 80px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px rgba(245, 158, 11, 0.1);
}

.btn-note-close {
    background-color: #f59e0b;
}

.btn-note-close:hover {
    background-color: #d97706;
}

@media (min-width: 640px) {
    .manage-container {
        max-width: 1800px;
        margin: 20px auto;
        padding: 30px;
        border-radius: 12px;
    }

    .manage-header {
        padding: 28px;
        margin-bottom: 32px;
    }

    .manage-title {
        font-size: 2.2rem;
    }

    .manage-title::after {
        width: 90px;
        height: 3.5px;
    }

    .form-row {
        grid-template-columns: 1fr 1fr;
    }

    .modal-header {
        padding: 24px;
    }

    .modal-header h2 {
        font-size: 20px;
    }

    .modal-body {
        padding: 24px;
    }

    .modal-footer {
        flex-direction: row;
        justify-content: flex-end;
        gap: 12px;
        padding: 24px;
    }


    .reservations-table th,
    .reservations-table td {
        padding: 14px 12px;
        font-size: 13px;
    }

    .cell-id {
        font-size: 14px;
    }

    .verification-badge {
        font-size: 10px;
        padding: 3px 8px;
        gap: 4px;
    }
}

@media (max-width: 1023px) and (orientation: landscape) {
    .manage-container {
        padding: 10px;
        min-height: auto;
    }

    .manage-header {
        padding: 15px;
        margin-bottom: 15px;
    }

    .manage-title {
        font-size: 1.5rem;
    }

    .table-container {
        max-height: 50vh;
        overflow-y: auto;
    }
}

@media (min-width: 1024px) {
    .manage-container {
        max-width: 1900px;
        margin: 30px auto;
        padding: 40px;
    }

    .manage-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 35px;
        margin-bottom: 40px;
    }

    .manage-title {
        font-size: 2.8rem;
    }

    .manage-title::after {
        width: 100px;
        height: 4px;
    }

    .manage-actions {
        flex-direction: row;
        width: auto;
        align-items: center;
    }

    .search-box {
        width: auto;
    }

    .search-input {
        width: 350px;
    }

    .filters-panel {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: end;
        padding: 20px;
    }

    .filter-select,
    .filter-input {
        width: auto;
        min-width: 150px;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .reservations-table {
        min-width: 1100px;
    }

    .reservations-table th,
    .reservations-table td {
        padding: 16px 20px;
        font-size: 14px;
    }

    .reservations-table th {
        font-size: 12px;
    }

    .cell-id {
        font-size: 14px;
    }
}
