﻿html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

.sidebar {
    min-width: 60px;
    max-width: 200px;
    transition: max-width 0.2s;
}
/* PC表示時はsidebar-closedクラスを無効にする */
@media (min-width: 768px) {
    .sidebar.sidebar-closed {
        transform: none !important;
        transition: none !important;
    }
}
.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255,255,255,0.05);
    color: #fff !important;
}

/* ドロップダウンメニューのスタイル */
.nav-item.dropdown .dropdown-menu {
    border: none;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-top: 0.25rem;
}

.nav-item.dropdown .dropdown-item {
    border-radius: 0.25rem;
    margin: 0.125rem;
    transition: background-color 0.15s ease-in-out;
}

.nav-item.dropdown .dropdown-item:hover {
    background: rgba(255,255,255,0.1);
}

/* アクティブメニューハイライト */
.sidebar-link.active,
.dropdown-item.active {
    background: rgba(255,255,255,0.15) !important;
    font-weight: 500;
}
@media (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 1050;
        max-width: 200px;
        width: 80vw;
        transform: translateX(-100%);
        /* 初期状態ではtransitionを無効にする */
        transition: none;
    }
    .sidebar:not(.sidebar-closed) {
        transform: translateX(0);
        box-shadow: 2px 0 8px rgba(0,0,0,0.15);
        /* 開いた状態になったらtransitionを有効にする */
        transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    }
    .sidebar.sidebar-closed {
        transform: translateX(-100%);
        /* 閉じた状態でもtransitionを有効にする */
        transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    }
    .min-width-license-table {
        min-width: 700px;
    }
    .min-width-order-table {
        min-width: 900px;
    }
    .min-width-user-table {
        min-width: 700px;
    }
}

/* 管理画面一覧カードのスマホ最適化 */
@media (max-width: 767.98px) {
  .admin-list-card .card-header,
  .admin-list-card .card-body {
    padding: 0.5rem 0.75rem;
  }
  .admin-list-card .card-body {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
  }
  .admin-list-card .card-body > [class^="col-"],
  .admin-list-card .card-body > [class*=" col-"] {
    flex: 0 0 auto !important;
    min-width: 140px;
    max-width: 220px;
    width: auto;
    box-sizing: border-box;
  }
  .admin-list-card .btn-group {
    min-width: 100px;
  }
  .admin-list-card .row.g-3.flex-nowrap.flex-md-wrap {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
  }
  .admin-list-card .row.g-3.flex-nowrap.flex-md-wrap > [class^="col-"],
  .admin-list-card .row.g-3.flex-nowrap.flex-md-wrap > [class*=" col-"] {
    flex: 0 0 auto !important;
    min-width: 140px;
    max-width: 220px;
    width: auto;
    box-sizing: border-box;
  }
  .admin-list-card .col-md-4,
  .admin-list-card .col-md-3,
  .admin-list-card .col-md-2 {
    grid-column: span 1;
    min-width: 0;
    max-width: 100%;
    flex: 1 1 0%;
  }
  .admin-list-card .col-md-4:last-child,
  .admin-list-card .col-md-3:last-child,
  .admin-list-card .col-md-2:last-child {
    grid-column: span 2;
  }
  .admin-list-card .d-flex.align-items-center {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .admin-list-card .badge,
  .admin-list-card small,
  .admin-list-card .text-muted {
    font-size: 0.95em;
  }

  /* カード内コンテンツの横スクロール対応 */
  .card-content-scroll {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
  }
  .card-content-scroll > [class^="col-"],
  .card-content-scroll > [class*=" col-"] {
    flex: 0 0 auto !important;
    min-width: 140px;
    max-width: 220px;
    width: auto;
    box-sizing: border-box;
  }
}

#requestBodyModal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}
#sidebarToggleFab {
    /* White with slight transparency */
    background-color: rgba(255, 255, 255, 0.85) !important;
}

#sidebarToggleFab:hover,
#sidebarToggleFab:focus {
    background-color: rgba(255, 255, 255, 0.95) !important;
    color: var(--bs-primary) !important;
}

#sidebarToggleFab:active {
    background-color: rgba(255, 255, 255, 0.9) !important;
    color: var(--bs-primary) !important;
}

/* Ensure the inner icon inherits the color */
#sidebarToggleFab i { color: inherit !important; }

/* Admin authenticated layout: only main scrolls */
.admin-auth .min-vh-100 {
  min-height: 100vh;
  height: 100vh; /* lock viewport height */
}
.admin-auth #content-wrapper {
  height: 100vh; /* fill viewport height within right column */
  overflow: hidden; /* hide overflow so only main scrolls */
}
.admin-auth #content-wrapper > main {
  overflow: auto; /* scroll main content only */
}
.admin-auth #sidebar {
  /* keep sidebar independently scrollable if its content exceeds viewport */
  overflow: auto;
}


