:root {
    color-scheme: light;
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #f1f4f8;
    --line: #d9dee7;
    --text: #172033;
    --muted: #667085;
    --primary: #246bfe;
    --primary-dark: #174fc3;
    --danger: #d92d20;
    --danger-bg: #fff1f0;
    --success-bg: #ecfdf3;
    --success: #067647;
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

body.is-scroll-locked {
    overflow: hidden;
}

a {
    color: inherit;
}

input, select, textarea, button {
    font: inherit;
}

input, select, textarea {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
    background: #fff;
}

textarea {
    resize: vertical;
}

.app-shell {
    min-height: 100vh;
}

.has-sidebar {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
}

.is-sidebar-collapsed {
    grid-template-columns: 72px minmax(0, 1fr);
}

.is-sidebar-collapsed .sidebar__nav a,
.is-sidebar-collapsed .brand,
.is-sidebar-collapsed .sidebar-user__menu summary {
    font-size: 0;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid var(--line);
    background: #111827;
    color: #fff;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
}

.sidebar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 24px;
}

.brand {
    font-weight: 700;
    text-decoration: none;
}

.sidebar__nav {
    display: grid;
    gap: 8px;
}

.sidebar__nav a {
    min-height: 40px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    padding: 0 12px;
    color: #d1d5db;
    text-decoration: none;
}

.sidebar__nav a.active,
.sidebar__nav a:hover {
    background: #263244;
    color: #fff;
}

.sidebar-user {
    margin-top: auto;
    padding-top: 16px;
}

.sidebar-user__menu {
    position: relative;
}

.sidebar-user__menu summary {
    min-height: 40px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    padding: 0 12px;
    color: #f9fafb;
    background: #1f2937;
    cursor: pointer;
    list-style: none;
    font-weight: 700;
}

.sidebar-user__menu summary::-webkit-details-marker {
    display: none;
}

.sidebar-user__menu summary::after {
    content: "⌃";
    margin-left: auto;
    color: #cbd5e1;
    font-size: 12px;
}

.sidebar-user__menu[open] summary::after {
    content: "⌄";
}

.sidebar-user__actions {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 8px);
    display: grid;
    gap: 4px;
    padding: 8px;
    border: 1px solid #334155;
    border-radius: 6px;
    background: #0f172a;
    box-shadow: 0 12px 24px rgba(0, 0, 0, .24);
    z-index: 2;
}

