:root {
    --sidebar-bg: #0b1220;
    --sidebar-border: rgba(255, 255, 255, 0.06);
    --primary: #0062ff;
    --primary-soft: #e8f0ff;
    --page-bg: #f3f5f9;
    --text-dark: #111827;
    --text-muted: #6b7280;
    --card-border: #e5e7eb;
    --project-blue: #0062ff;
    --project-red: #ef4444;
    --project-green: #22c55e;
    --project-orange: #f59e0b;
}

body {
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--page-bg);
    color: var(--text-dark);
}

/* Login */
.login-page {
    min-height: 100vh;
}

.login-hero {
    position: relative;
    min-height: 100vh;
    background: url("../img/login-bg.png") center center / cover no-repeat;
}

.login-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.55) 100%);
}

.login-hero-content {
    position: relative;
    z-index: 1;
    padding: 3rem;
    max-width: 32rem;
}

.login-hero-title {
    color: #fff;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    margin: 0;
}

.login-panel {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #fff;
}

.login-card {
    width: 100%;
    max-width: 28rem;
    border: 1px solid #eef2f7;
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.login-kicker {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.input-icon-wrap {
    position: relative;
}

.input-icon-wrap .form-control {
    padding-left: 2.75rem;
    padding-right: 2.75rem;
    min-height: 3rem;
    border-radius: 0.75rem;
    border-color: #d1d5db;
}

.input-icon-wrap .input-icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.input-icon-wrap .toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #9ca3af;
    padding: 0.25rem;
}

.btn-login {
    background: var(--primary);
    border-color: var(--primary);
    min-height: 3rem;
    border-radius: 0.75rem;
    font-weight: 600;
}

.btn-login:hover,
.btn-login:focus {
    background: #0054db;
    border-color: #0054db;
}

.login-footer-note {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eef2f7;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
}

/* Admin layout */
.admin-shell {
    min-height: 100vh;
    display: flex;
}

.admin-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    border-right: 1px solid var(--sidebar-border);
}

.admin-sidebar-nav {
    padding: 1.5rem 1rem;
    flex: 1;
}

.sidebar-section-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding: 0 0.75rem;
}

.sidebar-section-link {
    color: #fff;
    text-decoration: none;
}

.sidebar-subnav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
}

.sidebar-subnav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.75rem;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.15s ease;
}

.sidebar-subnav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: 0.75rem;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.sidebar-nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.sidebar-nav-link.active {
    background: rgba(0, 98, 255, 0.25);
    color: #fff;
}

