/* ============================================================
   APP.CSS — Minimalist SaaS Design (Apple-inspired)
   Cores: preto/branco + accent colors (azul, verde, vermelho)
   Bordas: rgba(0,0,0,0.1) | Sombras sutis | Border-radius: 10px
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    color: var(--color-primary);
    background: #F8F8FA;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* --- App Layout --- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin var(--transition);
}

.app-content {
    flex: 1;
    padding: 28px 32px;
    max-width: 1400px;
    width: 100%;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    background: #FFFFFF;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition);
    overflow: hidden;
}

.sidebar-header {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo img {
    height: 27px;
    width: auto;
}

.sidebar-logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sidebar-close {
    display: none;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--color-muted);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 12px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-muted);
    padding: 12px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 450;
    color: #3F3F46;
    transition: all var(--transition);
    position: relative;
}

.nav-item:hover {
    background: rgba(0,0,0,0.04);
    color: var(--color-primary);
}

.nav-item.active {
    background: rgba(0,0,0,0.06);
    color: var(--color-primary);
    font-weight: 550;
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    opacity: 0.65;
}

.nav-item.active i {
    opacity: 1;
}

.nav-badge {
    margin-left: auto;
    background: var(--color-danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 0 6px;
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding: 12px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 550;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.72rem;
    color: var(--color-muted);
}

.nav-item-logout {
    color: var(--color-muted);
    margin-top: 4px;
}
.nav-item-logout:hover {
    color: var(--color-danger);
    background: rgba(220,38,38,0.06);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 99;
    backdrop-filter: blur(2px);
}

/* --- Topbar --- */
.topbar {
    height: var(--topbar-height);
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--color-muted);
}
.topbar-menu-btn:hover { background: rgba(0,0,0,0.04); }

.topbar-title {
    font-size: 1.15rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-search {
    position: relative;
    display: flex;
    align-items: center;
}

.topbar-search i, 
.topbar-search svg {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    color: var(--color-muted);
    pointer-events: none;
}

.topbar-search input {
    width: 240px;
    height: 38px;
    padding: 0 14px 0 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: #F8F8FA;
    font-size: 0.85rem;
    color: var(--color-primary);
    transition: all var(--transition);
    outline: none;
}

.topbar-search input:focus {
    border-color: rgba(0,0,0,0.2);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}

.topbar-search input::placeholder {
    color: var(--color-muted);
}

.topbar-icon-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--color-muted);
    position: relative;
    transition: all var(--transition);
}
.topbar-icon-btn:hover {
    background: rgba(0,0,0,0.04);
    color: var(--color-primary);
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--color-danger);
    border-radius: 50%;
    border: 2px solid #fff;
}

/* --- Cards --- */
.card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.card-body {
    padding: 22px;
}

.card-body-flush {
    padding: 0;
}

/* --- Stat Cards --- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-icon-primary { background: rgba(0,0,0,0.06); color: #000; }
.stat-icon-success { background: rgba(22,163,74,0.08); color: var(--color-success); }
.stat-icon-warning { background: rgba(245,158,11,0.08); color: var(--color-warning); }
.stat-icon-accent  { background: rgba(37,99,235,0.08); color: var(--color-accent); }
.stat-icon-danger  { background: rgba(220,38,38,0.08); color: var(--color-danger); }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--color-muted);
    margin-top: 2px;
}

/* --- Dashboard Components --- */
.stats-row-6 {
    grid-template-columns: repeat(3, 1fr);
}

.stat-card-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    animation: dashFadeIn 0.4s ease both;
    animation-delay: calc(var(--anim-delay, 0) * 0.08s);
}

.stat-card-link:hover {
    border-color: rgba(0,0,0,0.15);
}

@keyframes dashFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    vertical-align: middle;
}

.stat-trend i,
.stat-trend svg {
    width: 16px;
    height: 16px;
}

.stat-trend-up { color: var(--color-success); }
.stat-trend-down { color: var(--color-danger); }

.stat-icon-completed { background: rgba(22,163,74,0.08); color: var(--color-success); }
.stat-icon-muted { background: rgba(0,0,0,0.04); color: var(--color-muted); }

/* Dashboard Header */
.dash-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.dash-greeting {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

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

.dash-date {
    font-size: 0.85rem;
    color: var(--color-muted);
}

.dash-store-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

.dash-store-badge i,
.dash-store-badge svg {
    width: 14px;
    height: 14px;
}

.dash-store-open {
    background: rgba(22,163,74,0.1);
    color: var(--color-success);
}

.dash-store-closed {
    background: rgba(220,38,38,0.1);
    color: var(--color-danger);
}

/* Dashboard Rows */
.dash-row-2 {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    margin-bottom: 20px;
}

.dash-chart-card {
    min-height: 300px;
}

.dash-chart-total {
    font-size: 0.82rem;
    color: var(--color-muted);
    margin-top: 2px;
}

.dash-row-4 {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
}

/* Quick Actions */
.dash-quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.dash-action-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 550;
    color: var(--color-primary);
    text-decoration: none;
    transition: all var(--transition);
    box-shadow: var(--shadow);
}

.dash-action-card:hover {
    border-color: rgba(0,0,0,0.15);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.dash-action-card i,
.dash-action-card svg {
    width: 20px;
    height: 20px;
    color: var(--color-accent);
    flex-shrink: 0;
}

/* Alerts */
.dash-alerts-card {
    max-height: 360px;
    display: flex;
    flex-direction: column;
}

.dash-alerts-list {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.dash-alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--color-primary);
    border-bottom: 1px solid rgba(0,0,0,0.04);
    transition: background var(--transition);
}

