:root{
  --bg:#f4f7fb;
  --panel:#ffffff;
  --panel-soft:#f8fafc;
  --text:#0f172a;
  --muted:#64748b;
  --line:#e2e8f0;
  --line-soft:#eef2f7;
  --primary:#2563eb;
  --primary-dark:#1d4ed8;
  --primary-soft:#dbeafe;
  --success:#16a34a;
  --success-soft:#dcfce7;
  --warning:#d97706;
  --warning-soft:#fef3c7;
  --danger:#dc2626;
  --danger-soft:#fee2e2;
  --shadow:0 16px 40px rgba(15,23,42,.08);
  --radius:16px;
  --sidebar:260px;
}

*{box-sizing:border-box}
html{height:100%}
body{
  margin:0;
  min-height:100%;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans JP","Hiragino Sans","Yu Gothic",Meiryo,sans-serif;
  background:var(--bg);
  color:var(--text);
  font-size:14px;
  line-height:1.6;
}
a{color:var(--primary);text-decoration:none}
a:hover{text-decoration:underline}
img,svg{max-width:100%}

.app-shell{display:flex;min-height:100vh;width:100%}
.sidebar{
  width:var(--sidebar);
  flex:0 0 var(--sidebar);
  background:#0f172a;
  color:#e5e7eb;
  padding:22px 18px;
  position:sticky;
  top:0;
  height:100vh;
  overflow-y:auto;
}
.brand{display:flex;align-items:center;gap:12px;margin-bottom:26px}
.brand-logo{
  width:42px;height:42px;border-radius:14px;
  display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#60a5fa,#2563eb);
  color:#fff;font-weight:800;letter-spacing:.02em;
}
.brand strong{display:block;color:#fff;font-size:16px;line-height:1.2}
.brand span{display:block;color:#94a3b8;font-size:12px;margin-top:3px}
.nav{display:flex;flex-direction:column;gap:4px}
.nav a{
  color:#cbd5e1;
  padding:10px 12px;
  border-radius:12px;
  display:block;
  font-weight:600;
}
.nav a:hover{background:rgba(255,255,255,.08);color:#fff;text-decoration:none}
.nav hr{width:100%;border:0;border-top:1px solid rgba(255,255,255,.12);margin:12px 0}
.sidebar-legal{
  margin-top:22px;
  padding-top:16px;
  border-top:1px solid rgba(255,255,255,.12);
  display:flex;
  flex-wrap:wrap;
  gap:8px 14px;
}
.sidebar-legal a{
  color:#94a3b8;
  font-size:12px;
  line-height:1.5;
}
.sidebar-legal a:hover{color:#fff;text-decoration:underline}

.main{flex:1;min-width:0;padding:24px 28px 44px}
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  margin-bottom:20px;
}
.topbar h1{margin:0;font-size:26px;line-height:1.25;letter-spacing:.02em}
.userbox{
  display:flex;
  align-items:center;
  gap:10px;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:999px;
  padding:8px 10px 8px 14px;
  box-shadow:0 4px 14px rgba(15,23,42,.04);
  white-space:nowrap;
}
.userbox small{color:var(--muted)}
.logout{
  background:#f1f5f9;
  color:#334155;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:700;
}
.logout:hover{background:#e2e8f0;text-decoration:none}

.card,details.card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:20px;
  margin:0 0 18px;
  box-shadow:var(--shadow);
  overflow-x:auto;
  overflow-y:visible;
}
.card h2,details.card h2{margin:0 0 14px;font-size:18px}
.card p:first-child{margin-top:0}
details.card summary{cursor:pointer}

.grid{display:grid;gap:16px}
.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}

.stat{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:20px;
  box-shadow:var(--shadow);
}
.stat b{display:block;font-size:30px;line-height:1.1;margin-bottom:8px}
.stat span{color:var(--muted);font-weight:700}

.actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.actions h2{margin:0}
.search{display:grid;gap:12px;width:100%}
.document-toolbar{display:flex;justify-content:space-between;align-items:flex-end;gap:14px;flex-wrap:wrap}
.document-search{flex:1 1 760px;min-width:0}
.document-search .search{grid-template-columns:1.45fr 1fr 1fr .95fr .95fr .95fr auto;align-items:end}
.document-actions{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;margin-left:auto}

.field{margin-bottom:14px}
label{display:block;margin-bottom:6px;color:#334155;font-size:13px;font-weight:700}
.input,input[type="text"],input[type="email"],input[type="password"],input[type="date"],input[type="number"],input:not([type]),select,textarea{
  width:100%;
  min-height:42px;
  border:1px solid #cbd5e1;
  border-radius:12px;
  padding:9px 12px;
  background:#fff;
  color:var(--text);
  font:inherit;
  outline:none;
}
textarea{min-height:120px;resize:vertical}
.input:focus,input:focus,select:focus,textarea:focus{border-color:var(--primary);box-shadow:0 0 0 4px rgba(37,99,235,.12)}
button:disabled,.btn:disabled{opacity:.55;cursor:not-allowed}

.btn,button.btn,a.btn,input[type="submit"].btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-height:42px;
  padding:9px 15px;
  border:0;
  border-radius:12px;
  background:var(--primary);
  color:#fff;
  font-weight:800;
  font-size:14px;
  line-height:1.2;
  cursor:pointer;
  white-space:nowrap;
  text-decoration:none;
  box-shadow:0 8px 18px rgba(37,99,235,.22);
}
.btn:hover,button.btn:hover,a.btn:hover{background:var(--primary-dark);color:#fff;text-decoration:none}
.btn.secondary{
  background:#f1f5f9;
  color:#334155;
  border:1px solid #cbd5e1;
  box-shadow:none;
}
.btn.secondary:hover{background:#e2e8f0;color:#0f172a}
.btn.danger{background:var(--danger);color:#fff;box-shadow:0 8px 18px rgba(220,38,38,.18)}
.btn-large{font-size:16px;padding:14px 18px;border-radius:13px;min-height:52px}

.table-wrap{width:100%;overflow-x:auto}
.table{width:100%;border-collapse:separate;border-spacing:0;min-width:760px}
.table th,.table td{border-bottom:1px solid var(--line-soft);padding:11px 10px;text-align:left;vertical-align:middle}
.table th{background:#f8fafc;color:#475569;font-size:12px;letter-spacing:.02em;white-space:nowrap}
.table tr:hover td{background:#fbfdff}
.table td{word-break:break-word}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:64px;
  min-height:24px;
  padding:3px 9px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}
.badge.pending,.badge.review,.badge.warn{background:var(--warning-soft);color:#92400e}
.badge.processed,.badge.ok,.badge.success{background:var(--success-soft);color:#166534}
.badge.confirmed{background:#dbeafe;color:#1d4ed8}
.badge.error{background:var(--danger-soft);color:#991b1b}
.badge.cancelled{background:#e5e7eb;color:#475569}
.badge.ocr_done,.badge.extracted{background:var(--primary-soft);color:#1e40af}

.flash{
  border-radius:14px;
  padding:12px 14px;
  margin:0 0 14px;
  border:1px solid var(--line);
  background:#f8fafc;
  color:#334155;
  font-weight:700;
}
.flash.success,.flash.ok{background:var(--success-soft);border-color:#bbf7d0;color:#166534}
.flash.error{background:var(--danger-soft);border-color:#fecaca;color:#991b1b}
.flash.warn,.flash.warning{background:var(--warning-soft);border-color:#fde68a;color:#92400e}

.muted{color:var(--muted)}
.hint{font-size:12px;color:var(--muted);margin-top:6px}
.link{color:var(--primary);text-decoration:underline}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace}
.pre{
  white-space:pre-wrap;
  word-break:break-word;
  background:#0f172a;
  color:#e5e7eb;
  border-radius:14px;
  padding:16px;
  overflow:auto;
  max-height:520px;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;
  font-size:13px;
}

.form-narrow{max-width:520px}
.drive-hero{display:flex;align-items:center;justify-content:space-between;gap:22px}
.drive-action{min-width:260px;text-align:right}
.folder-tree{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:14px;
  margin-top:12px;
  line-height:1.8;
}
.drive-connections-table{table-layout:fixed;width:100%;min-width:980px}
.drive-connections-table th,.drive-connections-table td{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}
.drive-connections-table .col-id{width:48px}
.drive-connections-table .col-status{width:64px}
.drive-connections-table .col-action{width:76px}
.drive-connections-table .col-account{width:220px}
.drive-connections-table .mono{font-size:12px}
.drive-connections-table .delete-button{padding:8px 12px;min-width:auto}

.login-page{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:100vh;
  padding:24px;
  background:linear-gradient(135deg,#eff6ff,#f8fafc 45%,#e0f2fe);
}
.login-card{
  width:100%;
  max-width:420px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:22px;
  padding:30px;
  box-shadow:0 24px 60px rgba(15,23,42,.14);
}
.login-logo{font-size:28px;font-weight:900;text-align:center;margin-bottom:6px;color:#0f172a}
.login-sub{text-align:center;color:var(--muted);margin-bottom:22px}
.footer-note{text-align:center;color:var(--muted);font-size:12px;margin-top:18px}

@media(max-width:1180px){
  .document-search .search{grid-template-columns:repeat(3,minmax(0,1fr))}
  .document-actions{width:100%;margin-left:0;justify-content:flex-start}
}
@media(max-width:900px){
  .app-shell{display:block}
  .sidebar{position:relative;width:100%;height:auto;min-height:0;display:block}
  .nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .main{padding:18px}
  .topbar{display:block}
  .userbox{margin-top:12px;width:fit-content;max-width:100%;flex-wrap:wrap;border-radius:16px}
  .cols-2,.cols-3,.cols-4{grid-template-columns:1fr}
  .drive-hero{display:block}
  .drive-action{text-align:left;margin-top:16px;min-width:0}
  .document-search .search{grid-template-columns:1fr}
  .btn{width:auto}
}
@media(max-width:560px){
  .nav{grid-template-columns:1fr}
  .main{padding:14px}
  .card,details.card{padding:16px;border-radius:14px}
  .document-actions{flex-direction:column;align-items:stretch}
  .document-actions .btn,.document-actions form,.document-actions form .btn{width:100%}
}


/* ===== UI refresh 2026-06-24: PCフォーム・Drive連携画面 ===== */
.main{
  background:
    radial-gradient(circle at 16% 0%, rgba(37,99,235,.08), transparent 32%),
    linear-gradient(180deg,#f8fbff 0%,#eef4fb 100%);
}
.card,details.card{
  border-color:#dbe5f0;
  box-shadow:0 18px 50px rgba(15,23,42,.07);
}
.topbar{margin-bottom:28px}
.topbar h1{font-size:28px;font-weight:900;letter-spacing:-.02em}

/* 決算期設定：PCでは縦長にしない */
.fiscal-form{
  display:grid;
  grid-template-columns:130px 140px 110px 140px 110px 140px minmax(190px,.9fr);
  gap:14px;
  align-items:end;
}
.fiscal-form > div{min-width:0;margin:0}
.fiscal-form button{width:100%;min-height:52px}
.fiscal-form input[type="number"]{
  text-align:center;
  font-weight:700;
  font-size:16px;
}
@media(max-width:1280px){
  .fiscal-form{grid-template-columns:repeat(3,minmax(0,1fr))}
  .fiscal-form button{grid-column:1 / -1}
}
@media(max-width:720px){
  .fiscal-form{grid-template-columns:1fr}
}

/* 汎用フォームを少しPC向けに */
.field{margin-bottom:16px}
label{color:#0f2344;font-weight:800}
.input,input[type="text"],input[type="email"],input[type="password"],input[type="date"],input[type="number"],input:not([type]),select,textarea{
  min-height:48px;
  border-color:#c8d6e8;
  border-radius:14px;
  padding:11px 14px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.75);
}
.btn,button.btn,a.btn,input[type="submit"].btn{
  min-height:46px;
  border-radius:14px;
}

/* Drive連携：説明・操作・状態をカード化 */
.drive-page{display:grid;gap:18px}
.page-kicker{
  display:inline-flex;
  color:#2563eb;
  font-size:12px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  margin-bottom:4px;
}
.section-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
.section-heading h2{margin:0;font-size:20px;letter-spacing:-.02em}
.drive-hero-modern{
  display:grid;
  grid-template-columns:minmax(0,1.35fr) minmax(320px,.65fr);
  gap:28px;
  align-items:stretch;
  padding:26px;
  overflow:hidden;
}
.drive-hero-modern h2{font-size:24px;margin-bottom:6px}
.drive-hero-copy{min-width:0}
.drive-action-panel{
  min-width:0;
  text-align:left;
  align-self:stretch;
  background:linear-gradient(180deg,#ffffff 0%,#f7fbff 100%);
  border:1px solid #dbeafe;
  border-radius:20px;
  padding:20px;
  box-shadow:0 14px 34px rgba(37,99,235,.08);
}
.drive-action-panel .flash{margin-bottom:14px;border-radius:14px}
.drive-action-panel form{margin:0}
.drive-action-panel .btn{width:100%;justify-content:center}
.drive-action-panel .field{margin-bottom:14px}
.folder-tree-modern{
  margin-top:18px;
  max-width:760px;
  background:linear-gradient(180deg,#f8fbff,#ffffff);
  border-color:#d8e4f2;
  border-radius:18px;
  padding:18px 20px;
  line-height:1.95;
  color:#0f2344;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
}
.drive-status-card{padding:24px}
.drive-status-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}
.drive-status-grid > div{
  min-width:0;
  padding:16px;
  border:1px solid #e2e8f0;
  border-radius:16px;
  background:#fbfdff;
}
.drive-status-grid strong{
  display:block;
  color:#64748b;
  font-size:12px;
  margin-bottom:6px;
}
.drive-status-grid a,.drive-status-grid span:not(.badge){word-break:break-word}
.drive-list-card{padding:24px}
.drive-connections-table{border:1px solid #e8eef6;border-radius:16px;overflow:hidden;background:#fff}
.drive-connections-table th{background:#f3f7fc;color:#334155;font-weight:900}
.drive-connections-table td{background:#fff}

/* サイドバーを少しSaaS風に */
.sidebar{background:linear-gradient(180deg,#0b1730 0%,#0f172a 100%)}
.nav a{padding:11px 13px;border-radius:12px}
.nav a[href="/app/drive_settings.php"]:hover,
.nav a:hover{background:rgba(37,99,235,.22)}

@media(max-width:1100px){
  .drive-hero-modern{grid-template-columns:1fr}
  .drive-status-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:720px){
  .drive-status-grid{grid-template-columns:1fr}
  .drive-hero-modern{padding:18px}
  .drive-action-panel{padding:16px}
}

/* Batch process page */
.batch-hero-card{padding:24px}
.batch-hero{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:22px;
  padding:4px 0 20px;
  border-bottom:1px solid #e8eef6;
  margin-bottom:18px;
}
.page-kicker{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:3px 10px;
  border-radius:999px;
  background:#eff6ff;
  color:#1d4ed8;
  font-size:12px;
  font-weight:900;
  letter-spacing:.03em;
  margin-bottom:8px;
}
.batch-hero-copy{min-width:0}
.batch-hero-copy h2{font-size:24px;margin:0 0 8px}
.batch-hero-copy p{max-width:920px;margin:0;line-height:1.8}
.batch-hero-stats{
  flex:0 0 150px;
  min-height:94px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  border:1px solid #dbeafe;
  border-radius:20px;
  background:linear-gradient(135deg,#eff6ff,#fff);
}
.batch-hero-stats strong{font-size:34px;line-height:1;color:#1d4ed8}
.batch-hero-stats span{margin-top:8px;color:#475569;font-weight:800;font-size:13px}
.batch-filter-form{
  display:grid;
  grid-template-columns:minmax(260px,420px) 120px 150px;
  gap:12px;
  align-items:end;
  max-width:720px;
}
.batch-filter-form .field{margin:0}
.batch-filter-form .btn{width:100%}
.batch-list-card{padding:22px 24px}
.batch-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
}
.batch-checks{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.check-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:42px;
  margin:0;
  padding:9px 13px;
  border:1px solid #dbe3ef;
  border-radius:999px;
  background:#f8fafc;
  color:#0f172a;
  font-weight:800;
}
.check-pill input{width:auto;min-height:0;margin:0}
.batch-main-button{min-width:190px}
.batch-table-wrap{border:1px solid #e8eef6;border-radius:16px;background:#fff}
.batch-table{margin:0;min-width:920px}
.batch-table th{background:#f3f7fc;color:#334155;font-weight:900}
.batch-table th:first-child,.batch-table td:first-child{width:42px;text-align:center}
.batch-table th:nth-child(2),.batch-table td:nth-child(2){width:64px;text-align:center}
.batch-filename{max-width:360px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

@media(max-width:900px){
  .batch-hero{align-items:flex-start;flex-direction:column}
  .batch-hero-stats{width:100%;flex-basis:auto;min-height:76px}
  .batch-filter-form{grid-template-columns:1fr;max-width:none}
  .batch-toolbar{align-items:stretch;flex-direction:column}
  .batch-main-button{width:100%}
}
@media(max-width:560px){
  .batch-hero-card,.batch-list-card{padding:16px}
  .check-pill{width:100%;border-radius:14px}
}

/* Section label color variants */
.page-kicker.kicker-batch{
  background:#eef2ff;
  color:#3730a3;
  border:1px solid #c7d2fe;
}
.page-kicker.kicker-drive{
  background:#ecfdf5;
  color:#047857;
  border:1px solid #bbf7d0;
}
.page-kicker.kicker-status{
  background:#fff7ed;
  color:#c2410c;
  border:1px solid #fed7aa;
}
.page-kicker.kicker-list{
  background:#f5f3ff;
  color:#6d28d9;
  border:1px solid #ddd6fe;
}

/* Dashboard spacing: statistics cards and recent documents */
.dashboard-stats,
.stats-grid{
  margin-bottom:32px;
}

.dashboard-page .card + .card{
  margin-top:32px;
}

.recent-documents-card{
  margin-top:8px;
}

/* Dashboard: add clear spacing between summary cards and recent documents */
.grid.cols-4{
  margin-bottom:32px;
}

.grid.cols-4 + .card{
  margin-top:32px;
}

@media(max-width:900px){
  .grid.cols-4{
    margin-bottom:24px;
  }
  .grid.cols-4 + .card{
    margin-top:24px;
  }
}


/* 書類登録：アップロード読み取り中の表示 */
.upload-reading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .38);
  backdrop-filter: blur(5px);
}
.upload-reading-overlay.is-visible {
  display: flex;
}
.upload-reading-box {
  width: min(520px, calc(100vw - 40px));
  padding: 34px 30px;
  border-radius: 24px;
  border: 1px solid rgba(191, 219, 254, .9);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
  text-align: center;
}
.upload-reading-spinner {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border-radius: 999px;
  border: 5px solid #dbeafe;
  border-top-color: #2563eb;
  animation: uploadReadingSpin .85s linear infinite;
}
.upload-reading-box h2 {
  margin: 0 0 10px;
  font-size: 22px;
  color: #0f2344;
}
.upload-reading-box p {
  margin: 0;
  color: #52637a;
  line-height: 1.8;
}
.upload-reading-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}
.upload-reading-steps span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}
@keyframes uploadReadingSpin {
  to { transform: rotate(360deg); }
}
.upload-read-button:disabled {
  opacity: .75;
  cursor: wait;
}

/* 書類詳細：上部操作ボタンと内容テーブルの余白 */
.document-detail-header-actions {
  margin-bottom: 16px;
}


/* ダッシュボード：統計カードと最近の書類の余白 */
.dashboard-stats {
  margin-bottom: 36px;
}
.recent-documents-card {
  margin-top: 0;
}
.dashboard-recent-actions {
  margin-bottom: 18px;
}
.dashboard-recent-actions .btn {
  margin-bottom: 8px;
}


/* 書類登録フォーム：保存・確定確認 */
.finalize-confirm-modal{
    position:fixed;
    inset:0;
    z-index:9998;
    display:none;
    align-items:center;
    justify-content:center;
    padding:24px;
    background:rgba(15,23,42,.42);
    backdrop-filter:blur(6px);
}
.finalize-confirm-modal.is-visible{display:flex}
.finalize-confirm-box{
    width:min(560px,100%);
    background:#fff;
    border:1px solid var(--border);
    border-radius:24px;
    box-shadow:0 28px 80px rgba(15,23,42,.24);
    padding:30px;
}
.finalize-confirm-box h2{margin:0 0 12px;font-size:24px}
.finalize-confirm-box p{margin:0 0 14px;color:var(--muted)}
.finalize-confirm-box ul{
    margin:12px 0 16px;
    padding:14px 18px 14px 38px;
    background:#f8fafc;
    border:1px solid var(--border);
    border-radius:16px;
}
.finalize-confirm-box li{margin:6px 0;font-weight:700}
.finalize-confirm-actions{justify-content:flex-end;margin-top:20px}

/* ダッシュボード：書類を登録ボタン下の余白を少し狭くする */
.dashboard-recent-actions{
    margin-bottom:5px;
}


/* ダッシュボード：統計カードと最近の書類の間隔を少しだけ狭く調整 */
.dashboard-stats,
.grid.cols-4{
    margin-bottom:28px;
}
.grid.cols-4 + .card{
    margin-top:28px;
}
.recent-documents-card{
    margin-top:0;
}
.dashboard-recent-actions{
    margin-bottom:5px;
}

/* ダッシュボード：統計カードと最近の書類の間隔をさらに少し狭くする */
.dashboard-stats,
.grid.cols-4{
    margin-bottom:20px;
}
.grid.cols-4 + .card{
    margin-top:20px;
}

/* アカウント設定：解約申請ボタン上の余白 */
.account-cancel-form{
    margin-top:14px;
}

/* プラン管理：契約期間の数値と単位 */
.plan-duration-row{
    display:grid;
    grid-template-columns:1fr 160px;
    gap:12px;
}
@media (max-width: 760px){
    .plan-duration-row{
        grid-template-columns:1fr;
    }
}

/* Account renewal controls */
.account-renew-form{
    max-width: 520px;
    margin-top: 18px;
}
.account-renew-form .field{
    margin-bottom: 14px;
}
.account-cancel-note{
    margin-top: 18px;
}

/* Batch upload drop area */
.batch-upload-card{padding:22px 24px;margin-bottom:18px}
.batch-upload-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:16px}
.batch-upload-head h3{margin:0 0 8px;font-size:20px}
.batch-upload-head p{margin:0;line-height:1.8;max-width:900px}
.batch-upload-limit{flex:0 0 auto;min-width:116px;text-align:center;border:1px solid #c7d2fe;border-radius:16px;background:#eef2ff;color:#3730a3;font-weight:900;padding:12px 14px}
.batch-upload-limit strong{font-size:26px;line-height:1}
.batch-upload-form{display:grid;gap:14px}
.batch-drop-zone{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:190px;padding:26px;border:2px dashed #c7d2fe;border-radius:20px;background:linear-gradient(180deg,#f8fafc,#fff);text-align:center;cursor:pointer;transition:.18s ease}
.batch-drop-zone:hover,.batch-drop-zone.is-dragover{border-color:#2563eb;background:#eff6ff;transform:translateY(-1px)}
.batch-drop-zone input{display:none}
.batch-drop-icon{display:flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:999px;background:#dbeafe;color:#1d4ed8;font-size:24px;font-weight:900}
.batch-drop-zone strong{font-size:16px;color:#0f172a}
.batch-drop-zone em{font-style:normal;color:#475569;font-weight:800}
.batch-drop-zone small{color:#64748b}
.batch-upload-actions{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.batch-upload-button{min-width:170px}
.batch-upload-button:disabled{opacity:.65;cursor:not-allowed}
.batch-upload-result{margin-top:16px}
.batch-upload-message{padding:12px 14px;border-radius:14px;font-weight:900;margin-bottom:12px}
.batch-upload-message.success{background:#ecfdf5;color:#047857;border:1px solid #bbf7d0}
.batch-upload-message.warning{background:#fff7ed;color:#c2410c;border:1px solid #fed7aa}
.batch-upload-message.error{background:#fef2f2;color:#b91c1c;border:1px solid #fecaca}
.batch-upload-result-table{border:1px solid #e8eef6;border-radius:14px;background:#fff}
.batch-upload-result-table table{margin:0;min-width:760px}
.batch-upload-result-table th{background:#f8fafc}

@media(max-width:720px){
  .batch-upload-card{padding:16px}
  .batch-upload-head{flex-direction:column}
  .batch-upload-limit{width:100%}
  .batch-upload-actions{align-items:stretch;flex-direction:column}
  .batch-upload-button{width:100%}
}

/* Batch upload selected file list */
.batch-selected-panel{
  border:1px solid #e2e8f0;
  border-radius:18px;
  background:#f8fafc;
  padding:14px;
}
.batch-selected-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.batch-selected-list{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:8px;
}
.batch-selected-list li{
  display:grid;
  grid-template-columns:1fr auto auto;
  align-items:center;
  gap:10px;
  min-height:42px;
  padding:8px 10px 8px 14px;
  border:1px solid #dbeafe;
  border-radius:14px;
  background:#fff;
}
.batch-selected-name{
  font-weight:800;
  color:#0f172a;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.batch-selected-list small{
  color:#64748b;
  font-weight:800;
}
.batch-selected-remove{
  width:30px;
  height:30px;
  border:0;
  border-radius:999px;
  background:#fee2e2;
  color:#b91c1c;
  font-weight:900;
  font-size:18px;
  line-height:1;
  cursor:pointer;
}
.batch-selected-remove:hover{
  background:#fecaca;
}
@media(max-width:720px){
  .batch-selected-list li{
    grid-template-columns:1fr auto;
  }
  .batch-selected-list small{
    display:none;
  }
}

.batch-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 9999;
    display: grid;
    place-items: center;
    backdrop-filter: blur(2px);
}
.batch-loading-overlay[hidden] { display: none !important; }
.batch-loading-box {
    width: min(420px, calc(100vw - 48px));
    background: #fff;
    border-radius: 22px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.25);
    border: 1px solid #dbeafe;
}
.batch-loading-box strong {
    display: block;
    font-size: 20px;
    margin: 12px 0 8px;
}
.batch-loading-box p {
    color: #64748b;
    margin: 0;
    line-height: 1.7;
}
.batch-loading-spinner {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    border: 5px solid #dbeafe;
    border-top-color: #2563eb;
    margin: 0 auto;
    animation: batchSpin 0.85s linear infinite;
}
@keyframes batchSpin { to { transform: rotate(360deg); } }


/* Pagination */
.pagination-summary {
    margin: 0 0 14px;
    color: var(--muted, #64748b);
    font-size: 0.95rem;
}
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}
.page-link {
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--border, #dbe5f3);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--text, #0f172a);
    font-weight: 700;
    text-decoration: none;
}
.page-link:hover {
    border-color: var(--primary, #2563eb);
    color: var(--primary, #2563eb);
}
.page-link.current {
    background: var(--primary, #2563eb);
    border-color: var(--primary, #2563eb);
    color: #fff;
}
.page-link.disabled {
    pointer-events: none;
    opacity: 0.45;
}

/* Compliance / 電子帳簿保存法 */
.compliance-page .stat b{font-size:26px}
.compliance-form .grid{margin-bottom:12px}
.compliance-checks{margin:8px 0 16px}
.check-card{display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:14px;background:#f8fafc;padding:12px;color:#334155;font-weight:800;margin:0}
.check-card input{width:auto;min-height:auto}
.notice-box{border:1px solid #facc15;background:#fffbeb;color:#713f12;border-radius:14px;padding:12px 14px;margin:12px 0 16px;font-size:13px;line-height:1.7}
.compliance-score{display:inline-flex;align-items:center;justify-content:center;min-width:96px;min-height:44px;border-radius:999px;font-size:22px;font-weight:900}
.compliance-score.good{background:var(--success-soft);color:#166534}
.compliance-score.warn{background:var(--warning-soft);color:#92400e}
.compliance-score.bad{background:var(--danger-soft);color:#991b1b}
.policy-preview{background:#fff;border:1px solid var(--line);border-radius:14px;padding:24px;max-height:700px;overflow:auto}
.policy-document{color:#0f172a;line-height:1.85}
.policy-document h1{text-align:center;font-size:22px;margin:0 0 24px}
.policy-document h2{font-size:16px;border-bottom:1px solid #cbd5e1;margin:22px 0 8px;padding-bottom:4px}
.policy-meta{width:100%;border-collapse:collapse;margin:0 0 20px}
.policy-meta th,.policy-meta td{border:1px solid #cbd5e1;padding:9px 10px;text-align:left;vertical-align:top}
.policy-meta th{width:170px;background:#f8fafc;color:#334155}
.policy-disclaimer{border:1px solid #facc15;background:#fffbeb;color:#713f12;border-radius:12px;padding:12px;margin-top:26px;font-size:13px}
@media (max-width: 900px){.compliance-score-grid,.compliance-form .cols-2,.compliance-checks{grid-template-columns:1fr}}

/* Compliance policy editable sections */
.policy-edit-box{border:1px solid var(--line);border-radius:14px;background:#f8fafc;padding:16px;margin:18px 0}
.policy-edit-sections{margin-top:16px}
.policy-section-editor{border:1px solid var(--line);border-radius:12px;background:#fff;padding:14px;margin-top:12px}
.policy-section-editor label{display:block;font-weight:800;margin:8px 0 6px;color:#334155}
.policy-section-textarea{min-height:110px;line-height:1.7}

/* Compliance policy section add and preview spacing */
.compliance-preview-header{margin-bottom:20px}
.policy-section-editor-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.policy-add-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:14px;padding-top:14px;border-top:1px dashed var(--line)}
.policy-remove-section{padding:8px 12px;font-size:13px}

/* Compliance policy insert/delete sections */
.policy-section-tools{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.policy-insert-section,.policy-remove-section{padding:8px 12px;font-size:13px}
/* update_040_compliance_form_card_spacing */
.compliance-page .compliance-score-grid {
    margin-bottom: 28px;
}
.compliance-page > .card:first-of-type {
    margin-top: 4px;
}
/* update_041_monthly_collection_checklist */

/* Monthly collection checklist */
.monthly-page .muted{color:#64748b;line-height:1.7}
.monthly-stat-grid{margin:18px 0 22px}
.monthly-alert-box{border-color:#fed7aa;background:#fff7ed;color:#9a3412}
.monthly-form-card{margin-top:22px}
.monthly-rule-form .field label{font-weight:800;color:#334155;margin-bottom:6px;display:block}
.check-inline{display:inline-flex;align-items:center;gap:8px;font-weight:800;color:#334155}
.check-inline input{width:auto;min-height:auto}
.table-wrap{overflow-x:auto}
.monthly-table small{color:#64748b;font-weight:700}
.monthly-status{display:inline-flex;align-items:center;justify-content:center;min-width:82px;border-radius:999px;padding:7px 10px;font-weight:900;font-size:12px}
.monthly-status.saved{background:#ecfdf5;color:#047857}
.monthly-status.pending{background:#fff7ed;color:#c2410c}
.monthly-status.not_required{background:#eff6ff;color:#1d4ed8}
.monthly-status.disabled{background:#f1f5f9;color:#64748b}
.monthly-row.alert{background:#fff7ed}
.monthly-alert-label{margin-top:6px;font-size:12px;font-weight:900;color:#c2410c}
.monthly-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap;min-width:260px}
.monthly-actions form{display:inline}
.btn.small{min-height:32px;padding:6px 10px;font-size:13px}
.btn.danger{border-color:#fecaca;background:#fef2f2;color:#b91c1c}
@media(max-width:900px){.monthly-actions{min-width:180px}.monthly-table{min-width:900px}}
/* update_042_monthly_checklist_button_spacing */
.monthly-page .card > .actions:first-child {
    margin-bottom: 18px;
}
.monthly-page .card > .actions:first-child + .table-wrap {
    margin-top: 4px;
}

/* update_043_monthly_ai_alert_full */
.monthly-rule-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 20px;align-items:start}
.monthly-grid-full{grid-column:1/-1}
.monthly-source-link{font-weight:900;text-decoration:none}
.monthly-dashboard-alert{margin:0 0 22px;padding:22px 26px;border-color:#fed7aa;background:#fff7ed;display:flex;align-items:center;justify-content:space-between;gap:16px;box-shadow:0 18px 42px rgba(194,65,12,.10)}
.monthly-dashboard-alert-title{font-size:23px;font-weight:900;color:#9a3412;margin-bottom:5px}
.monthly-dashboard-alert-text{font-weight:700;color:#7c2d12;line-height:1.6}
.monthly-dashboard-alert-list{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.monthly-dashboard-alert-list span{display:inline-flex;align-items:center;border-radius:999px;background:#ffedd5;color:#9a3412;padding:5px 10px;font-size:12px;font-weight:900}
.monthly-dashboard-mail-note{margin-top:8px;color:#166534;font-weight:900;font-size:13px}
.mc-modal{position:fixed;inset:0;background:rgba(15,23,42,.42);display:none;align-items:center;justify-content:center;z-index:9999;padding:20px}
.mc-modal.show{display:flex}
.mc-modal-panel{width:min(520px,100%);background:#fff;border-radius:24px;padding:28px;box-shadow:0 28px 80px rgba(15,23,42,.28)}
.mc-modal-title{font-size:22px;font-weight:900;color:#0f172a;margin-bottom:10px}
.mc-modal-panel p{color:#475569;line-height:1.7;font-weight:700;margin:0 0 18px}
.mc-modal-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}
@media(max-width:900px){.monthly-rule-grid{grid-template-columns:1fr}.monthly-dashboard-alert{align-items:flex-start;flex-direction:column}.monthly-dashboard-alert .btn{width:100%;justify-content:center}}
/* update_044_monthly_stats_grid */
.monthly-page .monthly-stat-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 18px !important;
    margin: 18px 0 22px !important;
}
.monthly-page .monthly-stat-grid .card.stat {
    min-height: 108px !important;
    padding: 22px 26px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}
.monthly-page .monthly-stat-grid .card.stat b {
    line-height: 1.1;
}
@media (max-width: 1100px) {
    .monthly-page .monthly-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
@media (max-width: 640px) {
    .monthly-page .monthly-stat-grid {
        grid-template-columns: 1fr !important;
    }
}

/* update_050 monthly notification settings */
.monthly-notification-card{margin-top:22px}
.monthly-notify-form .hint{margin-top:6px;color:#64748b;font-size:13px;line-height:1.6}

/* update_060: 毎月チェックリスト Webログイン支援 */
.monthly-open-site-btn {
  white-space: nowrap;
  font-weight: 700;
}
.monthly-url-register-btn {
  white-space: nowrap;
}
.monthly-mail-search-btn {
  white-space: nowrap;
}
.monthly-source-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 700;
}
.monthly-source-chip::before {
  content: "🔗";
}
@media (max-width: 900px) {
  .monthly-actions .monthly-open-site-btn,
  .monthly-actions .monthly-url-register-btn,
  .monthly-actions .monthly-mail-search-btn {
    width: 100%;
    justify-content: center;
  }
}
/* update_061: ダッシュボード強化通知・AIアドバイス */
.monthly-dashboard-alert {
  border: 1px solid rgba(245, 158, 11, .28);
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 54%, #eff6ff 100%);
  box-shadow: 0 16px 40px rgba(15, 23, 42, .08);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}
.monthly-dashboard-alert-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #92400e;
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 6px;
}
.monthly-dashboard-alert-kicker::before { content: "🔔"; }
.monthly-dashboard-alert-title {
  font-size: 24px;
  line-height: 1.35;
  font-weight: 900;
  color: #111827;
  margin-bottom: 6px;
}
.monthly-dashboard-alert-text {
  color: #475569;
  font-weight: 600;
  margin-bottom: 12px;
}
.monthly-dashboard-alert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.monthly-dashboard-alert-list span {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(251, 191, 36, .18);
  color: #78350f;
  font-weight: 700;
  font-size: 13px;
}
.monthly-dashboard-ai-advice {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(59, 130, 246, .22);
  border-radius: 16px;
  background: rgba(255, 255, 255, .78);
}
.monthly-dashboard-ai-advice-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 900;
  color: #1d4ed8;
  margin-bottom: 8px;
}
.monthly-dashboard-ai-advice-head::before { content: "✨"; }
.monthly-dashboard-ai-advice-item {
  padding: 10px 0;
  border-top: 1px solid rgba(148, 163, 184, .25);
}
.monthly-dashboard-ai-advice-item:first-of-type { border-top: 0; padding-top: 0; }
.monthly-dashboard-ai-advice-main {
  color: #0f172a;
  font-weight: 800;
  line-height: 1.7;
}
.monthly-dashboard-ai-advice-sub {
  margin-top: 3px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}
.monthly-dashboard-ai-advice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.monthly-dashboard-mail-note {
  display: inline-flex;
  margin-top: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 13px;
  font-weight: 800;
}
@media (max-width: 900px) {
  .monthly-dashboard-alert {
    flex-direction: column;
    align-items: stretch;
  }
  .monthly-dashboard-alert > .btn,
  .monthly-dashboard-alert a.btn.primary {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .monthly-dashboard-alert-title { font-size: 20px; }
}

/* update_064 monthly stability */
button[disabled], .btn[disabled]{opacity:.45;cursor:not-allowed;box-shadow:none;}
.mcs-ai-empty-help{line-height:1.8;}
.monthly-status.success{background:#dcfce7;color:#166534;}
.monthly-status.failed{background:#fee2e2;color:#991b1b;}

/* update_065: 毎月チェックリスト ボタン縦位置調整 */
.ai-auto-create-card-aligned .ai-auto-create-head {
  display: block;
}
.ai-auto-create-card-aligned .ai-auto-create-actions-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.ai-auto-create-card-aligned .ai-auto-settings-form {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}
.ai-auto-create-card-aligned .ai-auto-bulk-form {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  margin: 0;
}
.ai-auto-create-card-aligned .ai-auto-select-field {
  margin: 0;
  min-width: 220px;
}
.ai-auto-create-card-aligned .btn {
  white-space: nowrap;
}
/* cron実行テストのボタンも入力欄下端に合わせる */
.cron-test-card .actions,
.monthly-cron-test-card .actions,
.mc-cron-test-card .actions {
  align-items: flex-end !important;
}
@media (max-width: 900px) {
  .ai-auto-create-card-aligned .ai-auto-create-actions-row,
  .ai-auto-create-card-aligned .ai-auto-settings-form,
  .ai-auto-create-card-aligned .ai-auto-bulk-form {
    display: block;
  }
  .ai-auto-create-card-aligned .ai-auto-settings-form > *,
  .ai-auto-create-card-aligned .ai-auto-bulk-form > * {
    margin-top: 12px;
    width: 100%;
  }
}
/* update_076: 書類台帳 操作ボタン2行2列 + タグ列コンパクト */
.documents-table th.col-tags,
.documents-table td.col-tags,
.document-table th.col-tags,
.document-table td.col-tags,
table.documents th.col-tags,
table.documents td.col-tags {
  width: 112px !important;
  max-width: 112px !important;
  min-width: 96px !important;
  white-space: normal !important;
}

.doc-tags-cell,
.document-tags-cell,
.tags-cell {
  width: 112px !important;
  max-width: 112px !important;
}

.doc-tags-cell .tag-label,
.document-tags-cell .tag-label,
.tags-cell .tag-label,
.tag-chip,
.document-tag-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-tag-edit-btn,
.tag-edit-btn,
button[name="tag_edit"],
.btn-tag-edit,
a.btn-tag-edit {
  min-width: 82px !important;
  padding: 8px 10px !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
  border-radius: 14px !important;
}

.documents-table th.col-actions,
.documents-table td.col-actions,
.document-table th.col-actions,
.document-table td.col-actions,
table.documents th.col-actions,
table.documents td.col-actions {
  width: 178px !important;
  min-width: 178px !important;
  max-width: 178px !important;
}

.doc-actions-grid,
.document-actions-grid,
.actions-grid,
.doc-row-actions,
.document-row-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  align-items: stretch !important;
  justify-content: end !important;
  width: 168px !important;
  min-width: 168px !important;
}

.doc-actions-grid a,
.doc-actions-grid button,
.document-actions-grid a,
.document-actions-grid button,
.actions-grid a,
.actions-grid button,
.doc-row-actions a,
.doc-row-actions button,
.document-row-actions a,
.document-row-actions button {
  width: 100% !important;
  min-width: 0 !important;
  height: 42px !important;
  padding: 0 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  border-radius: 13px !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
}

/* 旧レイアウトが横並びのままの場合も強制的に整える */
td.col-actions > .btn,
td.col-actions > a,
td.col-actions > button,
td.actions > .btn,
td.actions > a,
td.actions > button {
  font-size: 13px !important;
}

@media (max-width: 900px) {
  .doc-actions-grid,
  .document-actions-grid,
  .actions-grid,
  .doc-row-actions,
  .document-row-actions {
    width: 150px !important;
    min-width: 150px !important;
    gap: 6px !important;
  }
  .doc-actions-grid a,
  .doc-actions-grid button,
  .document-actions-grid a,
  .document-actions-grid button,
  .actions-grid a,
  .actions-grid button,
  .doc-row-actions a,
  .doc-row-actions button,
  .document-row-actions a,
  .document-row-actions button {
    height: 38px !important;
    font-size: 12px !important;
    padding: 0 6px !important;
  }
}
/* update_077: 書類台帳 タグ・プレビューを非表示にしてシンプル化 */
.documents-table th.col-tags,
.documents-table td.col-tags,
.document-table th.col-tags,
.document-table td.col-tags,
table.documents th.col-tags,
table.documents td.col-tags,
.document-tags-cell,
.doc-tags-cell,
.tags-cell {
  display: none !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.document-preview-btn,
button.document-preview-btn,
a.document-preview-btn {
  display: none !important;
}

/* プレビューとタグを外したので操作列を少しコンパクトに戻す */
.documents-table th.col-actions,
.documents-table td.col-actions,
.document-table th.col-actions,
.document-table td.col-actions,
table.documents th.col-actions,
table.documents td.col-actions {
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;
}

.doc-actions-grid,
.document-actions-grid,
.actions-grid,
.doc-row-actions,
.document-row-actions {
  width: 140px !important;
  min-width: 140px !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.doc-actions-grid a,
.doc-actions-grid button,
.document-actions-grid a,
.document-actions-grid button,
.actions-grid a,
.actions-grid button,
.doc-row-actions a,
.doc-row-actions button,
.document-row-actions a,
.document-row-actions button {
  height: 40px !important;
  font-size: 13px !important;
  padding: 0 8px !important;
  border-radius: 13px !important;
}

/* ファイル名列を広めに使う */
.documents-table th.col-file,
.documents-table td.col-file,
.document-table th.col-file,
.document-table td.col-file,
table.documents th.col-file,
table.documents td.col-file {
  min-width: 260px !important;
}
/* update_078: 書類台帳 プレビュー削除・操作ボタンを一行へ戻す */
.document-preview-btn,
button.document-preview-btn,
a.document-preview-btn,
.preview-document-btn,
button.preview-document-btn,
a.preview-document-btn,
.btn-preview,
button.btn-preview,
a.btn-preview {
  display: none !important;
}

.documents-table th.col-actions,
.documents-table td.col-actions,
.document-table th.col-actions,
.document-table td.col-actions,
table.documents th.col-actions,
table.documents td.col-actions,
th.col-actions,
td.col-actions {
  width: 270px !important;
  min-width: 270px !important;
  max-width: 270px !important;
  white-space: nowrap !important;
}

.doc-actions-grid,
.document-actions-grid,
.actions-grid,
.doc-row-actions,
.document-row-actions,
.documents-actions,
.document-actions {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  grid-template-columns: none !important;
}

.doc-actions-grid a,
.doc-actions-grid button,
.document-actions-grid a,
.document-actions-grid button,
.actions-grid a,
.actions-grid button,
.doc-row-actions a,
.doc-row-actions button,
.document-row-actions a,
.document-row-actions button,
.documents-actions a,
.documents-actions button,
.document-actions a,
.document-actions button,
td.col-actions a,
td.col-actions button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 62px !important;
  height: 42px !important;
  padding: 0 14px !important;
  border-radius: 14px !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

/* タグ列は引き続き非表示 */
.documents-table th.col-tags,
.documents-table td.col-tags,
.document-table th.col-tags,
.document-table td.col-tags,
table.documents th.col-tags,
table.documents td.col-tags,
.document-tags-cell,
.doc-tags-cell,
.tags-cell {
  display: none !important;
}

/* ファイル名は見やすく */
.documents-table th.col-file,
.documents-table td.col-file,
.document-table th.col-file,
.document-table td.col-file,
table.documents th.col-file,
table.documents td.col-file {
  min-width: 330px !important;
}




/* update_079: 書類台帳テーブルの朝版デザイン復元 */
.documents-table {
    width: 100% !important;
    min-width: 1240px !important;
    table-layout: auto !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}
.documents-table th,
.documents-table td {
    vertical-align: middle !important;
    padding: 14px 12px !important;
    line-height: 1.55 !important;
}
.documents-table th:nth-child(1),
.documents-table td:nth-child(1) { width: 42px !important; min-width: 42px !important; text-align: center !important; }
.documents-table th:nth-child(2),
.documents-table td:nth-child(2) { width: 118px !important; min-width: 118px !important; }
.documents-table th:nth-child(3),
.documents-table td:nth-child(3) { width: 98px !important; min-width: 98px !important; }
.documents-table th:nth-child(4),
.documents-table td:nth-child(4) { width: 150px !important; min-width: 150px !important; }
.documents-table th:nth-child(5),
.documents-table td:nth-child(5) { width: 92px !important; min-width: 92px !important; }
.documents-table th:nth-child(6),
.documents-table td:nth-child(6) { width: 84px !important; min-width: 84px !important; }
.documents-table th:nth-child(7),
.documents-table td:nth-child(7) { width: 105px !important; min-width: 105px !important; text-align: center !important; }
.documents-table th:nth-child(8),
.documents-table td:nth-child(8) { min-width: 330px !important; }
.documents-table th:nth-child(9),
.documents-table td:nth-child(9) { width: 72px !important; min-width: 72px !important; text-align: center !important; }
.documents-table th:nth-child(10),
.documents-table td:nth-child(10) { width: 265px !important; min-width: 265px !important; }
.documents-table td:nth-child(8) {
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
}
.document-row-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    white-space: nowrap !important;
    position: static !important;
    width: auto !important;
    min-width: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.document-row-actions form {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
}
.documents-table .document-action-btn,
.document-action-btn {
    min-width: 72px !important;
    height: 44px !important;
    padding: 0 16px !important;
    border-radius: 14px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
}
.documents-table .document-action-btn.danger,
.document-action-btn.danger {
    background: #dc2626 !important;
    color: #fff !important;
    border-color: #dc2626 !important;
    box-shadow: 0 14px 28px rgba(220, 38, 38, .22) !important;
}
.documents-table .document-action-btn.danger:hover,
.document-action-btn.danger:hover {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
}
.documents-table .btn:not(.danger).document-action-btn {
    box-shadow: none !important;
}
.documents-table .link {
    white-space: nowrap !important;
}
@media (max-width: 900px) {
    .documents-table { min-width: 1160px !important; }
    .documents-table th,
    .documents-table td { padding: 12px 10px !important; }
    .documents-table th:nth-child(10),
    .documents-table td:nth-child(10) { min-width: 250px !important; }
}
/* /update_079 */

/* 初回セットアップナビ */
.onboarding-nav{
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  border-radius:16px;
  padding:12px;
  margin:0 0 16px;
}
.onboarding-nav-title{color:#fff;font-weight:900;font-size:14px;letter-spacing:.02em}
.onboarding-nav-sub{color:#94a3b8;font-size:11px;line-height:1.5;margin:2px 0 9px}
.onboarding-chip{
  display:flex!important;
  align-items:center;
  gap:8px;
  padding:7px 8px!important;
  margin:4px 0;
  border-radius:999px!important;
  color:#cbd5e1!important;
  font-size:12px;
  font-weight:800!important;
  background:rgba(15,23,42,.3);
}
.onboarding-chip:hover{background:rgba(255,255,255,.1)!important;text-decoration:none!important;color:#fff!important}
.onboarding-chip.current{background:rgba(37,99,235,.35)!important;color:#fff!important;box-shadow:inset 0 0 0 1px rgba(147,197,253,.35)}
.onboarding-chip.done{color:#bbf7d0!important;background:rgba(22,163,74,.14)!important}
.ob-num{
  width:22px;
  height:22px;
  flex:0 0 22px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,.12);
  color:#fff;
  font-size:11px;
}
.onboarding-chip.done .ob-num{background:rgba(34,197,94,.22);color:#dcfce7}
.onboarding-card{
  background:linear-gradient(135deg,#ffffff 0%,#f6f9ff 100%);
  border:1px solid #d9e6fb;
  border-radius:18px;
  padding:20px 22px;
  margin:0 0 18px;
  box-shadow:0 14px 34px rgba(15,35,70,.06);
}
.onboarding-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:14px}
.onboarding-kicker{color:#2563eb;font-size:12px;font-weight:900;margin-bottom:4px;letter-spacing:.04em}
.onboarding-card h2{margin:0 0 6px;color:#071936;font-size:20px;font-weight:900}
.onboarding-card p{margin:0;color:#52647d;line-height:1.75}
.onboarding-card-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.ob-guide-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px;margin-top:14px}
.ob-guide-step{border:1px solid #dbe6f6;background:#fff;border-radius:16px;padding:14px;min-height:112px}
.ob-guide-step b{display:block;color:#071936;font-size:15px;margin-bottom:8px}
.ob-guide-step p{font-size:13px;color:#52647d;line-height:1.75;margin:0 0 10px}
.ob-guide-step code{background:#f1f5f9;border:1px solid #e2e8f0;border-radius:6px;padding:1px 5px;color:#1e293b}
.ob-guide-note{margin-top:12px;border-left:4px solid #2563eb;background:#f4f7ff;border-radius:12px;padding:12px 14px;color:#40536d;line-height:1.75}
@media(max-width:900px){.onboarding-card-head{display:block}.onboarding-card-actions{margin-top:12px}.onboarding-nav{display:none}}


/* monthly checklist document type badges */
.monthly-doc-type{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  max-width:180px;
  padding:6px 11px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
  line-height:1.2;
  white-space:nowrap;
  border:1px solid transparent;
}
.monthly-doc-type-invoice{background:#dbeafe;color:#1d4ed8;border-color:#bfdbfe}
.monthly-doc-type-statement{background:#ede9fe;color:#6d28d9;border-color:#ddd6fe}
.monthly-doc-type-receipt{background:#dcfce7;color:#15803d;border-color:#bbf7d0}
.monthly-doc-type-delivery{background:#ffedd5;color:#c2410c;border-color:#fed7aa}
.monthly-doc-type-order{background:#f1f5f9;color:#475569;border-color:#e2e8f0}
.monthly-doc-type-payment{background:#ccfbf1;color:#0f766e;border-color:#99f6e4}
.monthly-doc-type-other{background:#f8fafc;color:#475569;border-color:#e2e8f0}
.monthly-doc-type-auto-1{background:#e0f2fe;color:#0369a1;border-color:#bae6fd}
.monthly-doc-type-auto-2{background:#fce7f3;color:#be185d;border-color:#fbcfe8}
.monthly-doc-type-auto-3{background:#ecfccb;color:#4d7c0f;border-color:#d9f99d}
.monthly-doc-type-auto-4{background:#fef3c7;color:#b45309;border-color:#fde68a}
.monthly-doc-type-auto-5{background:#e0e7ff;color:#4338ca;border-color:#c7d2fe}
.monthly-doc-type-auto-6{background:#fae8ff;color:#a21caf;border-color:#f5d0fe}
.monthly-doc-type-auto-7{background:#cffafe;color:#0e7490;border-color:#a5f3fc}
.monthly-doc-type-auto-8{background:#f3f4f6;color:#374151;border-color:#e5e7eb}
@media(max-width:900px){.monthly-doc-type{max-width:150px;overflow:hidden;text-overflow:ellipsis}}

/* update_092_monthly_checklist_hover_actions_fix */
/* Keep the 操作 column as a real table cell so row background/hover fills under the buttons. */
.monthly-table td.monthly-actions{
    display:table-cell !important;
    vertical-align:middle;
    min-width:260px;
    white-space:normal;
    background:inherit;
}
.monthly-table td.monthly-actions > a,
.monthly-table td.monthly-actions > form{
    display:inline-block;
    vertical-align:middle;
    margin:3px 3px;
}
.monthly-table td.monthly-actions > form .btn{
    vertical-align:middle;
}
.monthly-table tr.monthly-row.alert > td{
    background:#fff7ed;
}
.monthly-table tr.monthly-row.alert:hover > td{
    background:#ffedd5;
}
.monthly-table tr.monthly-row:not(.alert):hover > td{
    background:#fbfdff;
}
@media(max-width:900px){
    .monthly-table td.monthly-actions{min-width:180px;}
}

/* update_092: Chromeでログイン時の月次通知ダイアログがちらつく対策 */
.mc-modal,
.mc-modal * {
  animation: none !important;
}
.mc-modal {
  transition: none !important;
  contain: layout paint style;
  backface-visibility: hidden;
}
.mc-modal-panel {
  transform: translateZ(0);
  backface-visibility: hidden;
}