.sidebar-dashboard-link {
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-version {
    padding: 1rem 1.25rem 1.5rem;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.875rem;
}

.admin-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.breadcrumb-kicker {
    color: #60a5fa;
    font-size: 0.875rem;
    margin-bottom: 0.15rem;
}

.page-title {
    color: var(--primary);
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

.admin-content {
    padding: 1.5rem 2rem 2rem;
}

.overview-card {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.overview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.overview-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.overview-subtitle {
    color: var(--text-muted);
    margin: 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge .dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--primary);
}

.project-card {
    display: block;
    border-radius: 0.9rem;
    padding: 1rem;
    height: 100%;
    border: 1px solid transparent;
}

.project-card-dynamic {
    background: color-mix(in srgb, var(--project-color) 5%, white);
    border-color: color-mix(in srgb, var(--project-color) 20%, white);
}

.project-card-dynamic .project-icon {
    background: var(--project-color);
    color: var(--project-contrast);
}

.project-card-dynamic .project-name {
    color: var(--project-heading);
}

.project-card-dynamic .project-label {
    display: -webkit-box;
    min-height: 2.6em;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.project-card-dynamic:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.project-card .project-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.85rem;
    font-size: 1.1rem;
}

.project-card .project-name {
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.project-card .project-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.project-card--blue {
    background: #f5f9ff;
    border-color: #dbeafe;
}

.project-card--blue .project-icon {
    background: #dbeafe;
    color: var(--project-blue);
}

.project-card--blue .project-name {
    color: var(--project-blue);
}

.project-card--red {
    background: #fff5f5;
    border-color: #fecaca;
}

.project-card--red .project-icon {
    background: #fee2e2;
    color: var(--project-red);
}

.project-card--red .project-name {
    color: var(--project-red);
}

.project-card--green {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.project-card--green .project-icon {
    background: #dcfce7;
    color: var(--project-green);
}

.project-card--green .project-name {
    color: var(--project-green);
}

.project-card--orange {
    background: #fffbeb;
    border-color: #fde68a;
}

.project-card--orange .project-icon {
    background: #fef3c7;
    color: var(--project-orange);
}

.project-card--orange .project-name {
    color: var(--project-orange);
}

.section-heading {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 1.75rem 0 1rem;
}

.agenda-card {
    display: block;
    width: 100%;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 0.9rem;
    padding: 1.25rem;
    height: 100%;
    color: inherit;
    text-decoration: none;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.agenda-card:hover {
    color: inherit;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    transform: translateY(-1px);
}

.agenda-card:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.22);
    outline-offset: 2px;
}

.agenda-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.85rem;
    font-size: 1.1rem;
}

.agenda-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.agenda-link {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-decoration: none;
}

/* Users */
.users-add-card {
    position: sticky;
    top: 1.5rem;
}

.users-card-icon,
.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
}

.users-card-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.user-avatar {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.users-table th {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom-color: var(--card-border);
    white-space: nowrap;
}

.users-table td {
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-bottom-color: #eef2f7;
}

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

.user-inactive td:first-child {
    opacity: 0.55;
}

.password-collapse {
    min-width: 18rem;
}

.password-input {
    max-width: 13rem;
}

/* Food database */
.food-search-wrap { position: relative; max-width: 52rem; }
.food-search-icon { position: absolute; z-index: 2; left: 1rem; top: 50%; transform: translateY(-50%); color: #9ca3af; }
.food-search-input { min-height: 3.25rem; padding-left: 2.75rem; border-radius: 0.8rem; }
.food-suggestions { position: absolute; z-index: 20; top: calc(100% + 0.4rem); left: 0; right: 0; overflow: hidden; max-height: 26rem; overflow-y: auto; background: #fff; border: 1px solid var(--card-border); border-radius: 0.8rem; box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14); }
.food-suggestion { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 1rem; text-align: left; background: #fff; border: 0; border-bottom: 1px solid #eef2f7; }
.food-suggestion:last-child { border-bottom: 0; }
.food-suggestion:hover, .food-suggestion:focus { background: #f8fafc; }
.food-suggestion strong, .food-suggestion small { display: block; }
.food-suggestion small { margin-top: 0.15rem; color: var(--text-muted); }
.food-suggestion-state { width: 0.55rem; height: 0.55rem; flex-shrink: 0; border-radius: 50%; background: #9ca3af; }
.food-suggestion-state.active { background: #22c55e; }
.food-suggestion-empty { padding: 1rem; color: var(--text-muted); }
.food-flags { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; padding: 1rem; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 0.75rem; }
.food-edit-empty { min-height: 24rem; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.food-edit-empty-icon { width: 3.5rem; height: 3.5rem; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 1rem; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 1.35rem; }
.food-types-table th { color: var(--text-muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.food-types-table td { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.food-type-new td { background: #f8fafc; }

/* Projects and project settings */
.empty-projects { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; border: 1px dashed #cbd5e1; border-radius: 0.85rem; background: #f8fafc; }
.empty-projects h3 { margin: 0 0 0.2rem; font-size: 1rem; }
.empty-projects p { margin: 0; color: var(--text-muted); }
.empty-projects .btn { margin-left: auto; white-space: nowrap; }
.empty-projects-icon { width: 2.75rem; height: 2.75rem; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 0.75rem; background: var(--primary-soft); color: var(--primary); font-size: 1.2rem; }

.project-topbar { position: relative; border-top: 4px solid var(--project-accent); }
.project-topbar .page-title { color: var(--project-heading, var(--primary)); }
.project-header-icon, .project-header-brand { width: 2.75rem; height: 2.75rem; flex-shrink: 0; border-radius: 0.75rem; }
.project-header-icon { display: inline-flex; align-items: center; justify-content: center; background: var(--project-accent); color: var(--project-accent-contrast); }
.project-header-brand { object-fit: cover; border: 1px solid var(--card-border); }

.project-navigation { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.65rem; margin-bottom: 1.5rem; padding: 0.5rem; background: #fff; border: 1px solid var(--card-border); border-radius: 0.9rem; }
.project-navigation-link { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem; border-radius: 0.65rem; color: var(--text-muted); text-decoration: none; font-weight: 600; text-align: center; }
.project-navigation-link:hover { color: var(--project-accent); background: color-mix(in srgb, var(--project-accent) 7%, white); }
.project-navigation-link.active { color: var(--project-accent-contrast); background: var(--project-accent); }

.project-placeholder { min-height: 24rem; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.project-placeholder h2 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.project-placeholder > p { color: var(--text-muted); }
.project-placeholder-icon { width: 4rem; height: 4rem; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 1rem; border-radius: 1rem; color: var(--project-accent); background: color-mix(in srgb, var(--project-accent) 12%, white); font-size: 1.5rem; }
.project-description-preview { max-width: 42rem; padding: 1rem 1.25rem; border-radius: 0.75rem; background: #f8fafc; color: #475569; }

.settings-section-title { margin: 0 0 1.25rem; font-size: 1.05rem; font-weight: 700; }
.settings-switches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.settings-switch { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1rem; border: 1px solid var(--card-border); border-radius: 0.75rem; cursor: pointer; }
.settings-switch .form-check { margin: 0; min-height: auto; }
.settings-switch .form-check-input { margin: 0; }
.deadline-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.deadline-fields small { display: block; margin-top: 0.3rem; color: var(--text-muted); }
.payment-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.settings-subsection-title { margin: 0 0 1rem; font-size: 1rem; font-weight: 700; }
.api-key-status, .api-key-empty { display: flex; align-items: center; gap: 0.55rem; padding: 0.75rem; border-radius: 0.65rem; }
.api-key-status { color: #15803d; background: #f0fdf4; border: 1px solid #bbf7d0; }
.api-key-empty { color: #64748b; background: #f8fafc; border: 1px solid var(--card-border); }
.customer-form-card { position: sticky; top: 1.5rem; }
.customers-context-navigation { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: -0.75rem; }
.customer-switches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.company-fields { padding: 1rem; background: #f8fafc; border: 1px solid var(--card-border); border-radius: 0.75rem; }
.customer-search { display: flex; align-items: center; gap: 0.6rem; position: relative; }
.customer-search > i { position: absolute; left: 1rem; color: #94a3b8; pointer-events: none; }
.customer-search .form-control { padding-left: 2.65rem; min-height: 2.75rem; }
.customer-table { min-width: 780px; }
.customer-table th { white-space: nowrap; }
.customer-inactive { opacity: 0.62; }
.customer-empty { display: flex; align-items: center; justify-content: center; gap: 0.65rem; padding: 2.5rem 1rem; color: var(--text-muted); }
.customer-balance-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.customer-balance-grid > div { padding: 0.8rem; border: 1px solid var(--card-border); border-radius: 0.65rem; background: #f8fafc; }
.customer-balance-grid span { display: block; min-height: 2.2em; color: var(--text-muted); font-size: 0.78rem; line-height: 1.15; }
.customer-balance-grid strong { display: block; margin-top: 0.35rem; font-size: 1.05rem; }
.customer-balance-grid .balance-due { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.customer-balance-grid .balance-credit { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.customer-payments-list { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--card-border); }
.customer-payment-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid #eef2f7; }
.customer-payment-item:last-child { padding-bottom: 0; border-bottom: 0; }
.customer-payment-item span, .customer-payment-item a { display: block; margin-top: 0.2rem; color: var(--text-muted); font-size: 0.8rem; }
.customer-payment-item a { color: var(--primary); text-decoration: none; }
.customer-payment-item a:hover { text-decoration: underline; }
.customer-payments-empty { display: flex; align-items: center; gap: 0.6rem; padding: 1rem; border-radius: 0.65rem; color: var(--text-muted); background: #f8fafc; }
.payment-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; align-items: end; }
.payment-filter-grid .form-label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); }
.payment-filter-actions { display: flex; gap: 0.5rem; }
.payment-table { min-width: 1250px; }
.payment-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.payment-summary-grid > div { padding: 0.9rem; border: 1px solid var(--card-border); border-radius: 0.7rem; background: #f8fafc; }
.payment-summary-grid span, .payment-allocation-preview span { display: block; color: var(--text-muted); font-size: 0.78rem; }
.payment-summary-grid strong { display: block; margin-top: 0.25rem; font-size: 1.05rem; }
.payment-allocation-preview { display: flex; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; border-bottom: 1px solid #eef2f7; }
.payment-allocation-preview:last-of-type { border-bottom: 0; }
.order-filter-actions { display: flex; gap: 0.5rem; }
.orders-context-navigation { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: -0.75rem; }
.order-filter-form .form-label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.date-filter-switch .btn { display: flex; align-items: center; justify-content: center; padding-left: 0.55rem; padding-right: 0.55rem; font-size: 0.82rem; }
.order-table { min-width: 850px; }
.orders-report-filter .form-label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.orders-report-period { white-space: nowrap; }
.orders-report-table { min-width: 520px; }
.order-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.order-detail-grid > div { padding: 0.85rem; background: #f8fafc; border-radius: 0.65rem; }
.order-detail-grid span, .detail-label { display: block; margin-bottom: 0.25rem; color: var(--text-muted); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.order-payment-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid var(--card-border); }
.order-payment-row:last-child { border-bottom: 0; }
.payment-option { cursor: pointer; }
.payment-option input { position: absolute; opacity: 0; pointer-events: none; }
.payment-option span { display: flex; align-items: center; gap: 0.65rem; padding: 0.9rem 1rem; border: 1px solid var(--card-border); border-radius: 0.75rem; color: #475569; }
.payment-option input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }

.color-picker-wrap { display: flex; align-items: center; gap: 0.75rem; }
.color-picker-wrap input[type="color"] { width: 3rem; height: 2.4rem; padding: 0.2rem; border: 1px solid #d1d5db; border-radius: 0.5rem; background: #fff; }
.color-presets { display: flex; gap: 0.55rem; margin-top: 0.75rem; }
.color-presets button { width: 1.65rem; height: 1.65rem; padding: 0; border: 3px solid #fff; border-radius: 50%; outline: 1px solid #d1d5db; background: var(--preset-color); }
.brand-preview { height: 10rem; margin-bottom: 0.75rem; overflow: hidden; border-radius: 0.75rem; border: 1px solid var(--card-border); background: #f8fafc; }
.brand-preview img { width: 100%; height: 100%; object-fit: contain; }
.settings-side-card, .settings-save-panel { position: sticky; top: 1.5rem; }
.settings-save-panel { top: 25rem; padding: 1rem; border: 1px solid var(--card-border); border-radius: 0.9rem; background: #fff; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06); }

.rich-editor-toolbar { display: flex; align-items: center; gap: 0.3rem; padding: 0.45rem; border: 1px solid #d1d5db; border-bottom: 0; border-radius: 0.65rem 0.65rem 0 0; background: #f8fafc; }
.rich-editor-toolbar button { width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 0.35rem; background: transparent; color: #475569; }
.rich-editor-toolbar button:hover { background: #e2e8f0; }
.rich-editor-toolbar span { width: 1px; height: 1.25rem; margin: 0 0.2rem; background: #d1d5db; }
.rich-editor { min-height: 12rem; padding: 0.85rem; border: 1px solid #d1d5db; border-radius: 0 0 0.65rem 0.65rem; background: #fff; outline: none; }
.rich-editor:empty::before { content: attr(data-placeholder); color: #9ca3af; }

/* Project menu calendar and daily editor */
.project-menu-layout { display: grid; grid-template-columns: 19rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.menu-calendar-card { position: sticky; top: 1.5rem; padding: 1rem; }
.calendar-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 1rem; }
.calendar-heading h2 { margin: 0; font-size: 1rem; font-weight: 700; text-transform: capitalize; }
.calendar-nav { width: 2rem; height: 2rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 0.5rem; color: #475569; text-decoration: none; }
.calendar-nav:hover { background: #f1f5f9; color: var(--primary); }
.menu-calendar-weekdays, .menu-calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.25rem; }
.menu-calendar-weekdays { margin-bottom: 0.35rem; }
.menu-calendar-weekdays span { padding: 0.25rem 0; color: #94a3b8; font-size: 0.7rem; font-weight: 700; text-align: center; text-transform: uppercase; }
.calendar-day { position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 0.55rem; color: #334155; font-size: 0.82rem; text-decoration: none; }
.calendar-day:not(.blank):hover { background: #eff6ff; color: var(--primary); }
.calendar-day.weekend { color: #94a3b8; }
.calendar-day.has-menu { background: #ecfdf3; color: #166534; font-weight: 700; }
.calendar-day.has-menu i { position: absolute; bottom: 0.22rem; width: 0.28rem; height: 0.28rem; border-radius: 50%; background: #22c55e; }
.calendar-day.today { border-color: #93c5fd; }
.calendar-day.selected { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 4px 12px rgba(0, 98, 255, 0.22); }
.calendar-day.selected i { background: #fff; }
.calendar-legend { margin-top: 1rem; padding-top: 0.8rem; border-top: 1px solid #eef2f7; color: var(--text-muted); font-size: 0.75rem; }
.calendar-legend span { display: flex; align-items: center; gap: 0.45rem; }
.calendar-legend i { width: 0.55rem; height: 0.55rem; border-radius: 0.2rem; background: #dcfce7; border: 1px solid #86efac; }

.menu-day-card { min-width: 0; }
.menu-day-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; padding-bottom: 1.25rem; border-bottom: 1px solid #eef2f7; }
.menu-day-header h2 { margin: 0; font-size: 1.35rem; }
.menu-food-search { position: relative; margin-bottom: 1.5rem; }
.menu-food-search .food-search-wrap { max-width: none; }
.menu-items { display: flex; flex-direction: column; gap: 0.65rem; }
.menu-item { display: grid; grid-template-columns: 2rem minmax(12rem, 1fr) 8.5rem auto 2rem; align-items: center; gap: 0.75rem; padding: 0.8rem; border: 1px solid var(--card-border); border-radius: 0.75rem; background: #fff; transition: box-shadow 0.15s ease, opacity 0.15s ease; }
.menu-item.dragging { opacity: 0.45; box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14); }
.menu-drag-handle, .menu-remove-item { width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 0.45rem; background: transparent; color: #94a3b8; }
.menu-drag-handle { cursor: grab; font-size: 1.15rem; }
.menu-drag-handle:active { cursor: grabbing; }
.menu-remove-item:hover { background: #fef2f2; color: #dc2626; }
.menu-item-main { min-width: 0; }
.menu-item-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item-main span { display: inline-block; margin-top: 0.2rem; color: var(--text-muted); font-size: 0.76rem; }
.menu-item-price label { display: block; margin-bottom: 0.2rem; color: var(--text-muted); font-size: 0.7rem; font-weight: 600; }
.menu-price-actions { display: flex; flex-direction: column; gap: 0.25rem; }
.menu-price-actions button { padding: 0; border: 0; background: transparent; color: var(--primary); font-size: 0.72rem; text-align: left; white-space: nowrap; }
.menu-price-actions button:hover { text-decoration: underline; }
.menu-items-empty { min-height: 9rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.55rem; margin-top: 0.5rem; border: 1px dashed #cbd5e1; border-radius: 0.75rem; color: #94a3b8; }
.menu-items-empty i { font-size: 1.4rem; }
.menu-information-section { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid #eef2f7; }
.menu-information-section .rich-editor { min-height: 8rem; }
.menu-save-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.5rem -1.5rem -1.5rem; padding: 1rem 1.5rem; border-top: 1px solid var(--card-border); border-radius: 0 0 1rem 1rem; background: #f8fafc; }
.menu-save-bar span { color: var(--text-muted); font-size: 0.85rem; }
.menu-readonly-empty { min-height: 20rem; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #94a3b8; text-align: center; }
.menu-readonly-empty i { margin-bottom: 0.75rem; font-size: 2rem; }
.menu-readonly-empty h3 { font-size: 1rem; }
.menu-readonly-information { margin-bottom: 1rem; padding: 1rem; border-left: 4px solid var(--primary); border-radius: 0.4rem; background: #eff6ff; }
.menu-readonly-items { display: flex; flex-direction: column; }
.menu-readonly-items > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; border-bottom: 1px solid #eef2f7; }
.menu-readonly-items > div:last-child { border-bottom: 0; }
.menu-readonly-items strong, .menu-readonly-items small { display: block; }
.menu-readonly-items small { margin-top: 0.15rem; color: var(--text-muted); }
.menu-readonly-items b { white-space: nowrap; }

@media (max-width: 991.98px) {
    .admin-shell {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        min-height: auto;
    }

    .login-hero {
        min-height: 40vh;
    }

    .login-panel {
        min-height: auto;
    }

    .project-navigation { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .settings-side-card, .settings-save-panel { position: static; }
    .project-menu-layout { grid-template-columns: 1fr; }
    .menu-calendar-card { position: static; max-width: 28rem; width: 100%; }
    .payment-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575.98px) {
    .project-navigation, .settings-switches, .payment-options, .deadline-fields { grid-template-columns: 1fr; }
    .empty-projects { align-items: flex-start; flex-wrap: wrap; }
    .empty-projects .btn { width: 100%; margin-left: 0; }
    .menu-item { grid-template-columns: 1.75rem minmax(0, 1fr) 2rem; }
    .menu-item-price { grid-column: 2 / 3; }
    .menu-price-actions { grid-column: 2 / 3; flex-direction: row; gap: 0.75rem; }
    .menu-remove-item { grid-column: 3; grid-row: 1; }
    .menu-save-bar { align-items: stretch; flex-direction: column; }
    .menu-save-bar .btn { width: 100%; }
    .payment-filter-grid, .payment-summary-grid { grid-template-columns: 1fr; }
    .payment-filter-actions .btn { flex: 1; }
}

@media (max-width: 575.98px) {
    .order-detail-grid { grid-template-columns: 1fr; }
    .order-filter-actions .btn { flex: 1; }
}