.dash-alert-item:last-child { border-bottom: none; }
.dash-alert-item:hover { background: rgba(0,0,0,0.02); }

.dash-alert-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-alert-icon i,
.dash-alert-icon svg {
    width: 16px;
    height: 16px;
}

.dash-alert-warning .dash-alert-icon { background: rgba(245,158,11,0.1); color: var(--color-warning); }
.dash-alert-info .dash-alert-icon { background: rgba(37,99,235,0.08); color: var(--color-accent); }
.dash-alert-accent .dash-alert-icon { background: rgba(139,92,246,0.08); color: #8B5CF6; }

.dash-alert-text {
    flex: 1;
    font-size: 0.84rem;
    line-height: 1.4;
}

.dash-alert-arrow {
    width: 14px;
    height: 14px;
    color: var(--color-muted);
    flex-shrink: 0;
}

/* Activity Timeline */
.dash-activity-list {
    display: flex;
    flex-direction: column;
}

.dash-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.dash-activity-item:last-child { border-bottom: none; }

.dash-activity-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.dash-activity-icon i,
.dash-activity-icon svg {
    width: 14px;
    height: 14px;
    color: var(--color-muted);
}

.dash-activity-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-activity-text {
    font-size: 0.84rem;
    line-height: 1.4;
}

.dash-activity-time {
    font-size: 0.75rem;
    color: var(--color-muted);
}

.dash-hide-mobile { /* shown by default */ }

/* --- Tables --- */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 550;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-muted);
    padding: 12px 22px;
    border-bottom: 1px solid var(--border-color);
    background: #FAFAFA;
}

.table td {
    padding: 14px 22px;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    vertical-align: middle;
}

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

.table-row-link {
    cursor: pointer;
    transition: background var(--transition);
}
.table-row-link:hover {
    background: rgba(0,0,0,0.02);
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 550;
    letter-spacing: 0.01em;
}

.badge-primary { background: rgba(37,99,235,0.1); color: #2563EB; }
.badge-success { background: rgba(22,163,74,0.1); color: #16A34A; }
.badge-warning { background: rgba(245,158,11,0.1); color: #B45309; }
.badge-danger  { background: rgba(220,38,38,0.1); color: #DC2626; }
.badge-info    { background: rgba(6,182,212,0.1); color: #0891B2; }
.badge-muted   { background: rgba(0,0,0,0.05); color: var(--color-muted); }
.badge-outline { background: transparent; border: 1px solid var(--border-color); color: var(--color-muted); }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 550;
    transition: all var(--transition);
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}
.btn-primary:hover {
    background: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-secondary {
    background: #fff;
    color: var(--color-primary);
    border-color: var(--border-color);
}
.btn-secondary:hover {
    background: #F8F8FA;
    border-color: rgba(0,0,0,0.2);
}

.btn-ghost {
    background: transparent;
    color: var(--color-muted);
}
.btn-ghost:hover {
    background: rgba(0,0,0,0.04);
    color: var(--color-primary);
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
    border-color: var(--color-danger);
}
.btn-danger:hover {
    background: #B91C1C;
}

.btn-full { width: 100%; }

/* --- Forms --- */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 550;
    margin-bottom: 6px;
    color: #374151;
}

.form-label-link {
    font-size: 0.78rem;
    font-weight: 450;
    color: var(--color-accent);
}
.form-label-link:hover {
    text-decoration: underline;
}

.form-input {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: 0.9rem;
    color: var(--color-primary);
    transition: all var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

.form-input::placeholder {
    color: #A1A1AA;
}

.input-password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-muted);
    padding: 4px;
}
.password-toggle:hover { color: var(--color-primary); }

.form-check {
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #4B5563;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
}

/* --- Alerts --- */
.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 450;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

.alert-success { background: rgba(22,163,74,0.08); color: #15803D; border: 1px solid rgba(22,163,74,0.15); }
.alert-error   { background: rgba(220,38,38,0.08); color: #B91C1C; border: 1px solid rgba(220,38,38,0.15); }
.alert-warning { background: rgba(245,158,11,0.08); color: #92400E; border: 1px solid rgba(245,158,11,0.15); }
.alert-info    { background: rgba(37,99,235,0.08); color: #1D4ED8; border: 1px solid rgba(37,99,235,0.15); }

.alert-close {
    font-size: 1.2rem;
    line-height: 1;
    color: inherit;
    opacity: 0.5;
}
.alert-close:hover { opacity: 1; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--color-muted);
}

.empty-state i {
    font-size: 2.5rem;
    opacity: 0.3;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 0.95rem;
    font-weight: 550;
    margin-bottom: 4px;
    color: #6B7280;
}

.empty-state span {
    font-size: 0.82rem;
}

/* --- Page Header --- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.page-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.page-heading {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* --- Icon Button --- */
.btn-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--color-muted);
    transition: all var(--transition);
    flex-shrink: 0;
}
.btn-icon:hover {
    background: rgba(0,0,0,0.05);
    color: var(--color-primary);
}
.btn-icon-danger:hover {
    background: rgba(220,38,38,0.06);
    color: var(--color-danger);
}

/* --- Filters Bar --- */
.filters-bar {
    margin-bottom: 20px;
    padding: 12px 16px;
}

.filters-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-item {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-item-grow {
    flex: 1;
    min-width: 180px;
}

.filter-icon {
    position: absolute;
    left: 12px;
    font-size: 0.9rem;
    color: var(--color-muted);
    pointer-events: none;
}

.filter-input {
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: 0.85rem;
    color: var(--color-primary);
    outline: none;
    transition: all var(--transition);
}

.filter-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}

.filter-item-grow .filter-input {
    width: 100%;
    padding-left: 36px;
}

.filter-select {
    min-width: 140px;
    appearance: auto;
    cursor: pointer;
}

/* --- Table Responsive --- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* --- Product Table Cells --- */
.product-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.product-thumb-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #D1D5DB;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.product-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.product-cell-name {
    font-weight: 550;
    font-size: 0.88rem;
    color: var(--color-primary);
}

.product-cell-desc {
    font-size: 0.78rem;
    color: var(--color-muted);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-weight: 600;
    font-size: 0.88rem;
}

.product-compare-price {
    display: block;
    text-decoration: line-through;
    color: var(--color-muted);
    font-size: 0.75rem;
    margin-top: 1px;
}

/* --- Dietary Tags Inline --- */
.dietary-tags-inline {
    display: flex;
    gap: 4px;
    margin-top: 3px;
    flex-wrap: wrap;
}

.dietary-tag {
    font-size: 0.62rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(22,163,74,0.08);
    color: var(--color-success);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* --- Toggle Switch --- */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    cursor: pointer;
    flex-shrink: 0;
}

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

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #D1D5DB;
    border-radius: 22px;
    transition: background 0.25s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--color-success);
}

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

/* --- Status Toggle Items --- */
.status-toggles {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.status-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    cursor: default;
}

.status-toggle-item + .status-toggle-item {
    border-top: 1px solid rgba(0,0,0,0.04);
}

.status-toggle-label {
    font-size: 0.85rem;
    font-weight: 450;
    color: #374151;
}

/* --- Form Grid (Product Form) --- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
}

.form-column-main .card,
.form-column-side .card {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-col-2 {
    flex: 1;
    min-width: 0;
}

.form-textarea {
    height: auto;
    padding: 10px 14px;
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.form-hint {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--color-muted);
}

.form-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 18px 0;
}

.form-input-file {
    padding: 8px 14px;
    height: auto;
    font-size: 0.82rem;
}

/* --- Form Sticky Header --- */
.form-sticky-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding: 14px 20px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: sticky;
    top: var(--topbar-height);
    z-index: 40;
}

