.mep-main {
  background:
    radial-gradient(circle at 92% 8%, rgba(112,130,72,.09), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,.08), transparent 32%);
}

.back-dashboard {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.52);
  color: #694f3d;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.back-dashboard:hover { border-color: var(--copper); color: var(--copper-dark); }
.sync-button {
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:34px;
  padding:0 11px;
  border:1px solid #bbc4a3;
  border-radius:9px;
  background:#f1f4e9;
  color:#59673c;
  font-size:11px;
  font-weight:750;
  cursor:pointer;
}
.sync-button:hover { background:#e6ecd9; }
.sync-button:disabled { opacity:.6; cursor:wait; }
.sync-button svg { width:15px; height:15px; }
.sync-button.is-loading svg { animation:mep-spin .8s linear infinite; }
.nav-count { display:grid; place-items:center; min-width:19px; height:19px; margin-left:auto; padding:0 5px; border-radius:10px; background:#b65b47; color:#fff; font-size:9px; }

.mep-command {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin: 15px 0 13px;
  padding: 25px 28px;
  overflow: hidden;
  border: 1px solid #59613a;
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 20%, rgba(230,194,116,.2), transparent 28%),
    linear-gradient(135deg, #313d2d, #515a34);
  color: #fff;
  box-shadow: 0 12px 32px rgba(47,57,37,.14);
}
.mep-eyebrow { margin:0 0 7px; color:#b56a49; font-size:10px; font-weight:850; letter-spacing:.19em; text-transform:uppercase; }
.mep-command .mep-eyebrow { color:#f0c970; }
.mep-command h2 { margin:0; font:600 clamp(22px,2.2vw,32px)/1.15 Georgia,serif; }
.mep-command p:last-child { max-width:720px; margin:9px 0 0; color:#d9decd; font-size:13px; line-height:1.55; }
.mep-primary-button,.mep-refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.mep-primary-button { flex:0 0 auto; min-height:49px; padding:0 16px; border:1px solid #efca75; background:linear-gradient(135deg,#f6dda3,#e5b95a); color:#343a29; box-shadow:0 8px 20px rgba(20,25,17,.2); }
.mep-primary-button:hover { filter:brightness(1.04); transform:translateY(-1px); }
.mep-primary-button svg,.mep-refresh-button svg { width:16px; height:16px; }

.mep-filterbar {
  display: grid;
  grid-template-columns: 140px 170px minmax(150px,1fr) minmax(160px,1fr) minmax(170px,1fr) minmax(190px,1.25fr) 44px;
  align-items: end;
  gap: 9px;
  margin-bottom: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,252,247,.84);
  box-shadow: var(--shadow);
}
.mep-filterbar label > span:first-child {
  display: block;
  margin: 0 0 5px;
  color: #746a60;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.mep-form-grid label > span,.problem-field > span {
  display:block;
  margin:0 0 5px;
  color:#746a60;
  font-size:8.5px;
  font-weight:800;
  letter-spacing:.35px;
  text-transform:uppercase;
}
.mep-filterbar select,.mep-filterbar input {
  width:100%;
  min-height:44px;
  border:1px solid #ddcebb;
  border-radius:9px;
  padding:9px 11px;
  background:#fffdfa;
  color:#423a33;
  font:inherit;
  font-size:14px;
  font-weight:400;
  line-height:1.4;
  outline:none;
}
.mep-filterbar select:focus,.mep-filterbar input:focus { border-color:#857e4f; box-shadow:0 0 0 3px rgba(106,112,64,.11); }
.search-field { display:flex!important; align-items:center; min-height:44px; margin:0!important; border:1px solid #ddcebb; border-radius:9px; background:#fffdfa; }
.search-field:focus-within { border-color:#857e4f; box-shadow:0 0 0 3px rgba(106,112,64,.11); }
.search-field svg { flex:0 0 auto; width:15px; height:15px; margin-left:9px; color:#897b6d; }
.search-field input { min-width:0; min-height:42px; border:0; box-shadow:none!important; background:transparent; }
.mep-refresh-button { width:44px; min-height:44px; padding:0; border:1px solid #bbc4a3; background:#f1f4e9; color:#59673c; }
.mep-refresh-button span { display:none; }
.mep-refresh-button:hover { background:#e6ecd9; }
.mep-refresh-button.is-loading svg { animation:mep-spin .8s linear infinite; }

.mep-kpi-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:12px; }
.mep-kpi-grid .kpi-card { min-height:122px; padding-top:16px; }
.mep-kpi-grid .kpi-card > strong { margin-top:8px; }
.mep-kpi-grid .kpi-meta { margin-top:10px; }

.mep-production-panel { min-height:460px; padding:18px 20px; }
.mep-list-heading { align-items:flex-start!important; padding-bottom:13px; border-bottom:1px solid #eee2d4; }
.mep-list-heading h2 { font-size:16px; }
.mep-list-heading p { margin:4px 0 0; color:var(--muted); font-size:10.5px; }
.mep-result-count { flex:0 0 auto; padding:5px 9px; border-radius:99px; background:#efe7d9; color:#6e6257; font-size:9px; font-weight:800; }

.mep-schedules { margin-top:14px; padding:20px; }
.mep-schedules-heading { align-items:flex-start!important; padding-bottom:14px; border-bottom:1px solid #eee2d4; }
.mep-schedules-heading h2 { margin:0; color:#3b342e; font-size:20px; line-height:1.2; }
.mep-schedules-heading p:last-child { margin:5px 0 0; color:#756c63; font-size:13px; line-height:1.45; }
.mep-schedules-tools { display:flex; align-items:center; justify-content:flex-end; gap:9px; }
.mep-schedules-tools .recurrence-hub-link {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
  padding:0 13px;
  border:1px solid #bdc9ae;
  border-radius:10px;
  background:#e9efe2;
  color:#4c6040;
  font-size:12px;
  font-weight:750;
  text-decoration:none;
}
.mep-schedules-tools .recurrence-hub-link:hover { background:#dfe8d6; }
.mep-schedules-tools .recurrence-hub-link:focus-visible { outline:3px solid rgba(98,116,72,.2); outline-offset:2px; }
.mep-schedule-list { display:grid; gap:11px; padding-top:15px; }
.mep-schedule-card {
  display:grid;
  grid-template-columns:48px minmax(0,1fr) auto;
  align-items:center;
  gap:14px;
  min-height:104px;
  padding:15px;
  border:1px solid #e2d5c5;
  border-radius:15px;
  background:#fffdfa;
  box-shadow:0 5px 18px rgba(71,55,38,.04);
}
.mep-schedule-icon { display:grid; place-items:center; width:48px; height:48px; border-radius:14px; background:#e8eddf; color:#5a6a40; }
.mep-schedule-icon svg { width:22px; height:22px; }
.mep-schedule-copy { min-width:0; }
.mep-schedule-copy h3 { margin:6px 0 0; overflow:hidden; color:#36302b; font-size:16px; font-weight:750; line-height:1.3; text-overflow:ellipsis; white-space:nowrap; }
.mep-schedule-copy p { margin:5px 0 0; color:#746b62; font-size:13px; line-height:1.45; }
.mep-schedule-tags { display:flex; flex-wrap:wrap; gap:6px; }
.mep-schedule-tags span { display:inline-flex; align-items:center; min-height:24px; padding:0 9px; border-radius:99px; background:#eef2e7; color:#58643e; font-size:10px; font-weight:800; letter-spacing:.03em; text-transform:uppercase; }
.mep-schedule-tags .schedule-paused { background:#f3e8d8; color:#865e34; }
.mep-schedule-tags .schedule-stopped { background:#eee9e5; color:#6f6862; }
.mep-recurrence-badge { border:1px solid #c2cfb5; background:#e8eee0!important; color:#4b6040!important; }
.mep-schedule-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:7px; }
.mep-schedule-actions button {
  min-height:42px;
  padding:0 13px;
  border:1px solid #d7c9b8;
  border-radius:10px;
  background:#fff;
  color:#5f564d;
  font-family:inherit;
  font-size:12px;
  font-weight:700;
  line-height:1;
  cursor:pointer;
}
.mep-schedule-actions button:hover { border-color:#879266; background:#f4f7ed; color:#4d5c35; }
.mep-schedule-actions .schedule-pause { border-color:#d5b98c; background:#fff8ed; color:#805d34; }
.mep-schedule-actions .schedule-resume { border-color:#aebc90; background:#eef3e5; color:#53633a; }
.mep-schedule-actions .schedule-stop { border-color:#dfb9b1; background:#fff6f3; color:#9b4b42; }
.mep-schedule-actions .schedule-archive { border-color:#dcaea6; background:#fff1ef; color:#8e4038; }
.mep-schedule-actions button:disabled { opacity:.58; cursor:wait; }
.schedule-archived {
  display:inline-flex;
  align-items:center;
  min-height:36px;
  padding:0 12px;
  border-radius:999px;
  background:#ece9e5;
  color:#6d665f;
  font-size:12px;
  font-weight:750;
}

.mep-recurrence-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; padding:14px; border:1px solid #dbe2cd; border-radius:14px; background:#f3f6ed; }
.mep-weekday-picker { display:flex; flex-wrap:wrap; gap:8px; margin:0; padding:0; border:0; }
.mep-recurrence-fields[hidden],.mep-weekday-picker[hidden],.one-off-only[hidden] { display:none!important; }
.mep-weekday-picker legend { width:100%; margin-bottom:1px; color:#5e5750; font-size:13px; font-weight:650; }
.mep-weekday-picker label { display:block; }
.mep-weekday-picker input { position:absolute; width:1px!important; height:1px!important; min-height:0!important; opacity:0; pointer-events:none; }
.mep-weekday-picker span { display:grid; place-items:center; width:46px; min-height:42px; border:1px solid #d4c7b7; border-radius:10px; background:#fff; color:#655d55; font-size:13px; font-weight:750; cursor:pointer; transition:.16s ease; }
.mep-weekday-picker input:focus-visible + span { outline:3px solid rgba(104,113,67,.18); outline-offset:2px; }
.mep-weekday-picker input:checked + span { border-color:#617044; background:#647348; color:#fff; box-shadow:0 5px 12px rgba(76,91,53,.14); }
.mep-schedule-dialog { width:min(700px,calc(100vw - 32px)); }

.mep-state { min-height:300px; align-items:center; justify-content:center; gap:13px; color:#625a52; text-align:left; }
.mep-state:not([hidden]) { display:flex; }
.mep-state[hidden] { display:none; }
.mep-state strong { display:block; color:#403830; font-size:14px; }
.mep-state p { margin:3px 0 0; color:var(--muted); font-size:10.5px; }
.mep-state > span:not(.mep-spinner) { display:grid; place-items:center; width:42px; height:42px; border-radius:13px; background:#f2e7d9; color:#a65e40; }
.mep-state > span svg { width:21px; height:21px; }
.mep-loading { min-height:260px; }
.mep-spinner { width:27px; height:27px; border:3px solid #e2d8c9; border-top-color:#687143; border-radius:50%; animation:mep-spin .8s linear infinite; }
.mep-error { min-height:260px; }
.mep-error button { min-height:35px; padding:0 12px; border:1px solid #d2baa6; border-radius:8px; background:#fff9f2; color:#85513d; font-size:10px; font-weight:800; cursor:pointer; }
.mep-empty > span { background:#e8eddd!important; color:#667546!important; }

.mep-task-list { display:grid; }
.mep-task {
  display:grid;
  grid-template-columns:minmax(240px,1.35fr) minmax(320px,1fr) auto;
  gap:18px;
  align-items:center;
  min-height:126px;
  padding:16px 2px;
  border-bottom:1px solid #eee3d7;
}
.mep-task:last-child { border-bottom:0; }
.mep-task-copy { min-width:0; }
.mep-task-head { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-bottom:6px; }
.mep-status,.mep-origin,.mep-risk-badge {
  display:inline-flex;
  align-items:center;
  min-height:21px;
  padding:0 8px;
  border-radius:99px;
  font-size:8px;
  font-weight:850;
  letter-spacing:.25px;
  text-transform:uppercase;
}
.mep-status.status-open { color:#8d5a29; background:#f5e6cb; }
.mep-status.status-in-progress { color:#526735; background:#e4ebd8; }
.mep-status.status-problem { color:#a13f3b; background:#f5dcda; }
.mep-status.status-done { color:#35654a; background:#dcece0; }
.mep-status.status-review { color:#765587; background:#eadff0; }
.mep-status.status-inactive { color:#6d6862; background:#e9e7e4; }
.mep-origin { color:#725e4e; background:#eee5dc; }
.mep-risk-badge { color:#9d473d; background:#f7e2d9; }
.mep-task-copy h3 { margin:0; overflow:hidden; color:#382f29; font-size:14px; line-height:1.25; text-overflow:ellipsis; white-space:nowrap; }
.mep-task-copy p { margin:5px 0 0; color:#6f675e; font-size:10px; }
.mep-task-copy small { display:block; margin-top:4px; color:#93877b; font-size:8.8px; }
.mep-figures { display:grid; grid-template-columns:repeat(3,minmax(76px,1fr)); gap:7px; }
.mep-figure { min-height:58px; padding:9px 10px; border:1px solid #e8dbcc; border-radius:10px; background:#fcf8f2; }
.mep-figure span,.mep-figure strong { display:block; }
.mep-figure span { color:#8c8176; font-size:7.5px; font-weight:800; letter-spacing:.5px; text-transform:uppercase; }
.mep-figure strong { margin-top:4px; color:#4b4138; font-size:12px; }
.mep-figure.highlight { border-color:#ccd3b6; background:#f1f4e9; }
.mep-figure.highlight strong { color:#5a673e; }
.mep-task-actions { display:grid; grid-template-columns:1fr 1fr; gap:6px; width:262px; }
.mep-task-actions button { display:flex; align-items:center; justify-content:center; gap:6px; min-height:36px; padding:0 9px; border-radius:9px; font-size:9px; font-weight:800; cursor:pointer; }
.mep-task-actions svg { width:14px; height:14px; }
.task-start { grid-column:span 2; border:1px solid #606a3d; background:#687143; color:#fff; }
.task-complete { grid-column:span 2; border:1px solid #4d6338; background:linear-gradient(135deg,#677544,#50603a); color:#fff; }
.task-details { border:1px solid #d9c7b5; background:#fffaf4; color:#654d3d; }
.task-problem { border:1px solid #e0b7ad; background:#fff5f1; color:#a0473d; }
.task-start:hover,.task-complete:hover { filter:brightness(1.08); }
.task-details:hover { border-color:#ae8568; }
.task-problem:hover { background:#fceae5; }
.mep-task-actions button:disabled { opacity:.55; cursor:wait; }

.mep-dialog {
  width:min(940px,calc(100vw - 30px));
  max-height:calc(100vh - 30px);
  margin:auto;
  padding:0;
  overflow:hidden;
  border:0;
  border-radius:20px;
  background:#fffdfa;
  color:var(--ink);
  box-shadow:0 28px 90px rgba(35,31,25,.32);
}
.mep-dialog::backdrop { background:rgba(35,35,29,.58); backdrop-filter:blur(5px); }
.mep-dialog form { display:flex; max-height:calc(100vh - 30px); flex-direction:column; }
.mep-dialog-header { display:flex; align-items:flex-start; justify-content:space-between; gap:25px; padding:22px 24px 18px; border-bottom:1px solid #ecdfd0; background:linear-gradient(120deg,#fffaf3,#f7f1e8); }
.mep-dialog-header h2 { margin:0; color:#342d28; font:700 24px/1.15 Georgia,serif; }
.mep-dialog-header p:last-child { margin:5px 0 0; color:#81776e; font-size:10.5px; }
.dialog-close { display:grid; place-items:center; flex:0 0 auto; width:38px; height:38px; border:0; border-radius:50%; background:#eee9e2; color:#5f564d; cursor:pointer; }
.dialog-close:hover { background:#e6ddd3; }
.dialog-close svg { width:18px; height:18px; }
.mep-dialog-body { overflow-y:auto; padding:4px 24px 18px; }
.form-section { padding:18px 0; border-bottom:1px solid #eee2d5; }
.form-section:last-of-type { border-bottom:0; }
.form-section-heading { display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.form-section-heading > span { display:grid; place-items:center; width:27px; height:27px; border-radius:50%; background:#687143; color:#fff; font-size:10px; font-weight:850; }
.form-section-heading h3 { margin:0; color:#4b3d32; font-size:13px; }
.form-section-heading p { margin:2px 0 0; color:#8a8075; font-size:9px; }
.mep-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.quantity-grid { grid-template-columns:repeat(5,minmax(0,1fr)); }
.mep-form-grid .field-wide { grid-column:1/-1; }
.mep-form-grid input,.mep-form-grid select,.problem-field textarea {
  width:100%;
  min-height:42px;
  border:1px solid #decfbd;
  border-radius:10px;
  padding:0 11px;
  background:#fff;
  color:#342f2a;
  font:400 12px/1.35 Inter,ui-sans-serif,sans-serif;
  outline:none;
}
.mep-form-grid input:focus,.mep-form-grid select:focus,.problem-field textarea:focus { border-color:#72794a; box-shadow:0 0 0 3px rgba(104,113,67,.12); }
.mep-form-grid input:disabled,.mep-form-grid select:disabled { background:#f5f1eb; color:#766e66; }
.switch-field { display:flex; align-items:flex-start; gap:10px; margin:0 0 13px; padding:12px; border:1px solid #e2d3c0; border-radius:11px; background:#fbf6ef; cursor:pointer; }
.switch-field input { width:19px; height:19px; margin:1px 0 0; accent-color:#697243; }
.switch-field span,.switch-field strong,.switch-field small { display:block; }
.switch-field strong { color:#4a4037; font-size:11px; }
.switch-field small { margin-top:2px; color:#887e73; font-size:9px; }
.risk-section.is-risk { margin-inline:-10px; padding-inline:10px; background:linear-gradient(90deg,rgba(246,222,209,.36),transparent); }
.photo-field { display:flex; position:relative; align-items:center; gap:11px; min-height:62px; margin-top:13px; padding:10px 12px; overflow:hidden; border:1px dashed #cdb99f; border-radius:11px; background:#fffaf3; cursor:pointer; }
.photo-field > span { display:grid; place-items:center; flex:0 0 auto; width:38px; height:38px; border-radius:10px; background:#f1dfc3; color:#936b2c; }
.photo-field svg { width:19px; height:19px; }
.photo-field strong,.photo-field small { display:block; }
.photo-field strong { font-size:10.5px; }
.photo-field small { margin-top:2px; color:#8c8176; font-size:8.5px; }
.photo-field input { position:absolute; inset:0; width:100%; opacity:0; cursor:pointer; }
.photo-field.has-file { border-style:solid; border-color:#9eae78; background:#f0f4e8; }
.problem-field { display:block; margin-top:15px; }
.problem-field textarea { min-height:120px; padding:11px; resize:vertical; }
.form-error { margin-top:14px; padding:11px 12px; border:1px solid #e3b9b1; border-radius:9px; background:#fff1ee; color:#a13f3a; font-size:10px; font-weight:700; }
.form-error[hidden] { display:none; }
.mep-dialog-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; padding:15px 24px; border-top:1px solid #eadccc; background:#faf5ee; }
.mep-dialog-actions button { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:40px; padding:0 15px; border-radius:9px; font-size:10.5px; font-weight:800; cursor:pointer; }
.mep-dialog-actions svg { width:15px; height:15px; }
.secondary-action { border:1px solid #d8c9b8; background:#fff; color:#675c52; }
.primary-action { min-width:160px; border:1px solid #60693d; background:#687143; color:#fff; }
.danger-action { min-width:150px; border:1px solid #a6483f; background:#b84c43; color:#fff; }
.mep-dialog-actions button.is-loading { opacity:.7; cursor:wait; }
.problem-dialog { width:min(620px,calc(100vw - 30px)); }

/* Vereenvoudigd MEP-venster: dezelfde rustige opbouw als de taakplanner. */
.mep-dialog {
  width:min(760px,calc(100vw - 32px));
  max-height:calc(100dvh - 32px);
  border-radius:22px;
  background:#f8f3eb;
  box-shadow:0 28px 90px rgba(35,31,25,.34);
}
.mep-dialog form { display:grid; grid-template-rows:auto minmax(0,1fr) auto; max-height:calc(100dvh - 32px); overflow:hidden; }
.mep-dialog-header {
  display:grid;
  grid-template-columns:minmax(0,1fr) 44px;
  align-items:center;
  gap:16px;
  padding:20px 22px;
  background:linear-gradient(125deg,#fffdf9,#f5ede2);
}
#mepDetailDialog .mep-dialog-header { grid-template-columns:48px minmax(0,1fr) 44px; }
.mep-dialog-icon { display:grid; place-items:center; width:48px; height:48px; border:1px solid #dfc68d; border-radius:15px; background:linear-gradient(135deg,#f9e6ae,#e7c26a); color:#59633b; box-shadow:0 8px 18px rgba(126,93,36,.1); }
.mep-dialog-icon svg { width:24px; height:24px; }
.mep-dialog-header h2 { font-family:inherit; font-size:27px; font-weight:720; line-height:1.12; }
.mep-dialog-header p:last-child { font-size:13px; line-height:1.45; }
.dialog-close { width:44px; height:44px; border:1px solid transparent; transition:.16s ease; }
.dialog-close:hover { border-color:#cdbdab; background:#f8f2e9; transform:rotate(3deg); }
.mep-dialog-body { display:grid; align-content:start; gap:13px; overflow-y:auto; overscroll-behavior:contain; padding:16px 18px 20px; scroll-padding-bottom:24px; }
.mep-core-section,.mep-extra-panel { border:1px solid #dfd1bf; border-radius:16px; background:#fffdfa; box-shadow:0 4px 15px rgba(73,55,35,.035); }
.mep-core-section { padding:17px; }
.mep-section-title { display:flex; align-items:center; gap:11px; margin-bottom:15px; }
.mep-section-title > span { display:grid; place-items:center; flex:0 0 auto; width:40px; height:40px; border-radius:12px; background:#e9eedf; color:#5f6d43; }
.mep-section-title svg { width:19px; height:19px; }
.mep-section-title h3 { margin:0; color:#37322d; font-size:17px; font-weight:750; line-height:1.25; }
.mep-section-title p { margin:2px 0 0; color:#7c746b; font-size:13px; line-height:1.4; }
.mep-core-grid,.mep-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.mep-core-grid .field-wide,.mep-form-grid .field-wide { grid-column:1/-1; }
.mep-core-grid label,.mep-form-grid label { display:grid; align-content:start; gap:7px; min-width:0; }
.mep-core-grid label > span,.mep-dialog-body .mep-form-grid label > span,.problem-field > span {
  display:block;
  margin:0;
  color:#5e5750;
  font-size:13px;
  font-weight:650;
  letter-spacing:0;
  line-height:1.3;
  text-transform:none;
}
.mep-core-grid label > span small,.mep-dialog-body .mep-form-grid label > span small { color:#8a8178; font-size:12px; font-weight:500; }
.mep-core-grid input,.mep-core-grid select,.mep-form-grid input,.mep-form-grid select,.problem-field textarea {
  width:100%;
  min-height:50px;
  border:1px solid #d8c8b5;
  border-radius:12px;
  padding:0 14px;
  background:#fff;
  color:#342f2a;
  font-family:inherit;
  font-size:15px;
  font-weight:400;
  line-height:1.35;
  outline:none;
}
.mep-core-grid input:focus,.mep-core-grid select:focus,.mep-form-grid input:focus,.mep-form-grid select:focus,.problem-field textarea:focus { border-color:#72794a; box-shadow:0 0 0 4px rgba(104,113,67,.11); }
.mep-core-grid input:disabled,.mep-core-grid select:disabled,.mep-form-grid input:disabled,.mep-form-grid select:disabled { background:#f2eee8; color:#6f6861; opacity:1; }
.mep-quantity-pair { display:grid; grid-template-columns:minmax(0,1fr) minmax(150px,.7fr); gap:14px; }
.mep-auto-defaults { display:flex; align-items:center; gap:9px; margin-top:14px; padding:10px 12px; border-radius:11px; background:#eff3e8; color:#657047; font-size:12px; line-height:1.4; }
.mep-auto-defaults svg { flex:0 0 auto; width:17px; height:17px; }
.mep-auto-defaults strong { color:#4f5e36; }
#mepDetailDialog:not([data-mode="create"]) .create-only,#mepDetailDialog[data-mode="create"] .execution-only { display:none; }
.mep-extra-panel { overflow:hidden; }
.mep-extra-panel > summary { display:grid; grid-template-columns:42px minmax(0,1fr) 24px; align-items:center; gap:12px; min-height:78px; padding:14px 16px; cursor:pointer; list-style:none; }
.mep-extra-panel > summary::-webkit-details-marker { display:none; }
.mep-extra-panel > summary:hover { background:#fbf7f1; }
.mep-extra-icon { display:grid; place-items:center; width:42px; height:42px; border-radius:12px; background:#f0e7d9; color:#8a6646; }
.safety-panel .mep-extra-icon { background:#f4e3dc; color:#a55a48; }
.mep-extra-icon svg { width:19px; height:19px; }
.mep-extra-panel > summary strong,.mep-extra-panel > summary small { display:block; }
.mep-extra-panel > summary strong { color:#403932; font-size:16px; font-weight:720; line-height:1.3; }
.mep-extra-panel > summary small { margin-top:3px; color:#746c64; font-size:13px; line-height:1.4; }
.mep-chevron { color:#776d63; font-size:21px; text-align:center; transition:transform .18s ease; }
.mep-extra-panel[open] .mep-chevron { transform:rotate(180deg); }
.mep-extra-content { padding:15px 16px 17px; border-top:1px solid #e9ddcf; background:#fffcf8; }
.risk-section { display:grid; gap:12px; }
.risk-section.is-risk { margin:0; padding:15px 16px 17px; background:linear-gradient(135deg,rgba(246,222,209,.32),#fffcf8 55%); }
.switch-field { display:flex; align-items:flex-start; gap:11px; margin:0; padding:13px; border:1px solid #dfd1c0; border-radius:12px; background:#fff; cursor:pointer; }
.switch-field input { flex:0 0 auto; width:21px; height:21px; margin:1px 0 0; accent-color:#697243; }
.switch-field strong { color:#453e37; font-size:14px; line-height:1.3; }
.switch-field small { margin-top:3px; color:#81786f; font-size:12px; line-height:1.4; }
#riskFields[hidden],#photoField[hidden] { display:none!important; }
.photo-field { min-height:72px; margin:0; padding:11px 13px; gap:12px; border-radius:12px; }
.photo-field > span { width:42px; height:42px; border-radius:11px; }
.photo-field strong { font-size:14px; }
.photo-field small { margin-top:3px; font-size:12px; }
.problem-field { display:grid; gap:7px; margin-top:0; }
.problem-field textarea { min-height:140px; padding:13px 14px; resize:vertical; }
.form-error { margin:0; padding:12px 14px; border-radius:11px; font-size:13px; font-weight:650; line-height:1.45; }
.mep-dialog-actions { gap:9px; padding:13px 18px max(13px,env(safe-area-inset-bottom)); background:#fffaf3; }
.mep-dialog-actions button { min-height:48px; padding:0 20px; border-radius:12px; font-size:14px; font-weight:750; }
.mep-dialog-actions svg { width:17px; height:17px; }
.primary-action { min-width:210px; background:linear-gradient(135deg,#647348,#53633b); box-shadow:0 8px 18px rgba(64,88,59,.16); }
.danger-action { min-width:170px; }
.problem-dialog { width:min(620px,calc(100vw - 32px)); }
.problem-dialog .mep-dialog-body { padding-top:18px; }

.toast { position:fixed; z-index:80; right:22px; bottom:22px; max-width:min(390px,calc(100vw - 30px)); padding:12px 15px; border:1px solid #b9c29f; border-radius:9px; background:#62683d; color:#fff; box-shadow:0 12px 34px rgba(50,52,30,.24); font-size:11px; opacity:0; pointer-events:none; transform:translateY(12px); transition:.2s ease; }
.toast.show { opacity:1; transform:translateY(0); }
.toast.is-error { border-color:#d6a29a; background:#9d433d; }
.mep-main > footer { display:flex; justify-content:space-between; gap:20px; padding:18px 0 1px; color:#827a71; font-size:8.5px; }

@keyframes mep-spin { to { transform:rotate(360deg); } }

@media (max-width:1400px) {
  .mep-filterbar { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .mep-search { grid-column:span 2; }
  .mep-refresh-button { justify-self:end; }
  .mep-task { grid-template-columns:minmax(240px,1fr) minmax(270px,.8fr); }
  .mep-task-actions { grid-column:1/-1; display:flex; width:auto; justify-content:flex-end; margin-top:-6px; }
  .mep-task-actions button { min-width:125px; }
  .task-start,.task-complete { grid-column:auto; }
}

@media (max-width:900px) {
  .back-dashboard { display:none; }
  .mep-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .mep-task { grid-template-columns:1fr; gap:10px; }
  .mep-task-actions { grid-column:auto; justify-content:flex-start; margin-top:0; }
  .quantity-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .mep-schedule-card { grid-template-columns:44px minmax(0,1fr); }
  .mep-schedule-actions { grid-column:1/-1; justify-content:flex-start; padding-left:58px; }
}

@media (max-width:820px) {
  .mep-command { align-items:stretch; flex-direction:column; }
  .mep-primary-button { align-self:flex-start; }
  .mep-filterbar { grid-template-columns:1fr 1fr; }
  .mep-search { grid-column:1/-1; }
  .mep-refresh-button { grid-column:2; grid-row:3; justify-self:end; }
}

@media (max-width:650px) {
  .mep-kpi-grid { grid-template-columns:1fr; }
  .mep-kpi-grid .kpi-card { min-height:105px; }
  .mep-production-panel { padding:14px; }
  .mep-list-heading { align-items:flex-start; flex-direction:column; gap:8px; }
  .mep-task { padding:15px 0; }
  .mep-figures { grid-template-columns:repeat(3,1fr); }
  .mep-task-actions { display:grid; grid-template-columns:1fr 1fr; }
  .mep-task-actions button { min-width:0; }
  .task-start,.task-complete { grid-column:1/-1; }
  .mep-dialog { width:100vw; max-height:100dvh; border-radius:0; }
  .mep-dialog form { max-height:100dvh; }
  .mep-dialog-header { padding:18px 16px 14px; }
  .mep-dialog-header h2 { font-size:20px; }
  .mep-dialog-body { padding:3px 16px 16px; }
  .mep-form-grid,.quantity-grid { grid-template-columns:1fr; }
  .mep-form-grid .field-wide { grid-column:auto; }
  .mep-dialog-actions { padding:12px 16px; }
  .mep-dialog-actions button { flex:1; padding-inline:10px; }
  .mep-main > footer { flex-direction:column; gap:4px; }
  .mep-schedules { padding:14px; }
  .mep-schedule-card { grid-template-columns:42px minmax(0,1fr); gap:11px; padding:13px; }
  .mep-schedule-icon { width:42px; height:42px; border-radius:12px; }
  .mep-schedule-copy h3 { white-space:normal; }
  .mep-schedule-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); padding-left:0; }
  .mep-schedule-actions button { width:100%; }
  .mep-recurrence-fields { grid-template-columns:1fr; padding:12px; }
}

@media (max-width:560px) {
  .mep-command { padding:20px; }
  .mep-command h2 { font-size:24px; }
  .mep-primary-button { width:100%; }
  .mep-filterbar { grid-template-columns:1fr; }
  .mep-search,.mep-refresh-button { grid-column:auto; grid-row:auto; }
  .mep-refresh-button { width:100%; justify-self:stretch; }
  .mep-refresh-button span { display:inline; }
}

@media (prefers-reduced-motion:reduce) {
  .mep-primary-button,.toast { transition:none; }
  .mep-spinner,.mep-refresh-button.is-loading svg,.sync-button.is-loading svg { animation-duration:1.5s; }
}

@media (max-width:650px) {
  .mep-dialog { width:100vw; height:100dvh; max-height:100dvh; margin:0; border-radius:0; }
  .mep-dialog form { height:100dvh; max-height:100dvh; }
  .mep-dialog-header { grid-template-columns:minmax(0,1fr) 44px; gap:11px; padding:16px; }
  #mepDetailDialog .mep-dialog-header { grid-template-columns:44px minmax(0,1fr) 44px; }
  .mep-dialog-icon { width:44px; height:44px; border-radius:13px; }
  .mep-dialog-icon svg { width:22px; height:22px; }
  .mep-dialog-header h2 { font-size:23px; }
  .mep-dialog-header p:last-child { font-size:12px; }
  .mep-dialog-body { gap:12px; padding:14px 14px 18px; scroll-padding-bottom:22px; }
  .mep-core-section { padding:14px; }
  .mep-core-grid,.mep-form-grid { grid-template-columns:1fr; }
  .mep-core-grid .field-wide,.mep-form-grid .field-wide { grid-column:auto; }
  .mep-quantity-pair { grid-template-columns:minmax(0,1fr) minmax(128px,.72fr); gap:10px; }
  .mep-core-grid input,.mep-core-grid select,.mep-form-grid input,.mep-form-grid select,.problem-field textarea { min-height:52px; font-size:16px; }
  .mep-extra-panel > summary { min-height:78px; padding:13px 12px; }
  .mep-extra-content { padding:13px; }
  .risk-section.is-risk { padding:13px; }
  .mep-dialog-actions { display:grid; grid-template-columns:1fr 1.28fr; padding:12px 14px max(12px,env(safe-area-inset-bottom)); }
  .mep-dialog-actions button,.primary-action,.danger-action { min-width:0; padding-inline:10px; }
}

@media (max-width:390px) {
  #mepDetailDialog .mep-dialog-header { grid-template-columns:minmax(0,1fr) 44px; }
  #mepDetailDialog .mep-dialog-icon { display:none; }
  .mep-quantity-pair { grid-template-columns:1fr; }
  .mep-section-title p { font-size:11.5px; }
}
.mail-work-source{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;margin:0 0 14px;padding:12px 14px;border:1px solid #cdd7bb;border-radius:11px;background:#f3f7ed;color:#4e5841}.mail-work-source[hidden]{display:none}.mail-work-source strong,.mail-work-source span{display:block}.mail-work-source strong{font-size:12px}.mail-work-source span{grid-column:1;color:#716f65;font-size:11px;overflow-wrap:anywhere}.mail-work-source a{grid-column:2;grid-row:1/3;align-self:center;color:#5d6f3e;font-size:11px;font-weight:800}
.mep-origin[href]{color:#5d6f3e;font-weight:800}
