/*
 * HOT KIT — ADMIN STYLES
 *
 * Contents
 * 1. Design tokens
 * 2. Global
 * 3. Sidebar
 * 4. Main Layout
 * 5. Welcome Card
 * 6. Buttons
 * 7. Stats
 * 8. Panels
 * 9. Quick Links
 * 10. Status
 * 11. Admin Tables
 * 12. Table Actions
 * 13. Forms
 * 14. Form Messages
 * 15. Categories
 * 16. Products - Category Picker
 * 17. Products - Index
 * 18. Admin Login
 * 19. Responsive - Tablet
 * 20. Page Header
 * 21. Inline Status Controls
 * 22. Reviews
 * 23. Profile & Security
 * 24. Comparison Rule Editor
 * 25. Category Specification Search
 * 26. Checkbox Options
 * 27. Product Specifications
 * 28. Product Image Manager
 * 29. Brand Logo Manager
 */

/* =========================================================
   1. DESIGN TOKENS
========================================================= */

:root {
    --bg: #061426;
    --bg-deep: #04101f;
    --surface: #0a1a2d;
    --surface-light: #10243a;
    --border: #29415c;
    --border-soft: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --muted: #aeb9c8;
    --orange: #ff5a00;
    --orange-hover: #ff6b1a;
    --action: #ff6b00;
    --action-hover: #e65f00;
    --teal: #12c7a3;
    --green: #24d6a5;
    --sidebar-width: 250px;
}

/* =========================================================
   2. GLOBAL
========================================================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

.admin-layout {
    min-height: 100vh;
}

/* =========================================================
   3. SIDEBAR
========================================================= */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    padding: 22px 20px;
    overflow: hidden;
    background: var(--bg-deep);
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px 18px;
    color: var(--text);
    border-radius: 10px;
    flex-shrink: 0;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 800;
    background: var(--orange);
    box-shadow: 0 8px 25px rgba(255, 90, 0, 0.25);
}

.sidebar-brand strong {
    display: block;
    font-size: 17px;
}

.sidebar-brand span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    gap: 3px;
    padding-bottom: 12px;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: 0;
    gap: 8px;
    padding: 9px 10px;
    font-size: 14px;
    border-radius: 12px;
    color: var(--muted);
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.sidebar-nav a.active {
    color: var(--text);
    background: linear-gradient(90deg, rgba(255, 90, 0, 0.2), rgba(255, 90, 0, 0.05));
    border: 1px solid rgba(255, 90, 0, 0.22);
}

.nav-icon {
    width: 20px;
    flex: 0 0 20px;
    text-align: center;
    color: var(--orange);
    font-weight: 700;
}

.sidebar-bottom {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
    flex-shrink: 0;
}

.sidebar-bottom a {
    display: block;
    padding: 8px 14px;
    color: var(--muted);
    border-radius: 12px;
}

.sidebar-bottom a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

/* =========================================================
   4. MAIN LAYOUT
========================================================= */

.admin-main {
    margin-left: var(--sidebar-width);
    padding: 36px;
    max-width: 1600px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.admin-header h1 {
    margin: 4px 0 0;
    font-size: clamp(28px, 4vw, 40px);
}

.eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 11px;
    font-weight: 800;
    color: var(--teal);
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    background: var(--surface-light);
    border: 1px solid var(--border);
}

.admin-user strong {
    display: block;
    font-size: 14px;
}

.admin-user span {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--muted);
}

/* =========================================================
   5. WELCOME CARD
========================================================= */

