/* assets/css/admin.css — Estética inspirada en Apple Human Interface */

:root {
    --bg: #fbfbfd;
    --bg-secondary: #f5f5f7;
    --surface: #ffffff;
    --text: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #86868b;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --accent-soft: rgba(0, 113, 227, 0.08);
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: #d2d2d7;
    --danger: #ff3b30;
    --danger-soft: rgba(255, 59, 48, 0.1);
    --success: #34c759;
    --success-soft: rgba(52, 199, 89, 0.12);
    --warning-soft: rgba(255, 149, 0, 0.12);
    --warning-text: #bf4800;
    --radius: 18px;
    --radius-md: 12px;
    --radius-sm: 10px;
    --radius-pill: 980px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.12);
    --sidebar-width: 280px;
    --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition: 0.22s var(--ease);
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.47059;
    letter-spacing: -0.022em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 28px 16px 20px;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 200;
    transition: transform var(--transition);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 12px 28px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: linear-gradient(145deg, #1d1d1f 0%, #424245 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-mark--lg {
    width: 56px;
    height: 56px;
    font-size: 17px;
    border-radius: 14px;
    margin: 0 auto 16px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.brand-name {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--text);
}

.brand-sub {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

.sidebar-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav a {
    text-decoration: none;
    color: var(--text);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.01em;
    transition: background var(--transition), color var(--transition);
    display: block;
}

.sidebar-nav a:hover {
    background: rgba(0, 0, 0, 0.04);
}

.sidebar-nav a.active {
    background: var(--text);
    color: #fff;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 8px 0;
    border-top: 1px solid var(--border);
}

/* ── Main ── */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 48px 56px 64px;
    max-width: 1280px;
    width: 100%;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 36px;
}

.page-header h2,
h2 {
    font-size: 40px;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text);
    margin-bottom: 8px;
}

.page-subtitle,
p.page-subtitle {
    color: var(--text-secondary);
    font-size: 17px;
    letter-spacing: -0.022em;
    margin-bottom: 0;
}

.section {
    display: none;
    animation: fadeUp 0.35s var(--ease);
}

.section.visible {
    display: block;
}

.section.hidden {
    display: none;
}

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

/* ── Buttons ── */
.btn {
    appearance: none;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
    padding: 9px 18px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), transform 0.12s var(--ease);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
    white-space: nowrap;
}

.btn:hover {
    background: #fafafa;
    border-color: #b0b0b5;
}

.btn:active {
    transform: scale(0.98);
}

.btn.primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text);
    border-color: transparent;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-danger {
    color: var(--danger);
    border-color: transparent;
    background: var(--danger-soft);
}

.btn-danger:hover {
    background: rgba(255, 59, 48, 0.16);
    border-color: transparent;
}

.btn-edit {
    color: var(--accent);
    border-color: transparent;
    background: var(--accent-soft);
}

.btn-edit:hover {
    background: rgba(0, 113, 227, 0.14);
    border-color: transparent;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.action-group {
    display: flex;
    gap: 8px;
}

/* ── Cards & Tables ── */
.table-card,
.recent-card,
.list-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.recent-card,
.list-card {
    padding: 24px;
}

.list-card {
    list-style: none;
}

.list-card li {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}

.list-card li:last-child {
    border-bottom: none;
}

.responsive-table {
    width: 100%;
    border-collapse: collapse;
}

.responsive-table th,
.responsive-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.responsive-table th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.responsive-table tbody tr {
    transition: background var(--transition);
}

.responsive-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.015);
}

.responsive-table tbody tr:last-child td {
    border-bottom: none;
}

.responsive-table a {
    color: var(--accent);
    text-decoration: none;
}

.responsive-table a:hover {
    text-decoration: underline;
}

.empty-row td {
    text-align: center;
    color: var(--text-tertiary);
    padding: 32px 20px;
    font-size: 14px;
}

