/* ============================================================
   ADMIN PANEL — Na Rychtě
   Component styles (sidebar/layout is in @layout.latte)
   ============================================================ */

:root {
    --admin-bg: #f4f1ec;
    --admin-card-bg: #ffffff;
    --admin-border: #e8e0d4;
    --admin-text: #3a2a1a;
    --admin-text-muted: #8a7a6a;
    --admin-gold: #c8a951;
    --admin-green: #2d8a4e;
    --admin-red: #c0392b;
    --admin-radius: 10px;
    --admin-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --admin-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ---- Cards ---- */
.admin-card {
    background: var(--admin-card-bg);
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--admin-border);
}

.admin-card-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

/* ---- Order Cards ---- */
.order-card {
    background: var(--admin-card-bg);
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
    margin-bottom: 16px;
    overflow: hidden;
    border-left: 4px solid transparent;
    transition: box-shadow 0.15s;
}

.order-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.order-card--new {
    border-left-color: var(--admin-gold);
}

.order-card--done {
    border-left-color: var(--admin-green);
    opacity: 0.85;
}

.order-card--done:hover {
    opacity: 1;
}

.order-card--rejected {
    border-left-color: #ef5350;
    opacity: 0.6;
}

.order-card--rejected:hover {
    opacity: 1;
}

/* Card header */
.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #faf7f2;
    border-bottom: 1px solid var(--admin-border);
}

.order-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.order-id {
    color: #b0a090;
    font-size: 13px;
    font-weight: 500;
}

.order-date {
    font-size: 12px;
    color: var(--admin-text-muted);
}

.order-card-total strong {
    font-size: 18px;
    color: var(--admin-gold);
    font-weight: 700;
}

/* Card body */
.order-card-body {
    padding: 16px 20px;
}

.order-card-customer {
    margin-bottom: 12px;
}

.order-customer-name {
    font-size: 16px;
    margin-bottom: 6px;
    color: var(--admin-text);
}

.order-customer-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    margin-bottom: 4px;
}

.order-phone-link,
.order-email-link {
    color: var(--admin-text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.order-phone-link:hover,
.order-email-link:hover {
    color: var(--admin-gold);
}

.order-customer-address {
    font-size: 13px;
    color: var(--admin-text-muted);
    margin-top: 4px;
}

.order-customer-note {
    font-size: 13px;
    color: #8d6e63;
    margin-top: 6px;
    font-style: italic;
}

/* Items section */
.order-card-items {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e8e0d4;
}

.order-items-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--admin-text-muted);
    margin-bottom: 8px;
}

.order-item-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 5px 0;
    font-size: 14px;
    border-bottom: 1px solid #f5f0e8;
}

.order-item-row:last-child {
    border-bottom: none;
}

.order-item-qty {
    font-weight: 700;
    color: var(--admin-gold);
    min-width: 30px;
}

.order-item-name {
    flex: 1;
    font-weight: 500;
    color: var(--admin-text);
}

.order-item-detail {
    color: var(--admin-text-muted);
    font-size: 12px;
}

.order-item-price {
    font-weight: 600;
    color: var(--admin-text);
    white-space: nowrap;
}

/* Card footer */
.order-card-footer {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: #faf7f2;
    border-top: 1px solid var(--admin-border);
}

/* ---- Badges ---- */
.order-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-new {
    background: #fff8e1;
    color: #b8860b;
    border: 1px solid #f0d060;
}

.badge-done {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #66bb6a;
}

.badge-rejected {
    background: #fce4ec;
    color: #b71c1c;
    border: 1px solid #ef5350;
}

/* ---- Action Buttons ---- */
.order-action-btn {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}

.order-action-done {
    background: #e8f5e9;
    color: #1b5e20;
}

.order-action-done:hover {
    background: #c8e6c9;
    color: #1b5e20;
}

.order-action-reject {
    background: #fce4ec;
    color: #b71c1c;
}

.order-action-reject:hover {
    background: #f8bbd0;
    color: #b71c1c;
}

.order-action-new {
    background: #f5f5f5;
    color: #555;
}

.order-action-new:hover {
    background: #e0e0e0;
    color: #333;
}

