/* style.css - main 002 (UI refresh)
   - No PHP helper additions. Pure HTML/CSS/JS polish.
*/

:root{
  --bg: #f6fbf7;           /* soft green background */
  --panel: #ffffff;        /* main surface */
  --panel2:#e7f2eb;        /* secondary surface (nav etc.) */        /* secondary surface (nav etc.) */
  --text:#1f2937;          /* readable dark */
  --muted:#6b7280;
  --brand:#6fa98a;         /* gentle green accent */
  --brand2:#4f8f6b;        /* deeper accent */
  --line: rgba(31,41,55,.10);
  --shadow: 0 12px 30px rgba(22,40,30,.10);
  --radius: 16px;
  --radius2: 22px;
  --header-h: 72px;
  --nav-w: 240px;
  --max: 1200px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, Arial, sans-serif;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  letter-spacing: .2px;
}

a{ color: var(--brand); text-decoration:none; }
a:hover{ text-decoration: underline; }
img{ max-width:100%; height:auto; border-radius: 12px; }

.app-header{
  position:fixed;
  top:0; left:0; right:0;
  height: var(--header-h);
  z-index: 50;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(231,242,235,.78);
  border-bottom: 1px solid var(--line);
}
.app-header__inner{
  height:100%;
  display:flex;
  align-items:center;
  gap:12px;
  padding: 0 16px;
  max-width: calc(var(--max) + var(--nav-w) + 48px);
  margin: 0 auto;
}
.brand{
  display:flex;
  align-items:baseline;
  gap:10px;
  min-width: 0;
}
.brand__title{
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .6px;
  white-space: nowrap;
}
.brand__meta{
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}

.nav-toggle{
  display:none;
  appearance:none;
  border: 1px solid var(--line);
  background: rgba(17,24,39,.06);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  cursor:pointer;
}
.nav-toggle:hover{ background: rgba(17,24,39,.10); }