.form-sticky-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.form-sticky-left .page-heading {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.form-sticky-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* --- Image Upload --- */
.image-upload-area {
    position: relative;
    border: 2px dashed rgba(0,0,0,0.12);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
    background: #FAFAFA;
}

.image-upload-area:hover {
    border-color: rgba(0,0,0,0.2);
}

.image-upload-area.drag-over {
    border-color: var(--color-accent);
    background: rgba(37,99,235,0.03);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}

.image-upload-placeholder {
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    color: var(--color-muted);
}

.image-upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-upload-icon i {
    font-size: 1.3rem;
    opacity: 0.4;
}

.image-upload-placeholder p {
    font-size: 0.85rem;
    font-weight: 500;
    color: #4B5563;
    margin-bottom: 4px;
}

.image-upload-placeholder span {
    font-size: 0.75rem;
    color: var(--color-muted);
}

.image-preview {
    position: relative;
}

.image-preview img {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    display: block;
}

.image-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all var(--transition);
    backdrop-filter: blur(4px);
}
.image-remove-btn:hover {
    background: var(--color-danger);
    transform: scale(1.1);
}

/* --- Dietary Chips --- */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: #fff;
    font-size: 0.78rem;
    font-weight: 500;
    color: #6B7280;
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.chip input[type="checkbox"] {
    display: none;
}

.chip i {
    font-size: 0.85rem;
    opacity: 0.5;
}

.chip:hover {
    border-color: rgba(0,0,0,0.2);
    background: #F9FAFB;
}

.chip-active {
    border-color: var(--color-success);
    background: rgba(22,163,74,0.06);
    color: var(--color-success);
}

.chip-active i {
    opacity: 1;
}

/* --- Modifier Select List (form) --- */
.modifier-select-list {
    display: flex;
    flex-direction: column;
}

.modifier-select-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px;
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.modifier-select-item:last-child {
    border-bottom: none;
}

.modifier-select-item:hover {
    background: rgba(0,0,0,0.015);
}

.modifier-select-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
    flex-shrink: 0;
}

.modifier-select-info {
    flex: 1;
    min-width: 0;
}

.modifier-select-name {
    display: block;
    font-size: 0.88rem;
    font-weight: 550;
}

.modifier-select-meta {
    display: block;
    font-size: 0.75rem;
    color: var(--color-muted);
    margin-top: 1px;
}

.modifier-select-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: transparent;
    transition: all var(--transition);
    flex-shrink: 0;
}

.modifier-select-item input:checked ~ .modifier-select-check {
    background: var(--color-primary);
    color: #fff;
}