/* ---- Flash Messages ---- */
.flash {
    padding: 12px 18px;
    margin-bottom: 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.flash.success {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #c8e6c9;
}

.flash.error {
    background: #fce4ec;
    color: #b71c1c;
    border: 1px solid #f8bbd0;
}

.flash.info {
    background: #e3f2fd;
    color: #0d47a1;
    border: 1px solid #bbdefb;
}

.flash.warning {
    background: #fff8e1;
    color: #e65100;
    border: 1px solid #ffe082;
}

/* ---- Forms ---- */
form {
    max-width: 560px;
}

form label {
    display: block;
    font-weight: 500;
    font-size: 13px;
    color: var(--admin-text-muted);
    margin-bottom: 4px;
    margin-top: 16px;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form input[type="tel"],
form textarea,
form select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--admin-text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

form input:focus,
form textarea:focus,
form select:focus {
    outline: none;
    border-color: var(--admin-gold);
    box-shadow: 0 0 0 3px rgba(200, 169, 81, 0.15);
}

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

form select {
    appearance: auto;
    cursor: pointer;
}

form input[type="submit"],
form button[type="submit"],
.admin-btn {
    display: inline-block;
    padding: 10px 24px;
    margin-top: 20px;
    margin-right: 8px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}

form input[type="submit"].default,
form button[type="submit"],
.admin-btn-primary {
    background: var(--admin-gold);
    color: #fff;
}

form input[type="submit"].default:hover,
form button[type="submit"]:hover,
.admin-btn-primary:hover {
    background: #b89840;
    box-shadow: var(--admin-shadow);
}

form input[type="submit"]:not(.default) {
    background: #f0ebe3;
    color: var(--admin-text);
}

form input[type="submit"]:not(.default):hover {
    background: #e0d9ce;
}

/* ---- Old .grid table ---- */
table.grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--admin-card-bg);
    border-radius: var(--admin-radius);
    overflow: hidden;
    box-shadow: var(--admin-shadow);
}

table.grid th {
    text-align: left;
    padding: 12px 14px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--admin-text-muted);
    background: #faf7f2;
    border-bottom: 2px solid var(--admin-border);
}

/* Column widths – class-based for consistency across all tables */
table.grid .drag-col {
    width: 30px;
}

table.grid .col-weight {
    width: 80px;
    text-align: center;
}

table.grid .col-price {
    width: 90px;
    text-align: right;
}

table.grid td.col-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

table.grid .col-actions {
    width: 110px;
    text-align: right;
}

table.grid td.col-price {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

table.grid tr:hover {
    background: #fdf9f3;
}

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

table.grid a {
    margin-right: 8px;
    font-weight: 500;
}

/* ---- Login Page ---- */
.admin-login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f4f1ec;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(200, 169, 81, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(200, 169, 81, 0.08) 0%, transparent 40%),
        radial-gradient(ellipse at 60% 80%, rgba(44, 36, 24, 0.06) 0%, transparent 50%);
}

.admin-login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 48px 44px;
    width: 100%;
    max-width: 420px;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.06),
        0 12px 48px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(200, 169, 81, 0.15);
    position: relative;
}

.admin-login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--admin-gold), #e0c060);
    border-radius: 0 0 4px 4px;
}

.admin-login-card .login-brand {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--admin-text);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.admin-login-card .login-subtitle {
    text-align: center;
    font-size: 13px;
    color: var(--admin-text-muted);
    margin-bottom: 32px;
}

.admin-login-card h1 {
    display: none;
}

.admin-login-card form {
    max-width: none;
}

.admin-login-card form table,
.admin-login-card form table tbody,
.admin-login-card form table tr,
.admin-login-card form table td,
.admin-login-card form table th {
    display: block;
    width: 100%;
}

.admin-login-card form table tr {
    margin-bottom: 16px;
}

.admin-login-card form table td:first-child,
.admin-login-card form table th {
    padding-bottom: 6px;
}

.admin-login-card form label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--admin-text-muted);
    margin-top: 20px;
}

.admin-login-card form label:first-of-type {
    margin-top: 0;
}

.admin-login-card form input[type="text"],
.admin-login-card form input[type="password"] {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 15px;
    border: 1px solid #e0d9ce;
    background: #faf8f5;
    transition: all 0.2s;
}

.admin-login-card form input[type="text"]:focus,
.admin-login-card form input[type="password"]:focus {
    background: #fff;
    border-color: var(--admin-gold);
    box-shadow: 0 0 0 4px rgba(200, 169, 81, 0.12);
}

.admin-login-card form input[type="submit"] {
    width: 100%;
    margin-top: 28px;
    padding: 13px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--admin-gold), #b89840);
    color: #fff;
    border: none;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 12px rgba(200, 169, 81, 0.3);
    transition: all 0.2s;
}

