/* ============================================
   ADMIN PANEL STYLES
   Ayusshkalp Healthcare Admin
   ============================================ */

:root {
    --admin-primary: #1a1a1a;
    --admin-gold: #c9a84c;
    --admin-gold-dark: #8b6914;
    --admin-bg: #f4f6f9;
    --admin-sidebar: #1e293b;
    --admin-sidebar-hover: #334155;
    --admin-card: #ffffff;
    --admin-border: #e2e8f0;
    --admin-text: #334155;
    --admin-text-light: #64748b;
    --admin-success: #22c55e;
    --admin-danger: #ef4444;
    --admin-warning: #f59e0b;
    --admin-info: #3b82f6;
    --admin-radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body.admin-body {
    font-family: 'Inter', sans-serif;
    background: var(--admin-bg);
    color: var(--admin-text);
    min-height: 100vh;
    display: flex;
}

/* ---- LOGIN PAGE ---- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--admin-primary) 0%, #2d2d2d 100%);
}

.login-card {
    background: var(--admin-card);
    padding: 2.5rem;
    border-radius: var(--admin-radius);
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--admin-primary);
}

.login-logo p {
    color: var(--admin-gold);
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* ---- SIDEBAR ---- */
.admin-sidebar {
    width: 260px;
    background: var(--admin-sidebar);
    color: #fff;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
}

.sidebar-brand small {
    color: var(--admin-gold);
    font-size: 0.65rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--admin-sidebar-hover);
    color: #fff;
    border-left-color: var(--admin-gold);
}

.sidebar-nav a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar-nav .nav-divider {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 0.5rem 0;
}

.sidebar-user {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.8rem;
    color: #94a3b8;
}

/* ---- MAIN CONTENT ---- */
.admin-main {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

.admin-topbar {
    background: var(--admin-card);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-topbar h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-content {
    padding: 2rem;
}

/* ---- MOBILE SIDEBAR TOGGLE ---- */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--admin-text);
    cursor: pointer;
    padding: 0.5rem;
}

.sidebar-toggle svg {
    width: 24px;
    height: 24px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 90;
}

/* ---- DASHBOARD CARDS ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--admin-card);
    padding: 1.5rem;
    border-radius: var(--admin-radius);
    border: 1px solid var(--admin-border);
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--admin-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--admin-primary);
}

.stat-card .stat-icon {
    float: right;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.gold { background: rgba(201,168,76,0.1); color: var(--admin-gold); }
.stat-icon.blue { background: rgba(59,130,246,0.1); color: var(--admin-info); }
.stat-icon.green { background: rgba(34,197,94,0.1); color: var(--admin-success); }
.stat-icon.red { background: rgba(239,68,68,0.1); color: var(--admin-danger); }

.admin-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-action-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 0.85rem;
    align-items: center;
    padding: 1rem;
    color: var(--admin-text);
    text-decoration: none;
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.admin-action-card:hover {
    border-color: rgba(201,168,76,0.6);
    box-shadow: 0 10px 25px rgba(15,23,42,0.08);
    transform: translateY(-1px);
}

.admin-action-card strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--admin-primary);
    font-size: 0.95rem;
}

.admin-action-card small {
    display: block;
    color: var(--admin-text-light);
    font-size: 0.78rem;
    line-height: 1.35;
}

.admin-action-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.admin-action-icon svg {
    width: 20px;
    height: 20px;
}

.admin-action-icon.gold { background: rgba(201,168,76,0.12); color: var(--admin-gold-dark); }
.admin-action-icon.green { background: rgba(34,197,94,0.12); color: #15803d; }
.admin-action-icon.red { background: rgba(239,68,68,0.12); color: #b91c1c; }

.section-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
}

.section-intro h2 {
    margin: 0.2rem 0 0.35rem;
    color: var(--admin-primary);
    font-size: 1.05rem;
    line-height: 1.3;
}

.section-intro p {
    max-width: 760px;
    color: var(--admin-text-light);
    font-size: 0.85rem;
    line-height: 1.5;
}

.section-kicker {
    color: var(--admin-gold-dark);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ---- TABLE ---- */
.admin-table-wrap {
    background: var(--admin-card);
    border-radius: var(--admin-radius);
    border: 1px solid var(--admin-border);
    overflow: hidden;
    margin-bottom: 2rem;
}

.admin-table-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-table-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--admin-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--admin-border);
}

.admin-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--admin-border);
    font-size: 0.875rem;
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover {
    background: #f8fafc;
}

.admin-table .thumb {
    width: 50px;
    height: 35px;
    object-fit: cover;
    border-radius: 4px;
}