/* --- Category Cards Grid --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.category-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.category-card:hover {
    box-shadow: var(--shadow-md);
}

.category-card-image {
    height: 120px;
    overflow: hidden;
    background: #F3F4F6;
}

.category-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-card-image-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #D1D5DB;
    font-size: 2rem;
}

.category-card-body {
    padding: 16px 18px;
    flex: 1;
}

.category-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.category-card-name {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.category-card-desc {
    font-size: 0.78rem;
    color: var(--color-muted);
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--color-muted);
}

.category-card-meta i {
    font-size: 0.85rem;
    vertical-align: -1px;
    margin-right: 2px;
}

.category-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    padding: 10px 14px;
    border-top: 1px solid var(--border-color);
    background: #FAFAFA;
}

/* --- Accordion Cards (Modifiers) --- */
.accordion-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.accordion-card {
    overflow: hidden;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    cursor: pointer;
    transition: background var(--transition);
    user-select: none;
}

.accordion-header:hover {
    background: rgba(0,0,0,0.01);
}

.accordion-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.accordion-chevron {
    font-size: 1rem;
    color: var(--color-muted);
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.accordion-open .accordion-chevron {
    transform: rotate(90deg);
}

.accordion-title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.accordion-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 0.75rem;
    flex-wrap: wrap;
}

.accordion-header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.accordion-body {
    display: none;
    border-top: 1px solid var(--border-color);
}

.accordion-open .accordion-body {
    display: block;
}

/* --- Modifier Options List (display) --- */
.modifier-options-list {
    padding: 4px 0;
}

.modifier-option-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 10px 20px 10px 48px;
    font-size: 0.85rem;
    gap: 14px;
}

.modifier-option-item + .modifier-option-item {
    border-top: 1px solid rgba(0,0,0,0.03);
}

.modifier-option-name {
    font-weight: 450;
}

.modifier-option-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.modifier-option-short,
.modifier-option-desc {
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--color-muted);
}

.modifier-option-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.modifier-option-price {
    font-size: 0.82rem;
    white-space: nowrap;
    margin-top: 2px;
}

.price-add { color: var(--color-success); font-weight: 550; }
.price-sub { color: var(--color-danger); font-weight: 550; }

/* --- Modifier Option Rows (modal form) --- */
.modifier-option-row {
    display: grid;
    gap: 10px;
    margin-bottom: 8px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
}

.modifier-option-row-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px 30px;
    align-items: center;
    gap: 8px;
}

#modifier-options {
    display: grid;
    gap: 8px;
}

.modifier-option-row-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
}

.modifier-option-price-input {
    position: relative;
    width: 100%;
    flex-shrink: 0;
}

.modifier-option-prefix {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.82rem;
    color: var(--color-muted);
    pointer-events: none;
}

.modifier-option-price-input .form-input {
    padding-left: 32px;
}

.modifier-option-textarea {
    min-height: 74px;
    resize: vertical;
}

.modifier-option-field {
    display: grid;
    gap: 6px;
}

.modifier-option-field-label {
    font-size: 0.72rem;
    font-weight: 520;
    color: var(--color-muted);
    line-height: 1.2;
}

.modifier-dietary-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.modifier-dietary-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: #fff;
    color: var(--color-muted);
    font-size: 0.72rem;
    font-weight: 520;
    line-height: 1;
    cursor: pointer;
    transition: all var(--transition);
}

.modifier-dietary-pill input[type="radio"] {
    display: none;
}

.modifier-dietary-pill span {
    display: inline-flex;
    padding: 6px 10px;
}

.modifier-dietary-pill:hover {
    border-color: rgba(0,0,0,0.2);
    background: #F9FAFB;
}

.modifier-dietary-pill.is-active {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(0,0,0,0.04);
}

.modifier-option-short,
.modifier-option-desc {
    overflow-wrap: anywhere;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalIn 0.2s ease;
}

.modal-lg {
    max-width: 640px;
}

.modal > form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 650;
}

.modal-close {
    font-size: 1.4rem;
    color: var(--color-muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.modal-close:hover {
    background: rgba(0,0,0,0.04);
    color: var(--color-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    overscroll-behavior: contain;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* --- Empty State (refined) --- */
.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: rgba(0,0,0,0.03);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon i {
    font-size: 1.6rem;
    color: var(--color-muted);
    opacity: 0.4;
    margin-bottom: 0;
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.empty-state-text {
    font-size: 0.85rem;
    color: var(--color-muted);
    max-width: 320px;
    margin: 0 auto;
    line-height: 1.5;
}

/* --- Badge Icons --- */
.badge-icon {
    width: 12px;
    height: 12px;
    vertical-align: -1px;
}

/* --- Detail Icons --- */
.detail-icon {
    width: 14px;
    height: 14px;
    vertical-align: -2px;
    margin-right: 2px;
    opacity: 0.5;
}

/* --- Card Title Icons --- */
.card-title i,
.card-title svg {
    width: 16px;
    height: 16px;
    vertical-align: -2px;
    margin-right: 4px;
    opacity: 0.5;
}

/* --- Order Timeline --- */
.order-timeline {
    display: flex;
    align-items: flex-start;
    gap: 0;
    position: relative;
    padding: 8px 0;
}

.timeline-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.timeline-step::before {
    content: '';
    position: absolute;
    top: 10px;
    left: -50%;
    right: 50%;
    height: 2px;
    background: rgba(0,0,0,0.08);
}

.timeline-step:first-child::before {
    display: none;
}

.timeline-done::before {
    background: var(--color-success);
}

.timeline-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,0.06);
    margin: 0 auto 8px;
    position: relative;
    z-index: 1;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.06);
}

.timeline-done .timeline-dot {
    background: var(--color-success);
    box-shadow: 0 0 0 2px rgba(22,163,74,0.2);
}

.timeline-current .timeline-dot {
    box-shadow: 0 0 0 3px rgba(37,99,235,0.25);
    background: var(--color-accent);
}

.timeline-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--color-muted);
    letter-spacing: 0.01em;
}