/* Modal stacking fixes to ensure modals overlay correctly across stacking contexts */
.modal, .modal.show {
  position: fixed !important;
  z-index: 2050 !important;
}
.modal-backdrop, .modal-backdrop.show {
  z-index: 2000 !important;
}

/* site.css - global styles */
html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

.sidebar {
    min-width: 60px;
    max-width: 200px;
    transition: max-width 0.2s;
}
/* PC表示時はsidebar-closedクラスを無効にする */
@media (min-width: 768px) {
    .sidebar.sidebar-closed {
        transform: none !important;
        transition: none !important;
    }
}
.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255,255,255,0.05);
    color: #fff !important;
}

/* ドロップダウンメニューのスタイル */
.nav-item.dropdown .dropdown-menu {
    border: none;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-top: 0.25rem;
}

.nav-item.dropdown .dropdown-item {
    border-radius: 0.25rem;
    margin: 0.125rem;
    transition: background-color 0.15s ease-in-out;
}

.nav-item.dropdown .dropdown-item:hover {
    background: rgba(255,255,255,0.1);
}

/* アクティブメニューハイライト */
.sidebar-link.active,
.dropdown-item.active {
    background: rgba(255,255,255,0.15) !important;
    font-weight: 500;
}
@media (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 1050;
        max-width: 200px;
        width: 80vw;
        transform: translateX(-100%);
        /* 初期状態ではtransitionを無効にする */
        transition: none;
    }
    .sidebar:not(.sidebar-closed) {
        transform: translateX(0);
        box-shadow: 2px 0 8px rgba(0,0,0,0.15);
        /* 開いた状態になったらtransitionを有効にする */
        transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    }
    .sidebar.sidebar-closed {
        transform: translateX(-100%);
        /* 閉じた状態でもtransitionを有効にする */
        transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    }
    .min-width-license-table {
        min-width: 700px;
    }
    .min-width-order-table {
        min-width: 900px;
    }
    .min-width-user-table {
        min-width: 700px;
    }
}

/* 管理画面一覧カードのスマホ最適化 */
@media (max-width: 767.98px) {
  .admin-list-card .card-header,
  .admin-list-card .card-body {
    padding: 0.5rem 0.75rem;
  }
  .admin-list-card .card-body {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
  }
  .admin-list-card .card-body > [class^="col-"],
  .admin-list-card .card-body > [class*=" col-"] {
    flex: 0 0 auto !important;
    min-width: 140px;
    max-width: 220px;
    width: auto;
    box-sizing: border-box;
  }
  .admin-list-card .btn-group {
    min-width: 100px;
  }
  .admin-list-card .row.g-3.flex-nowrap.flex-md-wrap {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
  }
  .admin-list-card .row.g-3.flex-nowrap.flex-md-wrap > [class^="col-"],
  .admin-list-card .row.g-3.flex-nowrap.flex-md-wrap > [class*=" col-"] {
    flex: 0 0 auto !important;
    min-width: 140px;
    max-width: 220px;
    width: auto;
    box-sizing: border-box;
  }
  .admin-list-card .col-md-4,
  .admin-list-card .col-md-3,
  .admin-list-card .col-md-2 {
    grid-column: span 1;
    min-width: 0;
    max-width: 100%;
    flex: 1 1 0%;
  }
  .admin-list-card .col-md-4:last-child,
  .admin-list-card .col-md-3:last-child,
  .admin-list-card .col-md-2:last-child {
    grid-column: span 2;
  }
  .admin-list-card .d-flex.align-items-center {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .admin-list-card .badge,
  .admin-list-card small,
  .admin-list-card .text-muted {
    font-size: 0.95em;
  }

  /* カード内コンテンツの横スクロール対応 */
  .card-content-scroll {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
  }
  .card-content-scroll > [class^="col-"],
  .card-content-scroll > [class*=" col-"] {
    flex: 0 0 auto !important;
    min-width: 140px;
    max-width: 220px;
    width: auto;
    box-sizing: border-box;
  }
}

#requestBodyModal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}
#sidebarToggleFab {
    /* White with slight transparency */
    background-color: rgba(255, 255, 255, 0.85) !important;
}

#sidebarToggleFab:hover,
#sidebarToggleFab:focus {
    background-color: rgba(255, 255, 255, 0.95) !important;
    color: var(--bs-primary) !important;
}

#sidebarToggleFab:active {
    background-color: rgba(255, 255, 255, 0.9) !important;
    color: var(--bs-primary) !important;
}

/* Ensure the inner icon inherits the color */
#sidebarToggleFab i { color: inherit !important; }

