@charset "UTF-8";

/* ============================================================
   Adminto Design Tokens
   ============================================================ */
:root {
  --primary:        #727cf5;
  --primary-dark:   #6169d0;
  --secondary:      #6c757d;
  --success:        #0acf97;
  --info:           #39afd9;
  --warning:        #ffbc00;
  --danger:         #fa5c7c;
  --light:          #eef2f7;
  --dark:           #313a46;

  --body-bg:        #edf0f7;
  --sidebar-bg:     #f8f9fc;
  --sidebar-width:  260px;
  --navbar-height:  54px;

  --card-bg:        #ffffff;
  --card-shadow:    0 0 35px 0 rgba(154, 161, 171, .15);
  --card-radius:    4px;

  --border-color:   #eef2f7;
  --border-input:   #dee2e6;

  --text-body:      #6c757d;
  --text-heading:   #343a40;
  --text-muted:     #98a6ad;

  --nav-item-color: #6c757d;
  --nav-item-hover: #727cf5;
  --nav-active-bg:  rgba(114, 124, 245, .08);
  --nav-active-bar: var(--primary);
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

* {
  font-size: 100%;
  list-style-type: none;
  padding: 0;
  margin: 0;
  vertical-align: bottom;
}

html, body {
  height: 100%;
}

body {
  background-color: var(--body-bg);
  color: var(--text-body);
  font-family: "Nunito", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  color: var(--primary-dark);
  text-decoration: none;
}
a:focus {
  outline: none;
}

img {
  border-style: none;
  max-width: 100%;
}

small {
  color: var(--text-muted);
  font-size: .82em;
  line-height: 1.5;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th, td {
  border: 1px solid var(--border-color);
  font-size: .82rem;
  padding: .4em .6em;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f9fafb;
}

/* ============================================================
   Form Elements
   ============================================================ */
input, select, textarea {
  font-family: inherit;
  font-size: .9rem;
  line-height: 1.5;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="search"],
input[type="number"],
input[type="date"],
select,
textarea {
  background: var(--card-bg);
  border: 1px solid var(--border-input);
  border-radius: var(--card-radius);
  color: var(--text-heading);
  min-height: 36px;
  padding: 0 .5rem;
  width: 180px;
}

textarea {
  min-height: 100px;
  overflow: hidden;
  padding: .45rem .5rem;
  resize: none;
  width: 100%;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(114, 124, 245, .15);
  outline: none;
}

input::placeholder {
  color: #adb5bd;
  opacity: 1;
}

.input_field_large,
select.input_field_large {
  width: 240px;
}

/* チェックボックス・ラジオ カスタム */
input[type="checkbox"] {
  display: none;
}

.checkbox {
  align-items: center;
  display: inline-flex;
  padding: .25rem;
  cursor: pointer;
}

.checkbox__icon {
  align-items: center;
  border: 1px solid var(--border-input);
  border-radius: 3px;
  display: inline-flex;
  font-size: 18px;
  height: 18px;
  justify-content: center;
  margin: 0 5px 0 0;
  user-select: none;
  width: 18px;
}

.checkbox__icon_mark {
  color: var(--primary);
  opacity: 0;
}

input[type="checkbox"]:checked ~ .checkbox__icon {
  border-color: var(--primary);
}

input[type="checkbox"]:checked ~ .checkbox__icon .checkbox__icon_mark {
  opacity: 1;
}

input[type="radio"] {
  display: none;
}

.radio {
  align-items: center;
  display: inline-flex;
  cursor: pointer;
}

.radio__icon {
  align-items: center;
  border: 1px solid var(--border-input);
  border-radius: 50%;
  display: inline-flex;
  height: 18px;
  justify-content: center;
  margin: 0 5px 0 0;
  user-select: none;
  width: 18px;
}

.radio__icon_mark {
  background-color: var(--primary);
  border-radius: 50%;
  display: inline-block;
  height: 10px;
  opacity: 0;
  width: 10px;
}

input[type="radio"]:checked ~ .radio__icon {
  border-color: var(--primary);
}

input[type="radio"]:checked ~ .radio__icon .radio__icon_mark {
  opacity: 1;
}

input[type="file"] {
  height: 100%;
  left: 0;
  opacity: 0;
  position: absolute;
  top: 0;
  width: 100%;
}

/* select2 */
.select2-container--default {
  min-width: 180px;
}

.select_date + .select2-container--default {
  min-width: 70px;
}

.select2-container .select2-selection--single {
  height: 36px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 34px;
}

.select2-container--default .select2-selection--single {
  background: var(--card-bg);
  border: 1px solid var(--border-input);
  border-radius: var(--card-radius);
}

.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(114, 124, 245, .15);
}

/* ============================================================
   Buttons
   ============================================================ */
.button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--border-input);
  border-radius: var(--card-radius);
  color: var(--text-heading);
  cursor: pointer;
  display: inline-flex;
  font-size: .85rem;
  font-weight: 700;
  justify-content: center;
  line-height: 1.4;
  min-height: 36px;
  padding: 6px 16px;
  text-align: center;
  transition: background .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease;
  white-space: nowrap;
}

.button:hover {
  box-shadow: none;
  outline: none;
}

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

.button.is_secondary {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #fff;
}
.button.is_secondary:hover {
  background: #5a6268;
  border-color: #545b62;
}

.button.is_info {
  background: var(--info);
  border-color: var(--info);
  color: #fff;
}
.button.is_info:hover {
  background: #2d9dc5;
  border-color: #2d9dc5;
}

.button.is_warning {
  background: var(--warning);
  border-color: var(--warning);
  color: #fff;
}
.button.is_warning:hover {
  background: #e5a800;
  border-color: #e5a800;
}

.button.is_dark {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}
.button.is_dark:hover {
  background: #272e37;
  border-color: #272e37;
}

