/* =============================================
   Rm.Admin.Ui — Shared Admin Base Styles
   Served at: _content/Rm.Admin.Ui/css/admin-base.css
   ============================================= */
@import url("admin-interactivity.css");

:root {
    --admin-brand: #c8a951;
    --admin-brand-light: rgba(200, 169, 81, 0.12);
    --admin-brand-border: rgba(200, 169, 81, 0.6);
    --sidebar-width: 260px;
    --sidebar-bg: #1a1d23;
    --sidebar-text: #a1a7b3;
    --sidebar-text-hover: #fff;
    --sidebar-active-bg: rgba(200, 169, 81, 0.1);
    --topbar-height: 56px;
}

body {
    background-color: #f5f6fa;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
}

/* ── Sidebar ── */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.sidebar-brand:hover { text-decoration: none; color: inherit; }

.sidebar-brand-text {
    color: var(--admin-brand);
    font-weight: 700;
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-brand img {
    height: 28px;
    width: auto;
    filter: brightness(0) invert(1);
}

.sidebar-brand .brand-badge {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--admin-brand);
    background: rgba(200, 169, 81, 0.15);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem 0;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.sidebar-nav:hover {
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
}

.sidebar-nav:hover::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.25);
}

.nav-section {
    padding: 0.5rem 1.5rem 0.25rem;
    margin-top: 0.5rem;
}

.nav-section:first-child { margin-top: 0; }

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    margin-bottom: 0.25rem;
}

.nav-item-admin {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.nav-item-admin:hover {
    color: var(--sidebar-text-hover);
    background: rgba(255,255,255,0.04);
    text-decoration: none;
}

.nav-item-admin.active {
    color: var(--admin-brand);
    background: var(--sidebar-active-bg);
    border-left-color: var(--admin-brand);
}

.nav-item-admin i {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.nav-item-admin-badge,
.nav-group-badge {
    margin-left: auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-footer .btn-logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0;
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s;
    text-decoration: none;
}

.sidebar-footer .btn-logout:hover { color: #f87171; }

/* Powered-by branding */
.sidebar-powered-by {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.625rem 0 0.25rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.7rem;
    color: rgba(255,255,255,0.3);
    text-decoration: none;
    transition: color 0.2s;
    letter-spacing: 0.02em;
}
.sidebar-powered-by:hover {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
}
.sidebar-powered-by i {
    font-size: 0.75rem;
}

/* ── Top bar ── */
.admin-topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 1030;
}

.admin-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s;
}

.breadcrumb-link:hover { color: #374151; }

.breadcrumb-sep {
    font-size: 0.6rem;
    color: #d1d5db;
}

.breadcrumb-current {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a1d23;
}

.admin-topbar .topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-visit-site {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    color: #6b7280;
    text-decoration: none;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    transition: all 0.15s;
}

.btn-visit-site:hover {
    background: #f3f4f6;
    color: #374151;
}

/* ── Main content ── */
.admin-main {
    margin-left: var(--sidebar-width);
    padding-top: calc(var(--topbar-height) + 1.5rem);
    padding-bottom: 2rem;
    min-height: 100vh;
}

.admin-main .container-fluid {
    max-width: 1400px;
    padding: 0 1.5rem;
}

/* ── Page Headers ── */
/* Single canonical top-row for every admin page. The legacy attributes
   (title, subtitle, icon) keep their original visual output; the new
   blocks (breadcrumb, meta row, description, actions slot) only render
   when the corresponding tag-helper attribute is set. See
   <page-header> in lib/SL.Admin.Ui/TagHelpers/PageHeaderTagHelper.cs. */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.page-header__breadcrumb {
    flex-basis: 100%;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: #6b7280;
    margin: 0 0 -0.25rem; /* tuck under the title row a bit */
}

.page-header__breadcrumb-link {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s;
}

a.page-header__breadcrumb-link:hover {
    color: #1f2937;
    text-decoration: underline;
}

.page-header__breadcrumb-sep {
    font-size: 0.7rem;
    color: #9ca3af;
}

.page-header__breadcrumb-current {
    color: #374151;
    font-weight: 500;
}

.page-header-left {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    flex: 1 1 320px;
    min-width: 0;
}

.page-header-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.page-header__titleblock {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    /* nudge title up so single-line headers visually align with the icon centre */
    padding-top: 0.1rem;
}

.page-header-title {
    font-weight: 700;
    font-size: 1.35rem;
    margin: 0;
    color: #1a1d23;
    line-height: 1.25;
    word-break: break-word;
}

.page-header-subtitle {
    color: #6b7280;
    font-size: 0.85rem;
    margin: 0.1rem 0 0;
}

.page-header__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.45rem;
}

.page-header__entity-key {
    font-family: Consolas, 'Cascadia Code', monospace;
    font-size: 0.78rem;
    color: #4b5563;
    background: #f3f4f6;
    border-radius: 4px;
    padding: 0.1rem 0.45rem;
    line-height: 1.4;
}

.page-header__status {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 4px;
    padding: 0.1rem 0.5rem;
    line-height: 1.4;
}

.page-header__status--success { background: #dcfce7; color: #166534; }
.page-header__status--warning { background: #fef3c7; color: #92400e; }
.page-header__status--danger  { background: #fee2e2; color: #991b1b; }
.page-header__status--muted   { background: #f3f4f6; color: #4b5563; }

.page-header__description {
    color: #4b5563;
    font-size: 0.85rem;
    margin: 0.45rem 0 0;
    max-width: 64ch;
}

.page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    align-self: flex-start;
    margin-left: auto;
}

/* ── Sticky save bar ── */
/* Replaces the duplicated `.flow-saveBar` markup. Use <admin-save-bar>
   in lib/SL.Admin.Ui/TagHelpers/AdminSaveBarTagHelper.cs. */
.admin-save-bar {
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(6px);
    border-top: 1px solid #e5e7eb;
    margin: 1rem -0.75rem 0;
    padding: 0.75rem 1rem;
    z-index: 100;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.admin-save-bar__inner {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}

.admin-save-bar__dirty {
    margin-right: auto;
    font-size: 0.85rem;
    color: #ca8a04;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.admin-save-bar__dirty .bi {
    font-size: 1rem;
}

/* ── Cards ── */
.admin-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.admin-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
}

.admin-card-pad {
    padding: 1.25rem;
}

.admin-card-heading {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: #1a1d23;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-card-heading > i {
    color: #6b7280;
    font-size: 1.05em;
}

.admin-card-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    gap: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.admin-card-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1rem;
    flex-shrink: 0;
}

.admin-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1a1d23;
    margin: 0;
}

.admin-card-subtitle {
    font-size: 0.78rem;
    color: #9ca3af;
    margin: 2px 0 0;
}

.admin-card-body {
    padding: 1.25rem;
}

.admin-card-footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
}

/* ── Tables ── */
.admin-table {
    width: 100%;
    font-size: 0.875rem;
}

.admin-table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
    white-space: nowrap;
}