/* ── Stats ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: box-shadow var(--transition), transform var(--transition);
}

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

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--bg-secondary);
    position: relative;
}

.stat-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 20px;
    height: 20px;
    background: var(--text);
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    opacity: 0.85;
}

.stat-icon--autos::after {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M18.92 6.01C18.72 5.42 18.16 5 17.5 5h-11c-.66 0-1.21.42-1.42 1.01L3 12v8c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h12v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-8l-2.08-5.99zM6.5 16c-.83 0-1.5-.67-1.5-1.5S5.67 13 6.5 13s1.5.67 1.5 1.5S7.33 16 6.5 16zm11 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM5 11l1.5-4.5h11L19 11H5z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M18.92 6.01C18.72 5.42 18.16 5 17.5 5h-11c-.66 0-1.21.42-1.42 1.01L3 12v8c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h12v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-8l-2.08-5.99zM6.5 16c-.83 0-1.5-.67-1.5-1.5S5.67 13 6.5 13s1.5.67 1.5 1.5S7.33 16 6.5 16zm11 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM5 11l1.5-4.5h11L19 11H5z'/%3E%3C/svg%3E");
}

.stat-icon--repuestos::after {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M22.7 19l-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M22.7 19l-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4z'/%3E%3C/svg%3E");
}

.stat-icon--tasaciones::after {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z'/%3E%3C/svg%3E");
}

.stat-icon--consultas::after {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z'/%3E%3C/svg%3E");
}

.stat-icon--autos      { background: var(--accent-soft); }
.stat-icon--repuestos  { background: var(--danger-soft); }
.stat-icon--tasaciones { background: var(--warning-soft); }
.stat-icon--consultas  { background: var(--success-soft); }

.stat-value {
    font-size: 34px;
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--text);
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.badge--green  { background: var(--success-soft); color: #248a3d; }
.badge--yellow { background: var(--warning-soft); color: var(--warning-text); }
.badge--blue   { background: var(--accent-soft); color: var(--accent); }

.recent-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.recent-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: -0.022em;
}

.recent-card .responsive-table {
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
}

/* ── Badges de estado ── */
.estado-badge {
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.estado-badge.pendiente   { background: var(--warning-soft); color: var(--warning-text); }
.estado-badge.aprobado    { background: var(--success-soft); color: #248a3d; }
.estado-badge.rechazado   { background: var(--danger-soft); color: #d70015; }
.estado-badge.respondida  { background: var(--accent-soft); color: var(--accent); }
.estado-badge.nueva       { background: var(--warning-soft); color: var(--warning-text); }
.estado-badge.contactada  { background: var(--success-soft); color: #248a3d; }
.estado-badge.finalizado  { background: rgba(0, 0, 0, 0.06); color: var(--text-secondary); }

/* ── Forms (panel flotante) ── */
.form-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 400;
    opacity: 1;
    transition: opacity var(--transition);
}

.form-backdrop.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.form-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 500;
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 520px;
    width: calc(100% - 40px);
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.form-panel.hidden {
    display: none;
}

.form-panel h3 {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
}

.form-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 16px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

input, textarea, select {
    padding: 12px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    letter-spacing: -0.022em;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    background: var(--bg-secondary);
    color: var(--text);
    width: 100%;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

input[type="file"] {
    padding: 10px;
    font-size: 13px;
    background: var(--surface);
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
}

/* ── Login ── */
.login-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.login-overlay.hidden {
    display: none;
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 48px 40px 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-brand h2 {
    font-size: 28px;
    margin-bottom: 6px;
}

.login-brand p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 32px;
}

.login-card form {
    text-align: left;
}

.login-card .btn-block {
    margin-top: 8px;
    padding: 12px 18px;
    font-size: 15px;
}

/* ── Image previews ── */
.images-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 4px 0 16px;
}

.thumb-preview {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.thumb-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-preview .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: transform 0.12s var(--ease);
}

.thumb-preview .remove-btn:hover {
    transform: scale(1.08);
}

/* ── Table image previews ── */
.table-image-preview {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    background: var(--bg-secondary);
}

.table-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.table-image-preview--empty {
    background: #d1d1d6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-count {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
}

.table-image-preview--empty .image-count {
    background: rgba(0, 0, 0, 0.5);
    position: static;
}

/* ── View Modal ── */
.view-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.view-modal {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    border: 1px solid var(--border);
}

.view-modal h3 {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    color: var(--text);
}

.view-details {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.view-details p {
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
}

.view-details strong {
    font-weight: 600;
    color: var(--text-secondary);
}

.view-description {
    white-space: pre-wrap;
    margin-top: 8px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.view-images {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.view-image {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.view-image--empty {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 14px;
    border: 1px dashed var(--border-strong);
}

.view-image--clickable {
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}

.view-image--clickable:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* ── Lightbox ── */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 32px;
    font-weight: 300;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 36px;
    font-weight: 300;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev:disabled,
.lightbox-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 500;
}

/* ── Toasts ── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(29, 29, 31, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.01em;
    box-shadow: var(--shadow-md);
    pointer-events: auto;
    animation: toastIn 0.35s var(--ease);
    max-width: 340px;
}

.toast--error {
    background: rgba(255, 59, 48, 0.94);
}

.toast--success {
    background: rgba(52, 199, 89, 0.94);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Mobile ── */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 300;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: var(--shadow-sm);
}

.mobile-menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: var(--transition);
}

@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .recent-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .mobile-menu-btn { display: flex; }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .main-content {
        margin-left: 0;
        padding: 80px 20px 48px;
    }

    .page-header h2, h2 {
        font-size: 32px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .responsive-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