.welcome-card {
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background:
        linear-gradient(135deg, rgba(255, 90, 0, 0.13), rgba(18, 199, 163, 0.06)), var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 22px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.welcome-card h2 {
    margin: 8px 0;
    font-size: clamp(24px, 4vw, 34px);
}

.welcome-card p:last-child {
    margin: 0;
    max-width: 650px;
    color: var(--muted);
    line-height: 1.6;
}

/* =========================================================
   6. BUTTONS
========================================================= */

.primary-button {
    flex-shrink: 0;
    padding: 13px 18px;
    border: 0;
    border-radius: 12px;
    background: var(--orange);
    color: var(--text);
    box-shadow: none;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.primary-button:hover {
    background: var(--orange-hover);
    box-shadow: none;
}

.primary-button:focus,
.primary-button:active {
    box-shadow: none;
    outline: none;
}

.secondary-button {
    background: var(--surface-light);
    font: inherit;
    cursor: pointer;
    padding: 11px 15px;
    border-radius: 11px;
    border: 1px solid var(--border);
    color: #d3dce8;
}

.secondary-button:hover {
    color: var(--text);
}

/* =========================================================
   7. STATS
========================================================= */

.stats-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.stat-card {
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
}

.stat-label {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.stat-card strong {
    display: block;
    margin: 10px 0 6px;
    font-size: 32px;
}

.stat-meta {
    color: var(--teal);
    font-size: 12px;
}

/* =========================================================
   8. PANELS
========================================================= */

.dashboard-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
    gap: 18px;
}

.panel {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
}

.panel-heading {
    margin-bottom: 18px;
}

.panel h3 {
    margin: 5px 0 0;
    font-size: 20px;
}

/* =========================================================
   9. QUICK LINKS
========================================================= */

.quick-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.quick-links a {
    padding: 18px;
    border-radius: 14px;
    background: var(--surface-light);
    border: 1px solid transparent;
    transition:
        border 0.2s ease,
        transform 0.2s ease;
}

.quick-links a:hover {
    border-color: rgba(255, 90, 0, 0.35);
    transform: translateY(-2px);
}

.quick-links strong {
    display: block;
    margin-bottom: 6px;
}

.quick-links span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

/* =========================================================
   10. STATUS
========================================================= */

.status-list {
    display: flex;
    flex-direction: column;
}

.status-list div {
    padding: 14px 0;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--border-soft);
}

.status-list div:last-child {
    border-bottom: 0;
}

.status-list span {
    color: var(--muted);
    font-size: 13px;
}

.status-list strong {
    font-size: 13px;
}

.status-good {
    color: var(--green);
}

.status-progress {
    color: #ffbf24;
}

/* =========================================================
   11. ADMIN TABLES
========================================================= */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

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

.admin-table th,
.admin-table td {
    padding: 16px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
}

.admin-table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.admin-table td {
    font-size: 14px;
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

.status-badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.status-badge.active {
    color: var(--green);
    background: rgba(36, 214, 165, 0.1);
}

.status-badge.inactive {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.06);
}

.table-actions {
    text-align: right !important;
}

.action-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* =========================================================
   12. TABLE ACTIONS
========================================================= */

.table-action,
.edit-button,
.delete-button,
.table-actions a {
    color: var(--action);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.table-action:hover,
.edit-button:hover,
.delete-button:hover,
.table-actions a:hover {
    color: var(--action-hover);
}

button.table-action,
.delete-button {
    padding: 0;
    border: 0;
    background: none;
}

.delete-action {
    margin-left: 12px;
}

.delete-form {
    margin: 0;
}

/* =========================================================
   13. FORMS
========================================================= */

.form-page {
    max-width: 900px;
    margin-right: auto;
}

.form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.form-header h1 {
    margin: 5px 0 0;
}

.form-panel {
    max-width: 700px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 13px 14px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: var(--bg-deep);
    color: var(--text);
    font: inherit;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--orange);
}

.form-group textarea {
    resize: vertical;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 24px;
    color: var(--muted);
    cursor: pointer;
}

.form-submit {
    border: 0;
    cursor: pointer;
}

/* =========================================================
   14. FORM MESSAGES
========================================================= */

.form-error {
    padding: 12px 14px;
    margin-bottom: 20px;
    border-radius: 10px;
    background: rgba(255, 90, 0, 0.12);
    border: 1px solid rgba(255, 90, 0, 0.3);
}

.form-success {
    padding: 12px 14px;
    margin-bottom: 20px;
    border-radius: 10px;
    color: var(--green);
    background: rgba(36, 214, 165, 0.1);
    border: 1px solid rgba(36, 214, 165, 0.25);
}

/* =========================================================
   15. CATEGORIES
========================================================= */

.category-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-depth-1 {
    padding-left: 28px;
}

.category-depth-2 {
    padding-left: 56px;
}

.category-branch {
    opacity: 0.45;
    font-weight: 400;
}

.category-depth-1 strong {
    font-weight: 600;
}

.category-depth-2 strong {
    font-weight: 500;
}

/* =========================================================
   16. PRODUCTS - CATEGORY PICKER
========================================================= */

.category-picker {
    display: grid;
    gap: 20px;
    padding: 18px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.category-group {
    display: grid;
    gap: 8px;
}

.category-level-one {
    margin-bottom: 4px;
    font-size: 1rem;
    font-weight: 700;
}

.category-level-two {
    padding-left: 20px;
    margin-top: 6px;
    font-weight: 600;
}

.form-group .category-check {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding-left: 40px;
    margin-bottom: 6px;
    color: var(--text);
    cursor: pointer;
}

.form-group .category-check input {
    width: auto;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
}

.form-group .category-check span {
    display: inline-block;
}

/* =========================================================
   17. PRODUCTS - INDEX
========================================================= */

.product-table-name {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.product-table-name span {
    font-size: 0.82rem;
    opacity: 0.55;
}

.product-category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.product-category-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.featured-badge {
    font-size: 0.82rem;
    font-weight: 600;
}

.muted-text {
    opacity: 0.45;
}

.empty-table {
    padding: 40px 20px;
    text-align: center;
    opacity: 0.55;
}

.product-table-name + .edit-button,
.admin-table .edit-button {
    text-decoration: none;
    font-weight: 700;
}

/* =========================================================
   18. ADMIN LOGIN
========================================================= */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 15% 20%, rgba(18, 199, 163, 0.1), transparent 32%),
        radial-gradient(circle at 85% 80%, rgba(255, 90, 0, 0.1), transparent 30%), var(--bg);
}

.login-wrapper {
    width: 100%;
    max-width: 430px;
}

.login-card {
    padding: 34px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent), var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 34px;
}