/* Admin authenticated layout: only main scrolls */
.admin-auth .min-vh-100 {
  min-height: 100vh;
  height: 100vh; /* lock viewport height */
}
.admin-auth #content-wrapper {
  height: 100vh; /* fill viewport height within right column */
  overflow: hidden; /* hide overflow so only main scrolls */
}
.admin-auth #content-wrapper > main {
  overflow: auto; /* scroll main content only */
}
.admin-auth #sidebar {
  /* keep sidebar independently scrollable if its content exceeds viewport */
  overflow: auto;
}


/* Modal stacking fixes to ensure modals overlay correctly across stacking contexts */
.modal, .modal.show {
  position: fixed !important;
  z-index: 2050 !important;
}
.modal-backdrop, .modal-backdrop.show {
  z-index: 2000 !important;
}

/* Extracted from inline styles in views */
:root { --accent-1:#6F7BF7; --accent-2:#7AD0F5; --accent-3:#7BE495; --accent-4:#F59E9E; --surface:#ffffff; --background:#f4f7fb; --muted:#8a94a6; --radius-lg:16px; --radius-sm:10px; --shadow-soft:0 10px 24px rgba(17,24,39,.08); --shadow-hover:0 16px 30px rgba(17,24,39,.12); }
body.admin-auth { background: linear-gradient(135deg, rgba(127,143,255,.16), rgba(122,208,245,.16)) fixed, var(--background); }
body.admin-auth #content-wrapper { background: radial-gradient(1200px 240px at 20% -60px, rgba(127,143,255,.35), transparent 60%), radial-gradient(1200px 240px at 80% -40px, rgba(122,208,245,.3), transparent 60%); }
body.admin-auth main { padding-top:.75rem; margin-top:0; }
body.admin-auth .card { border-radius:var(--radius-lg) !important; border:1px solid rgba(255,255,255,.35) !important; box-shadow:var(--shadow-soft); overflow:hidden; -webkit-backdrop-filter: blur(10px) saturate(130%); backdrop-filter: blur(10px) saturate(130%); background: rgba(255,255,255,.58); color: #475569; }
body.admin-auth .card:hover { box-shadow: var(--shadow-hover); transition: box-shadow .2s ease; }
body.admin-auth .card-header, body.admin-auth .card-footer { background: rgba(255,255,255,.72) !important; border-color: rgba(255,255,255,.55) !important; }
body.admin-auth .card.bg-primary, body.admin-auth .card.bg-success, body.admin-auth .card.bg-info, body.admin-auth .card.bg-warning, body.admin-auth .card.bg-danger, body.admin-auth .card.bg-secondary, body.admin-auth .card.bg-dark { border:0 !important; -webkit-backdrop-filter:none; backdrop-filter:none; }
body.admin-auth .card table thead th { background: rgba(255,255,255,.85); }
@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)) { body.admin-auth .card { background: rgba(255,255,255,.9) !important; } body.admin-auth .card-header, body.admin-auth .card-footer { background: rgba(255,255,255,.95) !important; } }
body.admin-auth .btn { border-radius: 999px; }
body.admin-auth .btn-icon { width:36px; height:36px; padding:0; display:inline-flex; align-items:center; justify-content:center; border-radius:50% !important; }
body.admin-auth .btn-group { gap:.5rem; }
body.admin-auth .btn-group > .btn + .btn { margin-left:0; }
body.admin-auth .btn-primary { background: linear-gradient(90deg, var(--accent-1), var(--accent-2)); border:none; color:#ffffff; }
body.admin-auth .btn-outline-primary { color: var(--accent-1); border-color: var(--accent-1); }
body.admin-auth .btn-outline-primary:hover { background-color: rgba(111,123,247,.08); border-color: var(--accent-1); }
body.admin-auth #sidebar { background:#ffffff; border-right:1px solid rgba(17,24,39,.06); box-shadow: 2px 0 22px rgba(17,24,39,.08); }
body.admin-auth #sidebar .nav { padding:.25rem .5rem; }
body.admin-auth #sidebar .sidebar-link { position:relative; border-radius:12px; color:#475569 !important; padding:.6rem .75rem; transition: background-color .2s ease, color .2s ease, box-shadow .2s ease; }
body.admin-auth #sidebar .nav > li > a.sidebar-link:hover { background-color: rgba(111,123,247,.08); color:#1f2937 !important; }
body.admin-auth #sidebar .nav > li > a.sidebar-link.active, body.admin-auth #sidebar .nav > li > a.sidebar-link[aria-current="page"] { background: linear-gradient(90deg, var(--accent-1), var(--accent-2)); }
body.admin-auth #sidebar .nav > li > a.sidebar-link.active::before, body.admin-auth #sidebar .nav > li > a.sidebar-link[aria-current="page"]::before { content:""; position:absolute; left:-6px; top:10%; bottom:10%; width:4px; border-radius:2px; background: linear-gradient(180deg, var(--accent-2), var(--accent-1)); box-shadow:0 0 0 2px rgba(111,123,247,.15); }
body.admin-auth #sidebar .sidebar-link i { color: inherit; opacity:.9; }
/* Sidebar user card subtle background moved from inline */
.sidebar-user-card-bg { background: rgba(15,23,42,0.03); }
body.admin-auth table.table { border-collapse: separate; border-spacing: 0 8px; }
body.admin-auth table.table thead th { border-bottom:none; color: var(--muted); font-weight:600; }
body.admin-auth table.table tbody tr td { border-top:none; }
body.admin-auth .form-control, body.admin-auth .form-select { border-radius: var(--radius-sm); }
body.admin-auth .form-control:focus, body.admin-auth .form-select:focus { box-shadow: 0 0 0 .25rem rgba(111,123,247,.15); border-color: var(--accent-1); }
header .navbar { -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 1px 8px rgba(17,24,39,.06); z-index:1030; }
@media (max-width: 575.98px){ body.admin-auth #content-wrapper{ background: none; } }

/* tabs and layout extracted styles */
.nav-pills .nav-link { border-radius: 9999px; }
.nav-pills .nav-link.active { background: linear-gradient(90deg, #6F7BF7, #7AD0F5); box-shadow: 0 4px 12px rgba(111,123,247,.35); }
#sidebar .nav-pills .nav-link.active { box-shadow: none; }

/* Mobile spacing: ensure consistent gaps between cards across admin pages */
@media (max-width: 575.98px) {
  /* Slight horizontal padding for small phones */
  .admin-auth main .container,
  .admin-auth main .container-fluid {
    padding-left: .5rem;
    padding-right: .5rem;
  }
  /* Uniform vertical gaps between stacked cards */
  .admin-auth main .card {
    margin-bottom: .85rem;
  }
  .admin-auth main .card:last-child {
    margin-bottom: 0;
  }
  /* When using Bootstrap rows, use row-gap for uniform spacing */
  .admin-auth main .row { row-gap: .75rem; }
  /* Subtle padding adjustments on cards for readability */
  .admin-auth main .card .card-body { padding: 1rem !important; }
  .admin-auth main .card .card-header,
  .admin-auth main .card .card-footer { padding: .75rem 1rem !important; }
}

/* Slightly larger mobile/tablet portrait */
@media (max-width: 767.98px) {
  .admin-auth main .row { row-gap: .75rem; }
}

/* Mobile page header: stack title and actions to prevent overlap on small screens */
@media (max-width: 575.98px) {
  .admin-auth main .d-flex.justify-content-between.align-items-center {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: .5rem;
  }
  .admin-auth main .d-flex.justify-content-between.align-items-center > :first-child {
    margin-bottom: 0 !important;
  }
  /* Ensure action buttons wrap nicely */
  .admin-auth main .d-flex.justify-content-between.align-items-center .btn-group,
  .admin-auth main .d-flex.justify-content-between.align-items-center .d-flex {
    flex-wrap: wrap;
    gap: .5rem;
  }
}

/* Login layout and page extracted styles */
body.login-layout { background: linear-gradient(135deg, rgba(127,143,255,.16), rgba(122,208,245,.16)) fixed, #f4f7fb; }
.login-layout .card { border:0; border-radius:16px; box-shadow:0 10px 24px rgba(17,24,39,.08) }
.login-layout .btn-primary { background: linear-gradient(90deg, #6F7BF7, #7AD0F5); border:none; border-radius:999px; color:#ffffff; }
/* Login page specific overrides */
.login-page .card { border-radius:15px; }
.login-page .form-control:focus { border-color:#007bff; box-shadow:0 0 0 0.2rem rgba(0,123,255,0.25); }
.login-page .btn-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border:none; border-radius:8px; font-weight:600; padding:12px 24px; transition: all 0.3s ease; }
.login-page .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3); }
.login-page .btn-outline-primary { border-radius:8px; font-weight:500; transition: all 0.3s ease; }
.login-page .alert { border-radius:8px; border:none; }
.login-page .bg-light { background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%) !important; }
@media (max-width: 768px) { .login-page .card-body { padding: 2rem !important; } }


/* Overrides for FAB position moved from inline style */
#sidebarToggleFab { position: fixed; right: 1rem; bottom: 1rem; width: 56px; height: 56px; z-index: 1060; }
#sidebarToggleFab i { font-size: 1.5rem; }

/* Unauthenticated lock icon size moved from inline */
.unauth-lock-icon { font-size: 3rem; }

/* Mobile horizontal scroll width for Role list table */
@media (max-width: 767.98px) {
  .min-width-role-table { min-width: 700px; }
}

/* Mobile-friendly tabs inside card headers (Application status tabs, etc.) */
@media (max-width: 575.98px) {
  .card-header .nav-tabs.card-header-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    gap: .25rem;
  }
  .card-header .nav-tabs.card-header-tabs .nav-item { flex: 0 0 auto; }
}

/* Utility: compact button group with consistent spacing */
.btn-group-wrap { display: inline-flex; flex-wrap: wrap; gap: .375rem; }
.btn-group-wrap.btn-group-sm .btn { padding: .25rem .5rem; line-height: 1; }

/* =====================
   Pagination Theming (Admin)
   ===================== */
:root {
  --admin-primary: #0d6efd; /* Bootstrap primary */
  --admin-primary-contrast: #ffffff;
  --admin-muted: #6c757d;
  --admin-surface: #ffffff;
  --admin-surface-alt: #f8f9fa;
  --admin-border: rgba(0,0,0,0.08);
}

.admin-auth .pagination {
  gap: .25rem;
}

.admin-auth .page-item .page-link {
  border: 1px solid var(--admin-border);
  color: #334155; /* slate-700-ish */
  background-color: var(--admin-surface);
  border-radius: .5rem; /* more rounded */
  min-width: 2.25rem;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.admin-auth .page-item .page-link:hover {
  background-color: var(--admin-surface-alt);
  color: #0f172a; /* darker text */
  border-color: rgba(0,0,0,0.12);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.admin-auth .page-item.active .page-link {
  background-color: rgba(13,110,253,0.1);
  color: var(--admin-primary);
  border-color: rgba(13,110,253,0.25);
  font-weight: 600;
}

.admin-auth .page-item.disabled .page-link,
.admin-auth .page-item.disabled .page-link:hover {
  color: var(--admin-muted);
  background-color: #f1f3f5;
  border-color: var(--admin-border);
  box-shadow: none;
}

/* Prev/Next icon buttons sizing harmony */
.admin-auth .page-link > .bi {
  vertical-align: -0.1em;
}

/* Compact variant for tight spaces */
.admin-auth .pagination.pagination-compact .page-link {
  min-width: 2rem;
  padding: .25rem .5rem;
  border-radius: .4rem;
}

/* Align with card footers and light backgrounds */
.card-footer .pagination .page-link {
  background-color: var(--admin-surface);
}

/* Reduce excessive focus ring but keep accessibility */
.admin-auth .page-link:focus {
  box-shadow: 0 0 0 .18rem rgba(13,110,253,.15);
}

/* Show total text as subdued and aligned */
.pagination-total-text {
  color: var(--admin-muted);
}

/* End of pagination theming */

/* =====================
   Glassmorphism Buttons (Admin)
   ===================== */
.admin-auth {
  /* Theme variables for glass buttons */
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-hover: rgba(255, 255, 255, 0.7);
  --glass-bg-pressed: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 4px 16px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.06);
  --glass-shadow-hover: 0 6px 24px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.08);
  --glass-ring: rgba(13,110,253,.25);
  --btn-radius: 12px;
  --btn-min-h: 40px; /* unified comfortable size */
  --btn-pad-x: 14px;
  --btn-pad-y: 8px;
  --btn-font-w: 600;

  /* Variant hues aligned to Bootstrap */
  --btn-primary-bg: rgba(13,110,253,0.18);
  --btn-primary-border: rgba(13,110,253,0.35);
  --btn-primary-color: #0d6efd;

  --btn-secondary-bg: rgba(108,117,125,0.18);
  --btn-secondary-border: rgba(108,117,125,0.35);
  --btn-secondary-color: #6c757d;

  --btn-success-bg: rgba(25,135,84,0.18);
  --btn-success-border: rgba(25,135,84,0.35);
  --btn-success-color: #198754;

  --btn-danger-bg: rgba(220,53,69,0.18);
  --btn-danger-border: rgba(220,53,69,0.35);
  --btn-danger-color: #dc3545;

  --btn-warning-bg: rgba(255,193,7,0.22);
  --btn-warning-border: rgba(255,193,7,0.45);
  --btn-warning-color: #b58100;

  --btn-info-bg: rgba(13,202,240,0.20);
  --btn-info-border: rgba(13,202,240,0.4);
  --btn-info-color: #0aa2c0;

  --btn-light-bg: rgba(248,249,250,0.55);
  --btn-light-border: rgba(0,0,0,0.08);
  --btn-light-color: #334155;

  --btn-dark-bg: rgba(0,0,0,0.25);
  --btn-dark-border: rgba(0,0,0,0.45);
  --btn-dark-color: #f8fafc;
}

/* Base glass look for all buttons inside admin */
.admin-auth .btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .425rem;
  min-height: var(--btn-min-h);
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border-radius: var(--btn-radius);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: #0f172a;
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  box-shadow: var(--glass-shadow);
  font-weight: var(--btn-font-w);
  transition: background-color .2s ease, box-shadow .2s ease, transform .02s ease, border-color .2s ease, color .2s ease;
}

/***** Size normalization *****/
.admin-auth .btn.btn-sm { min-height: 36px; padding: 6px 12px; border-radius: 10px; }
.admin-auth .btn.btn-lg { min-height: 48px; padding: 10px 18px; border-radius: 14px; }

/***** Hover / Active *****/
.admin-auth .btn:hover { background: var(--glass-bg-hover); box-shadow: var(--glass-shadow-hover); }
.admin-auth .btn:active, .admin-auth .btn.active { background: var(--glass-bg-pressed); transform: translateY(1px); box-shadow: 0 2px 8px rgba(15,23,42,.12); }

/***** Focus ring *****/
.admin-auth .btn:focus { outline: none; box-shadow: 0 0 0 .22rem var(--glass-ring); }

/***** Disabled *****/
.admin-auth .btn.disabled, .admin-auth .btn:disabled { opacity: .7; cursor: not-allowed; box-shadow: none; }

/***** Icon alignment *****/
.admin-auth .btn > .bi { font-size: 1.05em; vertical-align: -0.12em; }

/* Variants: fill buttons keep glass effect with tinted background */
.admin-auth .btn-primary { background: var(--btn-primary-bg); color: #ffffff; border-color: var(--btn-primary-border); }
.admin-auth .btn-primary:hover { color: #ffffff; }
.admin-auth .btn-primary:focus, .admin-auth .btn-primary:active { color: #ffffff; }
.admin-auth .btn-secondary { background: var(--btn-secondary-bg); color: var(--btn-secondary-color); border-color: var(--btn-secondary-border); }
.admin-auth .btn-success { background: var(--btn-success-bg); color: var(--btn-success-color); border-color: var(--btn-success-border); }
.admin-auth .btn-danger { background: var(--btn-danger-bg); color: var(--btn-danger-color); border-color: var(--btn-danger-border); }
.admin-auth .btn-warning { background: var(--btn-warning-bg); color: var(--btn-warning-color); border-color: var(--btn-warning-border); }
.admin-auth .btn-info { background: var(--btn-info-bg); color: var(--btn-info-color); border-color: var(--btn-info-border); }
.admin-auth .btn-light { background: var(--btn-light-bg); color: var(--btn-light-color); border-color: var(--btn-light-border); }
.admin-auth .btn-dark { background: var(--btn-dark-bg); color: var(--btn-dark-color); border-color: var(--btn-dark-border); }

/* Variant hovers */
.admin-auth .btn-primary:hover { background: rgba(13,110,253,0.26); }
.admin-auth .btn-secondary:hover { background: rgba(108,117,125,0.26); }
.admin-auth .btn-success:hover { background: rgba(25,135,84,0.26); }
.admin-auth .btn-danger:hover { background: rgba(220,53,69,0.26); }
.admin-auth .btn-warning:hover { background: rgba(255,193,7,0.3); }
.admin-auth .btn-info:hover { background: rgba(13,202,240,0.28); }
.admin-auth .btn-light:hover { background: rgba(248,249,250,0.75); }
.admin-auth .btn-dark:hover { background: rgba(0,0,0,0.35); }

/* Outline variants keep transparent glass base with tinted borders and text */
.admin-auth .btn-outline-primary { background: var(--glass-bg); color: var(--btn-primary-color); border-color: var(--btn-primary-border); }
.admin-auth .btn-outline-secondary { background: var(--glass-bg); color: var(--btn-secondary-color); border-color: var(--btn-secondary-border); }
.admin-auth .btn-outline-success { background: var(--glass-bg); color: var(--btn-success-color); border-color: var(--btn-success-border); }
.admin-auth .btn-outline-danger { background: var(--glass-bg); color: var(--btn-danger-color); border-color: var(--btn-danger-border); }
.admin-auth .btn-outline-warning { background: var(--glass-bg); color: var(--btn-warning-color); border-color: var(--btn-warning-border); }
.admin-auth .btn-outline-info { background: var(--glass-bg); color: var(--btn-info-color); border-color: var(--btn-info-border); }
.admin-auth .btn-outline-light { background: var(--glass-bg); color: var(--btn-light-color); border-color: var(--btn-light-border); }
.admin-auth .btn-outline-dark { background: rgba(255,255,255,0.08); color: var(--btn-dark-color); border-color: rgba(255,255,255,0.22); }

/* Outline hover tints */
.admin-auth .btn-outline-primary:hover { background: rgba(13,110,253,0.12); }
.admin-auth .btn-outline-secondary:hover { background: rgba(108,117,125,0.12); }
.admin-auth .btn-outline-success:hover { background: rgba(25,135,84,0.12); }
.admin-auth .btn-outline-danger:hover { background: rgba(220,53,69,0.12); }
.admin-auth .btn-outline-warning:hover { background: rgba(255,193,7,0.16); }
.admin-auth .btn-outline-info:hover { background: rgba(13,202,240,0.14); }
.admin-auth .btn-outline-light:hover { background: rgba(248,249,250,0.65); }
.admin-auth .btn-outline-dark:hover { background: rgba(255,255,255,0.14); }

/* Pressed state for outline variants */
.admin-auth .btn-outline-primary:active { background: rgba(13,110,253,0.18); }
.admin-auth .btn-outline-secondary:active { background: rgba(108,117,125,0.18); }
.admin-auth .btn-outline-success:active { background: rgba(25,135,84,0.18); }
.admin-auth .btn-outline-danger:active { background: rgba(220,53,69,0.18); }
.admin-auth .btn-outline-warning:active { background: rgba(255,193,7,0.24); }
.admin-auth .btn-outline-info:active { background: rgba(13,202,240,0.2); }
.admin-auth .btn-outline-light:active { background: rgba(248,249,250,0.7); }
.admin-auth .btn-outline-dark:active { background: rgba(255,255,255,0.18); }

/* Context: dark sidebar area needs stronger contrast */
.admin-auth #sidebar .btn,
.admin-auth #sidebar .btn-outline-primary,
.admin-auth #sidebar .btn-outline-secondary {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.24);
  color: #e5e7eb;
}
/* Make logout (outline-danger) slightly reddish instead of pure white */
.admin-auth #sidebar .btn-outline-danger {
  background: rgba(220,53,69,0.10); /* faint red tint */
  border-color: rgba(220,53,69,0.35);
  color: #dc3545; /* readable red text/icon */
}
.admin-auth #sidebar .btn-outline-danger:hover {
  background: rgba(220,53,69,0.16);
}
.admin-auth #sidebar .btn-outline-danger:active {
  background: rgba(220,53,69,0.22);
}
.admin-auth #sidebar .btn:hover { background: rgba(255,255,255,0.14); }

/* Fallback when backdrop-filter unsupported */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .admin-auth .btn { background: rgba(255,255,255,0.9); }
  .admin-auth .btn-dark { background: rgba(0,0,0,0.85); }
}