.admin-login-card form input[type="submit"]:hover {
    background: linear-gradient(135deg, #b89840, #a08030);
    box-shadow: 0 6px 20px rgba(200, 169, 81, 0.4);
    transform: translateY(-1px);
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
    .admin-content h1 {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .admin-content h2 {
        font-size: 22px;
        text-align: center;
        margin: 22px 0 12px;
    }

    .admin-content h3 {
        font-size: 18px;
        text-align: center;
        margin: 16px 0 8px;
    }

    /* Fix emoji action icons: keep compact */
    .action-link {
        font-size: 16px;
        line-height: 1;
        text-decoration: none;
    }

    /* ---------- Forms: full width, iOS zoom prevention ---------- */
    form {
        max-width: none;
    }

    form input[type="text"],
    form input[type="email"],
    form input[type="password"],
    form input[type="number"],
    form input[type="url"],
    form input[type="tel"],
    form input[type="date"],
    form textarea,
    form select {
        font-size: 16px !important;
        padding: 12px 14px;
    }

    form input[type="submit"],
    form button[type="submit"],
    .admin-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px;
        min-height: 48px;
    }

    form label {
        margin-top: 14px;
        font-size: 13px;
    }

    /* ---------- Tables: fit viewport, wrap names ---------- */
    table.grid {
        table-layout: fixed;
        width: 100%;
        font-size: 13px;
    }

    table.grid th,
    table.grid td {
        padding: 8px 6px;
        white-space: normal;
        word-break: break-word;
        overflow: hidden;
    }

    /* Fixed widths for utility columns */
    table.grid .drag-handle,
    table.grid .drag-col {
        width: 30px;
    }

    table.grid .col-weight {
        width: 50px;
        white-space: nowrap;
    }

    table.grid .col-price {
        width: 65px;
        white-space: nowrap;
    }

    table.grid .col-actions {
        width: 80px;
        white-space: nowrap;
    }

    /* Drag handle: bigger touch target */
    .drag-handle {
        font-size: 22px;
        padding: 14px 10px !important;
        min-width: 48px;
        min-height: 48px;
    }



    /* ---------- Cards ---------- */
    .admin-card {
        padding: 16px;
        margin-bottom: 16px;
    }

    /* ---------- Stat cards stacked ---------- */
    .admin-stats {
        flex-direction: column;
    }

    .admin-stat-card {
        min-width: auto;
    }

    /* ---------- Day pills ---------- */
    .admin-day-pills {
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    .day-pill {
        padding: 6px 14px;
        font-size: 13px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1.3;
    }

    /* ---------- Sub-navigation ---------- */
    .admin-subnav {
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE/Edge */
    }

    .admin-subnav::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari */
    }

    .admin-subnav-link {
        font-size: 13px;
        padding: 6px 12px;
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1.3;
    }

    /* ---------- Anchor navigation: compact strip ---------- */
    .print-section {
        display: none;
    }

    .menu-anchors {
        padding: 4px 8px;
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        scrollbar-width: none;
        -ms-overflow-style: none;
        display: flex;
        align-items: center;
    }

    .menu-anchors::-webkit-scrollbar {
        display: none;
    }

    .menu-anchors>strong {
        display: none;
    }

    .anchor-link {
        font-size: 11px;
        padding: 4px 8px;
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1.3;
    }

    .anchor-group {
        display: inline-flex;
        flex-wrap: nowrap;
        flex-shrink: 0;
        gap: 4px;
    }

    /* ---------- Section/category headers ---------- */
    .admin-content h2 {
        font-size: 17px;
    }

    .admin-content h3 {
        font-size: 14px;
    }

    /* ---------- Toast: safe area ---------- */
    .sort-flash {
        bottom: env(safe-area-inset-bottom, 24px);
        right: 12px;
        left: 12px;
        text-align: center;
    }

    /* ---------- Login card ---------- */
    .admin-login-card {
        margin: 16px;
        padding: 32px 24px;
    }

    /* ---------- Inline editing on mobile ---------- */
    .editable-cell input {
        font-size: 16px !important;
        padding: 8px 10px;
    }

    /* ---------- Print buttons: hide on mobile ---------- */
    .admin-content>div>strong:first-child:has(+ a),
    .admin-content>div>a[target="_blank"].btn-xs {
        font-size: 12px;
    }
}

/* ---- Stats summary row ---- */
.admin-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.admin-stat-card {
    flex: 1;
    min-width: 140px;
    background: var(--admin-card-bg);
    border-radius: var(--admin-radius);
    padding: 20px;
    box-shadow: var(--admin-shadow);
    text-align: center;
}

.admin-stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--admin-gold);
}