.login-brand .brand-mark {
    flex-shrink: 0;
}

.login-brand strong {
    display: block;
    font-size: 18px;
}

.login-brand span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.login-heading {
    margin-bottom: 26px;
}

.login-heading h1 {
    margin: 6px 0 8px;
    font-size: 32px;
    letter-spacing: -0.03em;
}

.login-heading > p:last-child {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.login-error {
    margin-bottom: 20px;
    padding: 12px 14px;
    color: #ff9a63;
    background: rgba(255, 90, 0, 0.1);
    border: 1px solid rgba(255, 90, 0, 0.28);
    border-radius: 11px;
    font-size: 13px;
    font-weight: 600;
}

.login-page .form-group {
    margin-bottom: 18px;
}

.login-page .form-group label {
    margin-bottom: 7px;
}

.login-page .form-group input {
    min-height: 52px;
    padding: 0 14px;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.login-page .form-group input:hover {
    border-color: rgba(255, 255, 255, 0.22);
}

.login-page .form-group input:focus {
    border-color: var(--teal);
    background: var(--surface-light);
    box-shadow: 0 0 0 3px rgba(18, 199, 163, 0.1);
}

.login-button {
    width: 100%;
    min-height: 52px;
    margin-top: 4px;
    border: 0;
    border-radius: 12px;
    background: var(--orange);
    color: var(--text);
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.login-button:hover {
    background: var(--orange-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(255, 90, 0, 0.22);
}

.login-button:active {
    transform: translateY(0);
}

.login-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--border-soft);
    color: var(--muted);
    font-size: 11px;
}

.login-status-dot {
    width: 6px;
    height: 6px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 8px rgba(18, 199, 163, 0.6);
}

/* =========================================================
   19. RESPONSIVE - TABLET
========================================================= */

@media (max-width: 950px) {
    .sidebar {
        position: static;
        width: 100%;
        min-height: auto;
        padding: 18px;
    }

    .sidebar-brand {
        padding-bottom: 16px;
    }

    .sidebar-nav {
        flex: 0 0 auto;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 8px;
    }

    .sidebar-nav a {
        flex-shrink: 0;
    }

    .sidebar-bottom {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .admin-main {
        margin-left: 0;
        padding: 24px 18px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

/* Responsive - mobile */

@media (max-width: 600px) {
    .admin-header {
        align-items: flex-start;
    }

    .admin-user div:last-child {
        display: none;
    }

    .welcome-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .primary-button {
        width: 100%;
        text-align: center;
    }

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

    .stat-card {
        padding: 18px;
    }

    .quick-links {
        grid-template-columns: 1fr;
    }
}

/* Responsive - login */

@media (max-width: 500px) {
    .login-page {
        padding: 16px;
    }

    .login-card {
        padding: 26px 22px;
        border-radius: 18px;
    }

    .login-brand {
        margin-bottom: 28px;
    }

    .login-heading h1 {
        font-size: 28px;
    }
}

/* =========================================================
   20. PAGE HEADER
========================================================= */

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.page-header h1 {
    margin: 5px 0 8px;
    font-size: clamp(28px, 4vw, 40px);
}

.page-description {
    margin: 0;
    max-width: 650px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.page-header .primary-button {
    margin-top: 4px;
}

/* =========================================================
   21. INLINE STATUS CONTROLS
========================================================= */

.status-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-form select {
    min-width: 130px;
    padding: 9px 34px 9px 11px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-deep);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.status-form select:hover {
    border-color: rgba(255, 255, 255, 0.22);
}

.status-form select:focus {
    border-color: var(--action);
    background: var(--surface-light);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

.status-update-button {
    padding: 9px 13px;
    border: 1px solid rgba(255, 107, 0, 0.3);
    border-radius: 10px;
    background: rgba(255, 107, 0, 0.1);
    color: var(--action);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.status-update-button:hover {
    background: rgba(255, 107, 0, 0.18);
    border-color: rgba(255, 107, 0, 0.45);
    color: var(--action-hover);
    transform: translateY(-1px);
}

.status-update-button:active {
    transform: translateY(0);
}

/* =========================================================
   22. REVIEWS
========================================================= */

.review-stars {
    color: #f5c542;
    font-size: 15px;
    letter-spacing: 1px;
    white-space: nowrap;
}

.review-text {
    max-width: 420px;
    line-height: 1.5;
}

.review-text-short,
.review-text-full {
    display: inline;
}

.review-text-full {
    display: none;
}

.review-toggle {
    display: inline-block;
    margin-top: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--action);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.review-toggle:hover {
    color: var(--action-hover);
}

/* =========================================================
   23. PROFILE & SECURITY
========================================================= */

.profile-section + .profile-section {
    margin-top: 28px;
}

.profile-image-section {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 22px 0 26px;
}

.profile-image-preview,
.profile-image-fallback,
.sidebar-profile-image {
    width: 54px;
    height: 54px;
    flex-shrink: 0;
    border-radius: 14px;
    object-fit: cover;
}

.profile-image-preview,
.sidebar-profile-image {
    border: 1px solid var(--border-soft);
}

.profile-image-fallback {
    display: grid;
    place-items: center;
    background: var(--orange);
    color: var(--text);
    font-weight: 800;
}

.sidebar-profile-image {
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.profile-image-label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 700;
}

.form-help {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

/* =========================================================
   24. COMPARISON RULE EDITOR
========================================================= */

.comparison-rule-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
    align-items: start;
}

.weighting-panel {
    padding: 24px;
}

.weighting-panel h2 {
    margin-bottom: 8px;
}

.weighting-description {
    margin-bottom: 24px;
    color: #8993a4;
    font-size: 0.9rem;
}

/* ---------- PERCENTAGE INPUT ---------- */

.percentage-input {
    position: relative;
}

.percentage-input input {
    padding-right: 52px;
}

.percentage-input > span {
    position: absolute;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    color: #8993a4;
    font-weight: 800;
    pointer-events: none;
}

/* ---------- OPTIONS ---------- */

.comparison-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comparison-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
    color: var(--text);
    cursor: pointer;
}

.comparison-options input[type='checkbox'] {
    width: auto;
    height: auto;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
}

/* ---------- EXISTING RULES ---------- */

.weighting-rules {
    display: flex;
    flex-direction: column;
    margin-bottom: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.weighting-rule {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.weighting-rule strong {
    display: block;
    font-size: 0.9rem;
}

.weighting-rule-note {
    display: block;
    margin-top: 2px;
    color: #8993a4;
    font-size: 0.72rem;
}

.weighting-rule-value {
    flex-shrink: 0;
    color: #12c7a3;
    font-weight: 800;
}

.weighting-empty {
    padding: 18px 0;
    color: #8993a4;
    font-size: 0.9rem;
}

/* ---------- SUMMARY ---------- */

.weighting-summary {
    padding-top: 4px;
}

.weighting-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.weighting-summary-row span {
    color: #8993a4;
}

.weighting-summary-total {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1rem;
}

.weighting-summary-total strong {
    font-size: 1.2rem;
}

/* ---------- PROGRESS ---------- */

.weighting-progress {
    width: 100%;
    height: 10px;
    margin-top: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
}

.weighting-progress-fill {
    height: 100%;
    background: #12c7a3;
    border-radius: inherit;
    transition: width 0.2s ease;
}

/* ---------- STATUS ---------- */

.weighting-status {
    margin-top: 14px;
    color: #8993a4;
    font-size: 0.82rem;
    line-height: 1.5;
}

.weighting-status strong {
    color: #ffffff;
}

.weighting-status-complete strong {
    color: #12c7a3;
}

.weighting-status-error strong {
    color: #ff6b6b;
}

/* ---------- DISABLED SAVE ---------- */

#saveRuleButton:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* =========================================================
   25. CATEGORY SPECIFICATION SEARCH
========================================================= */

.spec-search-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.spec-search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(100%, 560px);
}

.spec-search-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-deep);
    color: var(--text);
    font: inherit;
    outline: none;
}

.spec-search-field input:focus {
    border-color: var(--accent);
}

@media (max-width: 700px) {
    .spec-search-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .spec-search-field {
        width: 100%;
    }
}

/* =========================================================
   26. CHECKBOX OPTIONS
========================================================= */

.form-group > label.checkbox-option {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    width: fit-content !important;
    gap: 10px;
    margin: 0 0 14px 0 !important;
    color: var(--muted);
    cursor: pointer;
}

.form-group > label.checkbox-option:last-of-type {
    margin-bottom: 0 !important;
}

.form-group > label.checkbox-option input[type='checkbox'] {
    width: 18px !important;
    min-width: 18px;
    height: 18px !important;
    flex: 0 0 18px;
    margin: 0 !important;
    padding: 0 !important;
}

/* =========================================================
   27. PRODUCT SPECIFICATIONS
========================================================= */

.product-specifications {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.product-specifications-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.product-specifications-header h2 {
    margin: 0 0 6px;
    font-size: 18px;
}

.product-specifications-header p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.product-specifications-link {
    flex-shrink: 0;
    color: var(--action);
    font-size: 12px;
    font-weight: 700;
}

.product-specifications-link:hover {
    color: var(--action-hover);
}

.product-spec-grid {
    display: grid;
    gap: 18px;
}

.product-spec-field {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-soft);
}

.product-spec-field:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.product-spec-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.product-spec-required {
    color: var(--orange);
}

.product-spec-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 10px;
}

.product-spec-field input,
.product-spec-field select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    outline: none;
}

.product-spec-field input:focus,
.product-spec-field select:focus {
    border-color: var(--orange);
}

.product-spec-empty {
    padding: 18px 6px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

@media (max-width: 600px) {
    .product-specifications-header {
        flex-direction: column;
    }

    .product-spec-input-row {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   28. PRODUCT IMAGE MANAGER
========================================================= */

.product-image-manager {
    margin-top: 24px;
    padding: 24px;
}

.product-image-manager-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.product-image-manager-header h2 {
    margin: 0 0 8px;
    font-size: 22px;
}

.product-image-manager-header p {
    color: var(--muted);
    font-size: 13px;
}

.product-image-count {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.product-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.product-image-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-deep);
}

.product-image-preview {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--surface);
}

.product-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-image-primary {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 5px 9px;
    border-radius: 6px;
    background: var(--orange);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.product-image-details {
    padding: 10px;
    color: var(--muted);
    font-size: 11px;
    overflow-wrap: anywhere;
}

.product-image-empty {
    margin-bottom: 24px;
    padding: 28px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

.product-image-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    margin-bottom: 20px;
    padding: 35px 20px;
    border: 2px dashed var(--border);
    border-radius: 14px;
    background: var(--bg-deep);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s;
}

.product-image-upload-zone:hover {
    border-color: var(--orange);
}

.product-image-upload-icon {
    font-size: 32px;
}

.product-image-upload-zone strong {
    color: var(--text);
}

.product-image-upload-zone > span:not(.product-image-upload-icon) {
    color: var(--muted);
    font-size: 12px;
}

.product-image-upload-message {
    margin-bottom: 16px;
    font-size: 13px;
}

.product-image-upload-message.is-error {
    color: #ff6b6b;
}

.product-image-upload-message.is-success {
    color: #49c89b;
}

.product-image-manager button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .product-image-manager {
        padding: 18px;
    }

    .product-image-manager-header {
        flex-direction: column;
        gap: 8px;
    }
}

/* Product image delete */

.product-image-card form {
    padding: 0 10px 10px;
}

.product-image-delete {
    width: 100%;
    padding: 10px;
    border: 1px solid #ff6b6b;
    border-radius: 8px;
    background: transparent;
    color: #ff6b6b;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 0.2s,
        color 0.2s;
}

.product-image-delete:hover {
    background: #ff6b6b;
    color: #fff;
}

/* Product image management */

.product-image-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 10px 10px;
}

.product-image-controls form {
    padding: 0;
    margin: 0;
}

.product-image-set-primary {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--orange);
    border-radius: 8px;
    background: transparent;
    color: var(--orange);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 0.2s,
        color 0.2s;
}

.product-image-set-primary:hover {
    background: var(--orange);
    color: #fff;
}

.product-image-order-controls {
    display: flex;
    gap: 8px;
}

.product-image-order-controls form {
    flex: 1;
}

.product-image-order-button {
    width: 100%;
    padding: 9px 5px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition:
        border-color 0.2s,
        color 0.2s;
}

.product-image-order-button:hover {
    border-color: var(--orange);
    color: var(--orange);
}

/* Product image cropper button */

.product-image-crop-button {
    display: block;
    width: calc(100% - 20px);
    margin: 0 10px 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.product-image-crop-button:hover {
    border-color: var(--orange);
    color: var(--orange);
}

/* Media crop dialog */

.media-crop-dialog {
    width: min(94vw, 850px);
    max-height: 94vh;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg-deep);
    color: var(--text);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.media-crop-dialog::backdrop {
    background: rgba(0, 0, 0, 0.8);
}

.media-crop-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.media-crop-header h2 {
    margin: 0 0 8px;
    font-size: 22px;
}

.media-crop-header p {
    color: var(--muted);
    font-size: 13px;
}

.media-crop-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
}

.media-crop-close:hover {
    color: var(--orange);
}

/* Crop area */

.media-crop-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    margin-bottom: 24px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #101820;
}

.media-crop-stage {
    position: relative;
    flex: none;
    overflow: hidden;
}

.media-crop-stage img {
    display: block;
    width: 100%;
    height: 100%;
    user-select: none;
    -webkit-user-drag: none;
}

.media-crop-selection {
    position: absolute;
    display: block;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 0;
    background: rgba(255, 90, 0, 0.08);
    box-shadow:
        0 0 0 2000px rgba(0, 0, 0, 0.4),
        inset 0 0 0 1px rgba(0, 0, 0, 0.4);
    cursor: move;
    touch-action: none;
}

.media-crop-selection:focus-visible {
    outline: 3px solid var(--orange);
    outline-offset: 3px;
}

.media-crop-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(
            90deg,
            transparent 33.33%,
            rgba(255, 255, 255, 0.5) 33.33%,
            rgba(255, 255, 255, 0.5) 33.55%,
            transparent 33.55%,
            transparent 66.66%,
            rgba(255, 255, 255, 0.5) 66.66%,
            rgba(255, 255, 255, 0.5) 66.88%,
            transparent 66.88%
        ),
        linear-gradient(
            transparent 33.33%,
            rgba(255, 255, 255, 0.5) 33.33%,
            rgba(255, 255, 255, 0.5) 33.55%,
            transparent 33.55%,
            transparent 66.66%,
            rgba(255, 255, 255, 0.5) 66.66%,
            rgba(255, 255, 255, 0.5) 66.88%,
            transparent 66.88%
        );
}

/* Adjustments and actions */

.media-crop-adjustments {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 18px;
}

.media-crop-adjustments label {
    font-size: 13px;
    font-weight: 700;
}

.media-crop-adjustments input {
    flex: 1;
    min-width: 0;
    accent-color: var(--orange);
}

.media-crop-message {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 13px;
}

.media-crop-message.is-error {
    color: #ff6b6b;
}

.media-crop-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.media-crop-actions button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .media-crop-dialog {
        padding: 16px;
    }

    .media-crop-adjustments {
        flex-wrap: wrap;
    }

    .media-crop-adjustments input {
        flex-basis: 100%;
        order: 3;
    }
}