/* ---- BADGES ---- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fce4ec; color: #b91c1c; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-default { background: #f1f5f9; color: #475569; }

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--admin-gold);
    color: #fff;
    border-color: var(--admin-gold);
}

.btn-primary:hover {
    background: var(--admin-gold-dark);
    border-color: var(--admin-gold-dark);
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--admin-text);
    border-color: var(--admin-border);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-danger {
    background: var(--admin-danger);
    color: #fff;
    border-color: var(--admin-danger);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
}

.btn-outline {
    background: transparent;
    color: var(--admin-text);
    border-color: var(--admin-border);
}

.btn-outline:hover {
    background: #f1f5f9;
}

.action-btns {
    display: flex;
    gap: 0.4rem;
}

.enquiry-message-cell {
    width: 230px;
    max-width: 230px;
    font-size: 0.8rem;
}

.enquiry-message-preview {
    overflow-wrap: anywhere;
    color: var(--admin-text);
    line-height: 1.45;
}

.enquiry-view-btn {
    margin-top: 0.45rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--admin-gold-dark);
    font: 700 0.72rem Inter, sans-serif;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.enquiry-modal[hidden] { display: none; }
.enquiry-modal {
    position: fixed;
    z-index: 2000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(4px);
}

body.enquiry-modal-open { overflow: hidden; }
.enquiry-modal-dialog {
    width: min(720px, 100%);
    max-height: min(82vh, 760px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    background: var(--admin-card);
    border-radius: 14px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.35);
}

.enquiry-modal-dialog>header,
.enquiry-modal-dialog>footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.35rem;
    border-bottom: 1px solid var(--admin-border);
}

.enquiry-modal-dialog>footer { justify-content: flex-end; border-top: 1px solid var(--admin-border); border-bottom: 0; }
.enquiry-modal-dialog header span { color: var(--admin-muted); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.enquiry-modal-dialog header h2 { margin: 0.15rem 0 0; font-size: 1.2rem; }
.enquiry-modal-close:not(.btn) { width: 38px; height: 38px; border: 1px solid var(--admin-border); border-radius: 50%; background: #fff; color: var(--admin-text); font-size: 1.5rem; cursor: pointer; }
.enquiry-modal-body {
    min-height: 220px;
    overflow: auto;
    padding: 1.5rem;
    color: var(--admin-text);
    font-size: 0.95rem;
    line-height: 1.75;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 640px) {
    .enquiry-modal { padding: 0.65rem; }
    .enquiry-modal-dialog { max-height: 92vh; }
    .enquiry-message-cell { min-width: 190px; }
}

/* ---- FORMS ---- */
.form-card {
    background: var(--admin-card);
    border-radius: var(--admin-radius);
    border: 1px solid var(--admin-border);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--admin-border);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--admin-text);
    margin-bottom: 0.4rem;
}

.form-group label .required {
    color: var(--admin-danger);
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    background: #fff;
    color: var(--admin-text);
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--admin-gold);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.blog-editor {
    overflow: hidden;
    border: 1px solid #d7c49a;
    border-radius: 8px;
    background: #071012;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
}

.blog-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    padding: 0.7rem;
    border-bottom: 1px solid rgba(215, 196, 154, 0.22);
    background: #0f172a;
}

.blog-editor-toolbar button,
.blog-editor-format {
    min-height: 32px;
    padding: 0.35rem 0.65rem;
    color: #e5dcc8;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid rgba(215, 196, 154, 0.22);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.blog-editor-format {
    min-width: 130px;
}

.blog-editor-toolbar button:hover,
.blog-editor-format:focus {
    color: #111827;
    border-color: #d7b46a;
    background: #d7b46a;
}

.blog-editor-divider {
    width: 1px;
    height: 24px;
    margin: 0 0.25rem;
    background: rgba(215, 196, 154, 0.22);
}

.blog-editor-surface {
    min-height: 520px;
    padding: clamp(1.25rem, 3vw, 2.25rem);
    color: rgba(250, 247, 240, 0.9);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1rem;
    line-height: 1.72;
    outline: none;
}

.blog-editor-html {
    width: 100%;
    min-height: 520px;
    padding: 1.25rem;
    border: 0;
    outline: none;
    resize: vertical;
    color: #e5dcc8;
    background: #071012;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.9rem;
    line-height: 1.65;
}

.blog-editor-surface h2,
.blog-editor-surface h3,
.blog-editor-surface h4 {
    color: #f8f2e6;
    line-height: 1.16;
}

.blog-editor-surface h2 {
    margin: 2.25rem 0 0.85rem;
    font-size: clamp(1.35rem, 1.4vw, 1.75rem);
    line-height: 1.22;
}

.blog-editor-surface h3 {
    margin: 1.75rem 0 0.7rem;
    font-size: 1.28rem;
    line-height: 1.24;
}

