/* ============================================================
   ADMIN.CSS — Панель управления «Пленэры Башкортостана»
   ============================================================ */

:root {
    --sidebar-bg: #1a2235;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active-border: #3b82f6;
    --card-bg: #ffffff;
    --primary-bg: #f1f5f9;
    --text-main: #1e293b;
    --text-light: #64748b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --border: #e2e8f0;
    --modal-bg: rgba(10, 20, 40, 0.7);
    --radius: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--primary-bg);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ─── Login ──────────────────────────────────────────────────── */
#login-screen {
    position: fixed;
    inset: 0;
    background: #0b1120;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s;
}

.login-box {
    background: #161d2f;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    width: 100%;
    max-width: 380px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.login-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin: 0 auto 1.25rem;
}

.login-box h2 {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    color: #64748b;
    margin-bottom: 1.75rem;
    font-size: 0.9rem;
}

.input-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

.input-group label {
    display: block;
    color: #94a3b8;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.input-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border 0.2s;
}

.input-control:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.06);
}

.login-hint {
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #64748b;
    font-size: 0.8rem;
    text-align: left;
}

.login-hint code {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.7rem 1.4rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.7rem 1.4rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--primary-bg);
}

.icon-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-light);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.icon-btn:hover {
    background: var(--primary-bg);
    color: var(--accent);
    border-color: var(--accent);
}

.icon-btn.danger:hover {
    background: #fee2e2;
    color: var(--danger);
    border-color: var(--danger);
}

