/* DigiMenu Admin — matches example2.html / digital menu app theme */

:root {
    --font-sans: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --fw-normal: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    /* App "bold" tier = semi-bold for calmer UI (avoid 700 everywhere) */
    --fw-bold: 600;
    --bg-body: #f8f9fa;
    --bg-white: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --primary: #f97316;
    --primary-light: #ffedd5;
    --primary-dark: #ea580c;
    --border-light: #f3f4f6;
    --success: #10b981;
    --danger: #ef4444;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --sidebar-width: 260px;
}

::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.admin-body {
    font-family: var(--font-sans);
    font-weight: var(--fw-normal);
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow: hidden;
}

strong,
b {
    font-weight: var(--fw-semibold);
}

svg {
    width: 100%;
    height: 100%;
    display: block;
}
.w-5 {
    width: 20px;
    height: 20px;
}
.w-6 {
    width: 24px;
    height: 24px;
}

button,
input,
textarea {
    font-family: inherit;
    border: none;
    outline: none;
    background: none;
}
button {
    cursor: pointer;
}

a {
    color: var(--primary-dark);
}

/* ========== Layout ========== */
.admin-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background-color: var(--bg-white);
    border-right: 1px solid var(--border-light);
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}
.sidebar.active {
    transform: translateX(0);
}

@media (min-width: 768px) {
    .sidebar-overlay {
        display: none;
    }
    .sidebar {
        position: relative;
        transform: translateX(0);
        box-shadow: none;
    }
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-light);
}
.brand-icon {
    background-color: var(--primary);
    color: white;
    padding: 8px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-header h2 {
    font-size: 20px;
    font-weight: var(--fw-bold);
    letter-spacing: -0.5px;
}

.nav-menu {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-weight: var(--fw-semibold);
    font-size: 14px;
    color: var(--text-muted);
    transition: all 0.2s;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}
.nav-item:hover {
    background-color: var(--bg-body);
    color: var(--text-main);
}
.nav-item.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}
.nav-item svg {
    flex-shrink: 0;
    stroke: currentColor;
}
.nav-item.active svg {
    stroke: white;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    min-width: 0;
}

.topbar {
    height: 70px;
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
    gap: 12px;
}
.hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background-color: var(--bg-body);
    border-radius: var(--radius-md);
    color: var(--text-main);
    border: none;
    cursor: pointer;
}
@media (min-width: 768px) {
    .hamburger {
        display: none;
    }
}
.topbar-title {
    font-size: 18px;
    font-weight: var(--fw-bold);
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.admin-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-body);
    padding: 6px 12px 6px 6px;
    border-radius: var(--radius-full);
    font-weight: var(--fw-semibold);
    font-size: 14px;
    color: var(--text-main);
}
.admin-avatar {
    width: 32px;
    height: 32px;
    background-color: var(--primary-dark);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--fw-bold);
    font-size: 13px;
}
.logout-link {
    font-size: 13px;
    font-weight: var(--fw-semibold);
    color: var(--text-muted);
    text-decoration: none;
}
.logout-link:hover {
    color: var(--primary-dark);
}

.content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    padding-bottom: 48px;
}

.content-inner {
    max-width: 960px;
    margin: 0 auto;
}

/* ========== Stats ========== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
@media (min-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
.stat-card {
    background-color: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}
.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon.orange {
    background: var(--primary-light);
    color: var(--primary-dark);
}
.stat-icon.green {
    background: #dcfce7;
    color: #166534;
}
.stat-icon.blue {
    background: #dbeafe;
    color: #1e40af;
}
.stat-info h3 {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
    font-weight: var(--fw-semibold);
}
.stat-info p {
    font-size: 24px;
    font-weight: var(--fw-bold);
    color: var(--text-main);
}

/* ========== Section header ========== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.section-title {
    font-size: 20px;
    font-weight: var(--fw-bold);
}

.btn-primary {
    background-color: var(--text-main);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: var(--fw-bold);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.1s;
    font-family: inherit;
}
.btn-primary:hover {
    opacity: 0.92;
    color: white;
}
.btn-primary:active {
    transform: scale(0.97);
}
.btn-primary svg {
    flex-shrink: 0;
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-main);
    border: 1px solid var(--border-light);
    padding: 10px 18px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: var(--fw-semibold);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-secondary:hover {
    background: var(--bg-body);
    color: var(--text-main);
}

/* ========== List rows (menus / orders style) ========== */
.admin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.admin-list-item {
    background-color: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}