.admin-stat-card .stat-label {
    font-size: 12px;
    color: var(--admin-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ---- Counter badge ---- */
.admin-badge {
    display: inline-block;
    background: var(--admin-gold);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
}

/* ---- Sub-navigation (inside pages) ---- */
.admin-subnav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.admin-subnav-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    background: var(--admin-card-bg);
    color: var(--admin-text);
    border: 1px solid var(--admin-border);
    transition: all 0.15s;
}

.admin-subnav-link:hover {
    background: #f5f0e8;
    color: var(--admin-text);
}

.admin-subnav-link.accent {
    background: var(--admin-gold);
    color: #fff;
    border-color: var(--admin-gold);
}

.admin-subnav-link.accent:hover {
    background: #b89840;
    color: #fff;
}

/* ---- Day Pills ---- */
.admin-day-pills {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.day-pill {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: var(--admin-card-bg);
    color: var(--admin-text-muted);
    border: 1px solid var(--admin-border);
    transition: all 0.15s;
    text-decoration: none;
}

.day-pill:hover {
    background: #f5f0e8;
    color: var(--admin-text);
    border-color: #d5cbba;
}

.day-pill.active {
    background: var(--admin-gold);
    color: #fff;
    border-color: var(--admin-gold);
    box-shadow: 0 2px 8px rgba(200, 169, 81, 0.3);
}

/* ---- Empty state ---- */
.admin-empty-state {
    text-align: center;
    padding: 48px 24px;
    background: var(--admin-card-bg);
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
}

.admin-empty-state .empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.admin-empty-state p {
    color: var(--admin-text-muted);
    font-size: 15px;
    margin-bottom: 20px;
}

/* ---- Table action links ---- */
.table-actions {
    white-space: nowrap;
}

.action-link {
    display: inline-block;
    padding: 4px 10px;
    margin: 2px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s;
}

.action-link.edit {
    background: #e3f2fd;
    color: #1565c0;
}

.action-link.edit:hover {
    background: #bbdefb;
    color: #0d47a1;
}

.action-link.delete {
    background: #c62828;
    color: #fff;
}

.action-link.delete:hover {
    background: #b71c1c;
    color: #fff;
}

/* ---- Toggle Switch ---- */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
    vertical-align: middle;
    cursor: pointer;
    margin: 0 4px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 18px;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch input:checked+.toggle-slider {
    background: #4caf50;
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(16px);
}

/* ---- Inactive row ---- */
tr.inactive {
    opacity: 0.45;
}

tr.inactive td.editable-cell {
    text-decoration: line-through;
}

/* ---- Quill Text Editor ---- */
#quill-editor {
    min-height: 300px;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    font-size: 15px;
    line-height: 1.7;
}

#quill-toolbar {
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 8px 8px 0 0;
}