.nav-check{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

.nav-backdrop{ display:none; }


.container{
  display:block;
  padding-top: var(--header-h);
}
.app-shell{
  display:grid;
  grid-template-columns: var(--nav-w) 1fr;
  gap: 18px;
  padding: 18px;
  max-width: calc(var(--max) + var(--nav-w) + 48px);
  margin: 0 auto;
}

nav{
  position: sticky;
  top: calc(var(--header-h) + 18px);
  align-self: start;
  height: calc(100dvh - var(--header-h) - 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius2);
  background: var(--panel2);
  box-shadow: var(--shadow);
  overflow:auto;
  padding: 14px 12px;
}

.nav-title{
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .6px;
  text-transform: uppercase;
  margin: 6px 10px 10px;
}

nav ul{
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}
nav ul li a{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 10px;
  border-radius: 14px;
  color: var(--text);
  text-decoration:none;
  border: 1px solid transparent;
}
nav ul li a:hover{
  background: rgba(17,24,39,.06);
  border-color: rgba(17,24,39,.08);
  text-decoration:none;
}
nav ul li a .nav-mark{
  color: var(--brand);
  font-weight: 900;
  width: 14px;
  display:inline-block;
  text-align:center;
}

main{
  margin:0;
  padding: 0;
  background: transparent;
  color: var(--text);
  min-width: 0;
}

.page-title{
  margin: 4px 0 14px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .4px;
}

.card{
  border: 1px solid var(--line);
  background: rgba(17,24,39,.04);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
}
.card__inner{ padding: 16px; }
.card__title{
  margin:0 0 10px;
  font-size: 14px;
  font-weight: 800;
  color: #f3f4f6;
}
.card__muted{ color: var(--muted); font-size: 12px; }

/* main004: details marker (avoid double chevron) */
details > summary{ list-style: none; }
details > summary::-webkit-details-marker{ display:none; }
details > summary::marker{ content:""; }


.details{
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(17,24,39,.03);
  padding: 10px 12px;
}
.details summary{
  cursor:pointer;
  font-weight: 800;
}
.details summary::-webkit-details-marker{ display:none; }
.details summary:before{
  content:"▸";
  display:inline-block;
  margin-right: 8px;
  color: var(--brand);
  transform: translateY(-1px);
}
.details[open] summary:before{ content:"▾"; }

.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.grid-3{
  display:grid;
  grid-template-columns: 1fr 1fr 280px;
  gap: 14px;
  align-items:start;
}
.feed{
  margin:0;
  padding-left: 1.1em;
}
.feed li{
  margin: 8px 0;
  line-height: 1.5;
}
.feed time{
  font-size: 11px;
  color: var(--muted);
  margin-left: 6px;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border: 1px solid rgba(107,182,166,.35);
  color: var(--brand);
  background: rgba(107,182,166,.08);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.badge a{ color: inherit; text-decoration:none; }
.badge a:hover{ text-decoration: underline; }

.row-links{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  margin-top: 10px;
}


.filterbar{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  align-items:center;
  margin-top: 10px;
}
.filter-input{
  flex: 1 1 280px;
  min-width: 220px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(17,24,39,.03);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}
.filter-input::placeholder{
  color: var(--muted);
  font-weight: 700;
}
.filter-clear{
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(17,24,39,.03);
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}
.filter-clear:hover{ background: rgba(17,24,39,.06); }
.filter-stat{
  flex: 1 1 auto;
  text-align: right;
  min-width: 120px;
}

.chip{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(17,24,39,.03);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}
.chip:hover{ background: rgba(17,24,39,.06); text-decoration:none; }

.news{
  display:grid;
  grid-template-columns: 420px 1fr;
  gap: 14px;
  align-items:start;
}
.news__meta{ color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.news__title{ margin: 0 0 10px; font-size: 18px; font-weight: 900; }
.news__body{ color: var(--text); line-height: 1.7; }
.news__img{
  border-radius: var(--radius2);
  border: 1px solid var(--line);
  background: rgba(17,24,39,.02);
  padding: 10px;
}
.list{
  margin: 0;
  padding-left: 1.1em;
}
.list li{ margin: 8px 0; }

footer{
  margin-top: 18px;
  padding: 20px 18px 34px;
  color: var(--muted);
}

/* legacy tables (render acceptable even if left in place) */
table{ border-collapse: collapse; width: 100%; }
td,th{ border: 1px solid rgba(17,24,39,.08); padding: 10px; vertical-align: top; }
table[style*="border:none"] td, table[style*="border:none"] th,
td[style*="border:none"], th[style*="border:none"]{
  border: none !important;
  padding: 0 !important;
}

/* --------------------------------------------------
   Mobile
-------------------------------------------------- */
@media (max-width: 980px){
  :root{ --nav-w: 220px; }
  .grid-3{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px){

  .nav-toggle{ display:inline-flex; }
  .app-shell{ grid-template-columns: 1fr; }
  .nav-backdrop{
    display:none;
    position: fixed;
    inset: 0;
    top: var(--header-h);
    background: rgba(0,0,0,.25);
    z-index: 50;
  }
  #nav-check:checked ~ .container .nav-backdrop{ display:block; }
  nav{ z-index: 60; }
  nav{
    position: fixed;
    top: var(--header-h);
    left: 12px;
    right: 12px;
    height: auto;
    max-height: calc(100dvh - var(--header-h) - 24px);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events:none;
    transition: .18s ease;
  }
  #nav-check:checked ~ .container nav{
    transform: translateY(0);
    opacity: 1;
    pointer-events:auto;
  }
  .grid-2{ grid-template-columns: 1fr; }
  .grid-3{ grid-template-columns: 1fr; }
  .news{ grid-template-columns: 1fr; }
}

/* ログアウト（控えめ・メニュー下部） */
.nav-logout {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed rgba(0,0,0,.15);
}

.nav-logout a {
  font-size: 0.85em;
  color: #888;
  text-decoration: none;
}

.nav-logout a:hover {
  color: var(--brand);
  text-decoration: underline;
}

/* =========================================================
   main 003 : soft-green final adjust
   - 文字を一段だけ濃く
   - 背景は単色（途中で色が変わらない）
   - 左メニューは白を使わない
   - Rakuten とその上の余白を少し広げる
   ========================================================= */

/* ------------------------------
   テーマ：薄いグリーン（確定）
------------------------------ */
:root[data-theme="soft-green"]{
  --bg:      #f6fbf7;   /* 全体背景 */
  --panel:   #ffffff;   /* カード */
  --panel2:  #eef6f0;   /* メニュー・サブ面 */
  --line:    #dfece3;   /* 罫線 */
  --shadow:  rgba(40, 80, 60, 0.08);

  --brand:   #6fa98a;
  --brand2:  #4f8f6b;

  /* ★ 可読性調整（今回の肝） */
  --text:    #111827;   /* 本文・リスト */
  --muted:   #4b5563;   /* 日付・補足 */
}

/* ------------------------------
   body 背景：単色固定
   （スクロールで色が変わらない）
------------------------------ */
body{
  background: var(--bg);
  color: var(--text);
}

/* ------------------------------
   左メニュー（白をやめる）
------------------------------ */
.side-nav,
.side-menu,
nav.side{
  background: var(--panel2);
  border-right: 1px solid var(--line);
}

/* ------------------------------
   カード・パネル
------------------------------ */
.card,
.panel,
.box{
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px var(--shadow);
}

/* ------------------------------
   Rakuten 周りの余白調整
------------------------------ */
.rakuten-area{
  margin-top: 16px;   /* 上を少し広く */
}

.rakuten-area .rakuten-box{
  padding: 14px 16px; /* 中の上下余白 */
}

/* ------------------------------
   テキスト微調整
------------------------------ */
p,
li,
dd,
dt{
  color: var(--text);
}

.time,
.date,
.meta,
.small{
  color: var(--muted);
}

/* ------------------------------
   リンク（色は変えない）
------------------------------ */
a{
  color: inherit;
}

a:hover{
  text-decoration: underline;
}


/* =========================================================
   main 004: Rakuten widget responsive (keep visible on mobile)
   - Rakuten script injects fixed-size iframe. Prevent overflow.
   ========================================================= */
.rakuten-widget,
iframe[src*="xml.affiliate.rakuten.co.jp"],
iframe[src*="rakuten.co.jp/widget"]{
  max-width: 100%;
}

@media (max-width: 768px){
  /* make widget block-level and centered */
  iframe[src*="xml.affiliate.rakuten.co.jp"],
  iframe[src*="rakuten.co.jp/widget"]{
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    margin: 8px auto;
  }

  /* if inside a narrow header row, allow wrapping */
  .app-header__inner,
  .header-inner,
  .header-row{
    flex-wrap: wrap;
  }
}

/* ===== main 004 header fix (確定) ===== */

.app-header__inner{
  display: flex;              /* ← これが無かった or 不完全 */
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;          /* 縦積みを絶対させない */
}

/* 三本バー */
.app-header .nav-toggle{
  flex: 0 0 auto;
  line-height: 1;
}

/* タイトル側 */
.app-header .brand{
  flex: 1 1 auto;
  min-width: 0;               /* ★ これが無いとシミュレーターで崩れる */
}

.app-header .brand__title{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== links.bitlabo-the-final.com standalone adjust ===== */
.app-shell--standalone{
  display:block;
  max-width: var(--max);
}
.footer-standalone{
  max-width: var(--max);
  margin: 0 auto;
  padding-left: 18px;
  padding-right: 18px;
}
.card--links{
  background: var(--panel);
}
@media (max-width: 760px){
  .app-shell--standalone{ display:block; }
}

/* ===== admin/links.php table responsive fix ===== */
.table-scroll{
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.links-table-wrap{
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.links-admin-table{
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
  border-collapse: collapse;
}
.links-admin-table th,
.links-admin-table td{
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.45;
}
.links-admin-table th{
  background: rgba(17,24,39,.035);
  white-space: nowrap;
}
.links-admin-table th:nth-child(1){ width: 58px; }
.links-admin-table th:nth-child(2){ width: 78px; }
.links-admin-table th:nth-child(3){ width: 24%; }
.links-admin-table th:nth-child(4){ width: auto; }
.links-admin-table th:nth-child(5){ width: 78px; }
.links-admin-table th:nth-child(6){ width: 132px; }
.links-admin-table th:nth-child(7){ width: 76px; }
.links-admin-table .cell-name,
.links-admin-table .cell-url,
.links-admin-table .cell-url a{
  overflow-wrap: anywhere;
  word-break: break-word;
}
.cell-center,
.cell-action{ text-align: center; }
.cell-right{ text-align: right; }
.cell-date{ white-space: nowrap; color: var(--muted); }
.cell-action button{
  min-width: 52px;
  padding: 6px 8px;
  border-radius: 10px;
}

@media (max-width: 700px){
  .card__inner{ padding: 12px; }
  .filterbar{ align-items: stretch; }
  .filter-input{ min-width: 0; flex-basis: 100%; }
  .filter-stat{ text-align: left; min-width: 0; }
  .links-table-wrap{
    border: none;
    background: transparent;
    overflow: visible;
  }
  .links-admin-table{
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }
  .links-admin-table,
  .links-admin-table thead,
  .links-admin-table tbody,
  .links-admin-table tr,
  .links-admin-table th,
  .links-admin-table td{
    display: block;
    width: 100%;
  }
  .links-admin-table thead{ display: none; }
  .links-admin-table tr{
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(40, 80, 60, 0.06);
  }
  .links-admin-table td{
    border: none;
    border-bottom: 1px solid rgba(17,24,39,.07);
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 9px 10px;
  }
  .links-admin-table td:last-child{ border-bottom: none; }
  .links-admin-table td::before{
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .3px;
    white-space: nowrap;
  }
  .links-admin-table .cell-url a{
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-all;
  }
  .links-admin-table .cell-center,
  .links-admin-table .cell-right,
  .links-admin-table .cell-action{
    text-align: left;
  }
  .links-admin-table .cell-action button{
    width: 100%;
    max-width: 160px;
  }
}

/* ===== category support ===== */
.filterbar--multi{
  align-items: stretch;
}
.filter-select{
  flex: 0 1 220px;
  min-width: 180px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(17,24,39,.03);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}
.links-admin-table th:nth-child(1){ width: 58px; }
.links-admin-table th:nth-child(2){ width: 78px; }
.links-admin-table th:nth-child(3){ width: 120px; }
.links-admin-table th:nth-child(4){ width: 22%; }
.links-admin-table th:nth-child(5){ width: auto; }
.links-admin-table th:nth-child(6){ width: 78px; }
.links-admin-table th:nth-child(7){ width: 132px; }
.links-admin-table th:nth-child(8){ width: 76px; }
.cell-category{
  font-weight: 800;
  color: var(--brand);
  overflow-wrap: anywhere;
}
.category-admin-table{
  min-width: 920px;
}
.category-admin-table th:nth-child(1){ width: 58px; }
.category-admin-table th:nth-child(2){ width: 78px; }
.category-admin-table th:nth-child(3){ width: 150px; }
.category-admin-table th:nth-child(4){ width: 140px; }
.category-admin-table th:nth-child(5){ width: auto; }
.category-admin-table th:nth-child(6){ width: 78px; }
.category-admin-table th:nth-child(7){ width: 132px; }
.category-admin-table th:nth-child(8){ width: 76px; }
.form-table select,
.form-table textarea,
.form-table input[type="text"],
.form-table input[type="url"],
.form-table input[type="number"],
.form-table input[type="password"]{
  max-width: 100%;
}
@media (max-width: 700px){
  .filter-select{ flex-basis: 100%; min-width: 0; }
}


/* =========================================================
   v1.0.4: admin category/admin list redesign
   - Remove drag/drop dependency from categories.php/admins.php.
   - Clean table/card view with numeric order fields.
   ========================================================= */
.page-title--with-action{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.button,
button.button,
a.button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:36px;
  padding:8px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--panel);
  color:var(--text);
  font-size:13px;
  font-weight:800;
  line-height:1.2;
  text-decoration:none;
  cursor:pointer;
  box-shadow:0 2px 8px rgba(40,80,60,.04);
}
.button:hover,
button.button:hover,
a.button:hover{
  background:#f5faf6;
  border-color:#cfe2d5;
  text-decoration:none;
}
.button--primary,
button.button--primary,
a.button--primary{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
}
.button--primary:hover,
button.button--primary:hover,
a.button--primary:hover{
  background:var(--brand2);
  border-color:var(--brand2);
  color:#fff;
}
.button--small,
a.button--small{
  min-height:30px;
  padding:6px 10px;
  border-radius:10px;
  font-size:12px;
}
.notice{
  margin:0 0 12px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background:#fff;
  font-weight:700;
}
.notice--success{
  border-color:#cfe8d7;
  background:#f3fbf5;
  color:#235d3b;
}
.admin-list-note{
  margin:0 0 12px;
  color:var(--muted);
  font-size:13px;
  line-height:1.6;
}
.admin-table-wrap{
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--panel);
  overflow:auto;
}
.admin-data-table{
  width:100%;
  min-width:900px;
  border-collapse:separate;
  border-spacing:0;
  table-layout:fixed;
}
.admin-data-table th,
.admin-data-table td{
  padding:10px 12px;
  border:0;
  border-bottom:1px solid rgba(17,24,39,.08);
  font-size:13px;
  line-height:1.45;
  vertical-align:middle;
}
.admin-data-table th{
  position:sticky;
  top:0;
  z-index:1;
  background:#f4faf6;
  color:#2f4f3c;
  text-align:left;
  font-size:12px;
  font-weight:900;
  letter-spacing:.04em;
  white-space:nowrap;
}
.admin-data-table tbody tr:hover td{
  background:#fbfdfb;
}
.admin-data-table tbody tr:last-child td{
  border-bottom:0;
}
.admins-data-table th:nth-child(1){ width:150px; }
.admins-data-table th:nth-child(2){ width:170px; }
.admins-data-table th:nth-child(3){ width:130px; }
.admins-data-table th:nth-child(4){ width:92px; }
.admins-data-table th:nth-child(5){ width:96px; }
.admins-data-table th:nth-child(6){ width:142px; }
.admins-data-table th:nth-child(7){ width:142px; }
.admins-data-table th:nth-child(8){ width:86px; }
.category-data-table{ min-width:980px; }
.category-data-table th:nth-child(1){ width:60px; }
.category-data-table th:nth-child(2){ width:92px; }
.category-data-table th:nth-child(3){ width:160px; }
.category-data-table th:nth-child(4){ width:150px; }
.category-data-table th:nth-child(5){ width:auto; }
.category-data-table th:nth-child(6){ width:96px; }
.category-data-table th:nth-child(7){ width:142px; }
.category-data-table th:nth-child(8){ width:86px; }
.cell-id,
.cell-center,
.cell-action{
  text-align:center;
}
.cell-name,
.cell-keywords,
.cell-mono{
  overflow-wrap:anywhere;
  word-break:break-word;
}
.cell-mono{
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size:12px;
  color:#374151;
}
.cell-keywords{
  color:#374151;
  font-size:12px;
  line-height:1.55;
}
.status-pill,
.role-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:26px;
  padding:4px 9px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
}
.status-pill--active{
  color:#23633f;
  background:#e8f7ed;
  border:1px solid #c8ead4;
}
.status-pill--inactive{
  color:#6b7280;
  background:#f3f4f6;
  border:1px solid #e5e7eb;
}
.role-pill{
  color:#365849;
  background:#eef6f0;
  border:1px solid #dbece0;
}
.order-input{
  width:76px;
  max-width:100%;
  padding:7px 8px;
  border-radius:10px;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  font-weight:800;
  text-align:right;
}
.order-input:focus{
  outline:2px solid rgba(111,169,138,.25);
  border-color:var(--brand);
}
.admin-list-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:14px;
}
@media (max-width:700px){
  .admin-table-wrap{
    border:0;
    background:transparent;
    overflow:visible;
  }
  .admin-data-table{
    min-width:0;
    border-collapse:separate;
    border-spacing:0 10px;
  }
  .admin-data-table,
  .admin-data-table thead,
  .admin-data-table tbody,
  .admin-data-table tr,
  .admin-data-table th,
  .admin-data-table td{
    display:block;
    width:100%;
  }
  .admin-data-table thead{ display:none; }
  .admin-data-table tr{
    border:1px solid var(--line);
    border-radius:16px;
    background:var(--panel);
    overflow:hidden;
    box-shadow:0 4px 12px rgba(40,80,60,.06);
  }
  .admin-data-table td{
    display:grid;
    grid-template-columns:92px minmax(0,1fr);
    gap:10px;
    align-items:start;
    padding:9px 10px;
    border-bottom:1px solid rgba(17,24,39,.07);
  }
  .admin-data-table td:last-child{ border-bottom:0; }
  .admin-data-table td::before{
    content:attr(data-label);
    color:var(--muted);
    font-size:11px;
    font-weight:900;
    letter-spacing:.03em;
    white-space:nowrap;
  }
  .cell-id,
  .cell-center,
  .cell-action{
    text-align:left;
  }
  .cell-action .button{
    width:100%;
    max-width:180px;
  }
  .order-input{
    width:100%;
    max-width:140px;
    text-align:left;
  }
  .admin-list-actions{
    justify-content:stretch;
  }
  .admin-list-actions .button{
    width:100%;
  }
}


/* =========================================================
   v1.0.5: overall admin UX polish
   ========================================================= */
nav a.is-current{
  background: rgba(111,169,138,.16);
  border-color: rgba(111,169,138,.28);
  color:#244f37;
  font-weight:900;
}
.page-actions{ display:inline-flex; gap:8px; flex-wrap:wrap; align-items:center; }
.summary-strip{
  display:grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap:10px;
  margin:0 0 14px;
}
.summary-chip,
.stat-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--panel);
  box-shadow:0 4px 12px rgba(40,80,60,.06);
  color:var(--text);
  text-decoration:none;
}
.summary-chip:hover{ background:#f5faf6; text-decoration:none; }
.summary-chip span,
.stat-card__label{ color:var(--muted); font-size:12px; font-weight:900; }
.summary-chip strong,
.stat-card__value{ font-size:24px; line-height:1; color:#1f4d35; }
.dashboard-grid{ display:grid; gap:14px; margin-bottom:14px; }
.dashboard-grid--stats{ grid-template-columns:repeat(6, minmax(110px, 1fr)); }
.dashboard-grid--lists{ grid-template-columns:1fr 1fr; align-items:start; }
.stat-card{ display:block; }
.stat-card__value{ margin-top:8px; font-weight:900; }
.section-title{ margin:0 0 12px; font-size:15px; font-weight:900; }
.mini-list{ display:grid; gap:8px; }
.mini-list__item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border:1px solid rgba(17,24,39,.07);
  border-radius:14px;
  background:#fff;
  color:var(--text);
  text-decoration:none;
}
.mini-list__item:hover{ background:#f8fcf9; text-decoration:none; }
.mini-list__main{ min-width:0; display:grid; gap:3px; }
.mini-list__main strong{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mini-list__main span{ color:var(--muted); font-size:12px; }
.mini-list__count{ min-width:42px; text-align:right; font-weight:900; color:#1f4d35; }
.button--danger{ color:#9f1239; border-color:#fecdd3; background:#fff1f2; }
.button--danger:hover{ color:#881337; border-color:#fda4af; background:#ffe4e6; }
.edit-form{ margin:0; }
.form-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:14px;
}
.form-field{ display:grid; gap:7px; }
.form-field--wide{ grid-column:1 / -1; }
.form-field label{ font-size:12px; font-weight:900; color:#2f4f3c; }
.required{ display:inline-block; margin-left:4px; color:#be123c; font-size:11px; }
.form-field input[type="text"],
.form-field input[type="url"],
.form-field input[type="number"],
.form-field input[type="password"],
.form-field select,
.form-field textarea,
.inline-control input,
.inline-control select{
  width:100%;
  min-height:42px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  color:var(--text);
  font-size:14px;
}
.form-field textarea{ min-height:140px; resize:vertical; line-height:1.6; }
.inline-control{ display:flex; gap:8px; align-items:center; }
.inline-control .button{ flex:0 0 auto; min-height:42px; }
.help-text{ color:var(--muted); font-size:12px; line-height:1.55; }
.switch-line{ display:inline-flex; align-items:center; gap:8px; min-height:42px; padding:10px 12px; border:1px solid var(--line); border-radius:14px; background:#fff; }
.readonly-box{ min-height:42px; display:flex; align-items:center; padding:10px 12px; border:1px solid var(--line); border-radius:14px; background:#f8fbf9; color:var(--muted); font-weight:800; }
.form-actions{ display:flex; justify-content:flex-end; gap:10px; flex-wrap:wrap; margin-top:18px; padding-top:14px; border-top:1px solid var(--line); }
.links-admin-table .cell-action .button{ width:auto; }
@media (max-width:980px){
  .dashboard-grid--stats{ grid-template-columns:repeat(3, minmax(0,1fr)); }
}
@media (max-width:700px){
  .summary-strip{ grid-template-columns:repeat(2, minmax(0,1fr)); }
  .dashboard-grid--stats,
  .dashboard-grid--lists,
  .form-grid{ grid-template-columns:1fr; }
  .inline-control{ flex-direction:column; align-items:stretch; }
  .form-actions{ justify-content:stretch; }
  .form-actions .button{ width:100%; }
  .summary-chip strong,.stat-card__value{ font-size:21px; }
}


/* v1.0.6 rich link management */
.notice--info {
    background: #eef6ff;
    border-color: #bddbff;
    color: #1f4f82;
}
.notice--error {
    background: #fff1f0;
    border-color: #ffccc7;
    color: #a8071a;
}
.links-admin-table--rich .cell-link-rich {
    min-width: 320px;
    max-width: 540px;
}
.link-title-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.link-mini-icon {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background-size: cover;
    background-position: center;
    background-color: rgba(0,0,0,.08);
    flex: 0 0 auto;
}
.link-url-line {
    display: block;
    font-size: .84rem;
    line-height: 1.35;
    word-break: break-all;
    color: var(--link, #2c6f62);
}
.link-description-line {
    margin-top: 6px;
    font-size: .88rem;
    line-height: 1.45;
    color: var(--text, #26332f);
    word-break: break-word;
}
.link-note-line {
    margin-top: 6px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(0,0,0,.04);
    font-size: .82rem;
    line-height: 1.45;
    color: var(--muted, #667085);
    word-break: break-word;
}
textarea {
    width: 100%;
    min-height: 96px;
    resize: vertical;
}
@media (max-width: 760px) {
    .links-admin-table--rich .cell-link-rich {
        min-width: 0;
        max-width: none;
    }
}