.button.is_alert {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.button.is_alert:hover {
  background: #e84368;
  border-color: #e84368;
}

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

.button:disabled {
  background: #e9ecef !important;
  border-color: #dee2e6 !important;
  box-shadow: none !important;
  color: #adb5bd !important;
  cursor: not-allowed;
}

/* ============================================================
   Layout: Topbar (.header)
   ============================================================ */
.header {
  align-items: center;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
  display: flex;
  height: 54px;
  justify-content: space-between;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 100;
}

.header__brand {
  align-items: center;
  display: flex;
  padding: 0 0 0 24px;
}

.header__logo {
  color: var(--dark);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: .01em;
}

.header__logo:hover {
  color: var(--primary);
}

.header__right {
  align-items: center;
  display: flex;
  gap: 4px;
  padding-right: 20px;
}

.header__user_btn {
  align-items: center;
  border-radius: var(--card-radius);
  color: var(--text-heading);
  display: inline-flex;
  gap: 6px;
  padding: 6px 12px;
  transition: background .12s;
}

.header__user_btn:hover {
  background: var(--light);
  color: var(--text-heading);
}

.header__user_icon {
  color: var(--primary);
  font-size: 22px;
}

.header__user_name {
  color: var(--text-heading);
  font-size: .85rem;
  font-weight: 700;
}

.header__logout_btn {
  align-items: center;
  border-radius: var(--card-radius);
  color: var(--text-muted);
  display: inline-flex;
  padding: 6px 10px;
  transition: background .12s, color .12s;
}

.header__logout_btn:hover {
  background: var(--light);
  color: var(--danger);
}

.header__logout_icon {
  font-size: 20px;
}

/* ============================================================
   Layout: Sidebar (.menu)
   ============================================================ */
.menu {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  bottom: 0;
  left: 0;
  min-width: var(--sidebar-width);
  overflow-x: hidden;
  overflow-y: auto;
  position: fixed;
  top: var(--navbar-height);
  width: var(--sidebar-width);
  z-index: 90;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.menu::-webkit-scrollbar {
  display: none;
}

.menu__list {
  padding: 10px 0 60px;
}

.menu__item {
  display: block;
  line-height: 1;
  margin: 0;
}

.menu__t1,
.menu__t1_link {
  align-items: center;
  color: var(--nav-item-color);
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  position: relative;
  transition: background .12s, color .12s;
  width: 100%;
}

.menu__t1:hover,
.menu__t1_link:hover {
  background: var(--nav-active-bg);
  color: var(--nav-item-hover);
}

.menu__item.selected > .menu__t1,
.menu__item.selected > .menu__t1_link {
  background: var(--primary);
  color: #fff;
}

/* subメニューがある親項目のキャレット */
.menu__item:not(.menu__item--single) > .menu__t1::after {
  color: var(--nav-item-color);
  content: '\F0142';
  font-family: "Material Design Icons";
  font-size: 18px;
  line-height: 1;
  margin-left: auto;
  transition: transform .2s;
}

.menu__item.selected > .menu__t1::after {
  color: #fff;
  transform: rotate(90deg);
}

.menu__icon {
  color: inherit;
  display: inline-block;
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
  width: 20px;
}

.menu__t1_txt {
  color: inherit;
  display: inline-block;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.3;
}

/* サブメニュー */
.menu__sub_list {
  background: rgba(0, 0, 0, .03);
  display: none;
  opacity: 0;
  transition: opacity .2s;
}

.menu__item.selected .menu__sub_list {
  display: block;
  opacity: 1;
}

.menu__sub_item {
  display: block;
}

.menu__t2 {
  align-items: center;
  color: #8391a2;
  display: flex;
  font-size: .8rem;
  font-weight: 700;
  gap: 8px;
  padding: 9px 20px 9px 32px;
  text-decoration: none;
  transition: background .12s, color .12s;
}

.menu__t2 .mdi {
  font-size: 15px;
}

.menu__t2:hover,
.menu__sub_item.selected .menu__t2 {
  background: rgba(114, 124, 245, .08);
  color: var(--primary);
}

/* ============================================================
   Layout: Content Area
   ============================================================ */
.has_side_menu .page-main {
  margin-left: var(--sidebar-width);
}

.has_side_menu .footer {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
}

.admin_page .page-main {
  background: var(--body-bg);
  min-height: calc(100vh - var(--navbar-height));
  padding: calc(var(--navbar-height) + 24px) 24px 40px;
}

.admin_page .page-contents {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  margin: 0 auto;
  overflow-x: auto;
  padding: 0 24px 28px;
}

/* ============================================================
   Layout: Page Title Box (.topicpath)
   ============================================================ */
.topicpath {
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  padding: 14px 0 12px;
  margin-bottom: 0;
}

.admin_page .topicpath {
  padding: 18px 0 14px;
}

.topicpath__h1 {
  color: var(--text-heading);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.4;
  margin: 0;
}

.page-heading {
  color: var(--text-heading);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.5;
  margin: 0;
}

/* パンくず */
.topicpath__breadcrumb {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.topicpath__bc_item {
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 600;
}

.topicpath__bc_item + .topicpath__bc_item::before {
  color: #ced4da;
  content: '/';
  margin: 0 6px;
}

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

.topicpath__bc_item a:hover {
  color: var(--primary);
}

.topicpath__bc_item:last-child {
  color: var(--primary);
}

/* topicpath直後の要素の上余白 */
.admin_page .page-contents .topicpath + * {
  margin-top: 20px;
}

.admin_page .page-contents > *:not(.topicpath) + *:not(.topicpath) {
  margin-top: 16px;
}

/* ============================================================
   Layout: Footer
   ============================================================ */
.footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: .78rem;
  padding: .6rem 1rem;
  text-align: center;
}

.admin_page .footer {
  margin-top: 24px;
}

/* ============================================================
   Tables
   ============================================================ */

/* 一覧テーブル */
.page-contents .listtable {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-collapse: separate;
  border-radius: var(--card-radius);
  border-spacing: 0;
  margin: 0;
  min-width: 720px;
  overflow: hidden;
}

.page-contents .listtable th,
.page-contents .listtable td {
  border: 0;
  border-bottom: 1px solid var(--border-color);
  font-size: .82rem;
  padding: 12px 16px;
  vertical-align: middle;
}

.page-contents .listtable thead th {
  background: #f9fafb;
  border-bottom: 2px solid var(--border-color);
  color: var(--text-heading);
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

.page-contents .listtable tbody td {
  color: var(--text-heading);
}

.page-contents .listtable tbody tr:nth-child(even) {
  background: #fbfcff;
}

.page-contents .listtable tbody tr:hover {
  background: #f3f5ff;
}

.page-contents .listtable tbody tr:last-child td {
  border-bottom: 0;
}

/* 編集フォームテーブル */
.page-contents .rowtable {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-collapse: collapse;
  border-radius: var(--card-radius);
  margin: 0;
  overflow: hidden;
}

.page-contents .rowtable th,
.page-contents .rowtable td {
  border: 0;
  border-bottom: 1px solid var(--border-color);
  padding: 13px 16px;
}

.page-contents .rowtable tr:last-child th,
.page-contents .rowtable tr:last-child td {
  border-bottom: 0;
}

.page-contents .rowtable th {
  background: #f9fafb;
  color: var(--text-heading);
  font-size: .84rem;
  font-weight: 700;
  width: 190px;
}

.page-contents .rowtable td {
  background: var(--card-bg);
}

/* フォームコントロール（page-contents内） */
.page-contents input[type="text"],
.page-contents input[type="email"],
.page-contents input[type="password"],
.page-contents input[type="tel"],
.page-contents input[type="search"],
.page-contents input[type="number"],
.page-contents input[type="date"],
.page-contents select,
.page-contents textarea {
  background: #fff;
  border: 1px solid var(--border-input);
  border-radius: var(--card-radius);
  color: var(--text-heading);
  font-size: .9rem;
  min-height: 36px;
}

.page-contents textarea {
  min-height: 120px;
  padding-top: .45rem;
  padding-bottom: .45rem;
}

.page-contents input[type="text"]:focus,
.page-contents input[type="email"]:focus,
.page-contents input[type="password"]:focus,
.page-contents input[type="tel"]:focus,
.page-contents input[type="search"]:focus,
.page-contents input[type="number"]:focus,
.page-contents input[type="date"]:focus,
.page-contents select:focus,
.page-contents textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(114, 124, 245, .15);
  outline: none;
}

/* テーブルアクションセル */
.table_actions_heading,
.table_actions_cell {
  white-space: nowrap;
  width: 1%;
}

.table_actions {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.table_actions form {
  margin: 0;
}

.table_actions .button {
  font-size: .8rem;
  min-height: 30px;
  padding: 4px 12px;
}

/* 選択行ハイライト */
.listtable tbody tr.is_selected td {
  background: #fff8e1;
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
  margin: 16px 0;
  overflow: visible;
}

.pagination__body {
  align-items: center;
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.pagination__item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  color: var(--text-heading);
  transition: background .12s, border-color .12s, color .12s;
}

.pagination__link {
  align-items: center;
  color: var(--text-heading);
  display: flex;
  font-size: .8rem;
  font-weight: 600;
  height: 32px;
  justify-content: center;
  min-width: 32px;
  padding: 0 4px;
  width: auto;
}

.pagination__item:not(.is_disabled):hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.pagination__item:not(.is_disabled):hover .pagination__link {
  color: #fff;
}

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

.pagination__item.is_current_page .pagination__link {
  color: #fff;
}

.pagination__item.is_disabled {
  background: var(--light);
  border-color: var(--border-color);
}

.pagination__item.is_disabled .pagination__link {
  color: #adb5bd;
  pointer-events: none;
}

.pagination__ellipsis {
  align-items: center;
  color: var(--text-muted);
  display: flex;
  font-size: .8rem;
  height: 32px;
  justify-content: center;
  min-width: 28px;
}

.pagination__current {
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  color: var(--text-heading);
  display: flex;
  font-size: .8rem;
  font-weight: 700;
  height: 32px;
  justify-content: center;
  min-width: 32px;
  padding: 0 6px;
}

.pagination__sep {
  align-items: center;
  color: var(--text-muted);
  display: flex;
  font-size: .8rem;
  height: 32px;
  padding: 0 2px;
}

/* ============================================================
   Badges
   ============================================================ */
.badge {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: .75rem;
  font-weight: 700;
  justify-content: center;
  line-height: 1.4;
  padding: .18rem .65rem;
  white-space: nowrap;
}

.badge--green {
  background: #d4f8ee;
  border-color: #a3f0d5;
  color: #027a48;
}

.badge--gray {
  background: var(--light);
  border-color: #dee2e6;
  color: var(--secondary);
}

.badge--blue {
  background: #e0e7ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.badge--amber,
.badge--yellow {
  background: #fef9c3;
  border-color: #fde68a;
  color: #92400e;
}

.badge--red {
  background: #ffe4e6;
  border-color: #fecdd3;
  color: #9f1239;
}

/* ============================================================
   Notices / Alerts
   ============================================================ */
.notice,
.alert {
  border-radius: var(--card-radius);
  font-weight: 600;
  line-height: 1.6;
  padding: 12px 16px;
}

.notice {
  background: #e0e7ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
}

.alert {
  background: #ffe4e6;
  border: 1px solid #fecdd3;
  color: #9f1239;
}

.admin_page .page-contents .notice {
  background: #e0e7ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.admin_page .page-contents .alert {
  background: #ffe4e6;
  border-color: #fecdd3;
  color: #9f1239;
}

/* ============================================================
   Search Form
   ============================================================ */
.search_form {
  align-items: end;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  display: grid;
  gap: 14px 18px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 16px;
}

.search_form .search_table {
  background: transparent;
  border: 0;
  display: block;
  grid-column: 1 / 2;
  margin: 0;
  overflow: visible;
  width: 100%;
}

.search_form .search_table tbody {
  align-items: end;
  display: grid;
  gap: 10px 18px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.search_form .search_table tr,
.search_form .search_table th,
.search_form .search_table td {
  background: transparent !important;
  border: 0 !important;
  display: block;
  padding: 0 !important;
  width: auto;
}

.search_form .search_table tr:first-child {
  grid-column: span 2;
  min-width: 0;
}

.search_form .search_table th {
  color: var(--text-heading);
  font-size: .78rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.search_form .search_table input,
.search_form .search_table select {
  box-sizing: border-box;
  width: 100%;
}

.search_form .search_table .date_range {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}

.search_form .search_table .date_picker {
  flex: 1 1 150px;
  min-width: 130px;
  width: auto;
}

.search_form .search_table .date-range-links--inline {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-start;
  margin: 0;
}

.search_form .search_table .search_table__range_heading {
  align-items: center;
  display: flex;
  gap: 12px;
  margin: 0 0 8px;
}

.search_form .btn_toolbar {
  align-self: end;
  grid-column: 2 / 3;
  justify-self: end;
  margin: 0;
}

.date_range__sep {
  color: var(--text-muted);
  line-height: 36px;
}

.flatpickr-calendar {
  z-index: 9999;
}

/* ============================================================
   Dashboard
   ============================================================ */
.date-range-links {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  justify-content: flex-end;
  margin: 0 0 1.2rem;
}

.page-contents .date-range-links__item {
  background: var(--card-bg);
  border: 1px solid var(--border-input);
  border-radius: 999px;
  color: var(--text-body);
  display: inline-flex;
  font-size: .8rem;
  font-weight: 700;
  min-height: 30px;
  padding: 4px 14px;
  transition: background .12s, border-color .12s, color .12s;
}

.page-contents .date-range-links__item:hover {
  background: var(--light);
  border-color: var(--primary);
  color: var(--primary);
}

.page-contents .date-range-links__item--active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.report-lag-note {
  color: var(--text-muted);
  font-size: .75rem;
  margin: 0 0 .8rem;
}

.date-range-period {
  color: var(--text-muted);
  font-size: .8rem;
  margin: -.8rem 0 1.2rem;
  text-align: right;
}

.dash-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0 0 1.6rem;
}

.dash-kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  border-top: 3px solid var(--primary);
  box-shadow: var(--card-shadow);
  color: var(--text-body);
  flex: 1;
  min-width: 180px;
  padding: 1rem 1.2rem;
}

.dash-kpi-card:nth-child(2) { border-top-color: var(--success); }
.dash-kpi-card:nth-child(3) { border-top-color: var(--info); }
.dash-kpi-card:nth-child(4) { border-top-color: var(--warning); }
.dash-kpi-card:nth-child(5) { border-top-color: var(--danger); }

.dash-kpi-label {
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 700;
  margin: 0 0 .3rem;
  text-align: center;
}

.dash-kpi-value {
  color: var(--text-heading);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 .2rem;
  text-align: center;
}

.dash-kpi-sub-label {
  color: var(--text-muted);
  font-size: .76rem;
  font-weight: 600;
  margin: .5rem 0 .1rem;
  text-align: center;
}

.dash-kpi-diff {
  font-size: .76rem;
  margin: 0 0 .15rem;
  text-align: center;
}

.dash-diff--plus  { color: var(--success); }
.dash-diff--minus { color: var(--danger); }

.dash-columns {
  align-items: flex-start;
  display: flex;
  gap: 1.5rem;
}

.dash-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  padding: 1.2rem;
}

.dash-section__header {
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  margin: 0 0 .8rem;
  padding-bottom: .7rem;
}

.dash-section__title {
  color: var(--text-heading);
  font-size: .96rem;
  font-weight: 800;
  margin: 0;
}

.dash-tab-row {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}

.page-contents .dash-tab-row__item {
  background: var(--card-bg);
  border: 1px solid var(--border-input);
  border-radius: 999px;
  color: var(--text-body);
  display: inline-flex;
  font-size: .8rem;
  font-weight: 700;
  min-height: 28px;
  padding: 4px 12px;
  transition: background .12s, border-color .12s, color .12s;
}

.page-contents .dash-tab-row__item:hover {
  background: var(--light);
  border-color: var(--primary);
  color: var(--primary);
}

.page-contents .dash-tab-row__item--active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ============================================================
   Tabs
   ============================================================ */
.tabs {
  align-items: stretch;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  font-size: 1rem;
  gap: 4px;
  justify-content: flex-start;
  overflow-x: auto;
  white-space: nowrap;
}

.tabs__ul {
  align-items: center;
  display: flex;
  gap: 4px;
  justify-content: flex-start;
}

.tabs__li {
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .88rem;
  font-weight: 700;
  padding: 8px 16px;
  transition: color .12s, border-color .12s;
}

.tabs__li:hover {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

.tabs__li.is_active {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

.tabs_contents__li:not(.is_active) {
  display: none;
}

/* ============================================================
   Panel / Hero (card style)
   ============================================================ */
.panel,
.hero {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

.panel__header,
.hero__header {
  border-bottom: 1px solid var(--border-color);
  color: var(--text-heading);
  font-size: .95rem;
  font-weight: 700;
  padding: .8rem 1rem;
}

.panel__body,
.hero__body {
  padding: .8rem 1rem;
}

/* ============================================================
   Drawer
   ============================================================ */
body.has_drawer .page-main {
  margin-right: 520px;
}

.alert_drawer {
  background: var(--card-bg);
  border-left: 1px solid var(--border-color);
  box-shadow: -4px 0 16px rgba(0, 0, 0, .07);
  height: 100vh;
  overflow-y: auto;
  position: fixed;
  right: 0;
  top: 0;
  width: 520px;
  z-index: 200;
}

.alert_drawer__inner {
  padding: 20px 24px 32px;
}

.alert_drawer__head {
  align-items: flex-start;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  margin-bottom: 4px;
  padding-bottom: 16px;
}

.alert_drawer__head_main {
  flex: 1;
  min-width: 0;
}

.alert_drawer__head_row {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.alert_drawer__title {
  font-size: 1rem;
  font-weight: bold;
  line-height: 1.4;
  margin: 0;
  overflow-wrap: break-word;
}

.alert_drawer__subtitle {
  color: var(--text-muted);
  font-size: .82rem;
  line-height: 1.5;
  margin: 0;
}

.alert_drawer__close {
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: 1.3rem;
  line-height: 1;
  margin-top: 1px;
  padding: 2px 4px;
}

.alert_drawer__close:hover {
  color: var(--text-heading);
}

.alert_drawer__body {
  padding-top: 14px;
}

.alert_drawer__account {
  color: var(--text-muted);
  font-size: .8rem;
  margin: 0 0 16px;
}

.alert_drawer__section {
  margin-bottom: 20px;
}

.alert_drawer__section h3 {
  color: var(--text-muted);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .04em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.alert_drawer__section > p {
  color: var(--text-heading);
  font-size: .875rem;
  line-height: 1.75;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.alert_drawer__chart {
  max-height: 200px;
}

.alert_drawer__kpi_grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, 1fr);
}

.alert_drawer__kpi {
  background: var(--light);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 10px 12px;
}

.alert_drawer__kpi_label {
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 600;
  margin: 0 0 4px;
}

.alert_drawer__kpi_value {
  color: var(--text-heading);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  margin: 0;
}

.alert_drawer__kpi_value--action {
  color: var(--warning);
  font-size: .85rem;
}

.alert_drawer__meta {
  color: var(--text-muted);
  font-size: .75rem;
  margin: 0 0 16px;
}

.alert_drawer__actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* ============================================================
   Loading Overlay
   ============================================================ */
.loading_overlay {
  align-items: center;
  background: transparent;
  display: none;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 9999;
}

body.is_loading .loading_overlay {
  display: flex;
}

.loading_overlay__spinner {
  animation: loading_spin .75s ease-in-out infinite;
  border: 4px solid rgba(114, 124, 245, .15);
  border-radius: 50%;
  border-top-color: var(--primary);
  height: 52px;
  width: 52px;
}

@keyframes loading_spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   Adhoc Analytics Components
   ============================================================ */
.layout-block {
  margin-bottom: 1.4rem;
}

.layout-block__title {
  border-bottom: 2px solid var(--border-color);
  color: var(--text-heading);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 .6rem;
  padding-bottom: .4rem;
}

.layout-block__note {
  color: var(--text-muted);
  font-size: .82rem;
  margin: .4rem 0 0;
}

.layout-block__summary {
  color: var(--text-body);
  font-size: .9rem;
  line-height: 1.6;
  margin: 0 0 .8rem;
}

.layout-block__subject {
  color: var(--text-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 .5rem;
}

.layout-block__primary-value {
  color: var(--text-heading);
  font-size: 1.6rem;
  font-weight: 700;
}

.layout-block__primary-label {
  color: var(--text-muted);
  font-size: .8rem;
  margin-bottom: .3rem;
}

.layout-block__delta--up   { color: var(--success); font-weight: 600; }
.layout-block__delta--down { color: var(--danger);  font-weight: 600; }
.layout-block__delta--flat { color: var(--text-muted); }

.layout-block__watchpoints {
  color: var(--text-body);
  font-size: .85rem;
  line-height: 1.7;
  margin: .6rem 0 0;
  padding-left: 1.2rem;
}

.layout-block-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  box-shadow: 0 2px 8px rgba(154, 161, 171, .1);
  margin-bottom: 1rem;
  padding: .9rem 1rem;
}

.layout-block-card__title {
  color: var(--text-heading);
  font-size: .95rem;
  font-weight: 700;
  margin: 0 0 .4rem;
}

.layout-block-card__summary {
  color: var(--text-body);
  font-size: .88rem;
  line-height: 1.6;
  margin: 0 0 .6rem;
}

.layout-detail-section {
  background: #f9fafb;
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  margin-bottom: 1.6rem;
  padding: 1rem 1.2rem;
}

.layout-detail-section__heading {
  border-bottom: 1px solid var(--border-color);
  color: var(--text-heading);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 1rem;
  padding-bottom: .5rem;
}

.layout-block-cards--grid3 {
  display: grid;
  gap: .8rem;
  grid-template-columns: repeat(3, 1fr);
}

.layout-block-card--high   { border-left: 4px solid var(--danger); }
.layout-block-card--medium { border-left: 4px solid var(--warning); }
.layout-block-card--low    { border-left: 4px solid var(--secondary); }

.layout-rank-circle {
  align-items: center;
  background: var(--text-heading);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex-shrink: 0;
  font-size: .72rem;
  font-weight: 700;
  height: 1.4rem;
  justify-content: center;
  margin-right: .4rem;
  vertical-align: middle;
  width: 1.4rem;
}

.layout-rank-circle--1 { background: #f59e0b; }
.layout-rank-circle--2 { background: #9ca3af; }
.layout-rank-circle--3 { background: #92400e; }

.layout-chip {
  background: var(--light);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-body);
  display: inline-block;
  font-size: .78rem;
  margin: .3rem .3rem 0 0;
  padding: .2rem .6rem;
}

.layout-chip--label {
  color: var(--text-muted);
  font-size: .72rem;
  margin-right: .2rem;
}

.layout-bar-chart__item {
  align-items: center;
  display: flex;
  font-size: .85rem;
  margin-bottom: .5rem;
}

.layout-bar-chart__label {
  color: var(--text-body);
  min-width: 13rem;
  overflow: hidden;
  padding-right: .8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 13rem;
}

.layout-bar-chart__bar-wrap {
  background: #e5e7eb;
  border-radius: .2rem;
  flex: 1;
  height: 1.1rem;
}

.layout-bar-chart__bar {
  background: var(--primary);
  border-radius: .2rem;
  height: 100%;
  min-width: 2px;
}

.layout-bar-chart__bar--positive { background: var(--success); }
.layout-bar-chart__bar--negative { background: var(--danger); }

.layout-bar-chart__value {
  color: var(--text-body);
  font-size: .82rem;
  min-width: 5rem;
  padding-left: .6rem;
  text-align: right;
}

.layout-bar-chart__legend {
  color: var(--text-muted);
  display: flex;
  font-size: .8em;
  gap: 1rem;
  margin-bottom: .5rem;
}

.layout-bar-chart__legend-item {
  align-items: center;
  display: flex;
  gap: .3rem;
}

.layout-bar-chart__legend-dot {
  border-radius: 2px;
  display: inline-block;
  height: .75rem;
  width: .75rem;
}

.layout-bar-chart__legend-dot--primary   { background: var(--primary); }
.layout-bar-chart__legend-dot--secondary { background: #cbd5e1; }
.layout-bar-chart__bar-wrap--secondary   { margin-top: .15rem; }
.layout-bar-chart__bar--secondary        { background: #cbd5e1; }

.layout-comparison-grid {
  display: grid;
  gap: .8rem;
  grid-template-columns: repeat(3, 1fr);
}

.layout-comparison-col {
  border: 1px solid var(--border-input);
  border-radius: var(--card-radius);
  padding: .7rem .8rem;
}

.layout-comparison-col--good    { background: #f0fdf4; border-color: #86efac; }
.layout-comparison-col--warning { background: #fefce8; border-color: #fde047; }
.layout-comparison-col--alert   { background: #fff1f2; border-color: #fda4af; }
.layout-comparison-col--neutral { background: #f9fafb; border-color: var(--border-input); }

.layout-comparison-col__label {
  color: var(--text-heading);
  font-size: .8rem;
  font-weight: 700;
  margin: 0 0 .4rem;
}

.layout-comparison-col__items {
  color: var(--text-heading);
  font-size: .85rem;
  line-height: 1.7;
  list-style: none;
  margin: 0;
  padding: 0;
}

.layout-comparison-item {
  border-top: 1px solid rgba(0, 0, 0, .07);
  padding: .4rem 0;
}

.layout-comparison-item:first-child { border-top: none; }

.layout-comparison-item__title {
  color: var(--text-heading);
  font-size: .88em;
  font-weight: bold;
  margin: 0 0 .1rem;
}

.layout-comparison-item__value {
  font-size: 1.05em;
  font-weight: bold;
  margin: 0 0 .1rem;
}

.layout-comparison-item__desc {
  color: var(--text-body);
  font-size: .78em;
  line-height: 1.4;
  margin: 0;
}

.layout-condition-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .4rem;
}

.layout-condition-item {
  background: var(--light);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  display: flex;
  flex: 1 1 9rem;
  flex-direction: column;
  gap: .15rem;
  min-width: 9rem;
  padding: .5rem .75rem;
}

.layout-condition-item__label {
  color: var(--text-muted);
  font-size: .72em;
  font-weight: bold;
  letter-spacing: .02em;
}

.layout-condition-item__value {
  color: var(--text-heading);
  font-size: .9em;
  font-weight: bold;
  line-height: 1.3;
}

.layout-movers-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
}

.layout-movers-col__title {
  border-bottom: 2px solid currentColor;
  font-size: .85em;
  font-weight: bold;
  margin: 0 0 .5rem;
  padding-bottom: .3rem;
}

.layout-movers-col__title--up   { color: var(--success); }
.layout-movers-col__title--down { color: var(--danger); }

.layout-movers-card {
  background: var(--light);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  margin-bottom: .5rem;
  padding: .65rem .8rem;
}

.layout-movers-card__header {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  margin-bottom: .2rem;
}

.layout-movers-card__name {
  color: var(--text-heading);
  flex: 1;
  font-size: .82em;
  font-weight: bold;
  line-height: 1.3;
  margin-right: .5rem;
}

.layout-movers-card__delta {
  font-size: .82em;
  font-weight: bold;
  white-space: nowrap;
}

.layout-movers-card__metric {
  color: var(--text-muted);
  font-size: .72em;
  margin: 0 0 .1rem;
}

.layout-movers-card__value {
  color: var(--text-heading);
  font-size: 1.1em;
  font-weight: bold;
  margin: 0 0 .2rem;
}

.layout-movers-card__reason {
  color: var(--text-muted);
  font-size: .78em;
  line-height: 1.4;
  margin: 0;
}

.layout-ranking-list {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.layout-ranking-row {
  align-items: center;
  background: var(--light);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  display: flex;
  gap: .6rem;
  padding: .55rem .75rem;
}

.layout-ranking-row__label {
  color: var(--text-heading);
  flex: 1;
  font-size: .88em;
  font-weight: bold;
}

.layout-ranking-row__meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: flex-end;
}

.layout-ranking-row__value {
  color: var(--text-heading);
  font-size: .95em;
  font-weight: bold;
}

.layout-action-card__header {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  margin-bottom: .3rem;
}

.layout-action-card__context {
  color: var(--text-muted);
  flex: 1;
  font-size: .75em;
  line-height: 1.4;
  margin-right: .5rem;
}

.layout-action-card__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .4rem;
}

.layout-metric-cards {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .5rem;
}

.layout-metric-card {
  background: var(--light);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  display: flex;
  flex: 1 1 8rem;
  flex-direction: column;
  gap: .1rem;
  min-width: 8rem;
  padding: .55rem .75rem;
}

.layout-metric-card__label {
  color: var(--text-muted);
  font-size: .72em;
  font-weight: bold;
}

.layout-metric-card__value {
  color: var(--text-heading);
  font-size: 1.05em;
  font-weight: bold;
}

.layout-metric-card__note {
  color: var(--text-muted);
  font-size: .72em;
}

.layout-metric-card__status {
  color: var(--text-muted);
  font-size: .75em;
}

/* Priority Count Card */
.priority-count-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  margin: .5rem 0;
}

.priority-count-card {
  border: 1px solid transparent;
  border-radius: var(--card-radius);
  padding: .9rem 1rem .8rem;
  text-align: center;
}

.priority-count-card__label {
  color: inherit;
  display: block;
  font-size: .78em;
  font-weight: bold;
  letter-spacing: .03em;
  margin-bottom: .3rem;
}

.priority-count-card__count {
  display: block;
  font-size: 2.2em;
  font-variant-numeric: tabular-nums;
  font-weight: bold;
  line-height: 1;
  margin-bottom: .25rem;
}

.priority-count-card__note {
  display: block;
  font-size: .76em;
  opacity: .8;
}

.priority-count-card--good    { background: #f0fdf4; border-color: #86efac; color: #166534; }
.priority-count-card--warning { background: #fefce8; border-color: #fde047; color: #92400e; }
.priority-count-card--alert   { background: #fff1f2; border-color: #fda4af; color: #9f1239; }
.priority-count-card--neutral { background: var(--light); border-color: var(--border-input); color: var(--text-body); }

/* ============================================================
   Creative Cards
   ============================================================ */
.creative-cards-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.creative-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  box-shadow: 0 2px 8px rgba(154, 161, 171, .1);
  overflow: hidden;
  width: 200px;
}

.creative-card__thumb {
  align-items: center;
  background: var(--light);
  display: flex;
  height: 150px;
  justify-content: center;
  overflow: hidden;
  width: 200px;
}

.creative-card__thumb img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.creative-card__thumb--empty::before {
  color: var(--text-muted);
  content: "NO IMAGE";
  font-size: .75rem;
}

.creative-card__body {
  padding: .6rem;
}

.creative-card__badge {
  background: #e0e7ff;
  border-radius: .25rem;
  color: #3730a3;
  display: inline-block;
  font-size: .72rem;
  padding: .1rem .4rem;
}

.creative-card__name {
  font-size: .82rem;
  margin: .3rem 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creative-card__kpi {
  display: grid;
  font-size: .78rem;
  gap: .1rem .5rem;
  grid-template-columns: 1fr 1fr;
  margin: .4rem 0 0;
}

.creative-card__kpi dt {
  color: var(--text-muted);
  margin: 0;
}

.creative-card__kpi dd {
  color: var(--text-heading);
  margin: 0;
  text-align: right;
}

/* ============================================================
   Login Page
   ============================================================ */
.login_page {
  background: var(--body-bg);
  min-height: 100vh;
}

.login_page .header {
  display: none;
}

.login_page .page-main {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
}

.login_page .page-contents {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  width: min(420px, 100%);
}

.login_page .topicpath {
  border-bottom: 1px solid var(--border-color);
  display: block;
  padding: 24px 28px 18px;
}

.login_page .topicpath__h1 {
  color: var(--text-heading);
  font-size: 1.2rem;
}

.login_page .topicpath__breadcrumb {
  display: none;
}

.login_page .notice,
.login_page .alert {
  margin: 20px 28px 0;
}

.login_page form {
  padding: 22px 28px 28px;
}

.login_page .page-contents .rowtable {
  background: transparent;
  border: 0;
  border-collapse: separate;
  border-radius: 0;
  border-spacing: 0 14px;
  display: block;
  overflow: visible;
}

.login_page .page-contents .rowtable tbody,
.login_page .page-contents .rowtable tr,
.login_page .page-contents .rowtable th,
.login_page .page-contents .rowtable td {
  background: transparent;
  border: 0;
  display: block;
  padding: 0;
  width: 100%;
}

.login_page .page-contents .rowtable th {
  color: var(--text-heading);
  font-size: .84rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.login_page .page-contents .rowtable input[type="text"],
.login_page .page-contents .rowtable input[type="password"] {
  border-radius: var(--card-radius);
  height: 42px;
  min-height: 42px;
  width: 100%;
}

.login_page .centering {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

.login_button {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
  min-height: 40px;
  min-width: 160px;
}

.login_button:hover {
  background: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
}

.login_page .footer {
  display: none;
}

.login_brand {
  margin-bottom: 20px;
  text-align: center;
}

.login_brand__name {
  color: var(--primary);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: .02em;
}

/* ============================================================
   Utility Classes
   ============================================================ */
.hide {
  display: none !important;
}

.mt10 { margin-top: 10px; }
.mt20 { margin-top: 20px; }
.mt30 { margin-top: 30px; }
.mb10 { margin-bottom: 10px; }
.mb20 { margin-bottom: 20px; }
.mb30 { margin-bottom: 30px; }
.ml10 { margin-left: 10px; }
.ml20 { margin-left: 20px; }
.ml30 { margin-left: 30px; }
.mr10 { margin-right: 10px; }
.mr20 { margin-right: 20px; }
.mr30 { margin-right: 30px; }

.w-fit  { width: fit-content; }
.h-fit  { field-sizing: content; }

.centering  { text-align: center; }
.righting   { text-align: right; }
.ta_right   { text-align: right; }

.horizontal {
  align-items: center;
  display: flex;
}

.flex         { display: flex; }
.inline_flex  { display: inline-flex; }
.flex-wrap    { flex-wrap: wrap; }
.flex-wrap-reverse { flex-wrap: wrap-reverse; }

.align_items_start   { align-items: flex-start; }
.align_items_center  { align-items: center; }
.align_items_end     { align-items: flex-end; }

.justify_content_start        { justify-content: flex-start; }
.justify_content_center       { justify-content: center; }
.justify_content_end          { justify-content: flex-end; }
.justify_content_space_evenly { justify-content: space-evenly; }

.gap5  { gap: 5px; }
.gap10 { gap: 10px; }
.gap20 { gap: 20px; }

.overflow_hidden { overflow: hidden; }
.scroll_x        { overflow-x: scroll; }

.em {
  color: var(--danger);
  font-weight: bold;
  text-decoration: none;
}

.em--small {
  font-size: .8rem;
  font-weight: normal;
}

.required {
  color: var(--danger);
  font-weight: 700;
}

.placeholder_txt {
  font-size: .8rem;
  font-weight: normal;
}

/* ボタンツールバー */
.btn_toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn_toolbar a {
  display: inline-flex;
}

.btn_toolbar form {
  margin: 0;
}

/* グリッドシステム（12分割） */
.g-col-1  { display: inline-block; width: calc(100% / 12 * 1);  }
.g-col-2  { display: inline-block; width: calc(100% / 12 * 2);  }
.g-col-3  { display: inline-block; width: calc(100% / 12 * 3);  }
.g-col-4  { display: inline-block; width: calc(100% / 12 * 4);  }
.g-col-5  { display: inline-block; width: calc(100% / 12 * 5);  }
.g-col-6  { display: inline-block; width: calc(100% / 12 * 6);  }
.g-col-7  { display: inline-block; width: calc(100% / 12 * 7);  }
.g-col-8  { display: inline-block; width: calc(100% / 12 * 8);  }
.g-col-9  { display: inline-block; width: calc(100% / 12 * 9);  }
.g-col-10 { display: inline-block; width: calc(100% / 12 * 10); }
.g-col-11 { display: inline-block; width: calc(100% / 12 * 11); }
.g-col-12 { display: inline-block; width: 100%; }

/* clearfix */
.cfix { display: block; }
.cfix::after {
  clear: both;
  content: ".";
  display: block;
  height: 0;
  visibility: hidden;
}

/* 新規登録行ハイライト */
.new_item_form {
  background-color: #fff7bf !important;
}

/* フォームグループ */
.input_group {
  border-bottom: 1px solid rgba(24, 28, 33, .06);
  padding: 0 0 .75rem 0;
}

.input_group:not(:last-child) {
  margin-bottom: .75rem;
}

.label {
  display: block;
  padding: 0 1rem;
}

.input {
  display: block;
  padding: 0 1rem;
}

.input_group.input_group--horizontal {
  display: grid;
  grid-template-columns: calc(100% / 12 * 2) 1fr;
}

.input_group.input_group--horizontal .label {
  align-items: center;
  display: inline-flex;
  justify-content: flex-end;
}

.input_group.input_group--horizontal .input {
  flex-basis: min-content;
  flex-grow: 1;
}

/* リスト */
.list--align_left {
  margin-inline: auto;
  max-inline-size: max-content;
}

.list_item:nth-child(n+2) {
  margin-top: 1rem;
}

/* div テーブル */
.d_table { display: table; width: 100%; }
.d_tr    { display: table-row; }

.d_table.stripe .d_tr:nth-child(even) {
  background-color: #fbfcff;
}

.d_th,
.d_td {
  border: 1px solid var(--border-color);
  display: table-cell;
  font-size: .8rem;
  padding: .4em .6em;
  text-align: left;
  vertical-align: middle;
}

.d_th {
  background: #f9fafb;
}

/* 表示切り替え */
.collapse:not(.show) {
  display: none !important;
}

/* テーブルストライプ */
table.stripe tr:nth-child(even),
.listtable tbody tr:nth-child(even) {
  background-color: #fbfcff;
}

/* カラーユーティリティ */
.is_color_primary { color: var(--primary); }
.is_color_info    { color: var(--info); }
.is_color_warning { color: var(--warning); }
.is_color_alert   { color: var(--danger); }

/* page-contents 内リンク色 */
.page-contents a {
  color: var(--primary);
}

.page-contents a:hover {
  color: var(--primary-dark);
}

/* ============================================================
   Responsive
   ============================================================ */
@media screen and (max-width: 1100px) {
  .dash-columns {
    flex-direction: column;
  }
  .dash-section {
    width: 100%;
  }
}

@media screen and (max-width: 960px) {
  .search_form {
    grid-template-columns: 1fr;
  }
  .search_form .search_table,
  .search_form .btn_toolbar {
    grid-column: auto;
  }
  .search_form .search_table tbody {
    grid-template-columns: 1fr;
  }
  .search_form .search_table .date-range-links--inline,
  .search_form .search_table .date_range {
    flex-wrap: wrap;
  }
}

@media screen and (max-width: 640px) {
  :root {
    --sidebar-width: 0px;
    --navbar-height: 60px;
  }

  .has_side_menu .menu {
    display: none;
  }

  .has_side_menu .page-main,
  .has_side_menu .footer {
    margin-left: 0;
    width: 100%;
  }

  .admin_page .page-main {
    padding: calc(var(--navbar-height) + 14px) 12px 30px;
  }

  .admin_page .page-contents {
    padding-left: 14px;
    padding-right: 14px;
  }

  .header__user_name {
    display: none;
  }

  .page-contents .rowtable th,
  .page-contents .rowtable td {
    display: block;
    width: 100%;
  }

  .page-contents .rowtable th {
    border-bottom: 0;
    padding-bottom: 4px;
  }

  .page-contents .rowtable td {
    padding-top: 4px;
  }

  .search_form .search_table tr:first-child {
    grid-column: auto;
  }
}