.timeline-done .timeline-label {
    color: var(--color-success);
}

.timeline-current .timeline-label {
    color: var(--color-accent);
    font-weight: 600;
}

.timeline-cancelled .timeline-dot {
    background: rgba(0,0,0,0.06) !important;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.06) !important;
}

.timeline-cancelled .timeline-label {
    color: var(--color-muted) !important;
}

.timeline-cancelled-step .timeline-dot {
    background: var(--color-danger) !important;
    box-shadow: 0 0 0 3px rgba(220,38,38,0.2) !important;
}

.timeline-cancelled-step .timeline-label {
    color: var(--color-danger) !important;
    font-weight: 600;
}

/* --- Order Items List --- */
.order-items-list {
    display: flex;
    flex-direction: column;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

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

.order-item-qty {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-muted);
    min-width: 30px;
}

.order-item-qty-control {
    display: flex;
    align-items: center;
    gap: 4px;
}

.qty-input {
    width: 56px;
    height: 34px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    background: #fff;
}

.qty-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}

.order-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.order-item-name {
    font-size: 0.88rem;
    font-weight: 550;
    color: var(--color-primary);
}

.order-item-mods {
    font-size: 0.78rem;
    color: var(--color-muted);
}

.order-item-note {
    font-size: 0.78rem;
    color: #92400E;
    display: flex;
    align-items: center;
    gap: 4px;
}

.order-item-note i {
    font-size: 0.72rem;
}

.order-item-price {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-primary);
    white-space: nowrap;
}

/* --- Detail Rows --- */
.detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

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

.detail-row-total {
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
    padding-top: 12px;
    border-bottom: none;
}

.detail-label {
    font-size: 0.82rem;
    color: var(--color-muted);
    font-weight: 450;
}

.detail-value {
    font-size: 0.88rem;
    font-weight: 550;
    color: var(--color-primary);
}

.detail-row-total .detail-label,
.detail-row-total .detail-value {
    font-size: 0.95rem;
    font-weight: 650;
}

/* --- Customer Cell (table) --- */
.customer-cell {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.customer-name {
    font-weight: 550;
    font-size: 0.88rem;
}

.customer-phone {
    font-size: 0.78rem;
    color: var(--color-muted);
}

/* --- Order Number (table) --- */
.order-number {
    font-weight: 600;
    color: var(--color-accent);
}

.order-date {
    font-size: 0.78rem;
}

/* --- Product Picker --- */
.product-picker-list {
    overflow-y: auto;
    max-height: calc(60vh - 70px);
}

.picker-category-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-muted);
    padding: 12px 24px 6px;
    background: #FAFAFA;
    position: sticky;
    top: 0;
    z-index: 1;
}

.picker-product {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.picker-product:hover {
    background: rgba(37,99,235,0.03);
}

.picker-product-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.picker-product-name {
    font-size: 0.88rem;
    font-weight: 500;
}

.picker-product-price {
    font-size: 0.82rem;
    color: var(--color-muted);
    font-weight: 500;
}

/* --- Order Summary (create form) --- */
.order-summary-card {
    position: sticky;
    top: calc(var(--topbar-height) + 80px);
}

.summary-items-list {
    margin-bottom: 12px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.82rem;
    color: #4B5563;
}

.summary-totals {
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
}

/* --- Catering Detail Grid --- */
.catering-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.catering-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.catering-detail-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(37,99,235,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--color-accent);
}

.catering-detail-icon i {
    font-size: 1rem;
}

.catering-detail-item .detail-label {
    display: block;
    font-size: 0.72rem;
    margin-bottom: 1px;
}

.catering-detail-item .detail-value {
    display: block;
    font-size: 0.88rem;
}

/* --- Button icon danger variant --- */
.btn-icon-danger {
    color: var(--color-muted);
    transition: color var(--transition);
}

.btn-icon-danger:hover {
    color: var(--color-danger);
}

/* --- Utility Classes --- */
.text-muted { color: var(--color-muted); }
.font-medium { font-weight: 500; }
.font-mono { font-family: var(--font-mono); font-size: 0.85em; }