@media (min-width: 640px) {
    .admin-list-item {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.menu-row-meta {
    flex: 1;
    min-width: 0;
}
.menu-row-meta h3 {
    font-size: 16px;
    font-weight: var(--fw-bold);
    margin-bottom: 4px;
}
.menu-row-meta .slug-pill {
    display: inline-block;
    font-family: ui-monospace, monospace;
    font-size: 12px;
    font-weight: var(--fw-semibold);
    color: var(--primary-dark);
    background: var(--primary-light);
    padding: 4px 10px;
    border-radius: 8px;
    margin-bottom: 8px;
}
.menu-row-meta a.public-link {
    font-size: 13px;
    font-weight: var(--fw-semibold);
    color: var(--primary-dark);
    text-decoration: none;
}
.menu-row-meta a.public-link:hover {
    text-decoration: underline;
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.btn-ghost {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: var(--fw-bold);
    background: var(--bg-body);
    color: var(--text-main);
    text-decoration: none;
    border: 1px solid var(--border-light);
}
.btn-ghost:hover {
    background: var(--border-light);
    color: var(--text-main);
}

.btn-text-danger {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 13px;
    font-weight: var(--fw-bold);
    cursor: pointer;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-family: inherit;
}
.btn-text-danger:hover {
    background: #fef2f2;
}

/* ========== Forms / panels (menu editor) ========== */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: var(--fw-semibold);
    margin-bottom: 20px;
}
.flash-success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}
.flash-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.panel {
    background: var(--bg-white);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.panel h2 {
    font-size: 18px;
    font-weight: var(--fw-bold);
    margin-bottom: 16px;
}

.field {
    margin-bottom: 16px;
}
.field label,
.panel label.field-label {
    display: block;
    font-size: 13px;
    font-weight: var(--fw-semibold);
    color: var(--text-muted);
    margin-bottom: 8px;
}
.panel input[type="text"],
.panel input[type="number"],
.panel input[type="password"],
.panel textarea,
.panel select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-body);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    font-weight: var(--fw-medium);
    font-size: 14px;
    color: var(--text-main);
}
.panel textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}
.panel input:focus,
.panel textarea:focus {
    background: var(--bg-white);
    border-color: #fdba74;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}

.cat-block input[type="text"],
.cat-block input[type="number"],
.cat-block textarea,
.item-edit-card input[type="text"],
.item-edit-card textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-body);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    font-weight: var(--fw-medium);
    font-size: 14px;
    color: var(--text-main);
}
.cat-block textarea,
.item-edit-card textarea {
    font-family: inherit;
    min-height: 70px;
}
.cat-block input:focus,
.cat-block textarea:focus,
.item-edit-card input:focus,
.item-edit-card textarea:focus {
    background: var(--bg-white);
    border-color: #fdba74;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}

.row-2 {
    display: grid;
    gap: 16px;
}
@media (min-width: 640px) {
    .row-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 6px;
    line-height: 1.4;
}

/* Professional image upload (menu logo + item dialog) */
.menu-logo-field .image-upload-wrap,
.item-image-field .image-upload-wrap {
    margin-top: 8px;
    position: relative;
    width: 100%;
    max-width: none;
}
.upload-area-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
}
.menu-logo-field .upload-area,
.item-image-field .upload-area {
    width: 100%;
    height: 220px;
    border: 2px dashed #d1d5db;
    border-radius: var(--radius-lg);
    background-color: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    padding: 20px;
    box-sizing: border-box;
    outline: none;
}
.menu-logo-field .upload-area:hover,
.item-image-field .upload-area:hover {
    background-color: var(--primary-light);
    border-color: var(--primary);
    transform: scale(1.01);
}
.menu-logo-field .upload-area.has-image,
.item-image-field .upload-area.has-image {
    border: 1px solid var(--border-light);
    background: var(--bg-white);
    padding: 0;
    transform: none;
}
.menu-logo-field .upload-area.has-image:hover,
.item-image-field .upload-area.has-image:hover {
    transform: none;
}
.menu-logo-field .upload-area.is-dragover,
.item-image-field .upload-area.is-dragover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.01);
}
.menu-logo-field .upload-area:focus-visible,
.item-image-field .upload-area:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}
.menu-logo-field .upload-placeholder,
.item-image-field .upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-light);
    gap: 12px;
    transition: transform 0.3s ease;
}
.menu-logo-field .upload-area:hover .upload-placeholder,
.item-image-field .upload-area:hover .upload-placeholder {
    transform: translateY(-5px);
}
.menu-logo-field .upload-area.has-image .upload-placeholder,
.item-image-field .upload-area.has-image .upload-placeholder {
    display: none;
}
.upload-icon-circle {
    width: 64px;
    height: 64px;
    background-color: var(--bg-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    color: var(--primary);
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.menu-logo-field .upload-area:hover .upload-icon-circle,
.item-image-field .upload-area:hover .upload-icon-circle {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(249, 115, 22, 0.3);
}
.upload-plus-icon {
    width: 32px;
    height: 32px;
    display: block;
}
.upload-placeholder-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.upload-placeholder-title {
    display: block;
    font-size: 16px;
    font-weight: var(--fw-bold);
    color: var(--text-main);
    margin: 0;
}
.upload-placeholder-sub {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: var(--fw-medium);
    margin: 0;
}
.menu-logo-field .image-preview-wrapper,
.item-image-field .image-preview-wrapper {
    width: 100%;
    height: 100%;
    min-height: 220px;
    position: relative;
    background-color: var(--bg-white);
}
.menu-logo-field .image-preview-wrapper img,
.item-image-field .image-preview-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.upload-actions-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 16px;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.menu-logo-field .upload-area.has-image:hover .upload-actions-overlay,
.item-image-field .upload-area.has-image:hover .upload-actions-overlay {
    opacity: 1;
}
.upload-actions-overlay .btn-action {
    pointer-events: auto;
}
.btn-action {
    padding: 10px 18px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: var(--fw-bold);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s;
}
.btn-action:active {
    transform: scale(0.95);
}
.btn-action svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.btn-replace {
    background: white;
    color: var(--text-main);
}
.btn-remove {
    background: var(--danger);
    color: white;
}
.upload-area-status {
    margin-top: 8px;
    min-height: 0;
}
.admin-dialog .item-image-field .image-upload-wrap {
    max-width: none;
}
@media (hover: none) {
    .menu-logo-field .upload-area.has-image .upload-actions-overlay,
    .item-image-field .upload-area.has-image .upload-actions-overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.06);
    }
}
.btn-submit {
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: var(--fw-bold);
    border: none;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}