.blog-editor-surface h4 {
    margin: 1.35rem 0 0.55rem;
    font-family: Inter, sans-serif;
    font-size: 0.88rem;
    line-height: 1.35;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.blog-editor-surface p,
.blog-editor-surface ul,
.blog-editor-surface ol,
.blog-editor-surface blockquote {
    margin-bottom: 1.2rem;
}

.blog-editor-surface ul,
.blog-editor-surface ol {
    display: grid;
    gap: 0.4rem;
    padding-left: 1.35rem;
    color: rgba(250, 247, 240, 0.9);
}

.blog-editor-surface li {
    color: rgba(250, 247, 240, 0.9);
    padding-left: 0.2rem;
}

.blog-editor-surface li::marker {
    color: #d7b46a;
    font-size: 0.78em;
}

.blog-editor-surface blockquote {
    margin: 2rem 0;
    padding: 1.25rem 0 1.25rem 1.35rem;
    color: rgba(250, 247, 240, 0.7);
    border-left: 2px solid #d7b46a;
}

.blog-editor-surface a {
    color: #d7b46a;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.blog-editor-surface img {
    max-width: 100%;
    height: auto;
    margin: 2rem 0;
    border-radius: 8px;
}

.blog-editor-source {
    display: none;
}

.blog-editor-status {
    padding: 0.55rem 0.75rem;
    border-top: 1px solid rgba(215, 196, 154, 0.22);
    color: rgba(250, 247, 240, 0.62);
    background: #0f172a;
    font-size: 0.78rem;
}

select.form-control {
    appearance: auto;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.blog-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 1.5rem;
    align-items: start;
}

/* ---- MARKDOWN BLOG EDITOR ---- */
.markdown-editor {
    overflow: hidden;
    border: 1px solid var(--admin-border);
    border-radius: 9px;
    background: #fff;
}

.markdown-toolbar {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.65rem;
    border-bottom: 1px solid var(--admin-border);
    background: #f8fafc;
}

.markdown-toolbar button {
    min-height: 32px;
    padding: 0.35rem 0.65rem;
    color: var(--admin-text);
    border: 1px solid var(--admin-border);
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
}

.markdown-toolbar button:hover {
    color: #fff;
    border-color: var(--admin-primary);
    background: var(--admin-primary);
}

.markdown-panes {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 620px;
}

.markdown-write-pane {
    border-right: 1px solid var(--admin-border);
}

.markdown-write-pane .blog-markdown-editor {
    display: block;
    width: 100%;
    min-height: 620px;
    padding: 1.25rem;
    border: 0;
    border-radius: 0;
    outline: none;
    resize: vertical;
    color: #172033;
    background: #fff;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.9rem;
    line-height: 1.7;
}

.markdown-preview {
    min-width: 0;
    padding: 1.5rem;
    overflow: auto;
    color: #334155;
    background: #fbfcfe;
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.75;
}

.markdown-preview h2 { margin: 1.8rem 0 0.7rem; color: #111827; font-size: 1.65rem; }
.markdown-preview h3 { margin: 1.4rem 0 0.6rem; color: #111827; font-size: 1.3rem; }
.markdown-preview p, .markdown-preview ul, .markdown-preview ol { margin: 0 0 1rem; }
.markdown-preview img { display: block; max-width: 100%; height: auto; margin: 1.5rem 0; border-radius: 6px; }
.markdown-preview blockquote { margin: 1.5rem 0; padding: 0.75rem 1rem; border-left: 3px solid var(--admin-gold); background: #fff8e7; }
.markdown-preview table { width: 100%; border-collapse: collapse; font-family: Inter, sans-serif; font-size: 0.8rem; }
.markdown-preview th, .markdown-preview td { padding: 0.65rem; border: 1px solid #dbe2ea; text-align: left; }
.markdown-preview th { background: #eef2f7; }
.markdown-preview figure { margin: 1.5rem 0; }
.markdown-preview figcaption { color: #64748b; font-family: Inter, sans-serif; font-size: 0.75rem; text-align: center; }

.markdown-panes.preview-hidden { grid-template-columns: 1fr; }
.markdown-panes.preview-hidden .markdown-preview { display: none; }
.markdown-panes.preview-hidden .markdown-write-pane { border-right: 0; }

.markdown-help {
    padding: 0.55rem 0.75rem;
    color: var(--admin-text-light);
    border-top: 1px solid var(--admin-border);
    background: #f8fafc;
    font-size: 0.75rem;
}

.blog-publish-status {
    display: inline-flex;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.blog-publish-status.is-published { color: #166534; background: #dcfce7; }
.blog-publish-status.is-draft { color: #92400e; background: #fef3c7; }

.featured-gallery-preview {
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid var(--admin-border);
    border-radius: 7px;
    background: #f8fafc;
}

.featured-gallery-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.featured-gallery-preview span {
    display: block;
    padding: .6rem;
    color: var(--admin-text-light);
    font-size: .75rem;
}

.markdown-gallery-modal[hidden] { display: none; }
.markdown-gallery-modal {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.72);
}

.markdown-gallery-dialog {
    width: min(920px, 100%);
    max-height: min(760px, 90vh);
    padding: 1.25rem;
    overflow: auto;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

.markdown-gallery-dialog header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.markdown-gallery-dialog header div { display: grid; gap: 0.2rem; }
.markdown-gallery-dialog header small { color: var(--admin-text-light); }
.markdown-gallery-dialog [data-close] { border: 0; background: transparent; cursor: pointer; font-size: 1.8rem; }
.markdown-gallery-search { width: 100%; padding: 0.75rem; margin-bottom: 1rem; border: 1px solid var(--admin-border); border-radius: 6px; }
.markdown-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.85rem; }
.markdown-gallery-grid button { overflow: hidden; padding: 0; color: var(--admin-text); border: 1px solid var(--admin-border); border-radius: 8px; background: #fff; cursor: pointer; text-align: left; }
.markdown-gallery-grid button:hover { border-color: var(--admin-gold); box-shadow: 0 6px 18px rgba(15,23,42,.12); }
.markdown-gallery-grid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.markdown-gallery-grid span { display: block; padding: 0.6rem; overflow: hidden; font-size: 0.75rem; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
    .markdown-panes { grid-template-columns: 1fr; }
    .markdown-write-pane { border-right: 0; border-bottom: 1px solid var(--admin-border); }
    .markdown-write-pane .blog-markdown-editor, .markdown-panes { min-height: 440px; }
    .markdown-preview { max-height: 520px; }
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--admin-gold);
}

.form-text {
    font-size: 0.75rem;
    color: var(--admin-text-light);
    margin-top: 0.25rem;
}

/* ---- IMAGE UPLOAD ---- */
.image-upload-area {
    border: 2px dashed var(--admin-border);
    border-radius: var(--admin-radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.image-upload-area:hover {
    border-color: var(--admin-gold);
}

.image-upload-area p {
    color: var(--admin-text-light);
    font-size: 0.85rem;
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.image-preview-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--admin-border);
}

.image-preview-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
}

.image-preview-item .remove-image {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--admin-danger);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-item.primary {
    border-color: var(--admin-gold);
    border-width: 2px;
}

.gallery-upload-form {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(170px, 0.55fr) minmax(170px, 0.75fr) auto auto;
    gap: 1rem;
    align-items: end;
}

.gallery-selected-preview {
    margin-top: 0.75rem;
}

.gallery-selected-heading {
    margin-bottom: 0.55rem;
    color: var(--admin-text-light);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.gallery-selected-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0.75rem;
}

.gallery-selected-card {
    display: grid;
    gap: 0.55rem;
    padding: 0.65rem;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background: #f8fafc;
}

.gallery-selected-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 6px;
    background: #e2e8f0;
}

.gallery-selected-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-selected-meta {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.gallery-selected-meta strong {
    overflow: hidden;
    color: var(--admin-text);
    font-size: 0.8rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-selected-meta span {
    color: var(--admin-text-light);
    font-size: 0.72rem;
}

/* ---- FLASH MESSAGES ---- */
.admin-flash {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-flash-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.admin-flash-error {
    background: #fce4ec;
    color: #b91c1c;
    border: 1px solid #fecdd3;
}

.admin-flash-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ---- PAGINATION ---- */
.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin-top: 1.5rem;
}

.admin-pagination a,
.admin-pagination span {
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    text-decoration: none;
    border: 1px solid var(--admin-border);
    color: var(--admin-text);
}

.admin-pagination .current {
    background: var(--admin-gold);
    color: #fff;
    border-color: var(--admin-gold);
}

.admin-pagination a:hover {
    background: #f1f5f9;
}

/* ---- EMPTY STATE ---- */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--admin-text-light);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 1rem;
}

/* ---- ENQUIRY DETAIL ---- */
.enquiry-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.enquiry-meta dt {
    font-size: 0.75rem;
    color: var(--admin-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.enquiry-meta dd {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 992px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .sidebar-toggle {
        display: block;
    }

    .admin-main {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-action-grid {
        grid-template-columns: 1fr;
    }

    .section-intro {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .gallery-upload-form {
        grid-template-columns: 1fr;
    }

    .blog-form-grid {
        grid-template-columns: 1fr;
    }

    .enquiry-meta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-content {
        padding: 1rem;
    }

    .admin-topbar {
        padding: 0.75rem 1rem;
    }

    .admin-table-wrap {
        overflow-x: auto;
    }

    .admin-table {
        min-width: 600px;
    }
}



.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem 1.25rem}.form-grid .form-group{margin:0}@media(max-width:760px){.form-grid{grid-template-columns:1fr}.admin-table{min-width:760px}}