.paintings-count-btn {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: var(--accent);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.paintings-count-btn:hover {
    background: var(--accent);
    color: white;
}

/* ─── Layout ─────────────────────────────────────────────────── */
.sidebar {
    width: 230px;
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-icon {
    font-size: 1.5rem;
    color: var(--accent);
}

.sidebar-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.sidebar-header small {
    color: #64748b;
    font-size: 0.75rem;
}

.nav-menu {
    list-style: none;
    padding: 0.75rem 0;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: none;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.5rem;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border-left: 3px solid transparent;
    font-size: 0.9rem;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: #e2e8f0;
}

.nav-link.active {
    background: var(--sidebar-hover);
    color: white;
    border-left-color: var(--accent);
}

.nav-link i {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
    font-size: 0.95rem;
}

.sidebar-footer {
    padding: 0.75rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-width: 0;
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--card-bg);
    padding: 1rem 1.75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.top-bar h3 {
    font-size: 1.05rem;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.role-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.role-badge.admin {
    background: #dbeafe;
    color: #1d4ed8;
}

.role-badge.author {
    background: #d1fae5;
    color: #065f46;
}

.content-area {
    padding: 1.5rem;
}

/* ─── Panels / Cards ─────────────────────────────────────────── */
.panel {
    display: none;
}

.panel.active {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
    border: 1px solid var(--border);
}

.panel.card {
    padding: 1.5rem;
}

.mt-2 {
    margin-top: 1.25rem;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border);
}

.panel-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
}

.panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

/* ─── Dashboard ──────────────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card.blue::before {
    background: var(--accent);
}

.stat-card.green::before {
    background: var(--success);
}

.stat-card.amber::before {
    background: var(--warning);
}

.stat-icon {
    font-size: 1.5rem;
}

.stat-card.blue .stat-icon {
    color: var(--accent);
}

.stat-card.green .stat-icon {
    color: var(--success);
}

.stat-card.amber .stat-icon {
    color: var(--warning);
}

.stat-info h3 {
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.stat-info p {
    font-size: 2rem;
    font-weight: 700;
}

.stat-link {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    margin-top: auto;
    cursor: pointer;
}

.stat-link:hover {
    text-decoration: underline;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-item:hover {
    background: var(--primary-bg);
}

.recent-item img {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.recent-info {
    flex: 1;
}

.recent-info b {
    display: block;
    font-size: 0.95rem;
}

.recent-info span {
    color: var(--text-light);
    font-size: 0.8rem;
}

.recent-item>.fa-chevron-right {
    color: var(--text-light);
    margin-left: auto;
    font-size: 0.8rem;
}

.empty-hint {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
    font-size: 0.9rem;
}

/* ─── Tables ─────────────────────────────────────────────────── */
.table-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.9rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

th {
    background: #f8fafc;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #fafbfc;
}

.thumbnail {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.author-cell,
.painting-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-cell b,
.painting-cell b {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
}

.author-cell small,
.painting-cell small {
    display: block;
    color: var(--text-light);
    font-size: 0.8rem;
}

.row-actions {
    display: flex;
    gap: 0.4rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-inactive {
    background: #f3f4f6;
    color: #6b7280;
}

/* ─── Painting grid (side panel + my-paintings) ──────────────── */
.ap-search-bar {
    padding: 0;
    position: relative;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

.ap-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.ap-search-bar .form-control {
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border: none;
    border-radius: 0;
    background: transparent;
    font-size: 0.9rem;
    box-shadow: none;
}

.ap-search-bar .form-control:focus {
    background: white;
}

.painting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    align-items: start;
    align-content: start;
}

.ap-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.2s;
    height: fit-content;
    align-self: start;
}

.ap-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.ap-img-wrap {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f1f5f9;
}

.ap-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.ap-card:hover .ap-img-wrap img {
    transform: scale(1.05);
}

.ap-badges {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ap-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
}

.ap-badge.sale {
    background: #d1fae5;
    color: #065f46;
}

.ap-badge.ex {
    background: #dbeafe;
    color: #1d4ed8;
}

.ap-card-actions {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.ap-card:hover .ap-card-actions {
    opacity: 1;
}

.ap-card-actions button {
    background: white;
    border: none;
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ap-card-actions button:hover {
    background: var(--accent);
    color: white;
}

.ap-card-actions button.danger:hover {
    background: var(--danger);
    color: white;
}

.ap-info {
    padding: 0.75rem;
}

.ap-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ap-info p {
    font-size: 0.78rem;
    color: var(--text-light);
}

.ap-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1rem;
    color: var(--text-light);
    gap: 0.75rem;
    grid-column: 1/-1;
}

.ap-empty i {
    font-size: 2.5rem;
    color: #ddd;
}

.ap-empty p {
    font-size: 0.95rem;
}

/* ─── Profile ────────────────────────────────────────────────── */
.profile-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem;
    border: 1px solid var(--border);
}

.profile-avatar-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.profile-avatar-box img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
}

.profile-avatar-placeholder {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: #c0c8d8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    border: 3px solid var(--border);
}

/* ─── Side Panel ─────────────────────────────────────────────── */
.side-panel-overlay {
    position: fixed;
    inset: 0;
    background: var(--modal-bg);
    z-index: 500;
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.side-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-panel {
    width: 90%;
    max-width: 700px;
    background: var(--primary-bg);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(30px);
    transition: transform 0.3s;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
}

.side-panel-overlay.active .side-panel {
    transform: translateX(0);
}

.side-panel-header {
    background: white;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.side-panel-header h3 {
    font-size: 1.1rem;
}

#ap-grid {
    overflow-y: auto;
    flex: 1;
}

/* ─── Modals ─────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--modal-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 14px;
    width: 100%;
    max-width: 580px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}

.modal.modal-lg {
    max-width: 780px;
}

.modal.modal-xl {
    max-width: min(98vw, 1400px);
    width: min(98vw, 1400px);
    max-height: 96vh;
}

.modal.modal-sm {
    max-width: 420px;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-light);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-modal:hover {
    background: #fee2e2;
    color: var(--danger);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: #f8fafc;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
    flex-shrink: 0;
}

.form-with-preview {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 1.5rem;
}

.modal-sm .form-with-preview,
.modal-sm .form-row {
    display: block;
}

.form-preview-col img {
    width: 100%;
    border-radius: 8px;
    aspect-ratio: 1;
    object-fit: cover;
    border: 1px solid var(--border);
}

.form-main-col {
    min-width: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full {
    grid-column: 1/-1;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.35rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

/* ─── Toast ──────────────────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #1e293b;
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.show {
    transform: translateX(0);
}

.toast-success i {
    color: var(--success);
}

.toast-warning i {
    color: var(--warning);
}

.toast-error i {
    color: var(--danger);
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }

    .sidebar-header h2,
    .sidebar-header small,
    .nav-link span,
    .nav-link:not(.active) i+* {
        display: none;
    }

    .nav-link {
        justify-content: center;
        padding: 1rem;
    }

    .nav-link i {
        margin: 0;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .form-with-preview {
        grid-template-columns: 1fr;
    }

    .form-preview-col {
        display: none;
    }
}

/* ─── Modal Tabs ─────────────────────────────────────────────── */
.modal-tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    background: #f8fafc;
}

.modal-tab {
    flex: 1;
    padding: 0.9rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.modal-tab:hover {
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.02);
}

.modal-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: white;
}

.tab-badge {
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ─── Exhibitions Tab ────────────────────────────────────────── */
.ex-section {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1.4rem;
    margin-bottom: 1rem;
}

.ex-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.ex-section-header h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.ex-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.4;
}

/* Live / current exhibition pulsing dot */
.ex-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.06);
    }
}

/* Exhibition history row */
.ex-row {
    display: grid;
    grid-template-columns: 90px 90px 1fr 1fr 34px;
    gap: 0.5rem;
    align-items: start;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem 0.85rem;
    margin-bottom: 0.5rem;
    transition: border-color 0.2s;
}

.ex-row:hover {
    border-color: #bfdbfe;
}

.ex-row-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-light);
    margin-bottom: 0.2rem;
    display: block;
}

.ex-remove-btn {
    background: none;
    border: 1px solid #e2e8f0;
    color: #94a3b8;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s;
    flex-shrink: 0;
    align-self: center;
    margin-top: 1.1rem;
}

.ex-remove-btn:hover {
    background: #fee2e2;
    color: var(--danger);
    border-color: var(--danger);
}