/* Subtle pressed lift removal for icon-only buttons */
.admin-auth .btn.btn-icon { width: var(--btn-min-h); min-width: var(--btn-min-h); padding: 0; }
/* =====================
   End Glassmorphism Buttons
   ===================== */


/* =====================
   Pastel Badges (Admin)
   ===================== */
/* Base badge look: soft chip-like, matching glass/pastel theme */
.admin-auth .badge {
  display: inline-flex;
  align-items: center;
  gap: .25em;
  border-radius: 999px;
  padding: .35em .6em;
  font-weight: 600;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 1px 2px rgba(17,24,39,.06);
  letter-spacing: .01em;
  line-height: 1; /* avoid baseline creep */
  vertical-align: middle; /* align within text line */
}

/* Primary (blue) */
.admin-auth .badge.bg-primary,
.admin-auth .text-bg-primary {
  background-color: rgba(13,110,253,0.14) !important;
  color: #1b57d0 !important;
  border-color: rgba(13,110,253,0.28) !important;
}

/* Secondary (gray) */
.admin-auth .badge.bg-secondary,
.admin-auth .text-bg-secondary {
  background-color: rgba(108,117,125,0.14) !important;
  color: #475569 !important; /* slate-ish */
  border-color: rgba(108,117,125,0.28) !important;
}

