/* Admin-specific styles */
body.admin-body {
    background: #eef0f3;
    font-family: 'Helvetica Neue', sans-serif;
    min-height: 100vh;
}

/* Login box */
.admin-login-box {
    max-width: 400px;
    margin: 8vh auto 0;
    background: #fff;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 30px rgba(0,0,0,.08);
    text-align: center;
}
.admin-login-box h1 { font-size: 2rem; color: #9B8ECD; margin-bottom: .3rem; }
.admin-login-box p { opacity: .6; margin-bottom: 2rem; font-size: .9rem; }

/* Dashboard wrap */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.admin-header h1 { font-size: 1.5rem; color: #9B8ECD; }
.admin-header-actions { display: flex; gap: .5rem; }

/* Filters */
.admin-filters { display: flex; gap: .5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.admin-filters a {
    padding: .4rem 1rem;
    border-radius: 99px;
    border: 1px solid rgba(155,142,205,.3);
    font-size: .85rem;
    color: #4A5D50;
    transition: all .15s;
    text-decoration: none;
}
.admin-filters a:hover, .admin-filters a.active {
    background: #9B8ECD;
    border-color: #9B8ECD;
    color: #fff;
}

/* Table */
.table-wrap { overflow-x: auto; border-radius: 15px; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.bookings-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: .88rem;
}
.bookings-table th {
    background: #9B8ECD;
    color: #fff;
    padding: .8rem 1rem;
    text-align: left;
    font-weight: 400;
    white-space: nowrap;
}
.bookings-table td { padding: .75rem 1rem; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.bookings-table tr:last-child td { border-bottom: none; }
.bookings-table tr.status-confirmed { background: #f0fdf4; }
.bookings-table tr.status-cancelled { background: #fff7ed; opacity: .7; }
.msg-cell { max-width: 200px; white-space: pre-wrap; word-break: break-word; font-size: .8rem; opacity: .75; }

/* Badges */
.badge { display: inline-block; padding: .2rem .7rem; border-radius: 99px; font-size: .75rem; white-space: nowrap; }
.badge--pending   { background: #fef3c7; color: #92400e; }
.badge--confirmed { background: #d1fae5; color: #065f46; }
.badge--cancelled { background: #fee2e2; color: #991b1b; }

/* Action buttons */
.btn--green  { background: #10b981; border-color: #10b981; color: #fff; }
.btn--orange { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.btn--red    { background: #ef4444; border-color: #ef4444; color: #fff; }
.btn--green:hover  { background: #059669; border-color: #059669; }
.btn--orange:hover { background: #d97706; border-color: #d97706; }
.btn--red:hover    { background: #dc2626; border-color: #dc2626; }
.actions-cell { white-space: nowrap; }

/* ── Accent button ──────────────────────────────────────────── */
.btn--accent { background: #9B8ECD; border-color: #9B8ECD; color: #fff; }
.btn--accent:hover { background: #7A6DAD; border-color: #7A6DAD; }

/* ── Admin tabs ─────────────────────────────────────────────── */
.admin-tabs {
    display: flex; gap: .25rem; margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(155,142,205,.2);
    flex-wrap: wrap;
}
.admin-tabs a {
    padding: .55rem 1.2rem; font-size: .9rem; color: #4A5D50;
    text-decoration: none; border-radius: 8px 8px 0 0;
    border: 1px solid transparent; border-bottom: none;
    transition: background .15s;
}
.admin-tabs a:hover { background: rgba(155,142,205,.1); }
.admin-tabs a.active {
    background: #fff; border-color: rgba(155,142,205,.2);
    color: #9B8ECD; font-weight: 400; margin-bottom: -2px;
}

/* ── Section header ─────────────────────────────────────────── */
.admin-section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.2rem; flex-wrap: wrap; gap: .5rem;
}
.admin-section-header h2 { font-size: 1.1rem; color: #4A5D50; font-family: 'Cormorant Garamond', serif; }

/* ── Page edit form ─────────────────────────────────────────── */
.page-edit-form { background: #fff; border-radius: 15px; padding: 2rem;
    box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.form-group { margin-bottom: 1.4rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 400;
    color: #4A5D50; margin-bottom: .4rem; letter-spacing: .02em; }
.form-group input[type="text"] {
    width: 100%; padding: .65rem 1rem; border: 1px solid rgba(155,142,205,.3);
    border-radius: 10px; font-size: .95rem; background: #fafafa;
    color: #4A5D50; transition: border-color .15s;
    font-family: inherit;
}
.form-group input[type="text"]:focus { outline: none; border-color: #9B8ECD; background: #fff; }
.slug-preview-wrap { display: flex; align-items: center; }
.slug-prefix { padding: .65rem .8rem; background: rgba(155,142,205,.1);
    border: 1px solid rgba(155,142,205,.3); border-right: none;
    border-radius: 10px 0 0 10px; font-size: .85rem; color: #9B8ECD;
    white-space: nowrap; }
.slug-preview-wrap input { border-radius: 0 10px 10px 0; }
.required { color: #ef4444; }

/* Quill editor wrapper */
.editor-toolbar-extra { margin-bottom: .5rem; }
#quill-editor {
    border: 1px solid rgba(155,142,205,.3) !important;
    border-radius: 0 0 10px 10px !important;
    font-family: inherit; font-size: .95rem; color: #4A5D50;
    background: #fafafa;
}
.ql-toolbar { border: 1px solid rgba(155,142,205,.3) !important;
    border-radius: 10px 10px 0 0 !important; background: #fff; }
.ql-container { border: none !important; }

/* Toggle switch */
.form-group--inline { display: flex; align-items: center; }
.toggle-label { display: flex; align-items: center; gap: .75rem; cursor: pointer;
    font-size: .9rem; user-select: none; }
.toggle-label input { display: none; }
.toggle-switch {
    width: 42px; height: 24px; background: #ccc; border-radius: 12px;
    position: relative; transition: background .2s; flex-shrink: 0;
}
.toggle-switch::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; background: #fff;
    border-radius: 50%; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-label input:checked ~ .toggle-switch { background: #9B8ECD; }
.toggle-label input:checked ~ .toggle-switch::after { left: 21px; }

/* Form actions */
.form-actions { display: flex; gap: .75rem; align-items: center;
    margin-top: 1.5rem; flex-wrap: wrap; }

/* ── Media grid ─────────────────────────────────────────────── */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem; margin-top: 1.5rem;
}
.media-card {
    background: #fff; border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07); overflow: hidden;
    transition: transform .15s, box-shadow .15s;
}
.media-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.media-card__img { aspect-ratio: 1; overflow: hidden; background: #f0f4f1; }
.media-card__img img { width: 100%; height: 100%; object-fit: cover; }
.media-card__info { padding: .6rem .8rem; }
.media-card__name {
    display: block; font-size: .75rem; color: #4A5D50;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: .4rem;
}
.media-card__actions { display: flex; gap: .3rem; }

/* ── Upload drop zone ───────────────────────────────────────── */
.upload-drop-zone {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .6rem; padding: 2rem; margin-bottom: 1.5rem;
    border: 2px dashed rgba(155,142,205,.4); border-radius: 15px;
    background: rgba(155,142,205,.04); cursor: pointer;
    text-align: center; color: #4A5D50; transition: all .2s;
    font-size: .9rem;
}
.upload-drop-zone:hover, .upload-drop-zone.drag-over {
    border-color: #9B8ECD; background: rgba(155,142,205,.1);
}
.upload-drop-zone__icon { font-size: 2.5rem; }

/* ── Media picker modal ─────────────────────────────────────── */
.media-modal {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
}
.media-modal__backdrop {
    position: absolute; inset: 0; background: rgba(0,0,0,.5);
    backdrop-filter: blur(4px);
}
.media-modal__box {
    position: relative; background: #fff; border-radius: 15px;
    width: min(90vw, 800px); max-height: 85vh;
    display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    overflow: hidden;
}
.media-modal__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.5rem; border-bottom: 1px solid rgba(155,142,205,.15);
}
.media-modal__header h3 { font-size: 1.1rem; color: #9B8ECD; font-family: 'Cormorant Garamond', serif; }
.media-modal__close {
    background: none; border: none; font-size: 1.2rem; cursor: pointer;
    color: #4A5D50; width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.media-modal__close:hover { background: #f0f0f0; }
.media-modal__upload { padding: .75rem 1.5rem; border-bottom: 1px solid rgba(155,142,205,.1); }
.media-modal__upload .upload-drop-zone { padding: 1rem; margin-bottom: 0; }
.media-modal__grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: .6rem; padding: 1rem 1.5rem; overflow-y: auto;
}
.media-thumb {
    cursor: pointer; border-radius: 8px; overflow: hidden;
    border: 2px solid transparent; transition: border-color .15s, transform .1s;
    background: #f0f4f1;
}
.media-thumb:hover { border-color: #9B8ECD; transform: scale(1.03); }
.media-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.media-thumb span { display: block; font-size: .65rem; padding: .2rem .4rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #4A5D50; }

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
    position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
    background: #4A5D50; color: #fff; padding: .7rem 1.5rem;
    border-radius: 99px; font-size: .9rem; z-index: 99999;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

/* ── Form select ─────────────────────────────────────────────── */
.form-select {
    width: 100%; padding: .65rem 1rem; border: 1px solid rgba(155,142,205,.3);
    border-radius: 10px; font-size: .95rem; background: #fafafa;
    color: #4A5D50; font-family: inherit; cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239B8ECD' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 1rem center;
    padding-right: 2.5rem;
}
.form-select:focus { outline: none; border-color: #9B8ECD; background-color: #fff; }
.form-hint {
    margin-top: .5rem; font-size: .8rem; opacity: .6;
    line-height: 1.5; padding: .5rem .75rem;
    background: rgba(155,142,205,.06); border-radius: 8px;
    border-left: 3px solid rgba(155,142,205,.3);
}

/* ── Page tree (admin list) ──────────────────────────────────── */
.page-tree-badge {
    display: inline-block; margin-left: .5rem;
    font-size: .7rem; padding: .15rem .6rem;
    background: rgba(155,142,205,.15); color: #7A6DAD;
    border-radius: 99px; vertical-align: middle;
}
.page-tree-indent { color: rgba(155,142,205,.6); font-family: monospace; }
.page-tree-child td { background: rgba(155,142,205,.03); }
.page-tree-child td:first-child { border-left: 3px solid rgba(155,142,205,.2); }

/* ── Responsive (admin) ─────────────────────────────────────── */
@media (max-width: 600px) {
    .admin-wrap { padding: 1rem; }
    .page-edit-form { padding: 1.2rem; }
    .media-grid { grid-template-columns: repeat(2, 1fr); }
    .media-modal__grid { grid-template-columns: repeat(3, 1fr); }
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; text-align: center; }
}