/* Empty state for past exhibitions */
.ex-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.75rem 1rem;
    color: var(--text-light);
    gap: 0.5rem;
    text-align: center;
}

.ex-empty i {
    font-size: 2rem;
    color: #dde1ea;
}

.ex-empty p {
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ─── Painting Modal XL ──────────────────────────────────────── */
.modal-xl {
    width: min(98vw, 1400px);
    max-height: 96vh;
    overflow-y: auto;
}

/* Two-column layout: left = preview, right = form */
.pm-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 0;
    min-height: 0;
}

/* Left: preview column */
.pm-preview-col {
    background: #f8fafc;
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 0;
    align-self: start;
}

.pm-img-box {
    aspect-ratio: 3/4;
    border-radius: 10px;
    overflow: hidden;
    background: #eef2f7;
    border: 2px dashed #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: border-color 0.3s;
}

.pm-img-box.has-image {
    border: none;
}

.pm-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    transition: opacity 0.3s;
}

.pm-img-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    font-size: 0.82rem;
    text-align: center;
    padding: 1rem;
    pointer-events: none;
}

.pm-img-placeholder i {
    font-size: 2.5rem;
    color: #cbd5e1;
}

/* URL input with status dot */
.pm-url-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.pm-url-input-wrap {
    position: relative;
}

.pm-url-input-wrap .form-control {
    padding-right: 2.2rem;
    font-size: 0.82rem;
}

.pm-url-status {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e2e8f0;
    transition: background 0.3s;
    flex-shrink: 0;
}

.pm-url-status.ok {
    background: #22c55e;
}

.pm-url-status.err {
    background: #ef4444;
}

.pm-url-status.loading {
    background: #f59e0b;
    animation: pulse-dot 1s infinite;
}

/* Right: form column */
.pm-form-col {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    overflow-y: auto;
    max-height: calc(92vh - 110px);
}

/* Labelled section blocks */
.pm-section {
    border: 1px solid var(--border);
    border-radius: 10px;
}

.pm-section-title {
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    border-radius: 10px 10px 0 0;
    padding: 0.55rem 1rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.pm-section-body {
    padding: 1rem 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.pm-section-body .form-group {
    margin-bottom: 0;
}

/* Icon labels */
.pm-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.3rem;
}

.pm-label i {
    font-size: 0.75rem;
    width: 14px;
    text-align: center;
}

/* Technique quick-select buttons */
.pm-quick-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.4rem;
}

.pm-quick-btns button {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: var(--text-light);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s;
}

.pm-quick-btns button:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    color: var(--accent);
}

/* Three-column mini row */
.pm-three-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
}

.pm-three-col .form-group {
    margin-bottom: 0;
}

/* Location row */
.pm-location-row {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.pm-map-row {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

/* Sale toggle */
.pm-sale-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.pm-toggle-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    flex: 1;
}

.pm-toggle-text {
    font-size: 0.88rem;
    color: var(--text-main);
}

.pm-toggle {
    position: relative;
    width: 46px;
    height: 24px;
    flex-shrink: 0;
}

.pm-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.pm-toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: 0.25s;
    cursor: pointer;
}

.pm-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    left: 3px;
    top: 3px;
    transition: 0.25s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.pm-toggle input:checked+.pm-toggle-slider {
    background: var(--accent);
}

.pm-toggle input:checked+.pm-toggle-slider::before {
    transform: translateX(22px);
}

/* Price input */
.pm-price-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.pm-price-input-wrap {
    display: flex;
    align-items: center;
}

.pm-price-prefix {
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-right: none;
    padding: 0.6rem 0.85rem;
    border-radius: 8px 0 0 8px;
    font-weight: 700;
    color: var(--accent);
    font-size: 0.9rem;
}

.pm-price-input-wrap .form-control {
    border-radius: 0 8px 8px 0;
}

/* ─── Coordinates row ────────────────────────────────────────── */
.pm-coords-group {
    flex: 1;
    min-width: 0;
}

.pm-coords-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.pm-coords-row .form-control {
    flex: 1;
    min-width: 0;
}

.pm-coords-sep {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-light);
    flex-shrink: 0;
    user-select: none;
}

.pm-coords-hint {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.35rem;
    line-height: 1.5;
}

.pm-coords-hint code {
    background: #f1f5f9;
    border-radius: 4px;
    padding: 0.1em 0.4em;
    font-family: monospace;
    font-size: 0.85em;
    color: var(--accent);
}

/* Mobile & Tablet Responsive */
@media (max-width: 1024px) {
    .sidebar { width: 70px; }
    .sidebar-header h2, .sidebar-header small, .nav-link span { display: none; }
    .main-container { margin-left: 70px; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); position: fixed; z-index: 1000; }
    .main-container { margin-left: 0; }
    .top-bar { flex-wrap: wrap; gap: 0.5rem; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .table-container { overflow-x: auto; }
    .modal { width: 95%; max-width: 95%; }
    .pm-layout { flex-direction: column; }
    .profile-layout { grid-template-columns: 1fr; }
    .painting-grid { grid-template-columns: 1fr; }
}