/* --- Responsive --- */
@media (max-width: 1024px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .topbar-search { display: none; }

    .form-grid {
        grid-template-columns: 1fr 300px;
    }

    .settings-grid-2col {
        grid-template-columns: 1fr;
    }

    .settings-pw-grid {
        grid-template-columns: 1fr 1fr;
    }

    .calendar-layout {
        grid-template-columns: 1fr;
    }

    .dash-row-2,
    .dash-row-4 {
        grid-template-columns: 1fr;
    }

    .dash-quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* --- GLOBAL: prevent horizontal scroll --- */
    html, body {
        overflow-x: hidden;
    }

    .app-main {
        margin-left: 0;
        overflow-x: hidden;
        min-width: 0;
    }

    .app-content {
        padding: 16px;
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* --- Sidebar drawer --- */
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: flex;
    }

    .sidebar-overlay.open {
        display: block;
    }

    .topbar-menu-btn {
        display: flex;
    }

    /* --- Stats --- */
    .stats-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stat-card {
        width: 100%;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.72rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-icon i,
    .stat-icon svg {
        width: 18px;
        height: 18px;
    }

    /* --- Tables --- */
    .table th,
    .table td {
        padding: 10px 12px;
        font-size: 0.78rem;
    }

    .table-responsive {
        margin: 0 -4px;
    }

    /* --- Page Header --- */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .page-header-left {
        flex-wrap: wrap;
    }

    .page-header .btn,
    .page-header-right .btn {
        width: 100%;
        justify-content: center;
    }

    .page-heading {
        font-size: 1.25rem;
    }

    /* --- Cards --- */
    .card {
        border-radius: 8px;
    }

    .card-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* --- Forms --- */
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-col-2 {
        flex: auto;
        width: 100%;
    }

    .form-sticky-header {
        position: relative;
        top: auto;
        flex-wrap: wrap;
    }

    .form-sticky-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* --- Filters --- */
    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-item-grow {
        min-width: auto;
    }

    .filter-select {
        min-width: auto;
        width: 100%;
    }

    .filters-bar .btn {
        width: 100%;
        justify-content: center;
    }

    /* --- Modals fullscreen --- */
    .modal-overlay {
        align-items: flex-start;
        padding: 0;
    }

    .modal {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        min-height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        overflow: hidden;
    }

    .modal-lg {
        max-width: 100%;
    }

    /* --- Settings grids --- */
    .settings-pw-grid {
        grid-template-columns: 1fr;
    }

    .settings-grid-2col {
        grid-template-columns: 1fr;
    }

    .settings-profile-fields {
        grid-template-columns: 1fr;
    }

    .mfa-method-grid {
        grid-template-columns: 1fr;
    }

    /* --- Calendar --- */
    .calendar-grid {
        gap: 4px;
    }

    .calendar-cell {
        padding: 4px;
        aspect-ratio: auto;
        min-height: 40px;
    }

    .calendar-day-num {
        font-size: 0.75rem;
    }

    .closure-indicator {
        font-size: 0.55rem;
        padding: 1px 3px;
    }

    .calendar-header-day {
        font-size: 0.65rem;
    }

    /* --- Users: hide less-important columns --- */
    .users-hide-mobile {
        display: none;
    }

    /* --- Categories --- */
    .category-grid {
        grid-template-columns: 1fr;
    }

    /* --- Accordion (Modifiers) --- */
    .accordion-header {
        padding: 14px 16px;
    }

    .modifier-option-item {
        padding-left: 36px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .modifier-option-price {
        margin-top: 0;
    }

    .modifier-option-row-top {
        grid-template-columns: minmax(0, 1fr) 98px 28px;
        align-items: center;
    }

    .modifier-option-row-grid {
        grid-template-columns: 1fr;
    }

    /* --- Order Timeline --- */
    .order-timeline {
        flex-wrap: wrap;
        gap: 4px;
    }

    .timeline-step {
        min-width: 60px;
    }

    .timeline-label {
        font-size: 0.68rem;
    }

    /* --- Order Items --- */
    .order-item {
        padding: 12px 16px;
        gap: 10px;
    }

    /* --- Catering Detail Grid --- */
    .catering-detail-grid {
        grid-template-columns: 1fr;
    }

    /* --- Order detail grid --- */
    .order-detail-grid {
        grid-template-columns: 1fr;
    }

    /* --- Dashboard mobile --- */
    .stats-row-6 {
        grid-template-columns: 1fr;
    }

    .dash-header {
        flex-direction: column;
        align-items: stretch;
    }

    .dash-header .btn {
        width: 100%;
        justify-content: center;
    }

    .dash-greeting {
        font-size: 1.2rem;
    }

    .dash-meta {
        flex-wrap: wrap;
        gap: 8px;
    }

    .dash-row-2,
    .dash-row-4 {
        grid-template-columns: 1fr;
    }

    .dash-quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .dash-action-card {
        padding: 12px 14px;
        font-size: 0.82rem;
    }

    .dash-hide-mobile {
        display: none;
    }

    .dash-chart-card {
        min-height: 240px;
    }
}

/* --- Extra Small (max-width: 480px) --- */
@media (max-width: 480px) {
    .app-content {
        padding: 12px;
    }

    .topbar-title {
        font-size: 1rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .stats-row {
        gap: 8px;
    }

    .stat-card {
        padding: 14px;
    }

    .card-body {
        padding: 16px;
    }

    .card-header {
        padding: 14px 16px;
    }

    .page-heading {
        font-size: 1.1rem;
    }

    .badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.82rem;
    }

    .btn-sm {
        padding: 7px 12px;
        font-size: 0.75rem;
    }

    .form-input,
    .filter-input {
        font-size: 0.85rem;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 12px 16px;
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .dash-greeting {
        font-size: 1.1rem;
    }

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

    .dash-action-card {
        flex-direction: column;
        text-align: center;
        padding: 12px 8px;
        font-size: 0.78rem;
        gap: 6px;
    }
}



/* ============================================================
   PROFILE DROPDOWN (Topbar)
   ============================================================ */

.topbar-profile-container {
    position: relative;
    margin-left: 12px;
}

/* O gatilho que abre o menu */
.topbar-profile-trigger {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 50%;
    transition: all var(--transition);
}
.topbar-profile-trigger:hover {
    box-shadow: 0 0 0 4px rgba(0,0,0,0.05);
}

/* O container do dropdown */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 260px;
    background: #fff;
    border-radius: 14px; /* Apple style radius */
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
}

/* Estado ativo do dropdown */
.profile-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Cabeçalho do Dropdown (Info do Usuário) */
.profile-dropdown-header {
    padding: 16px;
    background: #FAFAFA;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.profile-dropdown-header .user-avatar {
    width: 60px;
    height: 60px;
    font-size: 1.25rem;
    margin-bottom: 10px;
}
.profile-dropdown-header img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.profile-dropdown-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-primary);
    margin-bottom: 2px;
}
.profile-dropdown-email {
    font-size: 0.8rem;
    color: var(--color-muted);
    margin-bottom: 8px;
}