/* Success (green) */
.admin-auth .badge.bg-success,
.admin-auth .text-bg-success {
  background-color: rgba(25,135,84,0.14) !important;
  color: #1f7a52 !important;
  border-color: rgba(25,135,84,0.30) !important;
}

/* Danger (red) */
.admin-auth .badge.bg-danger,
.admin-auth .text-bg-danger {
  background-color: rgba(220,53,69,0.14) !important;
  color: #b02a37 !important;
  border-color: rgba(220,53,69,0.32) !important;
}

/* Warning (yellow) */
.admin-auth .badge.bg-warning,
.admin-auth .text-bg-warning {
  background-color: rgba(255,193,7,0.18) !important;
  color: #8a6d00 !important;
  border-color: rgba(255,193,7,0.38) !important;
}

/* Info (cyan) */
.admin-auth .badge.bg-info,
.admin-auth .text-bg-info {
  background-color: rgba(13,202,240,0.16) !important;
  color: #0b778f !important;
  border-color: rgba(13,202,240,0.34) !important;
}

/* Dark */
.admin-auth .badge.bg-dark,
.admin-auth .text-bg-dark {
  background-color: rgba(0,0,0,0.18) !important;
  color: #f8fafc !important;
  border-color: rgba(0,0,0,0.35) !important;
}

