/* G7K36L_ERIK_BACKOFFICE_V1 */
:root {
  --ink: #172018;
  --muted: #687069;
  --canvas: #f2f4ee;
  --panel: #ffffff;
  --line: #dfe4dc;
  --green: #173d2c;
  --green-2: #245e43;
  --mint: #dcebdc;
  --cream: #f7f1df;
  --gold: #d0a24d;
  --danger: #a53b35;
  --shadow: 0 22px 60px rgba(23, 49, 34, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.ambient { position: fixed; width: 42vw; height: 42vw; border-radius: 50%; filter: blur(80px); opacity: .45; pointer-events: none; }
.ambient-one { top: -18vw; left: -10vw; background: #b8d3b9; }
.ambient-two { right: -18vw; bottom: -22vw; background: #ead8a7; }

.login-shell { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.login-card { width: min(100%, 470px); padding: 42px; border: 1px solid rgba(255,255,255,.78); border-radius: 28px; background: rgba(255,255,255,.88); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.brand-lockup { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.brand-lockup > div { display: grid; }
.brand-lockup strong { font-family: Georgia, serif; font-size: 19px; letter-spacing: .02em; }
.brand-lockup span:not(.brand-mark) { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .16em; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #fff; background: var(--green); font-family: Georgia, serif; font-size: 17px; }
.brand-light { color: #fff; }
.brand-light span:not(.brand-mark) { color: #b9cbbf; }
.brand-light .brand-mark { color: var(--green); background: #fff; }
.eyebrow { margin: 0 0 8px; color: var(--green-2); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; line-height: 1.08; }
h1 { font-size: clamp(32px, 4vw, 46px); }
h2 { font-size: 27px; }
.lede { margin: 14px 0 28px; color: var(--muted); line-height: 1.55; }
.stack { display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: #384239; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--ink); background: #fff; outline: none; transition: border-color .18s, box-shadow .18s; }
input:focus, select:focus, textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 4px rgba(36, 94, 67, .1); }
textarea { min-height: 90px; resize: vertical; }
.security-note { display: flex; gap: 8px; align-items: center; margin: 18px 0 0; color: var(--muted); font-size: 12px; }
.security-note span { color: #3f9264; }

.button { min-height: 42px; padding: 10px 16px; border: 1px solid transparent; border-radius: 11px; font-weight: 750; transition: transform .12s, opacity .12s, background .12s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .6; transform: none; }
.button-primary { color: #fff; background: var(--green); }
.button-primary:hover { background: var(--green-2); }
.button-secondary { color: var(--green); border-color: var(--line); background: #fff; }
.button-light { color: var(--green); background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.button-danger { color: var(--danger); border-color: #eccbc7; background: #fff5f3; }
.button-wide { width: 100%; margin-top: 4px; }

.app-shell { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 18px 20px; color: #eef7ef; background: linear-gradient(170deg, #153929, #0d261c); }
.sidebar .brand-lockup { padding: 0 10px; margin-bottom: 34px; }
nav { display: grid; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-radius: 12px; color: #c2d2c7; background: transparent; text-align: left; font-weight: 700; }
.nav-item span { width: 20px; font-size: 19px; text-align: center; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.1); }
.sidebar-policy { display: grid; gap: 7px; margin: auto 7px 18px; padding: 15px; border: 1px solid rgba(255,255,255,.12); border-radius: 13px; color: #dce9df; background: rgba(255,255,255,.05); }
.sidebar-policy strong { font-size: 13px; }
.sidebar-policy span { color: #aec2b5; font-size: 11px; line-height: 1.5; }
.logout { margin-top: 4px; }

.workspace { min-width: 0; padding: 34px clamp(24px, 4vw, 56px) 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.topbar h1 { font-size: 36px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 7px 11px 7px 7px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.72); }
.user-chip > div { display: grid; }
.user-chip strong { font-size: 13px; }
.user-chip span:not(.avatar) { color: var(--muted); font-size: 10px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; background: var(--green); font-family: Georgia, serif; }

.view { animation: enter .2s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } }
.hero-panel { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 34px 38px; border-radius: 22px; color: #eef7ef; background: linear-gradient(120deg, #173d2c 0%, #245e43 100%); box-shadow: var(--shadow); overflow: hidden; }
.hero-panel .eyebrow { color: #bed7c4; }
.hero-panel h2 { max-width: 640px; color: #fff; font-size: 35px; }
.hero-panel p:not(.eyebrow) { max-width: 640px; margin: 10px 0 0; color: #c9dacf; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin: 20px 0; }
.metric-card { position: relative; min-height: 128px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.88); overflow: hidden; }
.metric-card::after { content: ""; position: absolute; right: -24px; bottom: -36px; width: 90px; height: 90px; border-radius: 50%; background: var(--mint); opacity: .65; }
.metric-card strong { display: block; margin: 5px 0; font-family: Georgia, serif; font-size: 34px; font-weight: 500; }
.metric-card span { color: var(--muted); font-size: 12px; }
.metric-card small { color: var(--green-2); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.two-column { display: grid; grid-template-columns: 1.25fr .75fr; gap: 20px; }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: 19px; background: rgba(255,255,255,.9); box-shadow: 0 12px 30px rgba(38,55,42,.06); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.heading-wrap { flex-wrap: wrap; }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.quick-action { display: grid; justify-items: start; min-height: 145px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: #fbfcfa; text-align: left; }
.quick-action:hover { border-color: #9db9a5; background: #f5f9f5; }
.quick-action > span { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px; border-radius: 10px; color: var(--green); background: var(--mint); font-size: 21px; }
.quick-action strong { font-size: 14px; }
.quick-action small { margin-top: 4px; color: var(--muted); line-height: 1.4; }
.trust-list { display: grid; gap: 15px; margin: 0; padding: 0; list-style: none; }
.trust-list li { display: flex; gap: 11px; color: #425047; font-size: 13px; line-height: 1.45; }
.trust-list li > span { flex: 0 0 23px; display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; color: var(--green); background: var(--mint); font-weight: 900; }

.toolbar { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; padding: 12px; border-radius: 14px; background: #f5f7f3; }
.toolbar-grid { display: grid; grid-template-columns: 1fr 1fr 1fr auto; }
.toolbar select { min-width: 180px; }
.search-field { position: relative; flex: 1; display: flex; align-items: center; }
.search-field span { position: absolute; left: 13px; color: var(--muted); z-index: 1; }
.search-field input { padding-left: 35px; }
.employee-list { display: grid; gap: 10px; }
.employee-row { display: grid; grid-template-columns: minmax(220px, 1.2fr) minmax(140px, .7fr) minmax(140px, .8fr) minmax(130px, .8fr) auto; align-items: center; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.employee-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.employee-photo { flex: 0 0 48px; width: 48px; min-width: 48px; max-width: 48px; height: 48px; min-height: 48px; max-height: 48px; border-radius: 14px; object-fit: cover; object-position: center 24%; display: block; background: var(--mint); }
.employee-photo-fallback { display: grid; place-items: center; color: var(--green); font-family: Georgia, serif; font-weight: 700; }
.employee-person > div, .employee-detail { display: grid; gap: 3px; min-width: 0; }
.employee-person strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.employee-person span, .employee-detail span { color: var(--muted); font-size: 11px; }
.employee-detail strong { font-size: 13px; }
.employee-actions { display: flex; gap: 8px; }
.status { display: inline-flex; align-items: center; width: fit-content; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.status-active { color: #1d6340; background: #dff3e5; }
.status-inactive { color: #786e64; background: #eeeae5; }
.policy-pill { padding: 7px 10px; border-radius: 999px; color: var(--green); background: var(--mint); font-size: 11px; font-weight: 800; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 10px 12px; color: var(--muted); background: #f5f7f3; text-align: left; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
th:first-child { border-radius: 10px 0 0 10px; } th:last-child { border-radius: 0 10px 10px 0; }
td { max-width: 320px; padding: 13px 12px; border-bottom: 1px solid #edf0eb; vertical-align: top; }
td .subtle { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.event-pill { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-weight: 800; }
.event-in { color: #1d6340; background: #dff3e5; } .event-out { color: #7d4d23; background: #faeadb; }
.empty-state { padding: 42px 20px; color: var(--muted); text-align: center; }
.retention-banner { display: flex; gap: 12px; margin-bottom: 18px; padding: 14px; border: 1px solid #eadcae; border-radius: 13px; background: #fffbeb; }
.retention-banner > span { flex: 0 0 26px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #725c21; background: #f2df9c; font-family: Georgia, serif; font-weight: 800; }
.retention-banner strong { font-size: 13px; }
.retention-banner p { margin: 3px 0 0; color: #736a4b; font-size: 11px; line-height: 1.45; }

.modal { width: min(760px, calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 0; border: 0; border-radius: 20px; color: var(--ink); background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.25); }
.modal::backdrop { background: rgba(12, 29, 21, .62); backdrop-filter: blur(4px); }
.modal form { padding: 26px; }
.modal-small { width: min(560px, calc(100vw - 28px)); }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 23px; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #fff; font-size: 23px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.span-two { grid-column: 1 / -1; }
fieldset { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
legend { padding: 0 6px; color: #384239; font-size: 13px; font-weight: 700; }
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.check-grid label { display: flex; align-items: center; gap: 8px; padding: 9px; border-radius: 9px; background: #f6f8f4; }
.check-grid input, .toggle-row input { width: auto; }
.toggle-row { grid-template-columns: auto 1fr; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.toggle-row small { grid-column: 2; color: var(--muted); font-weight: 400; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; padding-top: 17px; border-top: 1px solid var(--line); }
.split-actions { justify-content: space-between; }
.split-actions > div { display: flex; gap: 9px; }
.photo-editor { display: grid; justify-items: center; gap: 14px; margin-bottom: 18px; }
.photo-preview { display: grid; place-items: center; width: 146px; height: 146px; border: 1px dashed #aeb8ad; border-radius: 24px; color: var(--muted); background: #f5f7f3; overflow: hidden; }
.photo-preview img { width: 100%; min-width: 0; max-width: 100%; height: 100%; min-height: 0; max-height: 100%; display: block; object-fit: cover; object-position: center 24%; }
.file-button { display: block; padding: 10px 15px; border: 1px solid var(--line); border-radius: 11px; color: var(--green); background: #fff; cursor: pointer; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.correction-summary { margin-bottom: 18px; padding: 13px; border-radius: 12px; background: #f5f7f3; font-size: 12px; line-height: 1.55; }
.correction-summary strong { display: block; font-size: 14px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: 410px; padding: 14px 17px; border-radius: 13px; color: #fff; background: var(--green); box-shadow: var(--shadow); font-size: 13px; }
.toast.error { background: #8c302b; }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .two-column { grid-template-columns: 1fr; }
  .employee-row { grid-template-columns: 1fr 1fr; }
  .employee-actions { justify-content: flex-end; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; padding: 14px; }
  .sidebar .brand-lockup, .sidebar-policy { display: none; }
  nav { grid-template-columns: repeat(4, 1fr); }
  .nav-item { justify-content: center; padding: 10px 5px; font-size: 0; }
  .nav-item span { font-size: 19px; }
  .logout { position: absolute; top: 14px; right: 14px; width: auto; }
  .workspace { padding: 24px 14px 40px; }
  .topbar { align-items: flex-start; }
  .topbar-actions .button, .user-chip > div { display: none; }
  .hero-panel { align-items: flex-start; flex-direction: column; padding: 25px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .toolbar, .toolbar-grid { display: grid; grid-template-columns: 1fr; }
  .toolbar select { min-width: 0; }
  .employee-row { grid-template-columns: 1fr; }
  .employee-actions { justify-content: flex-start; }
  .form-grid, .check-grid { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
}

@media (max-width: 430px) {
  .login-card { padding: 28px 22px; }
  .metric-grid { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 30px; }
  .modal-actions, .split-actions { align-items: stretch; flex-direction: column-reverse; }
  .split-actions > div { display: grid; }
}

/* HF24_SMART_PLAN_CALENDAR_R6 */
:root {
  --ink: #171314;
  --muted: #6b6662;
  --canvas: #f5f5f5;
  --panel: #ffffff;
  --line: #e2ded8;
  --green: #b00020;
  --green-2: #7a0016;
  --mint: #f8e4e6;
  --cream: #faf7f2;
  --gold: #d6a83d;
  --danger: #a53b35;
  --shadow: 0 16px 42px rgba(18, 18, 18, .10);
}
body { background: linear-gradient(180deg, #121212 0 116px, var(--canvas) 116px); }
.ambient { display: none; }
.brand-mark { border-radius: 5px; background: #b00020; font-family: Georgia, "Times New Roman", serif; }
.brand-light .brand-mark { color: #b00020; background: #fff; }
.brand-light span:not(.brand-mark), .sidebar-policy span { color: #d6d0c7; }
.sidebar { background: linear-gradient(180deg, #121212 0%, #231014 100%); }
.nav-item { border-radius: 8px; }
.nav-item:hover, .nav-item.active { background: rgba(176, 0, 32, .28); }
.button { border-radius: 8px; }
.button-primary { background: #b00020; }
.button-primary:hover { background: #7a0016; }
.button-secondary { color: #171314; }
.eyebrow { color: #b00020; }
.hero-panel { border-radius: 8px; background: linear-gradient(120deg, #121212 0%, #2b1619 100%); }
.hero-panel .eyebrow { color: #ffccd3; }
.topbar h1 { color: #fff; }
.topbar .eyebrow { color: #ffccd3; }
.user-chip { background: rgba(255,255,255,.88); }
.metric-card { border-radius: 8px; }
.metric-card::after { content: none; }
.panel { border-radius: 8px; }
.policy-pill { color: #7a0016; background: #f8e4e6; }
.employee-row { grid-template-columns: minmax(230px, 1.25fr) minmax(150px, .75fr) minmax(145px, .75fr) minmax(160px, .85fr) auto; border-radius: 8px; }
.smart-card-status small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.employee-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.employee-actions .button { min-height: 34px; padding: 7px 10px; font-size: 12px; }
.employee-smart-panel { display: grid; gap: 13px; background: #fffdf9; }
.smart-dialog-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.skill-editor { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.skill-editor label, .weekday-grid label { font-size: 12px; }
.weekday-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.weekday-grid label { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 38px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.weekday-grid input { width: auto; }
.smart-dialog-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.smart-dialog-actions small { color: var(--muted); }

.smart-plan-shell { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.94); box-shadow: 0 12px 30px rgba(18,18,18,.08); }
.smart-plan-hero { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; border-radius: 8px; color: #fff; background: linear-gradient(120deg, #121212, #321118); }
.smart-plan-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.smart-plan-title .brand-mark { flex: 0 0 42px; width: 42px; height: 42px; background: #b00020; }
.smart-plan-title h2 { color: #fff; font-size: 29px; }
.smart-plan-title .eyebrow { color: #ffccd3; }
.smart-plan-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #faf7f2; }
.location-tabs { display: inline-grid; grid-template-columns: repeat(2, minmax(170px, 1fr)); gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.location-tabs button { display: grid; gap: 2px; min-height: 52px; padding: 8px 12px; border: 0; border-radius: 6px; color: #171314; background: transparent; text-align: left; }
.location-tabs button.active { color: #fff; background: #b00020; }
.location-tabs strong { font-size: 13px; }
.location-tabs small { color: currentColor; opacity: .72; font-size: 10px; }
.smart-plan-controls.compact { display: grid; grid-template-columns: minmax(160px, 220px) minmax(132px, 170px); gap: 10px; align-items: end; }
.schedule-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.smart-metric { min-height: 104px; padding: 18px; }
.smart-metric strong { font-size: 30px; }
.smart-insights { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 10px; }
.insight-card { display: grid; gap: 5px; min-height: 68px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf9; }
.insight-card strong { font-size: 13px; }
.insight-card span { color: var(--muted); font-size: 12px; line-height: 1.35; }
.smart-plan-board { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 14px; align-items: start; }
.schedule-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day-tile { display: grid; align-content: start; gap: 5px; min-height: 112px; padding: 11px; border: 1px solid var(--line); border-left-width: 5px; border-radius: 8px; background: #fff; color: #171314; text-align: left; }
.day-tile strong { font-family: Georgia, "Times New Roman", serif; font-size: 28px; line-height: 1; }
.day-tile small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.day-weekday { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.day-status { width: fit-content; padding: 3px 7px; border-radius: 999px; font-size: 10px; font-weight: 850; text-transform: uppercase; }
.day-tile.is-ok { border-left-color: #21834f; }
.day-tile.is-ok .day-status { color: #16613a; background: #ddf3e4; }
.day-tile.is-warn { border-left-color: #d6a83d; background: #fffaf0; }
.day-tile.is-warn .day-status { color: #715610; background: #fff0bd; }
.day-tile.is-risk { border-left-color: #b00020; background: #fff5f6; }
.day-tile.is-risk .day-status { color: #8d001a; background: #ffdbe1; }
.day-tile.is-selected { outline: 3px solid rgba(176,0,32,.18); box-shadow: 0 10px 24px rgba(176,0,32,.11); }
.schedule-day-panel { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf9; }
.day-panel-heading { display: grid; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.day-panel-heading h3 { margin: 0; font-size: 18px; line-height: 1.2; }
.schedule-day-panel h4 { margin: 2px 0 -4px; color: #171314; font-size: 12px; text-transform: uppercase; }
.coverage-list, .assignment-list, .suggestion-list { display: grid; gap: 8px; }
.coverage-card, .assignment-card, .suggestion-card { display: grid; gap: 8px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.coverage-card.is-risk, .suggestion-card.is-risk { border-color: #efb7bf; background: #fff5f6; }
.coverage-card.is-warn, .suggestion-card.is-warn { border-color: #eadcae; background: #fffaf0; }
.coverage-card.is-ok, .suggestion-card.is-ok { border-color: #cde8d6; background: #f5fbf6; }
.coverage-card strong, .assignment-card strong, .suggestion-card strong { font-size: 13px; }
.coverage-card span, .coverage-card small, .assignment-card span, .suggestion-card span { color: var(--muted); font-size: 11px; line-height: 1.35; }
.assignment-card { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.assignment-card .role-chip-row { grid-column: 1 / -1; }
.role-chip-row { display: flex; flex-wrap: wrap; gap: 5px; }
.role-chip { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 7px; border-radius: 999px; color: #5d5551; background: #f1eee9; font-size: 10px; font-weight: 800; }
.role-chip.is-ok { color: #16613a; background: #ddf3e4; }
.role-chip.is-missing { color: #8d001a; background: #ffdbe1; }
.candidate-list { display: grid; gap: 6px; }
.candidate-pill { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: #171314; background: #fff; text-align: left; }
.candidate-pill:hover { border-color: #b00020; }
.candidate-pill span { color: #6b6662; }

.skill-matrix-panel { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf9; }
.skill-matrix-panel .panel-heading { margin-bottom: 0; }
.skill-matrix { display: grid; gap: 6px; overflow-x: auto; }
.skill-matrix-row { display: grid; grid-template-columns: minmax(180px, 1.35fr) minmax(120px, .9fr) repeat(5, minmax(92px, .65fr)); align-items: center; gap: 7px; min-width: 860px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: #171314; background: #fff; text-align: left; }
button.skill-matrix-row { cursor: pointer; }
button.skill-matrix-row:hover { border-color: #b00020; box-shadow: 0 6px 18px rgba(176,0,32,.08); }
.skill-matrix-head { position: sticky; top: 0; z-index: 1; border-color: #d8d2cb; background: #f7f3ed; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.skill-person { display: grid; gap: 2px; }
.skill-person strong { font-size: 12px; }
.skill-person small, .skill-base { color: var(--muted); font-size: 10px; }
.skill-level { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 4px 7px; border-radius: 999px; font-size: 10px; font-weight: 850; }
.skill-level-0 { color: #746d68; background: #efedea; }
.skill-level-1 { color: #715610; background: #fff0bd; }
.skill-level-2 { color: #16613a; background: #ddf3e4; }

.schedule-table-drawer { border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.schedule-table-drawer summary { padding: 12px 14px; color: #171314; font-weight: 800; cursor: pointer; }
.compact-table { max-height: 360px; border-top: 1px solid var(--line); background: #fff; }
.compact-table table { min-width: 820px; }
.compact-action { min-height: 32px; padding: 6px 10px; font-size: 12px; }
.compact-empty { padding: 12px; text-align: left; }

@media (max-width: 1280px) {
  .employee-row { grid-template-columns: 1fr 1fr; }
  .employee-actions { justify-content: flex-start; }
  .smart-dialog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill-editor { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .smart-plan-board { grid-template-columns: 1fr; }
}
@media (max-width: 1050px) {
  .schedule-summary, .smart-insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .schedule-calendar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  nav { grid-template-columns: repeat(6, 1fr); }
  .smart-plan-shell { padding: 12px; }
  .smart-plan-hero, .smart-plan-toolbar { align-items: stretch; flex-direction: column; }
  .location-tabs, .smart-plan-controls.compact, .schedule-summary, .smart-insights, .smart-dialog-grid, .skill-editor, .weekday-grid { grid-template-columns: 1fr; }
  .schedule-calendar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .assignment-card { grid-template-columns: 1fr; }
}


/* BACKOFFICE_TWO_PORTAL_SMARTPLAN_PIN_R1 */
.portal-tabs{position:fixed;top:12px;left:50%;transform:translateX(-50%);z-index:60;display:flex;gap:4px;padding:4px;border:1px solid rgba(0,0,0,.1);border-radius:10px;background:rgba(255,255,255,.96);box-shadow:0 8px 24px rgba(0,0,0,.1)}
.portal-tabs button{min-width:118px;height:34px;border:0;border-radius:7px;background:transparent;color:#706866;font-weight:800}.portal-tabs button.active{background:#171415;color:#fff}
.sp-portal{min-height:100vh;padding:62px 16px 20px;background:#f4f4f2;color:#191617;font:13px/1.35 Inter,Segoe UI,Arial,sans-serif}
.sp-pin-shell{min-height:calc(100vh - 90px);display:grid;place-items:center}.sp-pin-card{width:min(330px,calc(100vw - 32px));padding:24px;border:1px solid #e5dfdb;border-radius:14px;background:#fff;box-shadow:0 24px 80px rgba(0,0,0,.18);text-align:center}
.sp-pin-logo,.sp-logo{display:grid;place-items:center;background:#b00020;color:#fff;font-weight:900}.sp-pin-logo{width:44px;height:44px;margin:0 auto 12px;border-radius:10px}.sp-logo{width:34px;height:34px;border-radius:8px}
.sp-pin-card h1{margin:0 0 4px;font-size:20px}.sp-pin-card p{margin:0 0 15px;color:#746e6b;font-size:11px}.sp-pin-row{display:grid;grid-template-columns:1fr auto;gap:7px}
.sp-pin-row input{height:42px;border:1px solid #d9d3cf;border-radius:8px;padding:0 12px;text-align:center;font-size:18px;font-weight:850;letter-spacing:.28em}.sp-pin-row button{height:42px;border:0;border-radius:8px;padding:0 16px;background:#171415;color:#fff;font-weight:850}.sp-pin-error{min-height:18px;margin-top:8px!important;color:#b00020!important;font-weight:700}
.sp-workspace{max-width:1540px;margin:0 auto}.sp-topbar{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center;margin-bottom:10px}.sp-brand{display:flex;align-items:center;gap:10px;font-weight:850}
.sp-location-tabs{display:flex;justify-self:start;padding:3px;border:1px solid #e6e1dd;border-radius:9px;background:#fff}.sp-location-tabs button{border:0;background:transparent;padding:7px 14px;border-radius:7px;font-weight:750;color:#746e6b}.sp-location-tabs button.active{background:#181516;color:#fff}
.sp-weekctl{display:flex;align-items:center;gap:6px}.sp-weekctl button{height:34px;border:1px solid #e6e1dd;border-radius:8px;background:#fff;padding:0 10px}.sp-weekctl strong{min-width:130px;text-align:center}.sp-weekctl .sp-lock{color:#7a0016;background:#fff1f3}
.sp-statusline{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:10px}.sp-kpi{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 11px;border:1px solid #e6e1dd;border-radius:9px;background:#fff}.sp-kpi span:first-child{display:grid}.sp-kpi b{font-size:19px}.sp-kpi small,.sp-kpi span:last-child{color:#746e6b;font-size:10px}.sp-kpi.bad{background:#fff1f3;border-color:#efc4cb}.sp-kpi.warn{background:#fff6d9;border-color:#ead89f}
.sp-main{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(330px,.75fr);gap:10px}.sp-right{display:grid;gap:10px;align-content:start}.sp-panel{border:1px solid #e6e1dd;border-radius:10px;background:#fff;box-shadow:0 8px 24px rgba(24,20,18,.06)}
.sp-panel-h{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border-bottom:1px solid #e6e1dd}.sp-panel-h h2{margin:0;font-size:14px}.sp-panel-h small{color:#746e6b}
.sp-week-wrap{overflow-x:auto}.sp-week-grid{display:grid;grid-template-columns:86px repeat(7,minmax(92px,1fr));min-width:860px}.sp-cell{min-height:58px;padding:7px;border-right:1px solid #eee9e6;border-bottom:1px solid #eee9e6;background:#fff}.sp-cell.head{min-height:46px;background:#faf8f6;font-weight:800}
.sp-day{display:grid;gap:2px}.sp-day strong{font-size:14px}.sp-day small{color:#746e6b}.sp-rowlabel{display:grid;align-content:center;font-weight:800;background:#faf8f6}.sp-rowlabel small{font-weight:500;color:#746e6b}.sp-shift{display:grid;gap:4px}
.sp-people{display:flex;flex-wrap:wrap;gap:3px}.sp-person{border:0;padding:2px 5px;border-radius:5px;background:#f0efed;color:#191617;font-size:10px;font-weight:700}.sp-person:hover{background:#e2deda}
.sp-cover{display:flex;align-items:center;justify-content:space-between}.sp-dot{width:7px;height:7px;border-radius:50%;display:inline-block}.sp-dot.ok{background:#1f7a4c}.sp-dot.warn{background:#d29a20}.sp-dot.bad{background:#b00020}.sp-cell.risk{background:#fff1f3;box-shadow:inset 3px 0 #b00020}.sp-cell.warning{background:#fff6d9;box-shadow:inset 3px 0 #d29a20}
.sp-roleline{display:flex;gap:3px;flex-wrap:wrap}.sp-role{padding:2px 4px;border-radius:4px;background:#eaf6ee;color:#1f7a4c;font-size:9px;font-weight:850}.sp-role.miss{background:#ffdfe5;color:#8f001a}
.sp-legend{display:flex;gap:10px;color:#746e6b;font-size:10px}.sp-legend span{display:flex;align-items:center;gap:4px}.sp-attn{display:grid;gap:7px;padding:10px}.sp-issue{display:grid;grid-template-columns:auto 1fr auto;gap:8px;align-items:center;padding:8px;border:1px solid #e6e1dd;border-radius:8px}.sp-issue .sev{width:7px;height:34px;border-radius:5px;background:#b00020}.sp-issue.warning .sev{background:#d29a20}.sp-issue strong{display:block;font-size:12px}.sp-issue small{color:#746e6b}
.sp-action{border:0;border-radius:7px;padding:6px 8px;background:#181516;color:#fff;font-size:10px;font-weight:800}.sp-smartbox{padding:10px;background:#171415;color:#fff;border-radius:10px}.sp-smartbox h3{margin:0 0 7px;font-size:13px}.sp-smartbox p{margin:0;color:#d9d2ce;font-size:11px}
.sp-suggest{display:grid;gap:6px;margin-top:8px}.sp-suggest button{display:grid;grid-template-columns:1fr auto;gap:8px;border:1px solid #3c3335;border-radius:8px;background:#241e20;color:#fff;padding:8px;text-align:left}.sp-suggest small{color:#c6bdb9}.sp-score{align-self:center;padding:3px 6px;border-radius:999px;background:#62d884;color:#17351f;font-weight:900;font-size:9px}
.sp-matrix{margin-top:10px;overflow:auto}.sp-matrix table{width:100%;min-width:720px;border-collapse:collapse}.sp-matrix th,.sp-matrix td{padding:7px 8px;border-bottom:1px solid #eee9e6;text-align:center}.sp-matrix th:first-child,.sp-matrix td:first-child{text-align:left}.sp-matrix th{background:#faf8f6;color:#746e6b;font-size:10px}.sp-matrix tr[data-employee]{cursor:pointer}.sp-matrix tr[data-employee]:hover{background:#faf8f6}
.sp-lv{display:inline-grid;place-items:center;min-width:24px;height:22px;padding:0 5px;border-radius:5px;font-size:9px;font-weight:900}.sp-lv2{background:#eaf6ee;color:#1f7a4c}.sp-lv1{background:#fff6d9;color:#a87300}.sp-lv0{background:#efedeb;color:#8a817d}.sp-empty{padding:16px;color:#746e6b;text-align:center}
.sp-dialog{width:min(760px,calc(100vw - 28px));max-height:calc(100vh - 28px);padding:0;border:0;border-radius:14px}.sp-dialog::backdrop{background:rgba(0,0,0,.55)}.sp-dialog form{padding:20px}.sp-dialog-head{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:14px}.sp-dialog-head h2{margin:2px 0}.sp-dialog-head button{border:1px solid #e6e1dd;background:#fff;border-radius:7px;width:32px;height:32px;font-size:20px}
.sp-form-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:9px}.sp-form-grid label,.sp-skills label{display:grid;gap:4px;font-size:10px;color:#746e6b;font-weight:800}.sp-form-grid input,.sp-form-grid select,.sp-skills select{height:34px;border:1px solid #ddd7d3;border-radius:7px;padding:0 8px;background:#fff}
.sp-weekdays{display:grid;grid-template-columns:repeat(7,1fr);gap:5px;margin:12px 0}.sp-weekdays label{display:flex;justify-content:center;gap:4px;padding:7px;border:1px solid #e6e1dd;border-radius:7px;font-size:10px}.sp-weekdays input{width:auto}.sp-skills{display:grid;grid-template-columns:repeat(5,1fr);gap:7px;margin:12px 0}.sp-toggle-row{display:flex;gap:16px;padding:9px 0}.sp-toggle-row label{display:flex;align-items:center;gap:6px}.sp-toggle-row input{width:auto}
.sp-dialog-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:12px}.sp-dialog-actions button{height:34px;border:1px solid #e0dbd7;border-radius:7px;background:#fff;padding:0 12px}.sp-dialog-actions .primary{border:0;background:#b00020;color:#fff;font-weight:800}#spEmployeeStatus{min-height:18px;color:#746e6b;font-size:11px}
@media(max-width:1050px){.sp-main{grid-template-columns:1fr}.sp-statusline{grid-template-columns:repeat(2,1fr)}.sp-topbar{grid-template-columns:1fr}.sp-location-tabs{justify-self:stretch}.sp-form-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:700px){.portal-tabs{top:6px}.sp-portal{padding:54px 8px 16px}.sp-statusline{grid-template-columns:1fr 1fr}.sp-weekctl{flex-wrap:wrap}.sp-form-grid,.sp-skills,.sp-weekdays{grid-template-columns:1fr 1fr}}



/* SMARTPLAN_PER_DAY_SHIFT_EDITOR_R2 */
.sp-dialog{width:min(1080px,calc(100vw - 28px))}
.sp-profile-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}
.sp-profile-grid label{display:grid;gap:4px;color:#746e6b;font-size:10px;font-weight:800}
.sp-profile-grid input,.sp-profile-grid select{height:34px;border:1px solid #ddd7d3;border-radius:7px;padding:0 8px;background:#fff}
.sp-cycle-tabs{display:flex;gap:4px;width:max-content;margin:12px 0 8px;padding:3px;border:1px solid #e6e1dd;border-radius:8px;background:#faf8f6}
.sp-cycle-tabs button{min-width:86px;height:30px;border:0;border-radius:6px;background:transparent;color:#746e6b;font-weight:800}
.sp-cycle-tabs button.active{background:#171415;color:#fff}
.sp-day-table-head,.sp-day-row{display:grid;grid-template-columns:92px 98px 88px 88px 88px 88px minmax(120px,1fr);gap:7px;align-items:center}
.sp-day-table-head{padding:0 8px 5px;color:#8a817d;font-size:9px;font-weight:850;text-transform:uppercase}
.sp-day-schedule{display:grid;gap:5px;margin-bottom:12px}
.sp-day-row{min-height:44px;padding:6px 8px;border:1px solid #e6e1dd;border-radius:8px;background:#fff}
.sp-day-row.is-off{background:#faf9f8}
.sp-day-name{display:flex;align-items:center;gap:7px;font-weight:850}
.sp-day-name input{width:auto}
.sp-day-row select,.sp-day-row input[type="time"]{width:100%;height:32px;border:1px solid #ddd7d3;border-radius:7px;padding:0 6px;background:#fff;font-size:11px}
.sp-day-row.is-off select,.sp-day-row.is-off input[type="time"]{opacity:.45}
.sp-day-preset{font-weight:750}
@media(max-width:900px){
  .sp-profile-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .sp-day-table-head{display:none}
  .sp-day-row{grid-template-columns:92px 1fr 1fr;gap:6px}
  .sp-day-row .sp-day-location{grid-column:2/4}
}



/* MINI_TOKYO_APP_MOBILE_R1 */
html.mini-app,
html.mini-app body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: #0b0b0b;
  overscroll-behavior-x: none;
}
html.mini-app body {
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
html.mini-app button,
html.mini-app input,
html.mini-app select,
html.mini-app textarea {
  touch-action: manipulation;
}
html.mini-app .ambient { display: none; }

/* top mode switch: safe, thumb-friendly */
html.mini-app .portal-tabs {
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  left: 12px;
  right: 12px;
  width: auto;
  max-width: 430px;
  margin: 0 auto;
  transform: none;
  padding: 5px;
  gap: 5px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
html.mini-app .portal-tabs button {
  flex: 1 1 0;
  min-width: 0;
  height: 48px;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 850;
}

/* login */
html.mini-app .login-shell {
  min-height: 100dvh;
  place-items: start center;
  padding: calc(env(safe-area-inset-top, 0px) + 86px) 12px 24px;
}
html.mini-app .login-card {
  width: 100%;
  max-width: 460px;
  padding: 22px 16px 20px;
  border-radius: 19px;
}
html.mini-app .login-card .brand-lockup { margin-bottom: 22px; }
html.mini-app .login-card h1 { font-size: 30px; }
html.mini-app .login-card .lede { margin: 10px 0 20px; font-size: 14px; }
html.mini-app .login-card input,
html.mini-app .login-card button { min-height: 50px; }

/* Backoffice mobile shell */
html.mini-app .app-shell {
  display: block;
  min-height: 100dvh;
  background: #f5f5f5;
}
html.mini-app .sidebar {
  position: static;
  height: auto;
  padding: calc(env(safe-area-inset-top, 0px) + 84px) 10px 10px;
}
html.mini-app .sidebar .brand-lockup,
html.mini-app .sidebar-policy { display: none; }
html.mini-app .sidebar nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 6px;
}
html.mini-app .sidebar .nav-item {
  justify-content: center;
  min-height: 48px;
  padding: 8px 4px;
  font-size: 0;
  border-radius: 10px;
}
html.mini-app .sidebar .nav-item span {
  width: auto;
  font-size: 21px;
}
html.mini-app .sidebar .logout {
  position: static;
  width: 100%;
  min-height: 44px;
  margin-top: 7px;
}
html.mini-app .workspace {
  padding: 12px 10px 28px;
}
html.mini-app .topbar {
  gap: 8px;
  margin-bottom: 12px;
}
html.mini-app .topbar h1 { font-size: 27px; }
html.mini-app .topbar-actions { gap: 6px; }
html.mini-app .topbar-actions .button,
html.mini-app .user-chip > div { display: none; }
html.mini-app .panel {
  padding: 14px 12px;
  border-radius: 14px;
}
html.mini-app .panel-heading {
  gap: 10px;
  margin-bottom: 12px;
}
html.mini-app .hero-panel {
  padding: 18px 15px;
  border-radius: 15px;
}
html.mini-app .hero-panel h2 { font-size: 25px; }
html.mini-app .hero-panel p:not(.eyebrow) { font-size: 13px; }
html.mini-app .metric-grid {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}
html.mini-app .metric-card {
  min-height: 92px;
  padding: 13px;
  border-radius: 13px;
}
html.mini-app .metric-card strong { font-size: 27px; }
html.mini-app .quick-grid { grid-template-columns: 1fr; }
html.mini-app .quick-action { min-height: 92px; padding: 13px; }
html.mini-app .toolbar,
html.mini-app .toolbar-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 9px;
}
html.mini-app .toolbar select { min-width: 0; }
html.mini-app .employee-row {
  grid-template-columns: 1fr;
  gap: 9px;
  padding: 11px;
}
html.mini-app .employee-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  gap: 7px;
}
html.mini-app .employee-actions .button { min-height: 44px; }
html.mini-app .table-wrap {
  max-width: 100%;
  overscroll-behavior-x: contain;
}
html.mini-app .toast {
  left: 10px;
  right: 10px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  max-width: none;
}

/* Backoffice dialogs become true mobile sheets */
html.mini-app .modal {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  border-radius: 0;
}
html.mini-app .modal form {
  height: 100%;
  overflow-y: auto;
  padding: 0 12px calc(env(safe-area-inset-bottom, 0px) + 86px);
}
html.mini-app .modal-heading {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 -12px 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px 10px;
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid var(--line);
}
html.mini-app .modal-heading .icon-button {
  width: 44px;
  height: 44px;
}
html.mini-app .form-grid,
html.mini-app .check-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}
html.mini-app .span-two { grid-column: auto; }
html.mini-app .modal input,
html.mini-app .modal select,
html.mini-app .modal textarea { min-height: 46px; }
html.mini-app .modal-actions {
  position: sticky;
  z-index: 9;
  bottom: calc(env(safe-area-inset-bottom, 0px) * -1);
  margin: 16px -12px -74px;
  padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 10px);
  background: rgba(255,255,255,.98);
  border-top: 1px solid var(--line);
}
html.mini-app .modal-actions .button { min-height: 48px; }

/* Smart Plan workspace */
html.mini-app .sp-portal {
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top, 0px) + 84px) 8px calc(env(safe-area-inset-bottom, 0px) + 18px);
  background: #efefed;
}
html.mini-app .sp-pin-shell {
  min-height: calc(100dvh - 110px);
}
html.mini-app .sp-pin-card {
  width: 100%;
  max-width: 390px;
  padding: 24px 16px;
  border-radius: 16px;
}
html.mini-app .sp-pin-row {
  grid-template-columns: 1fr;
}
html.mini-app .sp-pin-row input,
html.mini-app .sp-pin-row button {
  height: 50px;
  font-size: 16px;
}
html.mini-app .sp-workspace {
  width: 100%;
  max-width: none;
}
html.mini-app .sp-topbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
html.mini-app .sp-brand {
  padding: 0 2px;
  font-size: 15px;
}
html.mini-app .sp-location-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  width: 100%;
  justify-self: stretch;
}
html.mini-app .sp-location-tabs button {
  min-height: 44px;
  padding: 6px 4px;
  font-size: 12px;
}
html.mini-app .sp-weekctl {
  display: grid;
  grid-template-columns: 46px minmax(0,1fr) 46px;
  width: 100%;
  gap: 6px;
}
html.mini-app #spPrevWeek { grid-column: 1; grid-row: 1; }
html.mini-app #spWeekLabel {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  align-self: center;
  font-size: 13px;
}
html.mini-app #spNextWeek { grid-column: 3; grid-row: 1; }
html.mini-app #spToday {
  grid-column: 1 / 3;
  grid-row: 2;
}
html.mini-app #spLock {
  grid-column: 3;
  grid-row: 2;
}
html.mini-app .sp-weekctl button { min-height: 44px; }
html.mini-app .sp-statusline {
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}
html.mini-app .sp-kpi {
  min-height: 72px;
  padding: 9px;
  border-radius: 10px;
}
html.mini-app .sp-kpi b { font-size: 22px; }
html.mini-app .sp-kpi > span:last-child { display: none; }
html.mini-app .sp-main {
  grid-template-columns: 1fr;
  gap: 8px;
}
html.mini-app .sp-panel {
  min-width: 0;
  border-radius: 12px;
  box-shadow: none;
}
html.mini-app .sp-panel-h {
  align-items: flex-start;
  gap: 7px;
  padding: 10px;
}
html.mini-app .sp-panel-h h2 { font-size: 15px; }
html.mini-app .sp-legend {
  display: grid;
  gap: 3px;
  font-size: 9px;
}
html.mini-app .sp-week-wrap {
  width: 100%;
  overflow: visible;
}
html.mini-app .sp-week-grid {
  display: grid;
  grid-template-columns: 1fr;
  min-width: 0;
  width: 100%;
  gap: 8px;
  padding: 8px;
}
html.mini-app .sp-mobile-day-card {
  overflow: hidden;
  border: 1px solid #ded9d4;
  border-radius: 12px;
  background: #fff;
}
html.mini-app .sp-mobile-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 9px 11px;
  background: #171415;
  color: #fff;
}
html.mini-app .sp-mobile-day-head strong { font-size: 15px; }
html.mini-app .sp-mobile-day-head span {
  color: #d8d0cc;
  font-size: 11px;
}
html.mini-app .sp-mobile-shift-block {
  display: grid;
  grid-template-columns: 72px minmax(0,1fr);
  gap: 0;
  border-top: 1px solid #eee9e6;
}
html.mini-app .sp-mobile-shift-label {
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 9px 7px;
  background: #faf8f6;
}
html.mini-app .sp-mobile-shift-label strong { font-size: 11px; }
html.mini-app .sp-mobile-shift-label small {
  color: #746e6b;
  font-size: 9px;
}
html.mini-app .sp-mobile-shift-block .sp-cell {
  min-width: 0;
  min-height: 70px;
  border: 0;
  padding: 9px;
}
html.mini-app .sp-cover b { font-size: 12px; }
html.mini-app .sp-person {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 11px;
  border-radius: 8px;
}
html.mini-app .sp-role {
  padding: 4px 6px;
  font-size: 9px;
}
html.mini-app .sp-right {
  gap: 8px;
}
html.mini-app .sp-attn { padding: 8px; }
html.mini-app .sp-issue {
  grid-template-columns: 6px minmax(0,1fr) auto;
  gap: 7px;
  padding: 8px;
}
html.mini-app .sp-issue .sev { width: 6px; }
html.mini-app .sp-action {
  min-width: 52px;
  min-height: 42px;
  font-size: 11px;
}
html.mini-app .sp-smartbox { border-radius: 12px; }
html.mini-app .sp-suggest button {
  min-height: 48px;
  padding: 9px;
}

/* Skill matrix -> employee cards */
html.mini-app .sp-matrix {
  margin-top: 8px;
  overflow: visible;
}
html.mini-app .sp-matrix table {
  display: block;
  width: 100%;
  min-width: 0;
}
html.mini-app .sp-matrix thead { display: none; }
html.mini-app .sp-matrix tbody {
  display: grid;
  gap: 8px;
  padding: 8px;
}
html.mini-app .sp-matrix .sp-matrix-person-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px;
  border: 1px solid #e6e1dd;
  border-radius: 11px;
  background: #fff;
}
html.mini-app .sp-matrix td {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: auto;
  max-width: none;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: #faf8f6;
  font-size: 11px;
}
html.mini-app .sp-matrix td::before {
  content: attr(data-label);
  color: #827a76;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}
html.mini-app .sp-matrix .sp-matrix-name {
  grid-column: 1 / -1;
  justify-content: flex-start;
  padding: 2px 0 8px;
  border-radius: 0;
  border-bottom: 1px solid #eee9e6;
  background: transparent;
}
html.mini-app .sp-matrix .sp-matrix-name::before { display: none; }
html.mini-app .sp-matrix .sp-matrix-name b { font-size: 15px; }
html.mini-app .sp-matrix .sp-matrix-base { grid-column: 1 / -1; }

/* Smart Plan edit dialog: full screen, labeled fields, sticky save */
html.mini-app .sp-dialog {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  border-radius: 0;
}
html.mini-app .sp-dialog form {
  height: 100%;
  overflow-y: auto;
  padding: 0 12px calc(env(safe-area-inset-bottom, 0px) + 92px);
}
html.mini-app .sp-dialog-head {
  position: sticky;
  top: 0;
  z-index: 12;
  margin: 0 -12px 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px 10px;
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid #e6e1dd;
}
html.mini-app .sp-dialog-head button {
  width: 44px;
  height: 44px;
}
html.mini-app .sp-profile-grid {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
html.mini-app .sp-profile-grid input,
html.mini-app .sp-profile-grid select {
  min-height: 46px;
  font-size: 13px;
}
html.mini-app .sp-cycle-tabs {
  width: 100%;
}
html.mini-app .sp-cycle-tabs button {
  flex: 1;
  min-height: 42px;
}
html.mini-app .sp-day-table-head { display: none; }
html.mini-app .sp-day-schedule { gap: 8px; }
html.mini-app .sp-day-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border-radius: 11px;
}
html.mini-app .sp-mobile-day-toggle {
  grid-column: 1 / -1;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f3f1ef;
}
html.mini-app .sp-mobile-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: #746e6b;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}
html.mini-app .sp-mobile-field > span { padding-left: 2px; }
html.mini-app .sp-mobile-field:last-child { grid-column: 1 / -1; }
html.mini-app .sp-mobile-field select,
html.mini-app .sp-mobile-field input[type="time"] {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 13px;
  text-transform: none;
}
html.mini-app .sp-skills {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
html.mini-app .sp-skills select { min-height: 44px; }
html.mini-app .sp-toggle-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}
html.mini-app .sp-toggle-row label {
  min-height: 44px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #faf8f6;
}
html.mini-app .sp-dialog-actions {
  position: sticky;
  z-index: 11;
  bottom: calc(env(safe-area-inset-bottom, 0px) * -1);
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 8px;
  margin: 14px -12px -80px;
  padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 10px);
  background: rgba(255,255,255,.98);
  border-top: 1px solid #e6e1dd;
}
html.mini-app .sp-dialog-actions button { min-height: 48px; }

/* prevent any app-level sideways drag */
html.mini-app .sp-week-wrap,
html.mini-app .sp-matrix,
html.mini-app .smart-plan-shell,
html.mini-app .workspace,
html.mini-app .view,
html.mini-app .panel {
  max-width: 100%;
  min-width: 0;
}
html.mini-app .schedule-table-drawer { display: none; }

@media (max-width: 390px) {
  html.mini-app .sp-statusline { grid-template-columns: 1fr 1fr; }
  html.mini-app .sp-profile-grid { grid-template-columns: 1fr; }
  html.mini-app .metric-grid { grid-template-columns: 1fr; }
  html.mini-app .employee-actions { grid-template-columns: 1fr; }
}



/* MINI_TOKYO_APP_MOBILE_R1_ACTIONBAR_FIX */
html.mini-app .sp-dialog-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 10px);
  background: rgba(255,255,255,.98);
  box-shadow: 0 -8px 24px rgba(0,0,0,.08);
}
html.mini-app .modal-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 10px);
  background: rgba(255,255,255,.98);
  box-shadow: 0 -8px 24px rgba(0,0,0,.08);
}



/* SMART_PLAN_CANDIDATE_PICKER_R1 */
.sp-shift-actionable{cursor:pointer;outline:none}
.sp-shift-actionable:hover{box-shadow:inset 0 0 0 2px rgba(176,0,32,.16)}
.sp-candidate-triggers{display:flex;gap:5px;flex-wrap:wrap;margin-top:3px}
.sp-candidate-trigger{min-height:28px;border:0;border-radius:7px;padding:5px 8px;background:#171415;color:#fff;font-size:9px;font-weight:850}
.sp-candidate-dialog{width:min(720px,calc(100vw - 28px));max-height:calc(100vh - 28px);padding:0;border:0;border-radius:15px;background:#f6f4f2;box-shadow:0 30px 90px rgba(0,0,0,.28)}
.sp-candidate-dialog::backdrop{background:rgba(0,0,0,.58)}
.sp-candidate-shell{display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;max-height:calc(100vh - 28px)}
.sp-candidate-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:16px 16px 12px;background:#fff;border-bottom:1px solid #e6e1dd}
.sp-candidate-head small{color:#746e6b}.sp-candidate-head h2{margin:2px 0 0;font-size:20px}
.sp-candidate-head button{width:38px;height:38px;border:1px solid #e6e1dd;border-radius:9px;background:#fff;font-size:22px}
.sp-candidate-context{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;background:#fff7dc;border-bottom:1px solid #ead89f}
.sp-candidate-context strong{font-size:12px}.sp-candidate-context small{color:#746e6b}
.sp-candidate-list{display:grid;gap:8px;overflow:auto;padding:10px}
.sp-candidate-section-title{padding:4px 2px 1px;color:#5f5855;font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.05em}
.sp-current-assignment{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 11px;border:1px solid #e2dcd8;border-radius:11px;background:#fff}
.sp-current-assignment.replacing{border-color:#9acaae;box-shadow:inset 3px 0 #1f7a4c;background:#f5fbf7}
.sp-current-assignment-main{min-width:0;text-align:left;color:#191617;background:transparent;border:0;padding:0;cursor:default}
button.sp-current-assignment-main{cursor:pointer;flex:1}
.sp-current-assignment-main strong{display:block;font-size:13px}.sp-current-assignment-main small{display:block;margin-top:2px;color:#746e6b;font-size:10px}
.sp-current-actions{display:flex;gap:6px;flex:0 0 auto}
.sp-current-source{flex:0 0 auto;padding:5px 7px;border-radius:999px;background:#f0efed;color:#5f5855;font-size:9px;font-weight:800}
.sp-current-replace,.sp-current-remove{flex:0 0 auto;min-height:34px;border-radius:8px;padding:6px 10px;font-weight:850}
.sp-current-replace{border:1px solid #9acaae;background:#eaf6ee;color:#1f6b45}
.sp-current-remove{border:1px solid #d7a0aa;background:#fff1f3;color:#8f001a}
.sp-current-replace:disabled,.sp-current-remove:disabled{opacity:.55}
.sp-replace-banner{padding:9px 10px;border-radius:9px;background:#eaf6ee;color:#1f6b45;font-size:11px;font-weight:850}
.sp-candidate-card{display:grid;gap:8px;padding:11px;border:1px solid #e2dcd8;border-radius:11px;background:#fff}
.sp-candidate-card.best{border-color:#9acaae;box-shadow:inset 3px 0 #1f7a4c}
.sp-candidate-card-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.sp-candidate-card-top strong{display:block;font-size:14px}.sp-candidate-card-top small{display:block;margin-top:2px;color:#746e6b;font-size:10px}
.sp-candidate-score{display:grid;place-items:center;min-width:50px;height:30px;border-radius:999px;background:#eaf6ee;color:#1f7a4c;font-size:11px;font-weight:900}
.sp-candidate-proposal{display:flex;justify-content:space-between;gap:10px;padding:7px 9px;border-radius:8px;background:#faf8f6;font-size:10px;color:#746e6b}
.sp-candidate-proposal b{color:#191617;font-size:12px}
.sp-candidate-reasons,.sp-candidate-skills{display:flex;gap:5px;flex-wrap:wrap}
.sp-candidate-reasons span{padding:4px 6px;border-radius:999px;background:#edf5fb;color:#285f88;font-size:9px;font-weight:750}
.sp-candidate-skills span{padding:4px 6px;border-radius:6px;background:#f0efed;color:#5f5855;font-size:9px;font-weight:750}
.sp-candidate-choose{min-height:38px;border:0;border-radius:8px;background:#171415;color:#fff;font-weight:850}
.sp-candidate-card.best .sp-candidate-choose{background:#1f7a4c}
.sp-candidate-status{min-height:18px;margin:0;padding:7px 12px 10px;color:#1f7a4c;font-size:10px;font-weight:750}

html.mini-app .sp-candidate-trigger{min-height:38px;padding:7px 10px;font-size:10px}
html.mini-app .sp-candidate-dialog{width:100vw;max-width:none;height:100dvh;max-height:100dvh;margin:0;border-radius:0}
html.mini-app .sp-candidate-shell{height:100dvh;max-height:100dvh;padding-bottom:env(safe-area-inset-bottom,0px)}
html.mini-app .sp-candidate-head{position:sticky;top:0;z-index:3;padding:calc(env(safe-area-inset-top,0px) + 12px) 12px 10px}
html.mini-app .sp-candidate-head button{width:44px;height:44px}
html.mini-app .sp-candidate-context{display:grid;gap:3px;padding:10px 12px}
html.mini-app .sp-candidate-list{padding:8px;gap:8px}
html.mini-app .sp-candidate-card{padding:11px;border-radius:12px}
html.mini-app .sp-candidate-card-top strong{font-size:15px}
html.mini-app .sp-candidate-score{min-width:56px;height:34px;font-size:12px}
html.mini-app .sp-candidate-proposal{min-height:40px;align-items:center}
html.mini-app .sp-candidate-reasons span,html.mini-app .sp-candidate-skills span{font-size:10px;padding:5px 7px}
html.mini-app .sp-candidate-choose{min-height:48px;font-size:14px}
html.mini-app .sp-current-assignment{padding:10px 11px}
html.mini-app .sp-current-assignment-main strong{font-size:14px}
html.mini-app .sp-current-assignment-main small{font-size:10px}
html.mini-app .sp-current-actions{gap:5px}
html.mini-app .sp-current-replace,html.mini-app .sp-current-remove{min-height:44px;padding:8px 11px;font-size:12px}
html.mini-app .sp-replace-banner{font-size:12px;padding:10px 11px}
html.mini-app .sp-candidate-status{padding:8px 12px calc(env(safe-area-inset-bottom,0px) + 10px);font-size:11px}



/* MINI_TOKYO_IPAD_STANDALONE_R1 */
@media (min-width: 700px) {
  html.mini-ipad.mini-app .portal-tabs {
    max-width: 560px;
    top: calc(env(safe-area-inset-top, 0px) + 18px);
  }
  html.mini-ipad.mini-app .sp-portal {
    padding: calc(env(safe-area-inset-top, 0px) + 88px) 18px calc(env(safe-area-inset-bottom, 0px) + 24px);
  }
  html.mini-ipad.mini-app .sp-workspace {
    max-width: 1180px;
    margin: 0 auto;
  }
  html.mini-ipad.mini-app .sp-topbar {
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: center;
  }
  html.mini-ipad.mini-app .sp-statusline {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  html.mini-ipad.mini-app .sp-main {
    grid-template-columns: minmax(0, 1.65fr) minmax(290px, .75fr);
    align-items: start;
  }
  html.mini-ipad.mini-app .sp-week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  html.mini-ipad.mini-app .sp-mobile-day-card {
    min-width: 0;
  }
  html.mini-ipad.mini-app .sp-matrix tbody {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  html.mini-ipad.mini-app .sp-dialog,
  html.mini-ipad.mini-app .sp-candidate-dialog {
    width: min(820px, calc(100vw - 44px));
    max-width: 820px;
    height: min(92dvh, 980px);
    max-height: 92dvh;
    margin: auto;
    border-radius: 18px;
  }
  html.mini-ipad.mini-app .sp-dialog form,
  html.mini-ipad.mini-app .sp-candidate-shell {
    height: 100%;
    max-height: 100%;
  }
  html.mini-ipad.mini-app .sp-profile-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  html.mini-ipad.mini-app .sp-day-row {
    grid-template-columns: 150px repeat(2, minmax(0, 1fr));
  }
  html.mini-ipad.mini-app .sp-mobile-day-toggle {
    grid-column: 1;
    grid-row: 1 / span 3;
    align-self: stretch;
  }
  html.mini-ipad.mini-app .sp-mobile-field:last-child {
    grid-column: 2 / -1;
  }
  html.mini-ipad.mini-app .sp-dialog-actions {
    left: 50%;
    right: auto;
    width: min(820px, calc(100vw - 44px));
    transform: translateX(-50%);
    border-radius: 0 0 18px 18px;
  }
  html.mini-ipad.mini-app .app-shell {
    max-width: 1180px;
    margin: 0 auto;
  }
  html.mini-ipad.mini-app .workspace {
    padding: 18px 18px 34px;
  }
  html.mini-ipad.mini-app .employee-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
  html.mini-ipad.mini-app .employee-actions {
    width: auto;
    grid-template-columns: repeat(2, auto);
  }
}
