/**
 * Admin Panel Core Styles - Reflexology Association
 */

:root {
    --primary: #002855;
    --primary-dark: #001b3a;
    --primary-light: #0d4b8f;
    --accent: #0d7a68;
    --accent-hover: #0a6354;
    --accent-light: #ecfdf5;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --pdf-red: #dc2626;
    --pdf-red-light: #fee2e2;
    --bg-page: #f1f5f9;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0, 40, 85, 0.08);
    --shadow-lg: 0 12px 28px rgba(0, 40, 85, 0.12);
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ------------------ AUTH SCREEN ------------------ */
#authSection {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #001e3d 0%, #002855 50%, #0d4b8f 100%);
    position: relative;
    overflow: hidden;
}

#authSection::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(13, 122, 104, 0.25) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    border-radius: 50%;
}

#authSection::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(13, 75, 143, 0.3) 0%, transparent 70%);
    bottom: -80px;
    left: -80px;
    border-radius: 50%;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow: 0 20px 45px rgba(0, 20, 50, 0.35);
    position: relative;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.4);
    animation: fadeIn 0.4s ease-out;
}

.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo img {
    max-height: 55px;
    object-fit: contain;
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 13.5px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.form-label-desc {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

.input-icon-wrap {
    position: relative;
}

.input-icon-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 16px;
}

.form-control-custom {
    width: 100%;
    height: 48px;
    padding: 10px 14px 10px 42px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14.5px;
    font-family: inherit;
    background: #ffffff;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.form-control-custom:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(13, 122, 104, 0.15);
}

.btn-auth-submit {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, var(--accent) 0%, #0a6354 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(13, 122, 104, 0.28);
}

.btn-auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(13, 122, 104, 0.38);
}

.auth-error-alert {
    background-color: var(--danger-light);
    color: var(--danger);
    border: 1px solid #fecaca;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    display: none;
    margin-bottom: 18px;
    align-items: center;
    gap: 8px;
}

/* ------------------ ADMIN PANEL UI ------------------ */
#adminSection {
    display: none;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Header */