/* Light */
.admin-auth .badge.bg-light,
.admin-auth .text-bg-light {
  background-color: rgba(248,249,250,0.75) !important;
  color: #334155 !important;
  border-color: rgba(0,0,0,0.08) !important;
}

/* Make sure badges sit nicely on white cards/tables */
.admin-auth .card-header .badge,
.admin-auth .card-footer .badge,
.admin-auth table .badge {
  box-shadow: 0 1px 1px rgba(17,24,39,.04);
}
/* End Pastel Badges (Admin) */


/* Sidebar width adjustments - appended to override earlier duplicates */
@media (min-width: 768px) {
  /* Desktop and up: widen sidebar a bit */
  .sidebar {
    min-width: 80px;
    max-width: 260px;
  }
}


/* Mobile sidebar width adjustments - appended override */
@media (max-width: 767.98px) {
  .sidebar {
    width: 88vw;
    max-width: 280px;
  }
}


/* Typography override: Elegant Japanese font stack */
:root {
  --font-sans-jp: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", "Meiryo", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-font-sans-serif: var(--font-sans-jp);
}
body {
  font-family: var(--font-sans-jp);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
/* Ensure form controls inherit the font */
button, input, select, textarea {
  font-family: inherit;
}


/* =====================
   Glassmorphism Modals (Admin)
   ===================== */
.admin-auth .modal-dialog {
  border-radius: 16px;
}
.admin-auth .modal-content {
  /* Body should be less or non-transparent per requirement */
  background: rgba(255, 255, 255, 0.70);
  border: 1px solid rgba(255, 255, 255, 0.50);
  border-radius: 16px;
  /* Keep subtle glass processing so edges blend nicely, but reduce impact on body */
  backdrop-filter: blur(8px) saturate(130%);
  -webkit-backdrop-filter: blur(8px) saturate(130%);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.20), 0 2px 10px rgba(15, 23, 42, 0.10);
  overflow: hidden;
}
.admin-auth .modal-header,
.admin-auth .modal-footer {
  /* Header/Footer should be translucent (glass) */
  border-color: rgba(255, 255, 255, 0.5);
}
/* Body text color for readability on frosted bg */
.admin-auth .modal-body {
  color: #334155;
}
/* Close button subtle depth so it doesn't get lost on frosted header */
.admin-auth .btn-close {
  filter: drop-shadow(0 1px 1px rgba(15,23,42,.08));
}
/* Backdrop: subtle gradients aligned with admin theme + slight blur */
.admin-auth .modal-backdrop.show {
  background: radial-gradient(1200px 240px at 20% -60px, rgba(127,143,255,.28), transparent 60%),
              radial-gradient(1200px 240px at 80% -40px, rgba(122,208,245,.24), transparent 60%),
              rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(6px);
}
/* Fallback when backdrop-filter unsupported */
@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)) {
  /* Keep body fully readable when blur isn't available */
  .admin-auth .modal-content { background: rgba(255,255,255,0.98); }
  /* Header/Footer still slightly translucent in look but effectively solid without blur */
  .admin-auth .modal-header, .admin-auth .modal-footer { background: rgba(255,255,255,0.96); }
  .admin-auth .modal-backdrop.show { background: rgba(15, 23, 42, 0.45); }
}
/* =====================
   End Glassmorphism Modals (Admin)
   ===================== */

/* Notification bell (global, non-scoped) */
.navbar .notif-bell { position: relative; display: inline-block; line-height: 1; }
.navbar .notif-bell .notif-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background-color: #dc3545;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.05);
  z-index: 1000; /* above header blur */
}
header .navbar { overflow: visible; }
/* Ensure header brand flexes and bell never grows */
header .navbar .navbar-brand { flex: 1 1 auto; min-width: 0; }
header .navbar .navbar-nav, header .navbar .navbar-nav .nav-item, header .navbar .navbar-nav .nav-link { flex: 0 0 auto; }
header .navbar .notif-bell { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto !important; }

/* Keep title and bell on the same line at extra small widths */
@media (max-width: 575.98px) {
  header .navbar .container-fluid { flex-wrap: nowrap !important; }
  header .navbar .navbar-brand { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70vw; }
  header .navbar .navbar-nav .nav-item { margin-right: .25rem; }
}
