/* ===== Layout & Cards (same as items) ===== */
.em-top-layout{ display:grid; grid-template-columns:minmax(560px,1fr) minmax(400px,.9fr); gap:14px; align-items:start; }
@media (max-width:1100px){ .em-top-layout{ grid-template-columns:1fr; } }
.em-card.big{ background:#fff; border:1px solid #eef2f7; border-radius:14px; box-shadow:0 1px 2px rgba(0,0,0,.02); }
.em-card.em-compact{ padding:14px; }
.em-card .em-card-title{ font-size:16px; font-weight:600; margin-bottom:12px; }
.em-card-actions{ display:flex; justify-content:flex-end; margin:6px 0 8px; }

/* ===== Form fields ===== */
.em-form .easymenu-select,
.em-form input[type="text"],
.em-form input[type="number"],
.em-form textarea{
  color:#0f172a; background:#fff; border:1px solid #cbd5e1; border-radius:10px; padding:9px 10px; width:100%;
}
.em-form textarea{ min-height:110px; resize:vertical; }
.em-form input:focus, .em-form textarea:focus, .em-form select:focus{
  outline:0; border-color:#3b82f6; box-shadow:0 0 0 3px rgba(59,130,246,.15);
}
.em-fieldgrid-2{ display:grid; grid-template-columns:1fr 1fr; gap:12px 16px; }
@media (max-width:1100px){ .em-fieldgrid-2{ grid-template-columns:1fr; } }
.em-field{ display:flex; flex-direction:column; gap:6px; }
.em-field > label{ font-size:12px; color:#6b7280; }
.em-actions-row{ margin-top:18px; display:flex; gap:8px; align-items:center; }

/* ===== Buttons ===== */
.em-btn{ display:inline-flex; align-items:center; gap:8px; padding:8px 14px; border-radius:10px; border:1px solid transparent; cursor:pointer; text-decoration:none; }
.em-btn-green{ background:#10b981; color:#fff; }
.em-btn-primary{ background:#3b82f6; color:#fff; }
.em-btn-ghost{ background:#fff; color:#334155; border-color:#e5e7eb; }
.em-btn-sm{ padding:5px 9px; border-radius:8px; border:1px solid #e5e7eb; text-decoration:none; }
.em-blue{ background:#e0f2fe; color:#0ea5e9; }
.em-red{ background:#fee2e2; color:#ef4444; }
.em-btn[disabled]{ opacity:.55; cursor:not-allowed; }

/* ===== Image & Options ===== */
.em-io-grid{ display:grid; grid-template-columns:1fr 360px; gap:14px; align-items:stretch; }
@media (max-width:1100px){ .em-io-grid{ grid-template-columns:1fr; } }
.em-io-left{ display:flex; flex-direction:column; gap:12px; }
.em-io-preview{ display:flex; }
.em-io-frame{
  border:2px dashed #cbd5e1; border-radius:12px;
  width:100%; min-height:180px;
  display:flex; align-items:center; justify-content:center;
  background:#fafafa; position:relative; cursor:pointer; overflow:hidden;
}
.em-io-frame img{ width:100%; height:auto; object-fit:cover; border-radius:10px; transition:transform .25s ease; z-index:1; position:relative; }
.em-io-frame:hover img{ transform:scale(1.02); }
/* overlay below remove button */
.em-io-overlay{ position:absolute; inset:0; border-radius:12px; background:rgba(0,0,0,.06); opacity:0; transition:.2s; z-index:2; pointer-events:none; }
.em-io-hover{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-weight:600; color:#111827; background:rgba(255,255,255,.6); border-radius:12px; text-align:center; padding:6px 10px; opacity:0; transition:.2s; z-index:2; pointer-events:none; }
.em-io-frame:hover .em-io-hover, .em-io-frame:hover .em-io-overlay{ opacity:1; }
.em-io-placeholder{ color:#94a3b8; font-weight:600; }
/* X must stay on top */
.em-img-remove{ position:absolute; top:8px; right:8px; width:28px; height:28px; border-radius:999px; border:none; background:#ef4444; color:#fff; font-weight:700; line-height:28px; text-align:center; cursor:pointer; box-shadow:0 2px 6px rgba(0,0,0,.15); z-index:5; }

/* ===== Filter box (same look as items) ===== */
.em-filterbox{ border:1px solid #eef2f7; background:#fafcff; border-radius:12px; padding:10px 12px; margin:6px 0 12px; }
.em-filterbox__title{ font-weight:600; margin-bottom:6px; font-size:13px; color:#334155; }
.em-filterbox__grid{ display:grid; grid-template-columns:260px 160px minmax(220px,1fr); gap:10px 12px; align-items:center; }
.em-filter-tight .em-field > label{ display:none; }
.em-search{ max-width:320px; }

/* ===== Table ===== */
.em-table{ table-layout:fixed; width:100%; border-collapse:separate; border-spacing:0; }
.em-table thead th{ position:sticky; top:0; background:#fff; z-index:2; border-bottom:1px solid #eef2f7; }
#emCatsTable td, #emCatsTable th{ padding:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:center; }
#emCatsTable tbody tr{ border-top:1px solid #f3f4f6; }
#emCatsTable tbody tr:hover{ background:#fcfcff; }
.drag-handle{ cursor:move; opacity:.6; font-weight:700; }

/* ===== Switch (like items) ===== */
.switch{ position:relative; display:inline-block; width:46px; height:24px; vertical-align:middle; transform:translateY(1px); }
.switch input{ display:none; }
.switch .slider{ position:absolute; inset:0; background:#cbd5e1; border-radius:999px; transition:.25s; }
.switch .slider:before{ content:""; position:absolute; left:3px; bottom:3px; width:18px; height:18px; background:#fff; border-radius:50%; transition:.25s; }
.switch input:checked + .slider{ background:#22c55e; }
.switch input:checked + .slider:before{ transform:translateX(22px); }
.switch.small{ width:38px; height:20px; }
.switch.small .slider:before{ width:14px; height:14px; bottom:3px; left:3px; }
.switch.small input:checked + .slider:before{ transform:translateX(18px); }

/* ===== Toast ===== */
.em-toast{ position:fixed; left:50%; bottom:22px; transform:translateX(-50%) translateY(20px); background:#111827; color:#fff; padding:10px 14px; border-radius:10px; opacity:0; box-shadow:0 6px 20px rgba(0,0,0,.2); transition:.25s; z-index:99999; font-size:13px; }
.em-toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
.em-toast.bad{ background:#dc2626; }