.sidebar-user__actions a,
.sidebar-user__actions button {
    min-height: 36px;
    width: 100%;
    display: flex;
    align-items: center;
    border: 0;
    border-radius: 6px;
    padding: 0 10px;
    background: transparent;
    color: #e5e7eb;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.sidebar-user__actions a:hover,
.sidebar-user__actions button:hover {
    background: #263244;
    color: #fff;
}

.main {
    padding: 24px;
    min-width: 0;
}

.service-selector {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.auth-panel {
    width: min(420px, calc(100vw - 32px));
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
}

.auth-panel h1 {
    margin: 0 0 22px;
}

.service-selector__inner {
    width: min(720px, calc(100vw - 32px));
    text-align: center;
}

.service-selector h1,
.page-header h1 {
    margin: 0;
    font-size: 28px;
}

.service-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 28px;
}

.service-button {
    width: 180px;
    min-height: 88px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
}

.service-button:hover {
    border-color: var(--primary);
}

.muted,
.muted-text {
    color: var(--muted);
}

.notice {
    margin-top: 18px;
    color: var(--primary-dark);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 13px;
}

.button,
.icon-button {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 12px;
    white-space: nowrap;
}

.button.primary {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.button.danger {
    border-color: var(--danger);
    color: var(--danger);
}

.button.small {
    min-height: 30px;
    padding: 0 8px;
    font-size: 12px;
}

.button.disabled {
    background: var(--surface-2);
    color: var(--muted);
    cursor: default;
}

.button:disabled {
    border-color: var(--line);
    background: var(--surface-2);
    color: var(--muted);
    cursor: not-allowed;
}

.icon-button {
    width: 36px;
    padding: 0;
}

.header-actions,
.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.toast {
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
}

.toast.success {
    background: var(--success-bg);
    color: var(--success);
}

.toast.error {
    background: var(--danger-bg);
    color: var(--danger);
}

.toast.warning {
    background: #fffbeb;
    color: #92400e;
}

.customer-alert-popups {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 80;
    display: grid;
    gap: 10px;
    width: min(680px, calc(100vw - 32px));
}

.customer-alert-popup {
    display: grid;
    gap: 16px;
    padding: 22px 24px;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    background: #fff7ed;
    box-shadow: 0 16px 36px rgba(15, 23, 42, .22);
}

.customer-alert-popup__message {
    margin: 0;
    color: var(--text);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.6;
    text-align: center;
}

.customer-alert-popup__nowrap {
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow-wrap: normal;
}

.customer-alert-popup__open {
    justify-self: center;
    min-width: 120px;
}

.in-modal {
    margin-top: 10px;
}

.list-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.filters,
.table-panel,
.detail-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.filters {
    display: grid;
    grid-template-columns: minmax(360px, auto) minmax(120px, 150px) minmax(120px, 150px) minmax(240px, 1.2fr) auto;
    align-items: end;
    gap: 12px;
    padding: 14px;
}

.filters__date-range {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.filters__date-range-label {
    color: var(--muted);
    font-size: 13px;
}

.filters__date-range-controls {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) auto minmax(130px, 1fr);
    align-items: center;
    gap: 8px;
}

.filters__date-range-separator {
    color: var(--text);
    font-size: 18px;
    line-height: 1;
}

.filters__date-range .list-date-picker,
.filters__date-range .list-date-picker__trigger {
    width: 100%;
}

.filters__keyword {
    grid-column: auto;
}

.filters__compact {
    max-width: 150px;
    width: 100%;
}

.filters__compact select {
    width: 100%;
}

.list-toolbar {
    display: flex;
    justify-content: flex-end;
}

.per-page-control {
    display: flex;
    align-items: center;
    gap: 6px;
    width: auto;
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.per-page-control select {
    width: 110px;
}

.filter-actions {
    flex-wrap: wrap;
}

.filters > .filter-actions {
    align-self: end;
}

.filters label,
.detail-form label,
.activity-form label,
.activity-edit label,
.stack-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    min-width: 0;
}

.form-hint {
    color: var(--muted);
    font-size: 12px;
}

.filter-footer {
    grid-column: 1 / -1;
    display: grid;
    gap: 12px;
    padding-top: 2px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chips a {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 10px;
    text-decoration: none;
    background: var(--surface-2);
    font-size: 12px;
}

.table-panel {
    min-width: 0;
    padding: 0;
}

.bulk-actions {
    display: flex;
    align-items: end;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
    flex-wrap: wrap;
}

.bulk-actions label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
}

.bulk-actions select {
    min-width: 150px;
}

.table-scroll {
    overflow: auto;
}

.customer-table {
    width: 100%;
    min-width: 1230px;
    border-collapse: separate;
    border-spacing: 0;
}

.customer-table th,
.customer-table td {
    border-bottom: 1px solid var(--line);
    padding: 10px;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.customer-table tbody tr.is-drawer-active td {
    background: #eff6ff;
    box-shadow: inset 0 1px 0 #93c5fd, inset 0 -1px 0 #93c5fd;
}

.customer-table tbody tr.is-drawer-active td:first-child {
    box-shadow: inset 3px 0 0 var(--primary), inset 0 1px 0 #93c5fd, inset 0 -1px 0 #93c5fd;
}

.customer-table th {
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    position: sticky;
    text-align: center;
    top: 0;
    z-index: 1;
}

.customer-table tbody td {
    text-align: center;
}

.customer-table .row-menu-col {
    width: 48px;
    min-width: 48px;
    text-align: center;
}

.row-action-menu {
    position: relative;
    display: inline-block;
}

.row-action-menu summary {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--muted);
    cursor: pointer;
    list-style: none;
    font-size: 22px;
    line-height: 1;
}

.row-action-menu summary::-webkit-details-marker {
    display: none;
}

.row-action-menu summary:hover,
.row-action-menu[open] summary {
    background: var(--surface-2);
    color: var(--text);
}

.row-action-menu__items {
    position: fixed;
    z-index: 30;
    width: 190px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    box-shadow: 0 12px 24px rgba(15, 23, 42, .16);
}

.row-action-menu__items a,
.row-action-menu__items button {
    width: 100%;
    min-height: 34px;
    display: flex;
    align-items: center;
    border: 0;
    border-radius: 6px;
    padding: 0 10px;
    background: transparent;
    color: var(--text);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.row-action-menu__items a:hover,
.row-action-menu__items button:hover {
    background: var(--surface-2);
}

.user-management-name-link {
    color: var(--text);
    font-weight: 700;
}

.user-management-name-link:hover {
    color: var(--primary);
}

.customer-table tbody td.sticky-col,
.customer-table tbody td.area-col {
    text-align: left;
}

.customer-table th.sortable-header {
    padding: 0;
    transition: background 0.15s ease;
}

.customer-table th.sortable-header:hover {
    background: #eef4ff;
}

.sortable-header__link {
    align-items: center;
    color: inherit;
    display: flex;
    gap: 6px;
    justify-content: center;
    min-height: 40px;
    padding: 10px;
    text-decoration: none;
    width: 100%;
}

.sortable-header__arrows {
    color: var(--primary);
    font-size: 11px;
}

.select-col {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    width: 42px;
    min-width: 42px;
    text-align: center;
}

.select-col input {
    width: auto;
}

.sticky-col {
    position: sticky;
    left: 42px;
    z-index: 2;
    background: #fff;
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    box-shadow: 1px 0 0 var(--line);
}

.customer-table--user .sticky-col {
    left: 0;
}

.registered-col {
    min-width: 104px;
}

.customer-table .region-col {
    min-width: 116px;
    text-align: center;
}

.area-col {
    min-width: 180px;
}

.customer-table tbody tr.is-drawer-active .sticky-col {
    background: #eff6ff;
}

.customer-table tbody tr.is-drawer-active .select-col {
    background: #eff6ff;
}

th.select-col {
    z-index: 3;
    background: #f8fafc;
}

th.sticky-col {
    z-index: 3;
    background: #f8fafc;
}

.name-cell__inner {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.name-cell__inner > a:first-child {
    flex: 1;
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: break-word;
}

.status-col {
    min-width: 150px;
}

.owner-col {
    min-width: 120px;
}

.status-col select,
.owner-col select {
    min-width: 100%;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text);
    padding: 0 10px;
    font-weight: 700;
    white-space: nowrap;
}

.status-pill--not-started {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

.status-pill--unavailable {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #334155;
}

.status-pill--reception-block {
    background: #ffe4e6;
    border-color: #fda4af;
    color: #be123c;
}

.status-pill--email {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0369a1;
}

.status-pill--contacted {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.status-pill--in-progress {
    background: #cffafe;
    border-color: #67e8f9;
    color: #0e7490;
}

.status-pill--prospect-before-appointment {
    background: #ffedd5;
    border-color: #fdba74;
    color: #c2410c;
}

.status-pill--appointment {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

.status-pill--prospect-after-appointment {
    background: #ecfccb;
    border-color: #bef264;
    color: #4d7c0f;
}

.status-pill--follow-up {
    background: #fae8ff;
    border-color: #e879f9;
    color: #a21caf;
}

.status-pill--current-analysis {
    background: #e0e7ff;
    border-color: #a5b4fc;
    color: #4338ca;
}

.status-pill--negotiation {
    background: #ede9fe;
    border-color: #c4b5fd;
    color: #6d28d9;
}

.status-pill--contracted {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.status-pill--ng {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;
}

.status-pill--lost {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.status-pill--call,
.status-pill--call-only {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.status-pill--contact-unavailable,
.status-pill--reception-block {
    background: #ffe4e6;
    border-color: #fda4af;
    color: #be123c;
}

.status-pill--memo,
.status-pill--info-share {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

.status-pill--return-call,
.status-pill--return-email {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0369a1;
}

.status-pill--apo,
.status-pill--return-contact-apo,
.status-pill--apo-change {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

.status-pill--apo-cancel,
.status-pill--ng {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;
}

.status-pill--reschedule,
.status-pill--website-inquiry {
    background: #fae8ff;
    border-color: #e879f9;
    color: #a21caf;
}

.status-pill--first-visit,
.status-pill--revisit,
.status-pill--handled {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.detail-link {
    flex: 0 0 28px;
    border: 1px solid var(--line);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    text-decoration: none;
    background: #fff;
}

.detail-link img {
    width: 16px;
    height: 16px;
    display: block;
}

.date-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.date-inline input {
    width: 145px;
}

.list-date-picker {
    display: inline-flex;
    position: relative;
}

.list-date-picker__trigger {
    box-sizing: border-box;
    width: 150px;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.list-date-picker__trigger:disabled {
    cursor: not-allowed;
    background: #f1f5f9;
    color: var(--muted);
}

.list-date-picker__trigger:focus-visible,
.list-date-picker__day:focus-visible,
.list-date-picker__nav:focus-visible,
.list-date-picker__text-button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.list-date-picker__icon {
    width: 18px;
    height: 18px;
    display: block;
    opacity: 0.72;
}

.list-date-picker__calendar {
    position: fixed;
    z-index: 100;
    width: 320px;
    overflow: auto;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
}

.list-date-picker__calendar[hidden] {
    display: none;
}

.list-date-picker__head {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 4px;
}

.list-date-picker__month {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    text-align: center;
}

.list-date-picker__nav {
    min-height: 38px;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.list-date-picker__weekdays,
.list-date-picker__dates {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-top: 10px;
}

.list-date-picker__weekdays span {
    height: 28px;
    display: grid;
    place-items: center;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.list-date-picker__weekdays span:first-child {
    color: var(--danger);
}

.list-date-picker__weekdays span:last-child {
    color: var(--primary);
}

.list-date-picker__day {
    height: 38px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: #fff;
    color: var(--text);
    font: inherit;
    cursor: pointer;
}

.list-date-picker__day.is-outside {
    color: var(--muted);
}

.list-date-picker__day.is-selected {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

.list-date-picker__day.is-focused {
    border-color: var(--muted);
}

.list-date-picker__foot {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.list-date-picker__text-button {
    border: 0;
    padding: 8px;
    background: transparent;
    color: var(--primary);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.detail-form .list-date-picker,
.detail-form .list-date-picker__trigger {
    width: 100%;
}

.date-time-picker,
.date-time-picker__trigger {
    width: 100%;
}

.date-time-picker {
    display: inline-flex;
    position: relative;
}

.date-time-picker__trigger {
    box-sizing: border-box;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.date-time-picker__trigger:focus-visible,
.date-time-picker__day:focus-visible,
.date-time-picker__nav:focus-visible,
.date-time-picker__text-button:focus-visible,
.date-time-picker__apply:focus-visible,
.date-time-picker select:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.date-time-picker__icon {
    width: 18px;
    height: 18px;
    display: block;
    opacity: 0.72;
}

.date-time-picker__panel {
    position: fixed;
    z-index: 110;
    width: min(520px, calc(100vw - 24px));
    overflow: auto;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
}

.date-time-picker__panel[hidden] {
    display: none;
}

.date-time-picker__grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 170px;
    gap: 14px;
}

.date-time-picker__head {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 4px;
}

.date-time-picker__month {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    text-align: center;
}

.date-time-picker__nav {
    min-height: 38px;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.date-time-picker__weekdays,
.date-time-picker__dates {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-top: 10px;
}

.date-time-picker__weekdays span {
    height: 28px;
    display: grid;
    place-items: center;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.date-time-picker__weekdays span:first-child {
    color: var(--danger);
}

.date-time-picker__weekdays span:last-child {
    color: var(--primary);
}

.date-time-picker__day {
    height: 38px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: #fff;
    color: var(--text);
    font: inherit;
    cursor: pointer;
}

.date-time-picker__day.is-outside {
    color: var(--muted);
}

.date-time-picker__day.is-disabled {
    background: #f8fafc;
    color: #cbd5e1;
    cursor: not-allowed;
}

.date-time-picker__day.is-selected {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

.date-time-picker__day.is-focused {
    border-color: var(--muted);
}

.date-time-picker__time {
    display: grid;
    gap: 10px;
    align-content: start;
    padding: 12px;
    border-radius: 8px;
    background: #f8fafc;
}

.date-time-picker__time strong {
    color: var(--muted);
    font-size: 13px;
}

.date-time-picker__time-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    align-items: center;
    gap: 4px;
}

.date-time-picker__time-row select {
    width: 100%;
    min-height: 36px;
    padding: 6px;
}

.date-time-picker__time p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.date-time-picker__shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.date-time-picker__shortcuts button {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 7px;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
}

.date-time-picker__foot {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.date-time-picker__text-button,
.date-time-picker__apply {
    min-height: 36px;
    border: 0;
    border-radius: 6px;
    padding: 0 10px;
    background: transparent;
    color: var(--primary);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.date-time-picker__apply {
    background: var(--primary);
    color: #fff;
}

.confirmed-date {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 100%;
}

.confirmed-date__display {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 42px;
    cursor: default;
    background: #fff;
}

.confirmed-date__button {
    position: absolute;
    right: 6px;
    top: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
}

.confirmed-date__button:hover {
    background: #eef4ff;
}

.confirmed-date__button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.confirmed-date__icon {
    width: 18px;
    height: 18px;
    display: block;
    opacity: 0.72;
}

.confirmed-date__panel {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    left: 0;
    width: min(420px, calc(100vw - 48px));
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
}

.confirmed-date__fields,
.confirmed-date__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.confirmed-date__field {
    display: grid;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.confirmed-date__fields select {
    width: 76px;
}

.confirmed-date__actions {
    margin-top: 10px;
}

.date-inline .confirmed-date {
    width: 175px;
}

.date-inline .confirmed-date__display {
    width: 100%;
}

.badge {
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 700;
}

.badge.danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.empty-state {
    padding: 28px;
    color: var(--muted);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.metric {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    background: var(--surface);
    text-decoration: none;
}

.metric span {
    color: var(--muted);
}

.metric strong {
    font-size: 34px;
}

.metric.danger strong {
    color: var(--danger);
}

.user-activity-summary {
    margin-bottom: 16px;
}

.user-activity-summary dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.user-activity-summary dt {
    color: var(--muted);
    font-size: 13px;
}

.user-activity-summary dd {
    margin: 6px 0 0;
    font-weight: 700;
}

.user-activity-metrics {
    grid-template-columns: repeat(2, 220px);
    justify-content: start;
    margin-bottom: 16px;
}

.user-activity-metrics .metric {
    border: 2px solid #94a3b8;
    width: 220px;
}

.user-activity-today-metric {
    border-color: #f97316;
    background: #fffbeb;
}

.mypage-summary {
    width: fit-content;
    max-width: 100%;
}

.mypage-summary__title {
    margin: 0 0 14px;
    font-size: 20px;
}

.mypage-metrics {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    margin-bottom: 0;
}

.mypage-summary-actions {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 12px;
}

.mypage-metrics .metric {
    border: 2px solid #94a3b8;
    width: 220px;
}

.mypage-today-metric {
    border-color: #f97316;
    background: #fffbeb;
}

.mypage-metrics .mypage-status-metric {
    width: 160px;
    border-color: #cbd5e1;
    background: #fff;
}

.mypage-status-metric strong {
    font-size: 30px;
}

.mypage-confirm-modal .modal__panel {
    display: grid;
    gap: 14px;
    width: min(460px, calc(100vw - 32px));
}

.mypage-confirm-modal h2,
.mypage-confirm-modal p {
    margin: 0;
}

.mypage-history {
    max-width: 980px;
    margin-top: 36px;
}

.mypage-history__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}

.mypage-history__header h2 {
    margin: 0;
    font-size: 20px;
}

.mypage-history-filter {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.mypage-history-period {
    display: grid;
    gap: 6px;
}

.mypage-history-period > span {
    color: var(--muted);
    font-size: 13px;
}

.mypage-history-period__controls {
    display: grid;
    grid-template-columns: 160px auto 160px;
    align-items: center;
    gap: 8px;
}

.mypage-history-period__controls .list-date-picker,
.mypage-history-period__controls .list-date-picker__trigger {
    width: 100%;
}

.mypage-history-period__separator {
    color: var(--muted);
    text-align: center;
}

.mypage-history__empty {
    padding: 22px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.mypage-history-table {
    min-width: 720px;
}

.mypage-history-table th:first-child,
.mypage-history-table td:first-child {
    width: 140px;
    text-align: center;
}

.mypage-history-table th:nth-child(2),
.mypage-history-table td:nth-child(2) {
    width: 110px;
    text-align: center;
}

.mypage-history-statuses {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mypage-history-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-2);
    white-space: nowrap;
}

.mypage-history-status strong {
    min-width: 18px;
    text-align: right;
}

.mypage-table {
    min-width: 720px;
}

.mypage-table th,
.mypage-table td {
    border-right: 1px solid var(--line);
}

.mypage-table th:last-child,
.mypage-table td:last-child {
    border-right: 0;
}

.customer-table .mypage-date-col {
    width: 140px;
    min-width: 140px;
}

.customer-table .mypage-business-col {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    white-space: normal;
}

.mypage-business-link {
    color: var(--text);
    font-weight: 700;
}

.mypage-business-link:hover {
    color: var(--primary);
}

.customer-table .mypage-memo-col {
    min-width: 460px;
    background: #fbfdff;
    text-align: left;
    white-space: pre-wrap;
}

.customer-table.mypage-table tbody tr.mypage-today-row td {
    background: #fffbeb;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr);
    gap: 16px;
}

.detail-section {
    padding: 16px;
    margin-bottom: 16px;
}

.detail-grid .detail-section,
.activity-section {
    background: #f8fbff;
}

.detail-section h2 {
    margin: 0 0 14px;
    font-size: 18px;
}

.detail-nav-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.detail-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.detail-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.span-2,
.wide {
    grid-column: 1 / -1;
}

.next-action-alert-row {
    display: grid;
    grid-template-columns: minmax(0, calc((100% - 12px) / 2)) auto;
    align-items: end;
    gap: 10px;
    min-width: 0;
    justify-content: start;
}

.next-action-field {
    min-width: 0;
}

.next-action-alert-toggle {
    min-height: 38px;
    padding-bottom: 2px;
    white-space: nowrap;
}

.input-with-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.copy-field-group {
    display: grid;
    gap: 4px;
    align-content: start;
}

.readonly-field-group {
    display: grid;
    gap: 4px;
    align-content: start;
}

.detail-field-label {
    color: var(--muted);
    font-size: 13px;
}

.copy-field {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    padding: 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
    min-width: 0;
}

.copy-field strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.readonly-field {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    padding: 8px 10px;
    display: grid;
    gap: 4px;
    min-height: 66px;
    min-width: 0;
    color: var(--muted);
    font-size: 13px;
}

.readonly-field strong {
    color: var(--text);
    font-size: 17px;
}

.readonly-field .status-pill {
    justify-self: start;
    min-height: 28px;
    font-size: 14px;
}

.readonly-field small {
    color: var(--muted);
}

.definition-list {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 10px;
}

.definition-list dt {
    color: var(--muted);
}

.definition-list dd {
    margin: 0;
}

.link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.link-list a {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    padding: 6px 10px;
    text-decoration: none;
}

.activity-form,
.activity-edit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.activity-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.activity-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 8px;
}

.activity-summary-toggle {
    width: 100%;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    padding: 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.activity-summary-toggle:hover {
    background: var(--primary-soft);
}

.activity-summary-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.activity-toggle-icon {
    display: inline-grid;
    place-items: center;
    width: 22px;
    min-height: 22px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1;
}

.activity-summary-toggle__content {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.activity-summary-toggle__main {
    display: grid;
    grid-template-columns: minmax(160px, 1.25fr) minmax(120px, 1fr) minmax(120px, 1fr);
    gap: 12px;
    align-items: start;
}

.activity-summary-value {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.activity-summary-value span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.activity-summary-value strong {
    min-width: 0;
    color: var(--text);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.activity-summary-value .status-pill {
    justify-self: start;
}

.activity-summary-value--memo strong {
    display: -webkit-box;
    overflow: hidden;
    white-space: pre-wrap;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.activity-item.is-collapsed > form[id^="activity-update-"],
.activity-item.is-collapsed > .activity-item__actions {
    display: none;
}

.activity-item > form[id^="activity-update-"] {
    margin-top: 10px;
}

.activity-item__summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.activity-summary-field {
    display: grid;
    gap: 4px;
    align-content: start;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    padding: 8px;
}

.activity-summary-field--readonly {
    background: #f1f5f9;
}

.activity-summary-field span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.activity-summary-field strong {
    min-width: 0;
    color: var(--text);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.activity-summary-field input,
.activity-summary-field select {
    width: 100%;
    min-height: 34px;
    padding: 6px 8px;
    font-size: 14px;
}

.activity-summary-field .status-pill {
    justify-self: start;
    min-height: 28px;
    font-size: 13px;
}

.activity-edit {
    margin-top: 12px;
}

.activity-item__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.danger-icon-button {
    width: 40px;
    height: 40px;
    border-color: #fecaca;
    background: #fff;
}

.danger-icon-button:hover {
    background: #fef2f2;
}

.danger-icon-button img {
    width: 18px;
    height: 18px;
    display: block;
}

@media (max-width: 1120px) {
    .filters {
        grid-template-columns: minmax(360px, auto) minmax(150px, 180px) minmax(200px, 1fr);
    }

    .filters > .filter-actions {
        grid-column: 1 / -1;
        justify-self: end;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-form {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .input-with-action {
        grid-template-columns: 1fr;
    }

    .copy-field {
        grid-template-columns: 1fr;
    }

    .copy-field .button {
        justify-self: start;
    }

    .activity-form,
    .activity-edit {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

.drawer,
.modal {
    position: fixed;
    inset: 0;
    z-index: 20;
}

.drawer__backdrop,
.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .35);
}

.drawer__panel {
    position: absolute;
    inset: 0 0 0 auto;
    width: min(980px, 86vw);
    overflow: auto;
    background: var(--bg);
    padding: 22px;
    box-shadow: -10px 0 30px rgba(15, 23, 42, .18);
}

.drawer__close,
.modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
}

.drawer__panel > [data-drawer-body] {
    padding-top: 34px;
}

.modal__panel {
    position: relative;
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow: auto;
    margin: 10vh auto 0;
    background: var(--surface);
    border-radius: 8px;
    padding: 22px;
    border: 1px solid var(--line);
}

.modal__panel .toast.error {
    max-height: min(420px, 50vh);
    overflow: auto;
}

.sales-owner-modal .modal__panel {
    display: grid;
    gap: 14px;
}

.sales-owner-modal h2,
.sales-owner-modal p {
    margin: 0;
}

.sales-owner-modal label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
}

.stack-form {
    display: grid;
    gap: 14px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.checkbox {
    display: flex !important;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px;
    color: var(--text) !important;
}

.checkbox input {
    width: auto;
}

.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-top: 1px solid var(--line);
}

.pagination-summary {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.pagination {
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pagination a,
.pagination span {
    min-width: 34px;
    min-height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    text-decoration: none;
    background: #fff;
    color: var(--text);
    font-size: 13px;
    padding: 0 10px;
}

.pagination span[aria-disabled="true"] {
    color: var(--muted);
    background: var(--surface-2);
}

.pagination .active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

@media (max-width: 860px) {
    .has-sidebar {
        grid-template-columns: 1fr;
    }

    .is-sidebar-collapsed {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto !important;
        min-height: 0 !important;
        padding: 12px;
    }

    .sidebar__head {
        min-height: 44px;
        margin-bottom: 10px;
    }

    .sidebar__nav {
        display: grid;
        gap: 6px;
    }

    .sidebar__nav a {
        min-height: 44px;
    }

    .is-sidebar-collapsed .sidebar {
        padding-bottom: 12px;
    }

    .is-sidebar-collapsed .sidebar__head {
        justify-content: flex-end;
        margin-bottom: 0;
    }

    .is-sidebar-collapsed .brand,
    .is-sidebar-collapsed .sidebar__nav {
        display: none;
    }

    .list-layout,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .filters {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .filters__compact {
        max-width: none;
    }

    .filters__date-range {
        grid-template-columns: 1fr;
    }

    .filters__keyword {
        grid-column: auto;
    }

    .pagination-wrap {
        align-items: flex-start;
        flex-direction: column;
    }

    .mypage-summary {
        width: 100%;
    }

    .mypage-summary-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    }

    .mypage-confirm-button {
        width: 100%;
    }

    .mypage-history__header,
    .mypage-history-filter {
        align-items: stretch;
        flex-direction: column;
    }

    .mypage-history-period__controls {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    }

    .mypage-history-filter > .button {
        width: 100%;
    }

    .drawer__panel {
        width: 100vw;
    }

    .detail-form,
    .activity-form,
    .activity-edit {
        grid-template-columns: 1fr;
    }

    .input-with-action {
        grid-template-columns: 1fr;
    }

    .activity-item__summary {
        grid-template-columns: 1fr;
    }

    .activity-summary-toggle__main {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}
.activity-item:not(.is-collapsed) > .activity-summary-toggle {
    align-items: center;
    background: #fff;
    border: 1px solid #d7e1ee;
    border-radius: 6px;
    box-shadow: none;
    display: inline-flex;
    font-size: 0;
    height: 32px;
    justify-content: center;
    line-height: 1;
    margin-bottom: 10px;
    min-height: 32px;
    padding: 0;
    width: 32px;
}

.activity-item:not(.is-collapsed) > .activity-summary-toggle::before {
    color: #53627a;
    content: "▼";
    font-size: 14px;
}

.activity-item:not(.is-collapsed) > .activity-summary-toggle > * {
    display: none;
}

.activity-item:not(.is-collapsed) > .activity-summary-toggle:hover {
    background: #f8fafc;
}
.customer-table th.registered-col,
.customer-table td.registered-col {
    display: none !important;
}