/* Badges de Role Coloridos (Briefing) */
.role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.role-superadmin { background: #000; color: #fff; }
.role-admin { background: #1E3A8A; color: #fff; } /* Azul Escuro */
.role-manager { background: #2563EB; color: #fff; } /* Azul */
.role-staff { background: #E5E7EB; color: #374151; } /* Cinza */
.role-kitchen { background: #FBBF24; color: #000; } /* Amarelo */

/* Lista de Links do Menu */
.profile-dropdown-list {
    list-style: none;
    padding: 6px;
    margin: 0;
}

.profile-dropdown-item a, 
.profile-dropdown-item button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    color: #374151;
    font-size: 0.85rem;
    text-decoration: none;
    border-radius: 8px;
    transition: background var(--transition);
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
}

.profile-dropdown-item a:hover, 
.profile-dropdown-item button:hover {
    background: #F3F4F6;
}

.profile-dropdown-item i, 
.profile-dropdown-item svg {
    width: 16px;
    height: 16px;
    margin-right: 12px;
    color: var(--color-muted);
}

.profile-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 6px 0;
}

/* Item de Logout (Vermelho) */
.profile-dropdown-item-logout a,
.profile-dropdown-item-logout button {
    color: var(--color-danger);
}
.profile-dropdown-item-logout i,
.profile-dropdown-item-logout svg {
    color: var(--color-danger);
}
.profile-dropdown-item-logout a:hover,
.profile-dropdown-item-logout button:hover {
    background: rgba(220, 38, 38, 0.05);
}

/* ============================================================
   AVATAR PREVIEW (User Form)
   ============================================================ */
.avatar-preview {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    background: #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--color-muted);
}

.avatar-placeholder i,
.avatar-placeholder svg {
    width: 36px;
    height: 36px;
    opacity: 0.4;
}

/* ============================================================
   CLOSURE LIST (Calendar)
   ============================================================ */
.closure-list {
    display: flex;
    flex-direction: column;
}

.closure-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

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

.closure-date-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 44px;
}

.closure-day {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
}

.closure-month {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-muted);
}

.closure-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.closure-reason {
    font-size: 0.88rem;
    font-weight: 550;
}

.closure-meta {
    font-size: 0.78rem;
    color: var(--color-muted);
}

.closure-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================================
   CALENDAR LAYOUT (two-column)
   ============================================================ */
.calendar-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 20px;
    align-items: start;
}

/* ============================================================
   TABLE RESPONSIVE
   ============================================================ */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================================
   SETTINGS GRIDS (named classes replace inline styles)
   ============================================================ */
.settings-profile-fields {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.settings-pw-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.settings-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* ============================================================
   MFA METHOD SELECTOR
   ============================================================ */
.mfa-method-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.mfa-method-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    background: #FAFAFA;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.mfa-method-option input[type="radio"] {
    display: none;
}

.mfa-method-option:hover {
    border-color: rgba(0,0,0,0.2);
}

.mfa-method-option.active {
    border-color: var(--color-accent);
    background: rgba(37,99,235,0.04);
}

.mfa-method-option i,
.mfa-method-option svg {
    width: 24px;
    height: 24px;
    color: var(--color-muted);
}

.mfa-method-option.active i,
.mfa-method-option.active svg {
    color: var(--color-accent);
}

.mfa-method-label {
    font-weight: 600;
    font-size: 0.88rem;
}

.mfa-method-desc {
    font-size: 0.75rem;
    color: var(--color-muted);
}

/* ============================================================
   UTILITIES
   ============================================================ */
/* --- Reports --- */
.stats-row-4 {
    grid-template-columns: repeat(4, 1fr);
}
.report-row-2 {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.report-trend {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}
.report-trend svg { width: 14px; height: 14px; }
.report-trend-up { color: var(--color-success); }
.report-trend-down { color: var(--color-danger); }
.stat-icon-muted { background: rgba(0,0,0,0.04); color: var(--color-muted); }
.filters-bar {
    padding: 16px 20px;
    margin-bottom: 20px;
}
.filters-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.filter-select {
    min-width: 140px;
}

@media (max-width: 1024px) {
    .report-row-2 { grid-template-columns: 1fr 1fr; }
    .stats-row-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .report-row-2 { grid-template-columns: 1fr; }
    .stats-row-4 { grid-template-columns: 1fr 1fr; }
    .filters-row { flex-direction: column; align-items: stretch; }
}
@media (max-width: 480px) {
    .stats-row-4 { grid-template-columns: 1fr; }
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 20px; }
.mb-5 { margin-bottom: 32px; }
.mt-1 { margin-top: 4px; }
.mt-3 { margin-top: 12px; }
.text-center { text-align: center; }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.text-primary { color: var(--color-primary); }
.py-4 { padding-top: 20px; padding-bottom: 20px; }
.form-col-2 { flex: 1; min-width: 0; }
.form-divider { border: none; border-top: 1px solid var(--border-color); margin: 16px 0; }
.form-hint { font-size: 0.82rem; color: var(--color-muted); }
.form-textarea { min-height: 80px; resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border-color); }
.form-label-link {
    float: right;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--color-accent, #3B82F6);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    transition: color var(--transition);
}
.form-label-link:hover { color: #1D4ED8; text-decoration: underline; }

/* ============================================================
   Additions for Bundles / Gift Cards / Catering modules
   ============================================================ */

/* --- Input Icon Wrapper (currency prefix etc.) --- */
.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon-wrapper .form-input {
    padding-left: 28px;
}
.input-icon-left {
    position: absolute;
    left: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-muted);
    pointer-events: none;
    z-index: 1;
    line-height: 1;
}