.admin-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    color: #374151;
}

.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: #f9fafb; }
.admin-table .cell-name { font-weight: 600; color: #1a1d23; }
.admin-table .cell-muted { color: #9ca3af; }
.admin-table .cell-actions { text-align: right; white-space: nowrap; }

/* ── Status Badges ── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    line-height: 1.3;
}

.status-pending { background: rgba(200, 169, 81, 0.15); color: #a68b3c; }
.status-requested { background: rgba(200, 169, 81, 0.15); color: #a68b3c; }
.status-estimated { background: rgba(168, 85, 247, 0.12); color: #7c3aed; }
.status-accepted { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.status-declined { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.status-inprogress { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.status-completed { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.status-needsinput { background: rgba(249, 115, 22, 0.12); color: #ea580c; }
.status-active { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.status-inactive { background: rgba(156, 163, 175, 0.15); color: #6b7280; }

/* Generic Bootstrap-like type variants for status-badge type="" usage */
.status-success { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.status-secondary { background: rgba(156, 163, 175, 0.15); color: #6b7280; }
.status-warning { background: rgba(249, 115, 22, 0.12); color: #ea580c; }
.status-info { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.status-danger { background: rgba(239, 68, 68, 0.12); color: #dc2626; }

/* ── Buttons ── */
.btn-gold {
    background: var(--admin-brand);
    color: #1a1d23;
    border: none;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.btn-gold:hover { background: #b8993e; color: #1a1d23; }
.btn-gold:active { background: #a88a38; }

.btn-subtle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: #6b7280;
    background: none;
    border: 1px solid #e5e7eb;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-subtle:hover {
    color: #374151;
    background: #f3f4f6;
    border-color: #d1d5db;
}

.btn-icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    font-size: 0.85rem;
    transition: all 0.15s ease;
    cursor: pointer;
    text-decoration: none;
}

.btn-icon-action:hover {
    border-color: #d1d5db;
    color: #374151;
    background: #f9fafb;
}

.btn-icon-action.danger:hover {
    border-color: #fca5a5;
    color: #dc2626;
    background: #fef2f2;
}

/* ── Alerts ── */
.admin-alert {
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border: none;
}

.admin-alert-success { background: rgba(34, 197, 94, 0.1); color: #16a34a; }
.admin-alert-danger { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.admin-alert-warning { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.admin-alert-info { background: rgba(59, 130, 246, 0.1); color: #2563eb; }
.admin-alert-dismissible { position: relative; padding-right: 2.5rem; }
.admin-alert-close { position: absolute; top: 50%; right: 0.75rem; transform: translateY(-50%); background: none; border: none; font-size: 1.25rem; opacity: 0.5; cursor: pointer; color: inherit; line-height: 1; }
.admin-alert-close:hover { opacity: 1; }

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.empty-state-text { font-size: 0.9rem; }

/* ── Filter Bar ── */
.filter-bar {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.filter-btn {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.4rem 0.875rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.15s ease;
}

.filter-btn:hover {
    border-color: #d1d5db;
    color: #374151;
    background: #f9fafb;
}

.filter-btn.active {
    background: var(--admin-brand);
    color: #1a1d23;
    border-color: var(--admin-brand);
}

/* ── Back Link ── */
.admin-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.15s;
}

.admin-back-link:hover { color: #1a1d23; }

/* ── Form Improvements (inside admin-card) ── */
.admin-card .form-label {
    font-weight: 500;
    font-size: 0.82rem;
    color: #374151;
    margin-bottom: 0.35rem;
}

.admin-card .form-control,
.admin-card .form-select {
    font-size: 0.875rem;
    border-radius: 8px;
    border-color: #e5e7eb;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.admin-card .form-control:focus,
.admin-card .form-select:focus {
    border-color: var(--admin-brand);
    box-shadow: 0 0 0 3px rgba(200, 169, 81, 0.15);
}

/* ── Mobile sidebar toggle ── */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    font-size: 1.25rem;
    color: #374151;
    cursor: pointer;
    margin-right: 0.75rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1035;
}

/* ── Login Page ── */
.admin-login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #1a1d23;
    margin: 0;
}

.login-wrapper { width: 100%; max-width: 400px; padding: 1rem; }

.login-brand { text-align: center; margin-bottom: 2rem; }

.login-brand-name {
    color: var(--admin-brand);
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0;
}

.login-brand img {
    max-height: 48px;
    width: auto;
    max-width: 200px;
}

.login-brand .brand-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--admin-brand);
    background: rgba(200, 169, 81, 0.15);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.75rem;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    padding: 2rem;
}

.login-card h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1d23;
    margin-bottom: 1.5rem;
}

.login-card .form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: #374151;
}

.login-card .form-control {
    border-radius: 10px;
    padding: 0.6rem 0.875rem;
    font-size: 0.9rem;
    border-color: #e5e7eb;
}

.login-card .form-control:focus {
    border-color: var(--admin-brand);
    box-shadow: 0 0 0 3px rgba(200, 169, 81, 0.15);
}

.btn-login {
    background: var(--admin-brand);
    border: none;
    color: #1a1d23;
    font-weight: 600;
    padding: 0.65rem;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: background 0.15s;
}

.btn-login:hover { background: #b8993e; color: #1a1d23; }

.login-alert {
    border-radius: 10px;
    padding: 0.65rem 0.875rem;
    font-size: 0.85rem;
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Comment Cards ── */
.comment-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #f3f4f6;
    padding: 0.875rem 1rem;
    margin-bottom: 0.5rem;
}

.comment-card.is-admin {
    border-left: 3px solid var(--admin-brand);
    background: #fffdf5;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.comment-author { font-weight: 600; font-size: 0.85rem; color: #1a1d23; }
.comment-time { font-size: 0.75rem; color: #9ca3af; }
.comment-body { font-size: 0.875rem; color: #374151; line-height: 1.5; }
.comment-body p { margin: 0 0 0.5rem; }
.comment-body p:last-child { margin-bottom: 0; }

.badge-admin {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(200, 169, 81, 0.15);
    color: #a68b3c;
    margin-left: 0.35rem;
}

/* ── Comments Section Header ── */
.comments-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.comments-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1d23;
    margin: 0;
}

.comments-count {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* ── Ticket Info ── */
.ticket-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: #6b7280;
}

.ticket-meta-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.ticket-meta-item i { font-size: 0.9rem; color: #9ca3af; }

.ticket-description {
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 10px;
    padding: 1rem;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.6;
}

/* ── CMS Language Switcher Bar ── */
.cms-lang-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 1rem;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.cms-lang-bar-buttons {
    display: flex;
    gap: 4px;
}

.cms-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.3;
}
.cms-lang-btn:hover {
    border-color: #9ca3af;
    color: #374151;
    background: #f9fafb;
}
.cms-lang-btn.active {
    border-color: var(--admin-brand);
    color: var(--admin-brand);
    background: var(--admin-brand-light);
}
.cms-lang-btn-code {
    font-weight: 700;
    letter-spacing: 0.02em;
}
.cms-lang-btn-name {
    font-weight: 400;
    color: #9ca3af;
    font-size: 0.72rem;
}
.cms-lang-btn.active .cms-lang-btn-name {
    color: var(--admin-brand-border);
}

.cms-lang-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cms-bilingual-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.65rem;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.cms-bilingual-toggle:hover {
    border-color: #9ca3af;
    color: #374151;
}
.cms-bilingual-toggle.active {
    border-color: #f59e0b;
    color: #d97706;
    background: #fffbeb;
}
.cms-bilingual-toggle i { font-size: 0.85rem; }

.cms-bilingual-source-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #9ca3af;
    margin-left: 0.25rem;
}

.cms-bilingual-source-select {
    width: auto !important;
    min-width: 90px;
    font-size: 0.75rem !important;
    padding: 0.2rem 1.5rem 0.2rem 0.5rem !important;
    border-color: #f59e0b !important;
}

/* ── Language Field Groups ── */
.cms-lang-group {
    position: relative;
}
.cms-lang-group.bilingual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.cms-lang-field {
    position: relative;
}
.cms-lang-field.source-readonly {
    background: #f9fafb;
    border-radius: 6px;
    padding: 0.35rem;
    opacity: 0.7;
    pointer-events: none;
}
.cms-lang-field.source-readonly::before {
    content: attr(data-cms-lang);
    position: absolute;
    top: -0.15rem;
    left: 0.5rem;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #9ca3af;
    background: #f9fafb;
    padding: 0 4px;
    border-radius: 3px;
    z-index: 1;
    letter-spacing: 0.05em;
}

/* ── Copy Button ── */
.cms-copy-btn {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #6b7280;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.cms-copy-btn:hover {
    border-color: var(--admin-brand);
    color: var(--admin-brand);
    background: var(--admin-brand-light);
}
.cms-copy-btn.copied {
    border-color: #22c55e;
    color: #16a34a;
    background: #f0fdf4;
}

/* ── Sidebar Nav (Pill Variant) ── */
/* Override default border-left sidebar nav with rounded pill style.
   Used by apps that set .sidebar-nav { padding: 0.5rem 0.75rem; } */
.sidebar-nav-pills .nav-item-admin {
    padding: 0 1rem;
    height: 36px;
    border-radius: 20px;
    border-left: none;
}
.sidebar-nav-pills .nav-item-admin:hover {
    background: rgba(255,255,255,0.08);
}
.sidebar-nav-pills .nav-item-admin.active {
    border-left: none;
}
.sidebar-nav-pills .nav-item-admin i {
    font-size: 1.15rem;
}

/* Section header (clickable, with chevron) */
.nav-group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
    height: 36px;
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 20px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    user-select: none;
    transition: background 0.12s ease, color 0.12s ease;
    margin-top: 2px;
}
.nav-group-header:hover {
    background: rgba(255,255,255,0.08);
    color: var(--sidebar-text-hover);
}
.nav-group-header.section-active {
    color: var(--admin-brand);
}
.nav-group-header i.group-icon {
    font-size: 1.15rem;
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}
.nav-group-header .group-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-group-header .group-chevron {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-right: 2px;
}
.nav-group-header[aria-expanded="true"] .group-chevron {
    transform: rotate(180deg);
}
/* The header badge only signals while collapsed — expanded groups show per-item badges */
.nav-group-header[aria-expanded="true"] .nav-group-badge {
    display: none;
}
.nav-group-header[aria-expanded="true"] .group-chevron,
.nav-group-header:hover .group-chevron {
    color: rgba(255,255,255,0.75);
}

/* Section children container.
   max-height drives the expand/collapse animation (collapsed = 0). It MUST clear the
   tallest group's content height or overflow:hidden silently clips the trailing items.
   This bit the managed-sites drill-through "Sites" group (11 items x 34px ~= 374px): the
   old 300px (~8.8 rows) hid "Theme files" + "Settings". 1500px ~= 44 rows, far above any
   real group; the sidebar's own scroll handles anything taller. Keep this well above
   (max group item count x 34px). */
.nav-group-items {
    overflow: hidden;
    transition: max-height 0.25s ease-out, opacity 0.15s ease;
    max-height: 1500px;
    opacity: 1;
}
.nav-group-items.collapsed {
    max-height: 0;
    opacity: 0;
}

/* Child nav items (indented) */
.nav-group-items .nav-item-admin {
    padding-left: 2.75rem;
    height: 34px;
    font-size: 0.835rem;
}
.nav-group-items .nav-item-admin i {
    font-size: 1.05rem;
}

/* Divider between top items and groups */
.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 0.5rem 0.75rem;
}

/* ── CMS Section Cards ── */
.cms-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}
.cms-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
}
.cms-card-header {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    gap: 0.875rem;
    user-select: none;
}
.cms-card-accent {
    width: 4px;
    align-self: stretch;
    border-radius: 4px;
    margin: -0.125rem 0;
    flex-shrink: 0;
}
.cms-card-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.cms-card-title-area {
    flex: 1;
    min-width: 0;
}
.cms-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1a1d23;
    line-height: 1.3;
}
.cms-card-subtitle {
    font-size: 0.78rem;
    color: #9ca3af;
    line-height: 1.3;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cms-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}
.cms-lang-badges { display: flex; gap: 4px; }
.cms-lang-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1.5px solid #d1d5db;
    color: #9ca3af;
    background: transparent;
    line-height: 1.3;
}
.cms-lang-badge.complete {
    border-color: #22c55e;
    color: #16a34a;
    background: #f0fdf4;
}
.cms-field-count {
    font-size: 0.75rem;
    color: #9ca3af;
    white-space: nowrap;
}
.cms-card-chevron {
    font-size: 0.85rem;
    color: #9ca3af;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}
.cms-card-header[aria-expanded="true"] .cms-card-chevron {
    transform: rotate(180deg);
}
.cms-card-body {
    padding: 0.25rem 1.25rem 1.25rem;
    border-top: 1px solid #f3f4f6;
}

/* ── Content Editor Utilities ── */
.text-hint { color: #9ca3af; }
.icon-field { max-width: 300px; }
.quill-editor-area { min-height: 120px; }

/* ── Content Page Cards (CMS index) ── */
.content-page-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    height: 100%;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.content-page-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    transform: translateY(-2px);
}
.content-page-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.content-page-card-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1a1d23;
    margin: 0;
    text-transform: capitalize;
}
.content-page-card-count {
    font-size: 0.78rem;
    color: #9ca3af;
}
.content-page-card-footer {
    margin-top: auto;
    padding-top: 0.5rem;
}

/* ── Dashboard KPI Cards ── */
.dashboard-kpi-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    height: 100%;
}
.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.kpi-icon-primary { background: rgba(13,110,253,0.1); color: #0d6efd; }
.kpi-icon-success { background: rgba(25,135,84,0.1); color: #198754; }
.kpi-icon-danger { background: rgba(220,53,69,0.1); color: #dc3545; }
.kpi-icon-green { background: rgba(34,197,94,0.1); color: #16a34a; }
.kpi-icon-blue { background: rgba(59,130,246,0.1); color: #3b82f6; }
.kpi-icon-purple { background: rgba(139,92,246,0.1); color: #8b5cf6; }
.kpi-icon-teal { background: rgba(20,184,166,0.1); color: #14b8a6; }
.kpi-icon-amber { background: rgba(245,158,11,0.1); color: #f59e0b; }
.kpi-body { flex: 1; min-width: 0; }
.kpi-value { font-size: 1.5rem; font-weight: 700; color: #1a1d23; line-height: 1.2; }
.kpi-label { font-size: 0.82rem; color: #6b7280; font-weight: 500; margin-top: 2px; }
.kpi-subtitle { font-size: 0.75rem; color: #9ca3af; margin-top: 2px; }

/* ── Dashboard Section Cards ── */
.dashboard-section-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    overflow: hidden;
    height: 100%;
}
.section-header {
    padding: 0.875rem 1.25rem;
    font-weight: 600;
    font-size: 0.92rem;
    color: #1a1d23;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-header i { color: #6b7280; }
.section-body { padding: 1rem 1.25rem; }

/* ── Dashboard Quick Actions ── */
.dashboard-quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1rem 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    text-decoration: none;
    color: #374151;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.15s ease;
}
.dashboard-quick-action:hover {
    border-color: var(--admin-brand-border);
    background: var(--admin-brand-light);
    color: #1a1d23;
}
.dashboard-quick-action i { font-size: 1.3rem; color: #6b7280; }
.dashboard-quick-action:hover i { color: var(--admin-brand); }
.dashboard-quick-action.compact {
    padding: 0.5rem 0.25rem;
    gap: 0.2rem;
    font-size: 0.75rem;
    border-radius: 8px;
}
.dashboard-quick-action.compact i { font-size: 1rem; }

/* ── Dashboard Table ── */
.dashboard-table { font-size: 0.85rem; }
.dashboard-table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #9ca3af;
    border-bottom-width: 1px;
}
.dashboard-table td { vertical-align: middle; }

/* ── Revenue Bar Chart (shared analytics Sales page) ── */
.revenue-chart {
    display: flex;
    align-items: flex-end;
    gap: 0;
    height: 200px;
    padding-top: 0.5rem;
}
.revenue-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}
.revenue-bar-wrapper {
    width: 100%;
    height: 140px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 6px;
}
.revenue-bar {
    width: 100%;
    max-width: 48px;
    background: linear-gradient(180deg, #198754, #20c997);
    border-radius: 4px 4px 0 0;
    transition: height 0.3s ease;
    min-height: 2px;
}
.revenue-bar-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}
.revenue-bar-value {
    font-size: 0.7rem;
    font-weight: 600;
    color: #198754;
    white-space: nowrap;
}
.revenue-bar-orders {
    font-size: 0.65rem;
    color: #9ca3af;
    white-space: nowrap;
}

/* Dense mode: 14+ buckets — rotate labels 45°, hide empty-bar values, keep non-zero visible */
.revenue-chart.dense {
    height: 240px;
    padding-bottom: 22px;
    position: relative;
}
.revenue-chart.dense .revenue-bar-group {
    gap: 2px;
    position: relative;
}
.revenue-chart.dense .revenue-bar-wrapper {
    padding: 0 2px;
    height: 160px;
}
.revenue-chart.dense .revenue-bar { max-width: 28px; }
.revenue-chart.dense .revenue-bar-label {
    font-size: 0.65rem;
    transform: rotate(-45deg);
    transform-origin: right top;
    margin-top: 6px;
    position: relative;
    right: -6px;
}
.revenue-chart.dense .revenue-bar-orders { display: none; }
/* Hide value by default in dense mode; show only for non-zero bars */
.revenue-chart.dense .revenue-bar-value { display: none; }
.revenue-chart.dense .revenue-bar-group.has-revenue .revenue-bar-value {
    display: block;
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.62rem;
    font-weight: 700;
    color: #198754;
    white-space: nowrap;
    background: rgba(255,255,255,0.9);
    padding: 1px 4px;
    border-radius: 3px;
    pointer-events: none;
    z-index: 1;
}
/* Chart summary strip shown above the chart */
.revenue-chart-summary {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 0.5rem;
    padding: 0.35rem 0.5rem;
    background: #f9fafb;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #6b7280;
}
.revenue-chart-summary strong {
    color: #111827;
    font-weight: 600;
}

/* ── Version History ── */
.version-timeline { position: relative; padding-left: 1.5rem; }
.version-entry {
    position: relative;
    padding: 0.75rem 0;
    border-left: 2px solid #dee2e6;
    padding-left: 1.25rem;
    margin-left: -1.5rem;
}
.version-entry:last-child { border-left-color: transparent; }
.version-marker {
    position: absolute;
    left: -1.5rem;
    top: 1rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dee2e6;
    border: 2px solid #fff;
    margin-left: -5px;
}
.version-latest .version-marker { background: var(--admin-brand); width: 12px; height: 12px; margin-left: -6px; }
.version-header { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.25rem; }
.version-time { font-weight: 600; font-size: 0.875rem; }
.version-relative { color: #6c757d; font-size: 0.8rem; }
.version-preview { font-size: 0.825rem; color: #495057; margin-bottom: 0.5rem; max-height: 2.6em; overflow: hidden; text-overflow: ellipsis; }
.version-actions { display: flex; gap: 0.375rem; }
.version-entry:hover { background: #f8f9fa; border-radius: 0 6px 6px 0; }
.version-detail { font-size: 0.9rem; }
.version-field-lang { padding: 0.25rem 0; border-bottom: 1px solid #f0f0f0; }
.version-html-preview { font-size: 0.825rem; padding: 0.5rem; background: #f8f9fa; border-radius: 4px; margin-top: 0.25rem; max-height: 200px; overflow-y: auto; }

/* ── Responsive ── */
@media (max-width: 991.98px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.show { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
    .admin-topbar { left: 0; }
    .admin-main { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}

@media (max-width: 767.98px) {
    .admin-main .container-fluid { padding: 0 1rem; }
    .cms-card-meta { display: none; }
    .cms-card-subtitle { display: none; }
    .ticket-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }
    .cms-lang-bar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .cms-lang-btn-name { display: none; }
    .cms-bilingual-label { display: none; }
    .cms-lang-group.bilingual {
        grid-template-columns: 1fr;
    }
}

/* Quill content alignment — works outside the .ql-editor context (preview panes, detail views) */
.ql-align-center { text-align: center; }
.ql-align-right { text-align: right; }
.ql-align-justify { text-align: justify; }

/* ──────────────────────────────────────────────────────────────────────────
   Catalog tree-view (lib/SL.EShop.Core/Pages/Admin/Catalog/Index.cshtml +
   _CatalogTreeNode.cshtml). Used when CatalogAdminOptions.EnableTreeView=true
   on /Admin/Catalog?view=tree. Mirrors the nested category structure with a
   sortable product list under each category. The Categories admin tree
   (lib/SL.EShop.Core/Pages/Admin/Categories/) reuses the same .cat-tree-*
   class names where it can — its own inline rules carry the category-only
   variants.
   ────────────────────────────────────────────────────────────────────────── */
.cat-tree-list { list-style: none; padding-left: 0; margin: 0; }
.cat-tree-list .cat-tree-list { padding-left: 1.5rem; border-left: 1px dashed rgba(127,127,127,0.25); margin-left: 0.5rem; }
.cat-tree-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.25rem; border-bottom: 1px solid rgba(127,127,127,0.08); }
.cat-tree-row:last-child { border-bottom: 0; }
.cat-tree-row--meta { font-weight: 500; }
.cat-tree-row--inactive .cat-tree-name { opacity: 0.55; }
.cat-tree-toggle { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; user-select: none; background: none; border: 0; color: inherit; padding: 0; }
.cat-tree-toggle.disabled { visibility: hidden; }
.cat-tree-toggle .bi-chevron-down { display: none; }
.cat-tree-node.open > .cat-tree-row > .cat-tree-toggle .bi-chevron-down { display: inline; }
.cat-tree-node.open > .cat-tree-row > .cat-tree-toggle .bi-chevron-right { display: none; }
.cat-tree-node:not(.open) > .cat-tree-children,
.cat-tree-node:not(.open) > .cat-tree-product-list { display: none; }
.cat-tree-icon { color: #6366f1; }
.cat-tree-name { font-weight: 500; flex-grow: 1; }
.cat-tree-eyebrow { color: rgba(127,127,127,0.7); font-size: 0.85rem; }
.cat-tree-handle { cursor: grab; color: rgba(127,127,127,0.5); display: inline-flex; align-items: center; }
.cat-tree-actions { display: inline-flex; gap: 0.35rem; }
.cat-tree-thumb { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; display: inline-block; vertical-align: middle; }
.cat-tree-thumb--empty { background: rgba(127,127,127,0.08); border: 1px dashed rgba(127,127,127,0.25); color: rgba(127,127,127,0.5); display: inline-flex; align-items: center; justify-content: center; font-size: 0.85rem; }

/* Category index — table-view thumbnail column (48×48, larger than tree row). */
.cat-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; display: inline-block; vertical-align: middle; }
.cat-thumb--empty { background: rgba(127,127,127,0.08); border: 1px dashed rgba(127,127,127,0.25); color: rgba(127,127,127,0.55); display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.cat-thumb-cell { width: 64px; padding-right: 0.5rem; }

.cat-tree-product-list { list-style: none; padding-left: 2.25rem; margin: 0 0 0.25rem 0; }
.cat-tree-uncategorized { margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px dashed rgba(127,127,127,0.2); }
.cat-tree-uncategorized .cat-tree-product-list { padding-left: 1.5rem; }
.cat-tree-product { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.25rem; border-bottom: 1px solid rgba(127,127,127,0.05); }
.cat-tree-product:last-child { border-bottom: 0; }
.cat-tree-product:hover { background: rgba(99,102,241,0.04); }
.cat-tree-product--inactive .cat-tree-product-name { opacity: 0.55; }
.cat-tree-product-thumb { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 6px; overflow: hidden; background: rgba(127,127,127,0.08); display: inline-flex; align-items: center; justify-content: center; }
.cat-tree-product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cat-tree-product-placeholder { color: rgba(127,127,127,0.6); }
.cat-tree-product-name { flex-grow: 1; min-width: 0; }
.cat-tree-product-link { color: inherit; text-decoration: none; }
.cat-tree-product-link:hover { text-decoration: underline; }
.cat-tree-product-price { color: rgba(127,127,127,0.85); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cat-tree-product-variants { font-size: 0.75rem; }
.cat-tree-product-actions { display: inline-flex; gap: 0.3rem; }

/* ──────────────────────────────────────────────────────────────────────────
   Category multi-select picker — used on /Admin/Catalog/Edit/{id?} when
   EnableCategories=true. Replaces the old flat checkbox wall with a
   collapsible, searchable tree. See _CategoryPickerNode.cshtml.
   ────────────────────────────────────────────────────────────────────────── */
.cat-pick { border: 1px solid rgba(127,127,127,0.18); border-radius: 8px; background: #fff; overflow: hidden; }
.cat-pick-toolbar { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid rgba(127,127,127,0.12); background: rgba(99,102,241,0.03); flex-wrap: wrap; }
.cat-pick-search-wrap { position: relative; flex: 1 1 220px; min-width: 180px; }
.cat-pick-search-wrap > .bi { position: absolute; left: 0.6rem; top: 50%; transform: translateY(-50%); color: rgba(127,127,127,0.7); pointer-events: none; }
.cat-pick-search { padding-left: 1.85rem; }
.cat-pick-actions { display: inline-flex; align-items: center; gap: 0.5rem; }
.cat-pick-tree { list-style: none; padding: 0.5rem 0.75rem; margin: 0; max-height: 460px; overflow-y: auto; }
.cat-pick-children { list-style: none; padding-left: 1.5rem; margin: 0; border-left: 1px dashed rgba(127,127,127,0.22); }
.cat-pick-node { padding: 0; }
.cat-pick-row { display: flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.5rem; border-radius: 6px; transition: background 0.12s, box-shadow 0.12s; }
.cat-pick-row:hover { background: rgba(99,102,241,0.04); }

/* Selected leaf — stronger tint + left accent bar so the highlight reads even when the
   row sits inside several levels of indented .cat-pick-children. The inset box-shadow
   acts as a vertical accent that's never cropped by the parent's left dashed border. */
.cat-pick-node.selected > .cat-pick-row {
    background: rgba(99,102,241,0.13);
    box-shadow: inset 3px 0 0 #6366f1;
}
.cat-pick-node.selected > .cat-pick-row > .cat-pick-label > .cat-pick-name { color: #4338ca; }

/* Has-selected-descendant — softer tint so a parent (Body Shop, BMW, …) is visually
   marked when any of its children are checked. Helps users find which root branch a
   selection lives under when the catalog has many top-level categories. */
.cat-pick-node.has-selected-descendant:not(.selected) > .cat-pick-row {
    background: rgba(99,102,241,0.04);
    box-shadow: inset 2px 0 0 rgba(99,102,241,0.45);
}
.cat-pick-toggle { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; user-select: none; background: none; border: 0; color: inherit; padding: 0; flex: 0 0 22px; }
.cat-pick-toggle.disabled { visibility: hidden; }
.cat-pick-toggle .bi-chevron-down { display: none; }
.cat-pick-node.open > .cat-pick-row > .cat-pick-toggle .bi-chevron-down { display: inline; }
.cat-pick-node.open > .cat-pick-row > .cat-pick-toggle .bi-chevron-right { display: none; }
.cat-pick-node:not(.open) > .cat-pick-children { display: none; }
.cat-pick-label { display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; flex: 1 1 auto; min-width: 0; margin: 0; padding: 0.1rem 0.25rem; border-radius: 4px; }
.cat-pick-label:hover { background: rgba(99,102,241,0.04); }
.cat-pick-label > .bi { color: #6366f1; flex-shrink: 0; }
.cat-pick-checkbox { margin: 0; cursor: pointer; }
.cat-pick-name { font-weight: 500; }
.cat-pick-slug { color: rgba(127,127,127,0.6); font-size: 0.78rem; margin-left: 0.4rem; }
.cat-pick-count { font-variant-numeric: tabular-nums; }
.cat-pick-node[hidden] { display: none !important; }

/* Right-aligned rollup badge on each catalog tree node — shows total products in
   this category + every descendant. Uses ms-auto in markup; this just normalizes
   typography and keeps the count tabular for stable column alignment. */
.cat-tree-rollup { display: inline-flex; align-items: center; min-width: 2.4rem; padding: 0.1rem 0.5rem; background: rgba(127,127,127,0.12); color: rgba(31,41,55,0.85); border-radius: 999px; font-size: 0.78rem; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ── Email/Slip Template Editor ──
   Shared by admin pages that render a two-column "form on the left, live HTML
   preview on the right" editor: ShippingSlip/Edit, EmailTemplates/Edit, etc.
   Promoted from per-app admin.css (eshop, kidoo) in 2026-05 so apps copying the
   same Razor view (e.g. rtriga) don't ship a broken layout. */
.ete-breadcrumb { margin-bottom: 0.75rem; }
.ete-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.15s;
}
.ete-back-link:hover { color: #1a1d23; }

.ete-title-row {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 1.25rem;
}
.ete-title-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.ete-title { font-weight: 700; margin: 0; font-size: 1.25rem; }
.ete-subtitle { color: #6b7280; font-size: 0.85rem; margin: 0.1rem 0 0; }

.ete-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
}

.ete-editor {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    padding: 1.25rem;
}

.ete-field-group {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f3f4f6;
}
.ete-field-group:last-of-type { border-bottom: none; margin-bottom: 0.5rem; padding-bottom: 0; }

.ete-field-subject {
    background: #fefce8;
    margin: -1.25rem -1.25rem 1.25rem;
    padding: 1.25rem;
    border-radius: 12px 12px 0 0;
    border-bottom: 2px solid #fef08a;
}

.ete-field-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #374151;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.ete-field-label .bi { color: #9ca3af; font-size: 0.8rem; }
.ete-field-hint { font-weight: 400; color: #9ca3af; font-size: 0.78rem; margin-left: 0.25rem; }

.ete-actions {
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
    display: flex;
    gap: 0.5rem;
}

.ete-editor .cms-lang-group .form-control { font-size: 0.88rem; }
.ete-editor .cms-lang-group textarea.form-control { resize: vertical; }

.ete-variables {
    margin-top: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem;
}
.ete-variables-title {
    font-weight: 600;
    font-size: 0.8rem;
    color: #374151;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.ete-var-item {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: #6b7280;
    padding: 0.2rem 0;
}
.ete-var-item code {
    background: #e5e7eb;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #374151;
    white-space: nowrap;
}

.ete-preview {
    position: sticky;
    top: 1rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
}
.ete-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    background: #fafafa;
}
.ete-preview-label {
    font-weight: 600;
    font-size: 0.82rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.ete-preview-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.ete-preview-controls .form-select-sm { width: 70px; font-size: 0.78rem; padding: 0.2rem 1.5rem 0.2rem 0.5rem; }
.ete-preview-controls .btn-sm { font-size: 0.78rem; padding: 0.25rem 0.5rem; }

.ete-preview-frame-wrapper { background: var(--ete-preview-bg, #f5f2f0); padding: 1rem; }
.ete-preview-frame {
    width: 100%;
    min-height: var(--ete-preview-min-height, 600px);
    border: none;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

@media (max-width: 991px) {
    .ete-layout { grid-template-columns: 1fr; }
    .ete-preview { position: static; }
}

/* Tom-Select admin multi-select overrides (paired with admin-multi-select.js render). */
/* Un-scoped from .ts-wrapper on purpose: admin-{multi-}select.js sets dropdownParent:'body', so the
   open menu (and its .ts-code/.ts-desc option spans) lives outside .ts-wrapper. These class names are
   bespoke to our render functions, so the un-scoped rules are collision-free and style both the
   in-wrapper chips and the body-portaled menu options. */
.ts-code { font-weight: 600; color: #111827; }
.ts-desc { color: #6b7280; font-size: 0.85em; }
.ts-wrapper.multi .ts-control { padding: 0.25rem 0.4rem; min-height: 32px; font-size: 0.875rem; }
.ts-wrapper.multi .ts-control > div { padding: 0.1rem 0.4rem; background: #eef2ff; color: #1e3a8a; border: 1px solid #c7d2fe; border-radius: 4px; font-size: 0.78rem; }
.ts-dropdown .option { padding: 0.4rem 0.6rem; }
/* dropdownParent:'body' portals the menu out of the .admin-card overflow:hidden clip. Lift it above
   the sticky save-bar (100), topbar (1030) and Bootstrap modals (1055). The `body >` qualifier wins on
   specificity over the vendored .ts-dropdown.form-select { z-index:1000 } regardless of load order. */
body > .ts-dropdown,
body > .ts-dropdown.form-control,
body > .ts-dropdown.form-select { z-index: 1060; }

/* Rich chips (data-ms-rich-chips): keep the industry NAME on the selected pill, not just the bare code,
   so an admin can read back what they picked. The name truncates so a long description stays compact. */
.ts-wrapper.multi .ts-control > div .ts-chip-code { font-weight: 600; }
.ts-wrapper.multi .ts-control > div .ts-chip-desc {
    margin-left: 0.3rem; opacity: 0.8; max-width: 14rem;
    display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    vertical-align: bottom;
}
/* "+N more" overflow (data-ms-chip-cap): collapse extra chips behind a clickable pill so a large
   selection doesn't blow up the form row. The pill is a node admin-multi-select.js owns + re-inserts. */
.ts-wrapper.multi .ts-control .item.ms-chip-hidden { display: none !important; }
.ts-wrapper.multi .ts-control .ms-more-pill {
    padding: 0.1rem 0.45rem; margin: 2px; border-radius: 4px; cursor: pointer; font-size: 0.78rem;
    background: #e5e7eb; color: #374151; border: 1px solid #d1d5db; user-select: none; white-space: nowrap;
}
.ts-wrapper.multi .ts-control .ms-more-pill:hover { background: #d1d5db; }

/* Browse-in-a-table picker modal (admin-table-picker.js + _AdminTablePickerModal). */
.admin-table-picker-modal .atp-searchbar { z-index: 2; }
.admin-table-picker-modal .atp-table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; color: #6b7280; }
.admin-table-picker-modal .atp-table td.atp-check,
.admin-table-picker-modal .atp-table th.atp-check { width: 2.2rem; text-align: center; }
.admin-table-picker-modal .atp-table td.atp-code code { font-weight: 600; color: #111827; white-space: nowrap; }
.admin-table-picker-modal .atp-table td.atp-count,
.admin-table-picker-modal .atp-table th.atp-count { text-align: right; color: #6b7280; white-space: nowrap; }
.admin-table-picker-modal .atp-row { cursor: pointer; }
/* NACE section group headers inside the picker table. */
.admin-table-picker-modal .atp-table tr.atp-group td {
    background: #f3f4f6; font-weight: 600; font-size: 0.78rem; color: #374151;
    text-transform: uppercase; letter-spacing: 0.03em; position: sticky; top: 0;
}
.admin-table-picker-modal .atp-table tr.atp-group:hover td { background: #f3f4f6; }
.admin-table-picker-modal .atp-searchbar .form-check-label { cursor: pointer; }

/* ── Media Library: two-column shell (category tree sidebar + content panel) ───────────── */
.media-admin { display: flex; gap: 1.25rem; align-items: flex-start; }
.media-cat-sidebar { flex: 0 0 290px; max-width: 290px; position: sticky; top: 0.5rem; align-self: flex-start; }
.media-cat-card { border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; overflow: hidden; }
.media-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.6rem 0.75rem; border-bottom: 1px solid #eef0f3; }
.media-cat-head-title { font-weight: 600; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 0.4rem; }
.media-cat-body { padding: 0.4rem 0.5rem 0.75rem; }
.media-cat-tree { list-style: none; padding-left: 0; margin: 0; }
.media-cat-tree .media-cat-tree { padding-left: 0.9rem; border-left: 1px dashed rgba(127,127,127,0.22); margin-left: 0.55rem; }
.media-cat-node { margin: 1px 0; }
.media-cat-row { display: flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.4rem; border-radius: 6px; cursor: pointer; color: inherit; text-decoration: none; }
.media-cat-row:hover { background: rgba(99,102,241,0.07); }
.media-cat-row.active { background: rgba(99,102,241,0.14); font-weight: 600; }
.media-cat-toggle { width: 18px; height: 18px; flex: 0 0 18px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; background: none; border: 0; color: #9ca3af; padding: 0; font-size: 0.7rem; }
.media-cat-toggle.disabled { visibility: hidden; }
.media-cat-node.open > .media-cat-row > .media-cat-toggle .bi-chevron-down { display: inline; }
.media-cat-node.open > .media-cat-row > .media-cat-toggle .bi-chevron-right { display: none; }
.media-cat-node:not(.open) > .media-cat-children { display: none; }
.media-cat-toggle .bi-chevron-down { display: none; }
.media-cat-handle { cursor: grab; color: rgba(127,127,127,0.45); display: inline-flex; align-items: center; font-size: 0.8rem; }
.media-cat-icon { color: #6366f1; font-size: 0.85rem; }
.media-cat-name { flex: 1 1 auto; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-cat-count { font-size: 0.7rem; color: #6b7280; background: #f1f3f5; border-radius: 10px; padding: 0 0.4rem; }
.media-cat-gallery-badge { color: #ec4899; font-size: 0.75rem; }
.media-cat-row--inactive .media-cat-name { opacity: 0.5; }
.media-cat-actions { display: none; gap: 0.15rem; }
.media-cat-row:hover .media-cat-actions { display: inline-flex; }
.media-cat-actions .btn { --bs-btn-padding-y: 0.05rem; --bs-btn-padding-x: 0.3rem; --bs-btn-font-size: 0.7rem; }
.media-cat-root-row { display: flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.4rem; border-radius: 6px; cursor: pointer; color: inherit; text-decoration: none; font-size: 0.86rem; }
.media-cat-root-row:hover { background: rgba(99,102,241,0.07); }
.media-cat-root-row.active { background: rgba(99,102,241,0.14); font-weight: 600; }
.media-main { flex: 1 1 auto; min-width: 0; }
.media-cat-sortable-ghost { opacity: 0.4; }

/* Asset grid drag-reorder (single-category view). */
.media-asset-cell .card { position: relative; }
.media-drag-handle { position: absolute; top: 6px; left: 6px; z-index: 3; cursor: grab; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; background: rgba(255,255,255,0.9); color: #6c757d; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.media-drag-handle:hover { color: #6366f1; }
.media-asset-cell.sortable-ghost { opacity: 0.4; }

/* Storefront-gallery image manager (assignment set). */
.gallery-cell .card { position: relative; }
.gallery-drag { position: absolute; top: 6px; left: 6px; z-index: 3; cursor: grab; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; background: rgba(255,255,255,0.9); color: #6c757d; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.gallery-thumb { height: 120px; object-fit: cover; width: 100%; border-top-left-radius: .375rem; border-top-right-radius: .375rem; background: #f8f9fa; }
.gallery-subcat { font-size: 0.78rem; }
.gallery-remove { font-size: 0.78rem; }
.gallery-cell.sortable-ghost { opacity: 0.4; }

/* ── Media Picker modal: two-pane (hierarchical category tree + paginated asset grid) ───── */
#mediaPickerModal .mp-layout { display: flex; height: 62vh; }
#mediaPickerModal .mp-cat-pane { flex: 0 0 240px; width: 240px; border-right: 1px solid #e9ecef; overflow-y: auto; padding: 8px 4px; background: #fbfbfc; }
#mediaPickerModal .mp-asset-pane { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
#mediaPickerModal .mp-toolbar { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid #e9ecef; }
#mediaPickerModal .mp-search-wrap { position: relative; flex: 1 1 auto; }
#mediaPickerModal .mp-search-wrap > i { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: #adb5bd; font-size: .85rem; }
#mediaPickerModal .mp-search-wrap > input { padding-left: 28px; }
#mediaPickerModal .mp-grid-scroll { flex: 1 1 auto; overflow-y: auto; padding: 10px 12px; }
#mediaPickerModal .mp-cat-wrap { margin: 0; }
#mediaPickerModal .mp-cat-children { padding-left: 0; }
#mediaPickerModal .mp-cat-row { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 6px; cursor: pointer; font-size: .85rem; color: #343a40; user-select: none; }
#mediaPickerModal .mp-cat-row:hover { background: #eef0f2; }
#mediaPickerModal .mp-cat-row.active { background: #6366f1; color: #fff; }
#mediaPickerModal .mp-cat-row.active .mp-cat-toggle > i { color: #fff; }
#mediaPickerModal .mp-cat-toggle { display: inline-flex; align-items: center; justify-content: center; width: 16px; flex: 0 0 16px; color: #adb5bd; font-size: .75rem; }
#mediaPickerModal .mp-cat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#mediaPickerModal .mp-cat-all { font-weight: 600; }
#mediaPickerModal .mp-asset-card { transition: border-color .12s ease; }
#mediaPickerModal .mp-cat-tree { font-size: .85rem; }

/* Media asset card edit modal + grid markers (also used by the paged _MediaAssetCards partial). */
.edit-modal-tabs { margin-bottom: .75rem; }
.usage-badge { margin-left: .25rem; }
.variant-replace-form { display: inline-flex; }
.cat-name-input { width: 100%; }

/* Media library grid: numbered pager + lightbox trigger thumbnail. */
.media-pager { row-gap: .35rem; }
.media-pager-input { width: 68px; text-align: center; }
.media-thumb-lb { cursor: zoom-in; }

/* Lightbox overlay (click a thumbnail → full asset, zoom + pan for images, player for video). */
.media-lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(15,17,21,0.93); display: flex; flex-direction: column; }
.media-lightbox[hidden] { display: none; }
.media-lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; color: #fff; }
.media-lightbox-title { font-size: .9rem; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-lightbox-actions { display: inline-flex; gap: 6px; flex: 0 0 auto; }
.media-lightbox-stage { flex: 1 1 auto; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.media-lightbox-img { max-width: 94%; max-height: 100%; object-fit: contain; transform-origin: center center; cursor: grab; will-change: transform; }
.media-lightbox-img:active { cursor: grabbing; }
.media-lightbox-video { max-width: 94%; max-height: 100%; }