.btn-submit:hover {
    background: var(--primary-dark);
}
.btn-submit-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-outline-danger {
    background: var(--bg-white);
    color: var(--danger);
    border: 1px solid #fecaca;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: var(--fw-bold);
    cursor: pointer;
    font-family: inherit;
}
.btn-outline-danger:hover {
    background: #fef2f2;
}

.cat-block {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
}
.cat-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.cat-head strong {
    font-size: 17px;
    font-weight: var(--fw-bold);
}

details.cat-details {
    margin-bottom: 16px;
}
details.cat-details summary {
    cursor: pointer;
    font-weight: var(--fw-bold);
    font-size: 14px;
    color: var(--text-muted);
    padding: 8px 0;
}
details.cat-details summary:hover {
    color: var(--primary-dark);
}

.table-items-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}
table.items {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
    background: var(--bg-white);
}
table.items th,
table.items td {
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}
table.items th {
    background: #fafafa;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: var(--fw-bold);
    text-align: left;
}
table.items tr:last-child td {
    border-bottom: none;
}

.empty-hint {
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    padding: 40px 20px;
}
.empty-hint a {
    font-weight: var(--fw-bold);
}

/* ========== Login page ========== */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-body);
    font-family: var(--font-sans);
    font-weight: var(--fw-normal);
    overflow: auto;
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-white);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}
.login-brand h1 {
    font-size: 22px;
    font-weight: var(--fw-bold);
}
.login-card .field {
    margin-bottom: 18px;
}