.editor-actions {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.save-status {
    font-size: 14px;
    transition: opacity 0.3s;
}

.save-status.is-ok {
    color: #2d7a3a;
}

.save-status.is-error {
    color: #c82828;
}

.text-slug-label {
    color: #888;
    font-size: 13px;
    margin-bottom: 16px;
}

.text-slug-label code {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
}

.action-link.edit {
    font-size: 14px;
    text-decoration: none;
}

/* ---- Text Image Upload ---- */
.text-image-section {
    margin-bottom: 24px;
}

.text-image-preview {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    margin-bottom: 12px;
    background: #fafafa;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 6px;
}

.no-image {
    color: #aaa;
    font-size: 14px;
}

.text-image-upload {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ---- Inline Add Row ---- */
.add-row {
    background: #f0faf0;
}

.add-row td {
    padding: 4px 6px !important;
}

.add-row td:last-child {
    text-align: right;
}

.add-row .add-field {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
}

.add-row .add-field:focus {
    border-color: var(--admin-accent, #4a90d9);
    outline: none;
}

.action-link.add {
    background: #2e7d32;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    line-height: 1;
}

.action-link.add:hover {
    background: #1b5e20;
    color: #fff;
}


/* ---- Content h1 ---- */
.admin-content h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: var(--admin-text);
}

/* ---- Menu anchor navigation ---- */
.menu-anchors {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: var(--admin-card-bg);
    border-radius: var(--admin-radius);
    border: 1px solid var(--admin-border);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.menu-anchors strong {
    font-size: 13px;
    color: var(--admin-text-muted);
}

.anchor-link {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    background: #f5f0e8;
    color: var(--admin-text);
    text-decoration: none;
    transition: all 0.15s;
}

.anchor-link:hover {
    background: var(--admin-gold);
    color: #fff;
}

.anchor-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.anchor-group+.anchor-group {
    margin-left: 4px;
    padding-left: 8px;
    border-left: 1px solid var(--admin-border);
}

.anchor-section {
    font-weight: 600;
}

.anchor-sub {
    font-size: 12px;
    padding: 3px 8px;
    background: #eee9df;
    color: var(--admin-text-muted);
}

.anchor-sub:hover {
    background: var(--admin-gold);
    color: #fff;
}

/* ---- Content h2/h3 scroll offset for sticky anchor bar ---- */
.admin-content h2[id],
.admin-content h3[id] {
    scroll-margin-top: 70px;
}

/* ---- Content h3 (category headers inside tables) ---- */
.admin-content h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--admin-text);
    margin: 24px 0 12px 0;
}

.admin-content h3:first-child {
    margin-top: 0;
}

/* ---- w400 column ---- */
.w400 {
    min-width: 250px;
}

/* ---- Drag & Drop (SortableJS) ---- */
.drag-col {
    width: 30px;
}

.drag-handle {
    cursor: grab;
    color: var(--admin-text-muted);
    font-size: 16px;
    text-align: center;
    user-select: none;
    width: 30px;
    padding: 10px 6px !important;
    transition: color 0.15s;
}

.drag-handle:hover {
    color: var(--admin-gold);
}

.drag-handle:active {
    cursor: grabbing;
}

.sortable-ghost {
    background: #fef9e7 !important;
    border: 2px dashed var(--admin-gold) !important;
    opacity: 0.6;
}

.sortable-chosen {
    background: #fffdf5 !important;
    box-shadow: 0 4px 16px rgba(200, 169, 81, 0.2);
}

.sortable-drag {
    opacity: 0.9;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Sort flash toast */
.sort-flash {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1b5e20;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.sort-flash.show {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Inline editing ---- */
.inline-editing td {
    position: relative;
}

.editable-cell {
    cursor: pointer;
    border-bottom: 1px dashed transparent;
    transition: border-color 0.15s;
}

.editable-cell:hover {
    border-bottom-color: var(--admin-gold);
}

.editable-cell input,
.editable-cell select {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid var(--admin-gold);
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    background: #fffdf5;
    box-shadow: 0 0 0 3px rgba(200, 169, 81, 0.12);
}

.editable-cell input:focus,
.editable-cell select:focus {
    outline: none;
    border-color: #b89840;
}

.inline-save-indicator {
    display: inline-block;
    color: #1b5e20;
    font-size: 11px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s;
    margin-left: 4px;
}

.inline-save-indicator.show {
    opacity: 1;
}

/* ---- Email badges ---- */
.email-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.email-badge.badge-ok {
    background: #e8f5e9;
    color: #2e7d32;
}

.email-badge.badge-warn {
    background: #fff3e0;
    color: #e65100;
}

.email-badge.badge-off {
    background: #fce4ec;
    color: #c62828;
}

/* Inactive sections in admin */
.btn-inactive {
    opacity: 0.5;
}

.section-inactive {
    color: #999;
}

.card-inactive {
    opacity: 0.5;
    pointer-events: none;
}

/* Food tag pills in admin */
.tags-row td {
    padding-top: 0 !important;
    padding-bottom: 8px !important;
    border-top: none !important;
}

.tags-row {
    background: transparent !important;
}

.food-tags-admin {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
    border: 1px solid #ddd;
    background: #f5f5f5;
    color: #999;
    transition: all 0.2s;
}

.tag-pill:hover {
    border-color: #aaa;
    color: #666;
}

.tag-pill.active {
    border-color: transparent;
    font-weight: 600;
}

/* Tag toggle button */
.tag-toggle-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 13px;
    position: relative;
    line-height: 1;
}

.tag-toggle-btn:hover {
    background: #f0f0f0;
}

.tag-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #e91e63;
    color: #fff;
    font-size: 10px;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}