.admin-nav {
    background: var(--primary);
    color: #ffffff;
    padding: 14px 28px;
    box-shadow: 0 4px 16px rgba(0, 20, 50, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.nav-brand img {
    max-height: 40px;
    filter: brightness(0) invert(1);
}

.nav-brand-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #ffffff;
}

.nav-brand-badge {
    background: rgba(13, 122, 104, 0.4);
    border: 1px solid rgba(52, 211, 153, 0.5);
    color: #a7f3d0;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
}

.sync-badge {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(52, 211, 153, 0.4);
    color: #6ee7b7;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
}

.user-pill i {
    color: #38bdf8;
}

.btn-nav-action {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-nav-action:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.btn-nav-logout {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.btn-nav-logout:hover {
    background: rgba(239, 68, 68, 0.35);
    color: #ffffff;
}

/* Main Container */
.admin-main {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 24px 60px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.icon-blue { background: #e0f2fe; color: #0284c7; }
.icon-green { background: #ecfdf5; color: #059669; }
.icon-amber { background: #fef3c7; color: #d97706; }
.icon-purple { background: #f3e8ff; color: #7c3aed; }

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

/* Controls Card */
.controls-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.controls-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.btn-add-member {
    background: linear-gradient(135deg, var(--accent) 0%, #0a6354 100%);
    color: #ffffff;
    border: none;
    padding: 11px 22px;
    border-radius: var(--radius-md);
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(13, 122, 104, 0.25);
    transition: all 0.2s ease;
}

.btn-add-member:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(13, 122, 104, 0.35);
}

.search-and-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.search-box-container {
    flex: 1;
    min-width: 280px;
    position: relative;
}

.search-box-container i.icon_search {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 16px;
}

.search-input-admin {
    width: 100%;
    height: 44px;
    padding: 10px 38px 10px 42px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.search-input-admin:focus {
    background: #ffffff;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(13, 75, 143, 0.12);
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 16px;
    display: none;
}

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

.filter-pill-btn {
    padding: 7px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1.5px solid var(--border-color);
    background: #f8fafc;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.18s ease;
}

.filter-pill-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.filter-pill-btn:hover:not(.active) {
    background: #e2e8f0;
    color: var(--text-main);
}

.sort-select {
    height: 40px;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    background: #ffffff;
    cursor: pointer;
    outline: none;
}

/* Table Card */
.table-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-meta-bar {
    padding: 16px 22px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13.5px;
    color: var(--text-muted);
}

.table-meta-bar strong {
    color: var(--primary);
}

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

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 14px;
}

.admin-table thead {
    background: #f1f5f9;
}

.admin-table th {
    padding: 14px 18px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #475569;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.admin-table td {
    padding: 14px 18px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

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

.member-name {
    font-weight: 700;
    color: var(--primary);
}

.code-badge {
    font-family: 'JetBrains Mono', monospace;
    background: #f1f5f9;
    color: #0f172a;
    padding: 3px 7px;
    border-radius: 5px;
    font-size: 12.5px;
    border: 1px solid #e2e8f0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.verified {
    background-color: var(--accent-light);
    color: #059669;
    border: 1px solid #a7f3d0;
}

.status-badge.not-member {
    background-color: var(--danger-light);
    color: #dc2626;
    border: 1px solid #fecaca;
}

.action-btns-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-table-action {
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.18s ease;
    font-size: 13px;
    font-weight: 600;
}

.btn-table-action:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.btn-table-action.pdf-btn {
    background: #fff1f2;
    color: #be123c;
    border-color: #fecdd3;
}

.btn-table-action.pdf-btn:hover {
    background: #be123c;
    color: #ffffff;
    border-color: #be123c;
    box-shadow: 0 2px 8px rgba(190, 18, 60, 0.3);
}

.btn-table-action.pdf-btn-en {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
    font-size: 11.5px;
    font-weight: 700;
    padding: 0 8px;
}

.btn-table-action.pdf-btn-en:hover {
    background: #1d4ed8;
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 2px 8px rgba(29, 78, 216, 0.3);
}

.btn-table-action.pdf-btn-tr {
    background: #fff1f2;
    color: #be123c;
    border-color: #fecdd3;
    font-size: 11.5px;
    font-weight: 700;
    padding: 0 8px;
}

.btn-table-action.pdf-btn-tr:hover {
    background: #be123c;
    color: #ffffff;
    border-color: #be123c;
    box-shadow: 0 2px 8px rgba(190, 18, 60, 0.3);
}

.btn-table-action.edit-btn:hover {
    background: #e0f2fe;
    color: #0284c7;
    border-color: #bae6fd;
}

.btn-table-action.delete-btn:hover {
    background: var(--danger-light);
    color: var(--danger);
    border-color: #fecaca;
}

/* Pagination & Per Page */
.table-pagination-bar {
    padding: 16px 22px;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}

.per-page-select {
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    outline: none;
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-page {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
}

.btn-page.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.btn-page:hover:not(.active):not(:disabled) {
    background: #f1f5f9;
    color: var(--primary);
}

.btn-page:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.empty-state {
    padding: 50px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 44px;
    color: #cbd5e1;
    margin-bottom: 12px;
    display: block;
}

.empty-state h4 {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

/* ------------------ MODALS ------------------ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 20, 50, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex !important;
}

.modal-box {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 580px;
    overflow: hidden;
    animation: modalIn 0.25s ease-out;
}

.modal-box.modal-lg {
    max-width: 900px;
}

.modal-header-custom {
    padding: 20px 26px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header-custom h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.15s ease;
    line-height: 1;
}

.btn-modal-close:hover {
    color: var(--danger);
}

.modal-body-custom {
    padding: 24px 26px;
    max-height: calc(85vh - 140px);
    overflow-y: auto;
}

.modal-footer-custom {
    padding: 16px 26px;
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.btn-secondary-custom {
    padding: 10px 18px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color);
    background: #ffffff;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-secondary-custom:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.btn-primary-custom {
    padding: 10px 22px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-primary-custom:hover {
    background: var(--primary-light);
}

/* Switch */
.toggle-switch-container {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 48px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.switch-label-text {
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
}

/* Toast Messages */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-msg {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(0, 20, 50, 0.18);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    font-weight: 600;
    border-left: 4px solid #38bdf8;
    animation: slideInRight 0.3s ease-out;
}

.toast-msg.toast-success {
    border-left-color: #10b981;
    color: #065f46;
}

.toast-msg.toast-error {
    border-left-color: #ef4444;
    color: #991b1b;
}

.toast-msg.toast-info {
    border-left-color: #3b82f6;
    color: #1e40af;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Responsive */
@media (max-width: 991px) {
    .admin-nav {
        padding: 12px 16px;
    }
    .admin-main {
        padding: 18px 14px 40px;
    }
    .form-row-2 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   7. GALLERY MANAGEMENT SECTION STYLES
   ========================================================================== */
.gallery-card-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    padding: 24px;
    margin-top: 24px;
    position: relative;
}

.gallery-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1.5px solid #f1f5f9;
    margin-bottom: 22px;
}

.gallery-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.gallery-header-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, #002855 0%, #0d7a68 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(0, 40, 85, 0.2);
}

.gallery-header-titles h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gallery-count-pill {
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid rgba(13, 122, 104, 0.25);
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
}

.gallery-header-titles p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.gallery-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-gallery-add {
    background: linear-gradient(135deg, var(--accent) 0%, #0a6354 100%);
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(13, 122, 104, 0.25);
    transition: all 0.2s ease;
}

.btn-gallery-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(13, 122, 104, 0.35);
}

.btn-gallery-sync {
    background: #f8fafc;
    color: #334155;
    border: 1.5px solid #cbd5e1;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s ease;
}

.btn-gallery-sync:hover {
    background: #ffffff;
    border-color: var(--accent);
    color: var(--accent);
}

/* Gallery Grid */
.gallery-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 20px;
}

.gallery-admin-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.gallery-admin-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 24px rgba(0, 40, 85, 0.12);
    transform: translateY(-3px);
}

.gallery-admin-card.is-dragging {
    opacity: 0.4;
    border-style: dashed;
    border-color: var(--accent);
}

.gallery-admin-card.drag-over {
    border-color: #0284c7;
    background: #f0f9ff;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.gallery-card-drag-handle {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: grab;
    transition: all 0.2s ease;
}

.gallery-card-drag-handle:active {
    cursor: grabbing;
    background: var(--accent);
}

.gallery-card-preview {
    position: relative;
    width: 100%;
    height: 180px;
    background: #0f172a;
    overflow: hidden;
    cursor: pointer;
}

.gallery-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-admin-card:hover .gallery-card-preview img {
    transform: scale(1.04);
}

.gallery-card-zoom-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 40, 85, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: #ffffff;
    font-size: 26px;
}

.gallery-card-preview:hover .gallery-card-zoom-overlay {
    opacity: 1;
}

.gallery-card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
    gap: 12px;
}

.gallery-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gallery-order-badge {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    font-weight: 700;
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.gallery-order-input {
    width: 36px;
    border: none;
    background: transparent;
    font-weight: 800;
    font-size: 13px;
    color: var(--primary);
    text-align: center;
    outline: none;
    padding: 0;
}

.gallery-order-input::-webkit-inner-spin-button,
.gallery-order-input::-webkit-outer-spin-button {
    opacity: 1;
}

.gallery-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.gallery-card-meta {
    display: flex;
    align-items: center;
}

.gallery-card-path {
    font-size: 11.5px;
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 5px;
}

.gallery-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.gallery-reorder-buttons {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-gallery-move {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.btn-gallery-move:hover:not(:disabled) {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

.btn-gallery-move:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.gallery-item-ops {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-gallery-action {
    height: 32px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.btn-gallery-edit {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.btn-gallery-edit:hover {
    background: #166534;
    color: #ffffff;
}

.btn-gallery-delete {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
    padding: 0 8px;
}

.btn-gallery-delete:hover {
    background: #dc2626;
    color: #ffffff;
}

/* Gallery Upload Dropzone */
.gallery-dropzone-box {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 24px 16px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 18px;
    position: relative;
}

.gallery-dropzone-box:hover,
.gallery-dropzone-box.drag-over {
    border-color: var(--accent);
    background: var(--accent-light);
}

.gallery-dropzone-icon {
    font-size: 36px;
    color: var(--accent);
    margin-bottom: 8px;
}

.gallery-dropzone-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.gallery-dropzone-sub {
    font-size: 12px;
    color: #64748b;
}

.gallery-preview-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    max-height: 220px;
    background: #0f172a;
    display: inline-block;
    width: 100%;
}

.gallery-preview-wrapper img {
    max-height: 220px;
    width: 100%;
    object-fit: contain;
    display: block;
}

.btn-remove-preview {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(220, 38, 38, 0.85);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s ease;
}

.btn-remove-preview:hover {
    background: #dc2626;
}

/* Lightbox Modal */
#galleryLightboxModal .modal-box {
    max-width: 820px;
    background: transparent;
    box-shadow: none;
    border: none;
}

.lightbox-inner {
    background: #001e3d;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-image-wrap {
    background: #000000;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image-wrap img {
    max-height: 70vh;
    max-width: 100%;
    object-fit: contain;
}

.lightbox-caption {
    padding: 16px 20px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