/* Product image drag and drop */

.product-image-upload-zone.is-dragover {
    border-color: var(--orange);
    background: rgba(255, 90, 0, 0.1);
    box-shadow: inset 0 0 0 1px var(--orange);
    transform: translateY(-2px);
}

.product-image-upload-zone {
    transition:
        border-color 0.2s,
        background 0.2s,
        box-shadow 0.2s,
        transform 0.2s;
}

/* Product image url import */

.product-image-url-import {
    margin-bottom: 20px;
}

.product-image-url-import label {
    display: block;
    margin-bottom: 10px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.product-image-url-row {
    display: flex;
    gap: 10px;
}

.product-image-url-row input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
}

.product-image-url-row input:focus {
    outline: none;
    border-color: var(--orange);
}

.product-image-url-row button {
    flex-shrink: 0;
}

.product-image-url-import p {
    margin-top: 9px;
    color: var(--muted);
    font-size: 12px;
}

/* Upload queue */

.product-image-queue-count {
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.product-image-queue-remove {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.product-image-queue-remove:hover {
    background: #ff6b6b;
}

.product-image-queue-remove:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .product-image-url-row {
        flex-direction: column;
    }
}

/* Product form width */

.admin-main.form-page > .form-panel {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

/* =========================================================
   29. BRAND LOGO MANAGER
========================================================= */

.brand-logo-panel {
    margin-top: 24px;
    padding: 24px;
}

.brand-logo-heading {
    margin-bottom: 20px;
}

.brand-logo-heading h2 {
    margin-bottom: 6px;
    font-size: 20px;
}

.brand-logo-heading p:last-child {
    color: var(--muted);
    font-size: 13px;
}

/* ---------- CURRENT LOGO ---------- */

.brand-logo-current {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}

.brand-logo-current-preview,
.brand-logo-selected-preview {
    width: 110px;
    height: 110px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 12px;
    background: #ffffff;
    color: #101820;
    border-radius: 16px;
}

.brand-logo-current-preview img,
.brand-logo-selected-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-logo-current-preview span {
    font-size: 32px;
    font-weight: 900;
}

.brand-logo-current p {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

/* ---------- DROP ZONE ---------- */

.brand-logo-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 32px 20px;
    border: 2px dashed var(--border);
    border-radius: 14px;
    text-align: center;
    cursor: pointer;
    transition:
        background 0.2s,
        border-color 0.2s;
}

.brand-logo-drop-zone > span {
    font-size: 28px;
}

.brand-logo-drop-zone strong {
    font-size: 14px;
}

.brand-logo-drop-zone small {
    color: var(--muted);
    font-size: 12px;
}

.brand-logo-drop-zone:hover,
.brand-logo-drop-zone.is-dragover,
.brand-logo-drop-zone:focus-visible {
    border-color: var(--orange);
    background: rgba(255, 90, 0, 0.08);
}

/* ---------- URL IMPORT ---------- */

.brand-logo-url-import {
    margin-top: 20px;
}

.brand-logo-url-import label {
    display: block;
    margin-bottom: 9px;
    font-size: 13px;
    font-weight: 700;
}

.brand-logo-url-import > div {
    display: flex;
    gap: 10px;
}

.brand-logo-url-import input {
    flex: 1;
    min-width: 0;
    padding: 12px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
}

/* ---------- SELECTED LOGO ---------- */

.brand-logo-selected {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 20px;
}

.brand-logo-selected[hidden] {
    display: none;
}

.brand-logo-selected p {
    margin: 5px 0 12px;
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

/* ---------- STATUS / ACTIONS ---------- */

.brand-logo-message {
    margin-top: 16px;
    color: var(--muted);
    font-size: 13px;
}

.brand-logo-message.is-error {
    color: #ff6b6b;
}

.brand-logo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.brand-logo-actions button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.brand-logo-remove {
    padding: 12px 18px;
    background: transparent;
    color: #ff6b6b;
    border: 1px solid #ff6b6b;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

.brand-logo-remove:hover {
    background: rgba(255, 107, 107, 0.1);
}

/* ---------- MOBILE ---------- */

@media (max-width: 600px) {
    .brand-logo-panel {
        padding: 18px;
    }

    .brand-logo-url-import > div {
        flex-direction: column;
    }

    .brand-logo-current,
    .brand-logo-selected {
        align-items: flex-start;
    }
}

/* Admin list search */

[data-admin-search] [hidden] {
    display: none !important;
}

.sidebar-brand:hover strong { color: var(--orange); }
.sidebar-brand:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }

/* Consistent padded dropdowns; list boxes and multi-selects keep their native layout. */
select:not([multiple]):not([size]), select[size="1"]:not([multiple]) {
    appearance: none !important;
    -webkit-appearance: none !important;
    min-height: 44px;
    background-color: var(--bg-deep, var(--hk-bg-deep, #04101f));
    color: var(--text, var(--hk-text, #fff));
    border: 1px solid var(--border, var(--hk-border, #29415c));
    border-radius: 11px;
    color-scheme: dark;
    font: inherit;
    padding: 11px 44px 11px 14px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='18' viewBox='0 0 12 18'%3E%3Cpath d='m2 6 4-4 4 4M2 12l4 4 4-4' fill='none' stroke='%23ff5a00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
    background-size: 12px 18px !important;
    cursor: pointer;
}
select:disabled { cursor: not-allowed; opacity: .6; }
select:focus-visible { outline: 2px solid #ff5a00; outline-offset: 3px; }
@media (forced-colors: active) {
    select:not([multiple]):not([size]), select[size="1"]:not([multiple]) { appearance: auto !important; -webkit-appearance: auto !important; background-image: none !important; }
}

/* Same dialog surface and backdrop as the public site. */
/* Load AFTER style.css. Includes existing Save / Exit / Category dialogs. */

.hk-save-comparison-dialog,
.hk-category-dialog {
    position: fixed;
    inset: 0;
    width: min(480px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 28px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background:
        linear-gradient(145deg, rgba(255, 90, 0, 0.065), transparent 50%), var(--hk-surface);
    color: var(--hk-text);
    border: 1px solid var(--hk-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.45);
}

.hk-save-comparison-dialog::backdrop,
.hk-category-dialog::backdrop {
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.hk-save-comparison-dialog h2 {
    margin-bottom: 12px;
    font-size: 1.5rem;
}

.hk-save-comparison-dialog p {
    color: var(--hk-text-muted);
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.hk-save-comparison-dialog p + p {
    margin-top: 12px;
}

.hk-save-comparison-dialog label {
    display: block;
    margin: 22px 0 8px;
    font-weight: 700;
}

.hk-save-comparison-dialog input {
    width: 100%;
    padding: 13px 14px;
    background: var(--hk-bg-deep);
    color: var(--hk-text);
    border: 1px solid var(--hk-border);
    border-radius: 12px;
}

.hk-save-comparison-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.hk-save-comparison-dialog :is(button, input):focus-visible,
.hk-category-dialog button:focus-visible {
    outline: 2px solid var(--hk-orange);
    outline-offset: 3px;
}

.hk-save-comparison-dialog button:disabled {
    opacity: 0.55;
    cursor: wait;
    transform: none;
}

.hk-save-comparison-dialog .hk-dialog-danger {
    color: #ffabab;
    border-color: #a94a4a;
}

.hk-save-comparison-dialog .hk-dialog-danger:hover {
    background: rgba(200, 50, 50, 0.12);
}

.hk-save-comparison-dialog .hk-save-comparison-error {
    color: #ffabab !important;
    margin-top: 12px;
}

.hk-save-comparison-error:empty {
    display: none;
}

@media (max-width: 500px) {
    .hk-save-comparison-dialog,
    .hk-category-dialog {
        padding: 22px;
    }

    .hk-save-comparison-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hk-save-comparison-actions .btn {
        width: 100%;
    }
}

.hk-admin-dialog, .hk-ui-dialog {
    --hk-surface: var(--surface); --hk-text: var(--text); --hk-text-muted: var(--muted);
    --hk-border: var(--border); --hk-bg-deep: var(--bg-deep); --hk-orange: var(--orange); --radius-lg: 22px;
    box-sizing: border-box;
}
dialog.hk-admin-dialog, dialog.hk-ui-dialog {
    position: fixed; inset: 0; margin: auto; width: min(480px, calc(100vw - 32px));
    max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); padding: 28px;
    background: linear-gradient(145deg, rgba(255,90,0,.065), transparent 50%), var(--surface);
    color: var(--text); border: 1px solid var(--border); border-radius: 22px;
    box-shadow: 0 25px 70px rgba(0,0,0,.45); overflow-y: auto;
}
dialog.hk-admin-dialog::backdrop, dialog.hk-ui-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.hk-ui-dialog p { white-space: pre-line; }
.hk-ui-dialog .btn { padding: 13px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-light); color: var(--text); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.hk-ui-dialog .btn-primary { background: var(--orange); border-color: var(--orange); }
.hk-ui-dialog .btn-primary:hover { background: var(--orange-hover); }
.hk-ui-dialog .hk-dialog-danger { color: #ffabab; border-color: #a94a4a; }
.hk-ui-dialog .hk-dialog-danger:hover { background: rgba(200,50,50,.12); }
.hk-admin-dialog :is(.hk-mail-actions, .hk-banner-actions, .hk-pages-actions) { justify-content: center; margin-top: 24px; }

/* Daily-work counters share one right edge; labels can wrap without crowding. */
.sidebar-nav-label { flex:1 1 auto;min-width:0;overflow-wrap:anywhere; }
.sidebar-count { display:inline-flex;align-items:center;justify-content:center;margin-left:auto;flex:0 0 auto;min-width:24px;padding:3px 6px;border-radius:6px;text-align:center;font-size:11px;line-height:1.3;font-variant-numeric:tabular-nums;color:var(--muted);background:rgba(255,255,255,.06); }
.sidebar-count.has-items { color:#ffae7a;background:rgba(255,90,0,.12); }
.sidebar-nav a:focus-visible,.sidebar-bottom a:focus-visible { outline:2px solid var(--orange);outline-offset:-2px; }
@media(max-width:950px){.sidebar-nav-label{white-space:nowrap}.sidebar-count{margin-left:4px}}
/* Optional destination field beside a password confirmation. */
.hk-ui-dialog .hk-dialog-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px}.hk-ui-dialog .hk-dialog-fields>div{min-width:0}.hk-ui-dialog .hk-dialog-fields label{display:block;margin:0 0 10px}.hk-ui-dialog .hk-dialog-fields input,.hk-ui-dialog .hk-dialog-fields select{box-sizing:border-box;width:100%;min-width:0;font:inherit;background:#0a1a2d;color:#fff;border:1px solid #29415c;border-radius:10px;padding:12px;margin:0}.hk-ui-dialog .hk-dialog-fields select:focus-visible{outline:2px solid #12c7a3;outline-offset:2px}@media(max-width:500px){.hk-ui-dialog .hk-dialog-fields{grid-template-columns:1fr}}

/* Shared list controls: match the specification-library search and security headings. */
.hk-admin-table-sort { display:inline-flex;align-items:center;gap:6px;padding:0;border:0;background:transparent;color:var(--muted);font:inherit;text-align:inherit;white-space:nowrap;cursor:pointer; }
.hk-admin-table-sort:hover,.hk-admin-table-sort.is-active { color:var(--orange);background:transparent; }
.hk-admin-table-sort:focus-visible { outline:2px solid var(--orange);outline-offset:4px; }
.hk-admin-table-filters { display:flex;flex-wrap:wrap;gap:16px;padding:18px 20px;border-bottom:1px solid var(--border); }
.hk-admin-table-filters label { display:grid;gap:8px;flex:1 1 180px;min-width:0;margin:0;font-size:13px; }
.hk-admin-table-filters select { width:100%;min-width:0;padding:11px 12px;border:1px solid var(--border);border-radius:10px;background:var(--bg-deep);color:var(--text);font:inherit; }
.spec-search-field input:focus,.hk-admin-table-filters select:focus-visible { border-color:var(--orange);outline:2px solid var(--orange);outline-offset:2px; }
[data-admin-table] tr[hidden] { display:none; }
