
  :root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #16a34a;
    --success-light: #dcfce7;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { font-family: 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif; background: var(--gray-50); color: var(--gray-900); font-size: 14px; }

  /* ===== Login ===== */
  #login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  }
  .login-card {
    background: white;
    border-radius: 16px;
    padding: 48px 40px;
    width: 360px;
    box-shadow: var(--shadow-md);
  }
  .login-logo {
    text-align: center;
    margin-bottom: 32px;
  }
  .login-logo h1 { font-size: 20px; font-weight: 700; color: var(--gray-900); margin-top: 12px; }
  .login-logo p { color: var(--gray-500); font-size: 13px; margin-top: 4px; }
  .form-group { margin-bottom: 16px; }
  .form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
  .form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color .2s;
    outline: none;
  }
  .form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .15s;
  }
  .btn:active { transform: scale(.97); }
  .btn-primary { background: var(--primary); color: white; }
  .btn-primary:hover { background: var(--primary-dark); }
  .btn-sm { padding: 6px 12px; font-size: 12px; }
  .btn-ghost { background: transparent; color: var(--gray-700); border: 1.5px solid var(--gray-200); }
  .btn-ghost:hover { background: var(--gray-100); border-color: var(--gray-300); }
  .btn-danger { background: var(--danger); color: white; }
  .btn-danger:hover { background: #b91c1c; }
  .error-msg { color: var(--danger); font-size: 12px; margin-top: 8px; text-align: center; }

  /* ===== App Layout ===== */
  #app { display: none; min-height: 100vh; }
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 220px;
    height: 100vh;
    background: #101d3f;
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 100;
  }
  .sidebar-header {
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .sidebar-header .logo-badge {
    width: 34px; height: 34px; flex-shrink: 0;
    background: white; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
  }
  .sidebar-header .logo-badge svg { width: 20px; height: 20px; }
  .sidebar-header h2 { font-size: 14px; font-weight: 700; color: white; line-height: 1.3; }
  .sidebar-header p { font-size: 10px; color: rgba(255,255,255,.45); margin-top: 1px; }
  .nav-section { padding: 12px 8px 0; flex: 1; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
  .nav-section::-webkit-scrollbar { display: none; }
  .nav-group-title {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 11px; font-weight: 700; color: rgba(255,255,255,.4);
    letter-spacing: .06em; padding: 10px 8px 4px; cursor: pointer;
    user-select: none; transition: color .15s;
  }
  .nav-group-title:hover { color: rgba(255,255,255,.75); }
  .nav-group-title .arrow { font-size: 10px; transition: transform .2s; }
  .nav-group-title .arrow.open { transform: rotate(90deg); }
  .nav-group-body { overflow: hidden; max-height: 0; transition: max-height .25s ease; }
  .nav-group-body.open { max-height: 1000px; }
  .nav-section-title { font-size: 10px; font-weight: 700; color: rgba(255,255,255,.3); letter-spacing: .08em; padding: 8px 8px 4px; text-transform: uppercase; }
  .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: rgba(255,255,255,.65);
    cursor: pointer;
    margin-bottom: 2px;
    transition: all .15s;
    font-size: 13px;
  }
  .nav-item:hover { background: rgba(255,255,255,.06); color: white; }
  .nav-item.active { background: var(--primary); color: white; font-weight: 700; }
  .nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
  .nav-item .nav-label { flex: 1; }
  .nav-badge {
    font-size: 10px; font-weight: 700; min-width: 18px; text-align: center;
    padding: 1px 6px; border-radius: 10px; line-height: 1.5;
    background: var(--danger); color: white;
  }
  .nav-badge.badge-blue { background: var(--primary); }
  .nav-badge.badge-green { background: var(--success); }
  .nav-badge.badge-amber { background: var(--warning); }
  .sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid rgba(255,255,255,.08);
  }
  .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
  }
  .user-avatar {
    width: 32px; height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; flex-shrink: 0;
    color: white;
  }
  .user-name { font-size: 12px; font-weight: 600; color: white; }
  .user-role { font-size: 10px; color: rgba(255,255,255,.45); }

  .main-content {
    margin-left: 220px;
    min-height: 100vh;
    padding: 24px;
  }
  .page { display: none; }
  .page.active { display: block; }
  .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
  }
  .page-title { font-size: 22px; font-weight: 700; color: var(--gray-900); }
  .page-subtitle { font-size: 13px; color: var(--gray-500); margin-top: 2px; }

  /* ===== Cards & Layout ===== */
  .card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
  }
  .card-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; color: var(--gray-900); }
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

  /* ===== KPI Cards ===== */
  .kpi-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    padding: 16px 20px;
    box-shadow: var(--shadow);
  }
  .kpi-label { font-size: 12px; color: var(--gray-500); font-weight: 600; margin-bottom: 6px; }
  .kpi-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
  .kpi-actual { font-size: 28px; font-weight: 700; }
  .kpi-target { font-size: 13px; color: var(--gray-500); }
  .kpi-diff { font-size: 12px; font-weight: 600; }
  .kpi-diff.pos { color: var(--success); }
  .kpi-diff.neg { color: var(--danger); }
  .progress-bar { height: 6px; background: var(--gray-100); border-radius: 999px; overflow: hidden; margin-top: 8px; }
  .progress-fill { height: 100%; border-radius: 999px; transition: width .4s; }
  .prog-ok  { background: var(--success); }
  .prog-mid { background: var(--warning); }
  .prog-low { background: var(--danger); }

  /* ===== Form ===== */
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
  .form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
  .field label { display: block; font-size: 12px; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
  .field input, .field select, .field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
    font-family: inherit;
  }
  .field input:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
  .field input[type="number"] { -moz-appearance: textfield; }

  /* ===== Table ===== */
  .table-wrap { overflow-x: auto; }
  table { width: 100%; border-collapse: collapse; }
  thead th {
    background: var(--gray-50);
    padding: 10px 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
  }
  tbody td {
    padding: 10px 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
  }
  tbody tr:last-child td { border-bottom: none; }
  tbody tr:hover { background: var(--gray-50); }
  .text-right { text-align: right; }
  .text-center { text-align: center; }

  /* ===== Badge ===== */
  .badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
  }
  .badge-blue { background: var(--primary-light); color: var(--primary-dark); }
  .badge-green { background: var(--success-light); color: var(--success); }
  .badge-yellow { background: var(--warning-light); color: var(--warning); }
  .badge-red { background: var(--danger-light); color: var(--danger); }
  .badge-gray { background: var(--gray-100); color: var(--gray-500); }

  /* ===== Loading ===== */
  .spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  .loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--gray-500);
    gap: 12px;
  }


  /* ===== SES 案件・要員 検索グリッド ===== */
  .ses-search-grid {
    display: grid;
    grid-template-columns: 130px 160px 160px 150px 150px 1fr auto;
    gap: 12px;
    align-items: end;
  }
  /* マッチングページ専用: 年月・チーム・営業担当は短め、案件列を広く */
  #page-matching .ses-search-grid {
    grid-template-columns: 120px 140px 160px 1fr auto;
  }
  @media (max-width: 1100px) {
    .ses-search-grid {
      grid-template-columns: repeat(3, 1fr) auto;
    }
  }
  @media (max-width: 700px) {
    .ses-search-grid {
      grid-template-columns: 1fr;
    }
  }
  /* ===== Date nav ===== */
  .date-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    padding: 8px 16px;
  }
  .date-nav button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    padding: 4px;
    border-radius: 4px;
    font-size: 18px;
    line-height: 1;
  }
  .date-nav button:hover { background: var(--gray-100); color: var(--gray-900); }
  .date-nav .date-label { font-weight: 700; font-size: 15px; min-width: 140px; text-align: center; }

  .record-search-grid {
    display: grid;
    grid-template-columns: minmax(300px, 380px) 180px 200px auto;
    gap: 12px;
    align-items: end;
  }
  .monthly-search-grid {
    display: grid;
    grid-template-columns: minmax(190px, 210px) minmax(200px, 1fr) minmax(120px, 140px) minmax(135px, 160px) auto;
    gap: 12px;
    align-items: end;
  }
  .week-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 6px 8px;
    background: white;
  }
  .week-picker button {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: var(--gray-100);
    color: var(--gray-700);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
  }
  .week-picker button:hover { background: var(--primary-light); color: var(--primary-dark); }
  .week-picker .week-label {
    min-width: 180px;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
  }
  .week-picker input[type="date"] {
    width: 120px;
    border: none;
    border-left: 1px solid var(--gray-200);
    padding-left: 8px;
    font-size: 13px;
    color: var(--gray-500);
    outline: none;
  }
  .month-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 6px 8px;
    background: white;
  }
  .month-picker button {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: var(--gray-100);
    color: var(--gray-700);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
  }
  .month-picker button:hover { background: var(--primary-light); color: var(--primary-dark); }
  .month-picker input[type="month"] {
    flex: 1;
    min-width: 100px;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-900);
    background: transparent;
  }
  .record-search-actions {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .record-search-actions .btn {
    width: auto;
    min-width: 88px;
    margin-top: 0;
    padding: 9px 16px;
    flex: 0 0 auto;
  }
  .monthly-search-grid .record-search-actions .btn {
    min-width: 72px;
    padding: 9px 12px;
  }
  .weekly-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
  }
  .weekly-stat {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: var(--shadow);
  }
  .weekly-stat-label {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 700;
    margin-bottom: 4px;
  }
  .weekly-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--gray-900);
  }
  .weekly-board {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .weekly-person-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 16px;
  }
  .weekly-person-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
  }
  .weekly-person-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--gray-900);
  }
  .weekly-person-meta {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
  }
  .weekly-pill {
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
  }
  .weekly-pill.ok { background: var(--success-light); color: var(--success); }
  .weekly-metrics {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 8px;
    margin-bottom: 12px;
  }
  .weekly-metric {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 8px;
    min-width: 0;
  }
  .weekly-metric-label {
    font-size: 10px;
    color: var(--gray-500);
    font-weight: 700;
    white-space: nowrap;
  }
  .weekly-metric-value {
    font-size: 15px;
    font-weight: 800;
    color: var(--gray-900);
    margin-top: 2px;
  }
  .weekly-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(90px, 1fr));
    gap: 8px;
  }
  .weekly-day {
    border: 1px solid var(--gray-200);
    background: white;
    border-radius: 8px;
    padding: 8px;
    text-align: left;
    cursor: pointer;
    min-height: 104px;
    transition: border-color .15s, box-shadow .15s, transform .15s;
    font-family: inherit;
  }
  .weekly-day:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    transform: translateY(-1px);
  }
  .weekly-day.empty {
    background: var(--gray-50);
    color: var(--gray-500);
  }
  .weekly-day-date {
    font-size: 12px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 6px;
  }
  .weekly-day.empty .weekly-day-date { color: var(--gray-600); }
  .weekly-day-lines {
    display: grid;
    gap: 3px;
    font-size: 11px;
    color: var(--gray-600);
    line-height: 1.25;
  }
  .weekly-day-action {
    margin-top: 7px;
    font-size: 11px;
    font-weight: 800;
    color: var(--primary);
  }
  .input-compact-card {
    padding: 16px;
  }
  .input-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-500);
    margin: 12px 0 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--gray-100);
  }
  .input-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(92px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
  }
  .input-grid .field input,
  .input-grid .field select,
  .input-memo textarea {
    padding: 7px 10px;
  }
  .amount-box {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 8px 10px;
    min-height: 55px;
  }
  .amount-box .amount-label {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 600;
    margin-bottom: 4px;
  }
  .amount-box .amount-value {
    font-size: 14px;
    font-weight: 700;
  }
  .input-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
  }
  .input-actions .btn {
    width: auto;
    min-width: 96px;
    margin-top: 0;
    padding: 9px 18px;
  }
  .memo-cell {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
  }

  .section-divider { border: none; border-top: 1px solid var(--gray-200); margin: 20px 0; }

  /* Alert */
  .alert { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
  .alert-info { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #93c5fd; }
  .alert-success { background: var(--success-light); color: var(--success); border: 1px solid #86efac; }

  @media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform .3s; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 16px; }
    .grid-3 { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .form-row.cols-3 { grid-template-columns: 1fr; }
    .record-search-grid,
    .monthly-search-grid { grid-template-columns: 1fr; }
    .week-picker,
    .month-picker { flex-wrap: wrap; }
    .week-picker .week-label { flex: 1; min-width: 160px; }
    .input-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
    .weekly-overview { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
    .weekly-board { grid-template-columns: 1fr; }
    .weekly-metrics { grid-template-columns: repeat(3, 1fr); }
    .weekly-days { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  }

    /* ===== モーダル・ポップアップ ===== */
    #modal-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(15,23,42,0.55);
      backdrop-filter: blur(2px);
      -webkit-backdrop-filter: blur(2px);
      z-index: 1000;
      align-items: center;
      justify-content: center;
      padding: 16px;
      animation: overlayIn 0.15s ease;
    }
    @keyframes overlayIn {
      from { opacity: 0; }
      to   { opacity: 1; }
    }
    #modal-box {
      background: white;
      border-radius: 16px;
      padding: 28px 32px;
      width: 500px;
      max-width: 95vw;
      max-height: 90vh;
      overflow-y: auto;
      box-shadow: 0 24px 64px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.08);
      animation: modalIn 0.18s cubic-bezier(0.34,1.56,0.64,1);
    }
    @keyframes modalIn {
      from { opacity: 0; transform: translateY(-16px) scale(0.97); }
      to   { opacity: 1; transform: translateY(0) scale(1); }
    }
    #modal-title {
      font-size: 17px;
      font-weight: 700;
      color: var(--gray-900);
      margin: 0;
    }
    #modal-footer {
      display: flex;
      gap: 8px;
      justify-content: flex-end;
      margin-top: 24px;
      padding-top: 16px;
      border-top: 1px solid var(--gray-200);
    }

    /* Excel取込モーダル */
    #excel-import-modal {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(15,23,42,0.55);
      backdrop-filter: blur(2px);
      -webkit-backdrop-filter: blur(2px);
      z-index: 1000;
      align-items: center;
      justify-content: center;
      padding: 16px;
    }
    #excel-import-modal > div {
      animation: modalIn 0.18s cubic-bezier(0.34,1.56,0.64,1);
    }

    /* SESモーダル全般（sesConfirm等） */
    .ses-modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(15,23,42,0.55);
      backdrop-filter: blur(2px);
      -webkit-backdrop-filter: blur(2px);
      z-index: 1000;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 16px;
      animation: overlayIn 0.15s ease;
    }
    .ses-modal-box {
      background: white;
      border-radius: 16px;
      padding: 28px 32px;
      max-width: 480px;
      width: 100%;
      box-shadow: 0 24px 64px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.08);
      animation: modalIn 0.18s cubic-bezier(0.34,1.56,0.64,1);
    }

    /* トースト通知 */
    .ses-toast {
      position: fixed;
      bottom: 28px;
      left: 50%;
      transform: translateX(-50%);
      background: var(--gray-900);
      color: white;
      padding: 12px 24px;
      border-radius: 100px;
      font-size: 13px;
      font-weight: 500;
      z-index: 9999;
      box-shadow: 0 8px 24px rgba(0,0,0,0.2);
      animation: toastIn 0.2s cubic-bezier(0.34,1.56,0.64,1);
      white-space: nowrap;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    @keyframes toastIn {
      from { opacity: 0; transform: translateX(-50%) translateY(12px); }
      to   { opacity: 1; transform: translateX(-50%) translateY(0); }
    }
    .ses-toast.success { background: #15803d; }
    .ses-toast.error   { background: #dc2626; }
    .ses-toast.warn    { background: #d97706; }

    /* メールAI取込モーダル */
    #mail-import-modal,
    #company-import-modal,
    #contact-import-modal,
    #ses-confirm-overlay {
      animation: overlayIn 0.15s ease;
    }
    #mail-import-modal > div,
    #company-import-modal > div,
    #contact-import-modal > div {
      animation: modalIn 0.18s cubic-bezier(0.34,1.56,0.64,1);
    }

    /* モーダル内フォーム */
    .modal-field {
      margin-bottom: 16px;
    }
    .modal-field label {
      display: block;
      font-size: 12px;
      font-weight: 600;
      color: var(--gray-500);
      margin-bottom: 6px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .modal-field input,
    .modal-field select,
    .modal-field textarea {
      width: 100%;
      padding: 9px 12px;
      border: 1.5px solid var(--gray-200);
      border-radius: var(--radius);
      font-size: 14px;
      font-family: inherit;
      outline: none;
      transition: border-color 0.15s;
      box-sizing: border-box;
    }
    .modal-field input:focus,
    .modal-field select:focus,
    .modal-field textarea:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
    }

  
  /* ===== 共通ドロップダウン（検索付き） ===== */
  .ses-dd { position: relative; }
  .ses-dd-trigger {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border: 1.5px solid var(--gray-200); border-radius: var(--radius);
    background: white; cursor: pointer; font-size: 13px; min-height: 38px;
  }
  .ses-dd-trigger:hover { border-color: var(--gray-300); }
  .ses-dd-trigger .ses-dd-arrow { margin-left: auto; color: var(--gray-500); font-size: 11px; flex-shrink: 0; }
  .ses-dd-placeholder { color: var(--gray-500); }
  .ses-dd-avatar {
    width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 11px; font-weight: 700;
  }
  .ses-dd-text { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
  .ses-dd-name { font-size: 13px; color: var(--gray-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ses-dd-sub { font-size: 11px; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ses-dd-panel {
    display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 200;
    background: white; border: 1px solid var(--gray-200); border-radius: var(--radius);
    box-shadow: var(--shadow-md); max-height: 280px; overflow: hidden;
  }
  .ses-dd-panel.open { display: block; }
  .ses-dd-search { padding: 8px; border-bottom: 1px solid var(--gray-100); }
  .ses-dd-search input { width: 100%; padding: 6px 8px; border: 1px solid var(--gray-200); border-radius: 6px; font-size: 12px; }
  .ses-dd-list { max-height: 220px; overflow-y: auto; }
  .ses-dd-opt { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; }
  .ses-dd-opt:hover { background: var(--gray-50); }
  .ses-dd-opt.sel { background: var(--primary-light); }
  .ses-dd-empty { padding: 16px; text-align: center; color: var(--gray-500); font-size: 12px; }

  /* ===== 共通日付ピッカー（ポップアップカレンダー） ===== */
  .ses-dp { position: relative; }
  .ses-dp-trigger {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1.5px solid var(--gray-200);
    border-radius: var(--radius); font-size: 14px; cursor: pointer; background: white; user-select: none;
  }
  .ses-dp-trigger:hover { border-color: var(--gray-300); }
  .ses-dp-text { flex: 1; min-width: 0; color: var(--gray-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ses-dp-placeholder { color: var(--gray-500); }
  .ses-dp-icon { flex-shrink: 0; font-size: 13px; }
  .ses-dp-panel {
    display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 200; width: 260px;
    background: white; border: 1px solid var(--gray-200); border-radius: var(--radius);
    box-shadow: var(--shadow-md); padding: 10px;
  }
  .ses-dp-panel.open { display: block; }
  .ses-dp-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--gray-900); }
  .ses-dp-nav { cursor: pointer; padding: 2px 8px; border-radius: 4px; color: var(--gray-500); }
  .ses-dp-nav:hover { background: var(--gray-100); color: var(--gray-900); }
  .ses-dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
  .ses-dp-dow { text-align: center; font-size: 11px; color: var(--gray-500); padding: 4px 0; }
  .ses-dp-day { text-align: center; font-size: 12px; padding: 6px 0; border-radius: 6px; cursor: pointer; color: var(--gray-900); }
  .ses-dp-day:hover { background: var(--gray-100); }
  .ses-dp-day.muted { color: var(--gray-300); cursor: default; }
  .ses-dp-day.muted:hover { background: none; }
  .ses-dp-day.today { font-weight: 700; color: var(--primary); }
  .ses-dp-day.sel { background: var(--primary); color: white; font-weight: 600; }
  .ses-dp-day.disabled { color: var(--gray-300); cursor: not-allowed; pointer-events: none; }
  .ses-dp-ft { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--gray-100); }
  .ses-dp-ft span { font-size: 12px; color: var(--primary); cursor: pointer; padding: 4px 6px; border-radius: 4px; }
  .ses-dp-ft span:hover { background: var(--gray-50); }

  /* 年のみピッカー：年グリッド */
  .ses-yp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .ses-yp-cell { text-align: center; font-size: 13px; padding: 10px 0; border-radius: 6px; cursor: pointer; color: var(--gray-900); }
  .ses-yp-cell:hover { background: var(--gray-100); }
  .ses-yp-cell.sel { background: var(--primary); color: white; font-weight: 600; }
  .ses-yp-cell.cur { font-weight: 700; color: var(--primary); }

  /* 年月ピッカー：月グリッド */
  .ses-ym-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .ses-ym-cell { text-align: center; font-size: 13px; padding: 10px 0; border-radius: 6px; cursor: pointer; color: var(--gray-900); }
  .ses-ym-cell:hover { background: var(--gray-100); }
  .ses-ym-cell.sel { background: var(--primary); color: white; font-weight: 600; }
  .ses-ym-cell.cur { font-weight: 700; color: var(--primary); }
