
:root{
  --tc-blue:#0b66d4;
  --tc-blue2:#1d7df2;
  --tc-blue-soft:#edf5ff;
  --tc-navy:#12304f;
  --tc-bg:#f4f7fb;
  --tc-card:#ffffff;
  --tc-line:#dbe4ee;
  --tc-text:#1d2a36;
  --tc-muted:#6c7a89;
  --tc-success:#18864b;
  --tc-warning:#bd7b00;
  --tc-danger:#c43b3b;
  --tc-shadow:0 8px 26px rgba(18,48,79,.08);
  font-family:system-ui,-apple-system,"Segoe UI","Yu Gothic UI","Meiryo",sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--tc-bg);color:var(--tc-text)}
body{font-size:14px;line-height:1.6}
a{color:var(--tc-blue);text-decoration:none}
a:hover{text-decoration:none}
.tc-shell{min-height:100vh}
.tc-topbar{
  position:sticky;top:0;z-index:50;
  background:linear-gradient(135deg,#0b66d4 0%,#0a5dbf 60%,#084e9f 100%);
  color:#fff;box-shadow:0 2px 10px rgba(0,0,0,.08)
}
.tc-topbar-inner{
  height:64px;display:flex;align-items:center;justify-content:space-between;
  max-width:1600px;margin:auto;padding:0 22px
}
.tc-brand{display:flex;align-items:center;gap:8px;color:#fff;font-weight:800}
.tc-brand:hover{color:#fff}
.tc-brand-mark{font-size:24px}
.tc-brand-text{font-size:19px;letter-spacing:.2px}
.tc-brand-sub{
  font-size:12px;background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.28);
  padding:2px 8px;border-radius:999px;font-weight:700
}
.tc-userbox{display:flex;align-items:center;gap:10px}
.tc-user-avatar{
  width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  background:#fff;color:var(--tc-blue);font-weight:800
}
.tc-user-meta{display:flex;flex-direction:column;line-height:1.2}
.tc-user-meta span{font-size:11px;opacity:.8}
.tc-workspace{display:grid;grid-template-columns:220px minmax(0,1fr);min-height:calc(100vh - 64px)}
.tc-sidebar{
  background:#fff;border-right:1px solid var(--tc-line);padding:20px 14px;position:sticky;top:64px;
  height:calc(100vh - 64px);overflow:auto
}
.tc-side-title{font-size:11px;color:#9aa8b6;font-weight:800;letter-spacing:.12em;margin:0 10px 10px}
.tc-side-nav{display:flex;flex-direction:column;gap:5px}
.tc-nav-item{
  color:#33475b;padding:10px 12px;border-radius:9px;font-weight:700;display:flex;align-items:center;gap:10px
}
.tc-nav-item:hover{background:var(--tc-blue-soft);color:var(--tc-blue)}
.tc-side-separator{height:1px;background:var(--tc-line);margin:12px 4px}
.tc-main{padding:26px;min-width:0}
.tc-main-login{max-width:620px;margin:40px auto}
.tc-page-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}
.tc-page-kicker{font-size:11px;color:var(--tc-blue);font-weight:800;letter-spacing:.08em;text-transform:uppercase}
h1{font-size:26px;line-height:1.25;margin:4px 0 0;color:var(--tc-navy)}
h2{font-size:18px;color:var(--tc-navy);margin:20px 0 10px}
.desc{color:var(--tc-muted);margin:-8px 0 18px}
.tc-flash,.flash{padding:12px 14px;border-radius:10px;margin:0 0 14px;font-weight:700}
.tc-flash.ok,.flash.ok{background:#e7f7ee;color:#166a3d;border:1px solid #bfe7cf}
.tc-flash.error,.flash.error{background:#ffeded;color:#a72c2c;border:1px solid #f4c4c4}
.tc-flash.warn,.flash.warn{background:#fff6dd;color:#8a6500;border:1px solid #eedb9f}
.panel,.section,.card,.template-card,.form-sheet,table,.route-box{
  background:var(--tc-card);border:1px solid var(--tc-line);box-shadow:var(--tc-shadow)
}
.panel,.section,.card,.template-card,.route-box{border-radius:12px}
.panel,.section{padding:18px}
.form-sheet{border-radius:12px;overflow:hidden}
.form-row{display:grid;grid-template-columns:190px minmax(0,1fr);border-bottom:1px solid #edf1f5;min-height:66px}
.form-row:last-child{border-bottom:0}
.form-label{
  padding:18px 16px;font-weight:800;background:#f8fbff;border-right:1px solid #edf1f5;color:#29445f
}
.required{color:#dc3e3e;font-size:11px;font-weight:800}
.form-field{padding:14px 16px}
.help{font-size:12px;color:var(--tc-muted);margin-top:6px}
input[type=text],input[type=password],input[type=date],input[type=number],select,textarea{
  border:1px solid #cdd8e4;background:#fff;border-radius:8px;padding:10px 11px;
  color:var(--tc-text);font:inherit;outline:none;transition:.15s
}
input:focus,select:focus,textarea:focus{
  border-color:var(--tc-blue2);box-shadow:0 0 0 3px rgba(29,125,242,.12)
}
input[type=text],input[type=password],select{min-width:300px}
.wide{width:min(760px,100%)}.money-input{width:240px}
textarea{width:100%;min-height:120px;resize:vertical}
.radio-line{display:flex;gap:18px;align-items:center;flex-wrap:wrap}
.radio-line label{display:inline-flex;align-items:center;gap:6px}
.section{margin-top:18px}
.section-title{
  font-size:17px;font-weight:800;color:var(--tc-navy);
  display:flex;align-items:center;gap:8px;border-bottom:1px solid #edf1f5;padding-bottom:10px;margin-bottom:14px
}
.dropzone{
  background:#f8fbff;border:2px dashed #bfd0e2;border-radius:10px;padding:24px;
  display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap
}
.button,button{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  border:0;border-radius:8px;background:linear-gradient(180deg,var(--tc-blue2),var(--tc-blue));
  color:#fff;padding:10px 16px;font-weight:800;cursor:pointer;box-shadow:0 3px 8px rgba(11,102,212,.18)
}
.button:hover,button:hover{filter:brightness(.98);transform:translateY(-1px)}
.button.gray,button.gray{background:#7e8a96;box-shadow:none}
.button.warn,button.warn{background:#cf8708;box-shadow:none}
.button.danger,button.danger{background:#c43b3b;box-shadow:none}
.bottom-actions{
  position:sticky;bottom:0;z-index:15;margin-top:18px;padding:14px 18px;
  background:rgba(255,255,255,.95);backdrop-filter:blur(7px);
  border:1px solid var(--tc-line);border-radius:12px;box-shadow:0 -5px 22px rgba(18,48,79,.08);
  display:flex;justify-content:flex-end;gap:8px
}
.bottom-actions .button,.bottom-actions button{min-width:160px}
.route-box{padding:18px;background:linear-gradient(180deg,#fff,#fbfdff)}
.route-step{display:grid;grid-template-columns:44px minmax(0,1fr);gap:10px;align-items:start}
.route-number,.route-done{
  width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:800
}
.route-number{background:var(--tc-blue);color:#fff;box-shadow:0 0 0 4px var(--tc-blue-soft)}
.route-done{background:#edf1f5;color:#7a8794}
.route-arrow{margin:5px 0 5px 15px;color:#9fb0c0;font-size:18px}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px}
.card{padding:18px}.card .big{font-size:34px;font-weight:900;color:var(--tc-navy)}
.template-card{display:block;padding:20px;color:var(--tc-text);transition:.15s}
.template-card:hover{border-color:#9ec4f3;box-shadow:0 10px 28px rgba(11,102,212,.12);transform:translateY(-2px)}
.template-icon{font-size:30px;margin-bottom:8px}
table{width:100%;border-collapse:separate;border-spacing:0;border-radius:12px;overflow:hidden}
th,td{border-bottom:1px solid #edf1f5;padding:11px 12px;text-align:left;vertical-align:top}
th{background:#f7faff;color:#40576e;font-size:12px;font-weight:800}
tr:last-child td{border-bottom:0}
.badge{display:inline-block;padding:4px 9px;border-radius:999px;font-size:11px;font-weight:800}
.badge.ok{background:#e3f6ea;color:#177145}.badge.info{background:#e7f1ff;color:#145fb4}
.badge.warn{background:#fff4d8;color:#936600}.badge.danger{background:#ffe9e9;color:#ac2d2d}.badge.muted{background:#edf1f5;color:#6e7b89}
.actions{display:flex;gap:8px;flex-wrap:wrap}.muted{color:var(--tc-muted)}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.confirm-table th{width:190px}
.tc-footer{text-align:center;color:#8b99a8;padding:22px;font-size:12px}
@media(max-width:900px){
  .tc-workspace{grid-template-columns:72px minmax(0,1fr)}
  .tc-sidebar{padding:14px 8px}
  .tc-side-title,.tc-nav-item span{display:none}
  .tc-nav-item{justify-content:center;font-size:18px}
}
@media(max-width:700px){
  .tc-topbar-inner{padding:0 12px}.tc-user-meta{display:none}
  .tc-workspace{display:block}.tc-sidebar{position:static;height:auto;border-right:0;border-bottom:1px solid var(--tc-line);padding:8px}
  .tc-side-nav{flex-direction:row;overflow:auto}.tc-nav-item{min-width:54px}
  .tc-main{padding:14px}
  .form-row{grid-template-columns:1fr}.form-label{border-right:0;padding-bottom:5px}
  input[type=text],input[type=password],select{min-width:0;width:100%}.money-input{width:70%}
  .row2{grid-template-columns:1fr}
  .bottom-actions .button,.bottom-actions button{min-width:0;flex:1}
  .tc-brand-sub{display:none}
}
@media print{
  .tc-topbar,.tc-sidebar,.tc-footer,.no-print,.bottom-actions{display:none!important}
  .tc-workspace{display:block}.tc-main{padding:0}.panel,.section,.card,.form-sheet,table,.route-box{box-shadow:none}
}


/* v2.2 master search */
.segmented{display:inline-flex;background:#edf3f9;border:1px solid #d5e0eb;border-radius:9px;padding:3px;margin-bottom:12px;gap:3px}
.segmented .seg{background:transparent;color:#52677b;box-shadow:none;padding:8px 13px}
.segmented .seg.active{background:#fff;color:var(--tc-blue);box-shadow:0 2px 8px rgba(18,48,79,.10)}
.item-type-row{margin-bottom:10px}.search-combo{position:relative;max-width:760px}.search-results{position:absolute;left:0;right:0;top:46px;z-index:30;background:#fff;border:1px solid #cdd8e4;border-radius:10px;box-shadow:0 12px 32px rgba(18,48,79,.16);max-height:320px;overflow:auto;display:none}.search-results.open{display:block}.search-result{display:flex;width:100%;flex-direction:column;align-items:flex-start;text-align:left;background:#fff;color:var(--tc-text);box-shadow:none;border-radius:0;border-bottom:1px solid #edf1f5;padding:11px 13px}.search-result:hover{background:var(--tc-blue-soft);transform:none}.search-result span{font-size:12px;color:var(--tc-muted);font-weight:500}.search-empty{padding:14px;color:var(--tc-muted)}.master-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px}.master-grid label{display:flex;flex-direction:column;gap:5px;font-weight:700;color:#40576e}.master-grid input,.master-grid select{min-width:0;width:100%}

/* v2.5 staff/route admin */
.tc-grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.tc-grid-3{display:grid;grid-template-columns:140px minmax(180px,1fr) minmax(280px,2fr);gap:16px;align-items:end}
.tc-step-list{display:flex;flex-direction:column;gap:10px}
.tc-step-card{display:grid;grid-template-columns:46px 1fr auto;gap:14px;align-items:center;padding:14px 16px;border:1px solid #dbe6f3;border-radius:12px;background:#fff}
.tc-step-num{width:38px;height:38px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#0b66d4;color:#fff;font-weight:700}
code{background:#f3f7fb;padding:2px 6px;border-radius:5px}
@media(max-width:900px){.tc-grid-2,.tc-grid-3{grid-template-columns:1fr}.tc-step-card{grid-template-columns:42px 1fr}.tc-step-card form{grid-column:2}}

/* v2.5.1 duplicate / merge */
.dup-group{border:1px solid #dbe6f3;border-radius:14px;background:#fff;padding:16px;margin:14px 0}
.dup-group h3{margin:0 0 12px}
.dup-group table{margin-bottom:12px}

/* v2.5.2 duplicate UI feedback */
.merge-updated-banner{border:2px solid #22a06b;background:#f0fff7}
.dup-group-merged{border:2px solid #22a06b;background:#f5fff9}
.merge-state-box{background:#e9fff3;border:1px solid #9be0bc;border-radius:10px;padding:10px 12px;margin-bottom:12px}
.status-badge{display:inline-block;padding:3px 8px;border-radius:999px;background:#edf2f7;font-size:12px;font-weight:700}
.status-badge.status-ok{background:#dff7e9;color:#11613a}
.status-badge.status-stop{background:#ffe5e5;color:#9b1c1c}
.merge-saved-text{margin-left:10px;color:#16794b;font-weight:700}
html{scroll-behavior:smooth}