/* --- Toggle Row (label + toggle side-by-side) --- */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}
.toggle-row + .toggle-row {
    border-top: 1px solid rgba(0,0,0,0.04);
}
.toggle-row-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: #374151;
}

/* --- Image Upload Preview (bundles / products) --- */
.image-upload-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    border: 2px dashed rgba(0,0,0,0.1);
    border-radius: var(--radius);
    background: #FAFAFA;
    overflow: hidden;
    transition: all var(--transition);
}
.image-upload-preview:hover {
    border-color: rgba(0,0,0,0.18);
}
.image-upload-preview img {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    display: block;
    border-radius: var(--radius);
}

/* --- Form Help text --- */
.form-help {
    display: block;
    font-size: 0.75rem;
    color: var(--color-muted);
    margin-top: 4px;
    line-height: 1.45;
}

/* --- Table Image Cell --- */
.table-img-cell {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.table-img-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.table-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F3F4F6;
    color: #D1D5DB;
}

/* --- Bundle Item Card (inside form) --- */
.bundle-item-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
    transition: box-shadow var(--transition);
}
.bundle-item-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.bundle-item-qty {
    width: 64px;
    flex-shrink: 0;
}
.bundle-item-qty .form-input {
    text-align: center;
    padding: 4px 8px;
    height: 36px;
    font-weight: 600;
}
.bundle-item-name {
    flex: 1;
    min-width: 0;
    font-weight: 550;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bundle-item-swap {
    width: 160px;
    flex-shrink: 0;
}
.bundle-item-swap select {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    background: #fff;
    color: var(--color-primary);
    cursor: pointer;
    appearance: auto;
}
.bundle-item-swap select:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.bundle-item-actions {
    flex-shrink: 0;
}

/* --- Summary Items (Quote/Order) --- */
.summary-items-list {
    font-size: 0.85rem;
    margin-bottom: 16px;
}
.summary-line {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    gap: 12px;
}
.summary-totals {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

/* --- Product Picker Modal --- */
.product-picker-list {
    overflow-y: auto;
    max-height: 50vh;
}
.picker-category-title {
    padding: 8px 24px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-muted);
    background: #F9FAFB;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
    z-index: 1;
}
.picker-product {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid rgba(0,0,0,0.03);
}
.picker-product:hover {
    background: rgba(0,0,0,0.02);
}
.picker-product-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.picker-product-name {
    font-weight: 500;
    font-size: 0.88rem;
}
.picker-product-price {
    font-size: 0.78rem;
    color: var(--color-muted);
}

/* --- Order Item Row (Catering / Order create) --- */
.order-items-list { list-style: none; }
.order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.order-item:last-child { border-bottom: none; }
.order-item-qty-control { width: 64px; flex-shrink: 0; }
.qty-input {
    width: 100%;
    height: 34px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.88rem;
}
.order-item-info { flex: 1; min-width: 0; }
.order-item-name { font-weight: 550; font-size: 0.88rem; display: block; }
.order-item-mods { font-size: 0.78rem; color: var(--color-muted); }
.order-item-price { font-weight: 600; font-size: 0.88rem; white-space: nowrap; }

/* --- Detail Rows (order detail / giftcard detail) --- */
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.88rem;
}
.detail-row-total {
    border-top: 2px solid var(--color-primary);
    margin-top: 8px;
    padding-top: 10px;
    font-weight: 700;
    font-size: 1rem;
}
.detail-label { color: var(--color-muted); }
.detail-value { font-weight: 600; }

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(2px);
}
.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 520px;
    overflow: hidden;
    animation: modalIn 0.2s ease;
}
.modal-lg { max-width: 640px; }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
}
.modal-title {
    font-size: 1rem;
    font-weight: 650;
}
.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.3rem;
    color: var(--color-muted);
    transition: all var(--transition);
}
.modal-close:hover { background: rgba(0,0,0,0.06); color: var(--color-primary); }
.modal-body { padding: 24px; overflow-y: auto; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 24px;
    border-top: 1px solid var(--border-color);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* --- Searchable Select Dropdown --- */
.searchable-select {
    position: relative;
}
.searchable-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
}
.searchable-select-trigger:hover {
    border-color: rgba(0,0,0,0.2);
}
.searchable-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    animation: modalIn 0.15s ease;
    overflow: hidden;
}
.searchable-select-search {
    position: relative;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}
.searchable-select-search input {
    width: 100%;
    height: 34px;
    padding: 0 12px 0 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--transition);
}
.searchable-select-search input:focus {
    border-color: var(--color-primary);
}
.searchable-select-options {
    max-height: 240px;
    overflow-y: auto;
}
.searchable-select-option {
    padding: 10px 14px;
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid rgba(0,0,0,0.03);
}
.searchable-select-option:last-child { border-bottom: none; }
.searchable-select-option:hover {
    background: rgba(0,0,0,0.03);
}