.item-edit-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    background: #fafafa;
}
.item-edit-card .item-thumb {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--border-light);
}
.item-edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}
@media (max-width: 639px) {
    .item-edit-actions form {
        width: 100%;
    }
}

/* Icon library picker */
.icon-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 10px;
    margin-top: 8px;
}
.icon-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-size: 10px;
    font-weight: var(--fw-semibold);
    color: var(--text-muted);
    text-align: center;
    line-height: 1.2;
}
.icon-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.icon-option .icon-preview {
    width: 32px;
    height: 32px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
}
.icon-option:has(input:focus-visible) {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.icon-option:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}
@supports not selector(:has(*)) {
    .icon-option input:checked + .icon-preview,
    .icon-option input:checked ~ .icon-label {
        /* fallback: rely on border via small JS if needed */
    }
}

/* Native dialog (item editor) — viewport center, scroll inner */
.admin-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    border: none;
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 520px;
    width: min(92vw, 520px);
    max-height: min(90vh, 720px);
    box-shadow: var(--shadow-lg);
    background: var(--bg-white);
    z-index: 10000;
}
.admin-dialog::backdrop {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
}
.dialog-inner {
    padding: 24px;
    max-height: min(90vh, 720px);
    overflow-y: auto;
    box-sizing: border-box;
}
.dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}
.dialog-head h3 {
    font-size: 18px;
    font-weight: var(--fw-bold);
    margin: 0;
}
.dialog-close {
    padding: 8px;
    border-radius: var(--radius-full);
    background: var(--bg-body);
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    line-height: 0;
}
.dialog-close:hover {
    background: var(--border-light);
    color: var(--text-main);
}
.dialog-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}
.item-dialog-form .dialog-fields {
    margin-bottom: 4px;
}
.item-dialog-form .dialog-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-body);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    font-weight: var(--fw-medium);
    font-size: 14px;
    color: var(--text-main);
    box-sizing: border-box;
}
.item-dialog-form .dialog-textarea {
    min-height: 88px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.45;
}
.item-dialog-form .dialog-input:focus {
    outline: none;
    background: var(--bg-white);
    border-color: #fdba74;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}
.item-image-field {
    margin-bottom: 4px;
}
.item-row-compact {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.item-row-compact img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--border-light);
}
.item-row-meta {
    flex: 1;
    min-width: 140px;
}
.item-row-meta .item-title {
    font-weight: var(--fw-bold);
    font-size: 14px;
    margin-bottom: 2px;
}
.item-row-meta .item-price {
    font-size: 13px;
    font-weight: var(--fw-bold);
    color: var(--primary-dark);
}
.item-row-actions {
    display: flex;
    gap: 8px;
}
.btn-small-dark {
    background: var(--text-main);
    color: #fff;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: var(--fw-bold);
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.btn-small-dark:hover {
    opacity: 0.92;
}
.divider-or {
    text-align: center;
    font-size: 11px;
    font-weight: var(--fw-bold);
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 12px 0;
}
.danger-zone {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px dashed #fecaca;
}

.item-extras-builder {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.extras-groups-root {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 10px;
    max-height: 280px;
    overflow-y: auto;
}

.extras-group-card {
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-body);
}

.extras-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.extras-group-title {
    font-size: 12px;
    font-weight: var(--fw-bold);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.extras-options-host {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0;
}

.extras-option-card {
    padding: 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    border: 1px dashed #e5e7eb;
}

.extras-inline-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.extras-inline-row .dialog-input {
    flex: 1;
    min-width: 100px;
}

.extras-subaddons {
    margin-top: 10px;
    padding-left: 8px;
    border-left: 2px solid var(--primary-light);
}

.extras-subrow {
    margin-bottom: 6px;
}

.extras-item-addons-block {
    margin-top: 4px;
}
