/* ธีมเดียวกับระบบเดิม (Google Apps Script v8.1.27 · css.html) — คัดลอกมาทั้งชุด ห้ามแก้ไฟล์นี้ ปรับเพิ่มที่ app.css */

:root {
    --bs-blue: #0d6efd;
    --bs-indigo: #6610f2;
    --bs-purple: #6f42c1;
    --bs-pink: #d63384;
    --bs-red: #dc3545;
    --bs-orange: #fd7e14;
    --bs-yellow: #ffc107;
    --bs-green: #198754;
    --bs-teal: #20c997;
    --bs-cyan: #0dcaf0;
    --bs-black: #000;
    --bs-white: #fff;
    --bs-gray: #6c757d;
    --bs-gray-dark: #343a40;
    --bs-gray-100: #f8f9fa;
    --bs-gray-200: #e9ecef;
    --bs-gray-300: #dee2e6;
    --bs-gray-400: #ced4da;
    --bs-gray-500: #adb5bd;
    --bs-gray-600: #6c757d;
    --bs-gray-700: #495057;
    --bs-gray-800: #343a40;
    --bs-gray-900: #212529;
    --bs-primary: #0d6efd;
    --bs-secondary: #6c757d;
    --bs-success: #198754;
    --bs-info: #0dcaf0;
    --bs-warning: #ffc107;
    --bs-danger: #dc3545;
    --bs-light: #f8f9fa;
    --bs-dark: #212529;
    --bs-primary-rgb: 13, 110, 253;
    --bs-secondary-rgb: 108, 117, 125;
    --bs-success-rgb: 25, 135, 84;
    --bs-info-rgb: 13, 202, 240;
    --bs-warning-rgb: 255, 193, 7;
    --bs-danger-rgb: 220, 53, 69;
    --bs-light-rgb: 248, 249, 250;
    --bs-dark-rgb: 33, 37, 41;
    --bs-white-rgb: 255, 255, 255;
    --bs-black-rgb: 0, 0, 0;
    --bs-body-color-rgb: 33, 37, 41;
    --bs-body-bg-rgb: 255, 255, 255;
    --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
    --bs-body-font-family: var(--bs-font-sans-serif);
    --bs-body-font-size: 1rem;
    --bs-body-font-weight: 400;
    --bs-body-line-height: 1.5;
    --bs-body-color: #212529;
    --bs-body-bg: #fff;
    --bs-border-width: 1px;
    --bs-border-style: solid;
    --bs-border-color: #dee2e6;
    --bs-border-color-translucent: rgba(0, 0, 0, 0.175);
    --bs-border-radius: 0.375rem;
    --bs-border-radius-sm: 0.25rem;
    --bs-border-radius-lg: 0.5rem;
    --bs-border-radius-xl: 1rem;
    --bs-border-radius-2xl: 2rem;
    --bs-border-radius-pill: 50rem;
    --bs-heading-color: ;
    --bs-link-color: #0d6efd;
    --bs-link-hover-color: #0a58ca;
    --bs-code-color: #d63384;
    --bs-highlight-bg: #fff3cd;
    --box1: #3c8cf3;
    --box2: #05be8a;
    --box3: #745af2;
    --box4: #ef5350;
    --bs-edit: #745af2;
    --bs-del: #ef5350;
    --bs-set: #3c8cf3;
    --bs-upload: #05be8a;
}
body {
    font-family: 'Prompt', sans-serif;
}

::-webkit-scrollbar {
	width: 5px;
  height: 5px;
	background-color: var(--grey); 
}
::-webkit-scrollbar-thumb {
	background-color: var(--box3); 
	border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
	background-color: var(--box3); 
}

.text-indigo:hover,
.text-indigo {
    color: var(--bs-blue);
}
.bg-indigo {
    background-color: var(--bs-blue);
}
.dropdown-toggle::after {
    display: none;
}
.cursor-pointer {
    cursor: pointer;
}
.fw-semibold {
    font-weight: 600;
}
.fs-7 {
    font-size: .875rem;
}


.fx-dropdown-menu {
    min-width: 16rem;
    padding: 0;
    overflow: hidden;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-color: rgba(0, 0, 0, .5);
    z-index: 490;
    opacity: 1;
    visibility: visible;
    transition: opacity .2s;
}
.sidebar.collapsed ~ .sidebar-overlay {
    opacity: 0;
    visibility: hidden;
}
.sidebar.collapsed:hover,
.sidebar {
    width: 16rem;
    overflow-y: auto;
    transition: width .2s, left .2s;
    left: 0;
    z-index: 500;
}
.sidebar.collapsed {
    left: -16rem;
}
.sidebar::-webkit-scrollbar {
    width: .25rem;
}
.sidebar::-webkit-scrollbar {
	width: 5px;
  height: 5px;
	background-color: var(--grey); 
}
.sidebar::-webkit-scrollbar-thumb {
	background-color: var(--blue); 
	border-radius: 6px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
	background-color: var(--red); 
}
.sidebar-toggle {
    cursor: pointer;
    transition: .2s;
}
.sidebar-toggle:hover {
    color: var(--bs-blue);
}
.sidebar-menu {
    list-style-type: none;
}
.sidebar-menu-item {
    margin-bottom: .25rem;
}
.sidebar-menu-item a {
    text-decoration: none;
    display: flex;
    align-items: center;
    color: var(--bs-dark);
    padding: .375rem .75rem;
    border-radius: .375rem;
    font-size: .875rem;
    white-space: nowrap;
}
.sidebar-menu-item > a {
    color: var(--bs-set);
    overflow: hidden;
}
.sidebar-menu-item.focused > a,
.sidebar-menu-item > a:hover {
  background-color: var(--bs-gray-200);
  color: var(--bs-set);
  transition: all 0.3s;
  transform: scale(1.1);
}
.sidebar-menu-item.active-home a {
  background-color: var(--bs-set);
  color: var(--bs-light);
  transition: all 0.3s;
  box-shadow: 0 .25rem .25rem rgba(0, 0, 0, 0.175);
}
.sidebar-menu-item.active-home:hover a {
  background-color: var(--bs-upload);
  color: var(--bs-light);
  transition: all 0.3s;
  transform: scale(1.1);
  box-shadow: 0 .25rem .25rem rgba(0, 0, 0, 0.175);
}
.sidebar-menu-item.active-setting a {
  background-color: var(--bs-edit);
  color: var(--bs-light);
  transition: all 0.3s;
  box-shadow: 0 .25rem .25rem rgba(0, 0, 0, 0.175);
}
.sidebar-menu-item.active-setting:hover a {
  background-color: var(--bs-upload);
  color: var(--bs-light);
  transition: all 0.3s;
  transform: scale(1.1);
  box-shadow: 0 .25rem .25rem rgba(0, 0, 0, 0.175);
}
.sidebar-menu-item.active-close a {
  background-color: var(--bs-del);
  color: var(--bs-light);
  transition: all 0.3s;
  box-shadow: 0 .25rem .25rem rgba(0, 0, 0, 0.175);
}
.sidebar-menu-item.active-close:hover a {
  background-color: var(--bs-upload);
  color: var(--bs-light);
  transition: all 0.3s;
  transform: scale(1.1);
  box-shadow: 0 .25rem .25rem rgba(0, 0, 0, 0.175);
}
.sidebar-menu-item-icon {
    margin-right: .625rem;
    font-size: 1.25rem;
}
.sidebar-menu-item-accordion {
    transition: transform .2s;
}
.sidebar-dropdown-menu-item.focused > a .sidebar-menu-item-accordion,
.sidebar-menu-item.focused > a .sidebar-menu-item-accordion {
    transform: rotateZ(180deg);
}
.sidebar.collapsed:hover .sidebar-menu-divider,
.sidebar-menu-divider {
    font-size: .75rem;
    color: var(--bs-gray-600);
    transition: opacity .2s;
    opacity: 1;
    visibility: visible;
}
.sidebar-dropdown-menu-item a {
    padding: .375rem 0;
    padding-right: .75rem;
}
.sidebar-dropdown-menu-item.focused > a,
.sidebar-dropdown-menu-item a:hover {
    color: var(--bs-blue);
}
.sidebar-dropdown-menu {
    padding-left: 2rem;
}
.sidebar-dropdown-menu .sidebar-dropdown-menu {
    padding-left: 1rem;
    list-style-type: circle;
}

main {
    padding-left: 0;
    min-height: 100vh;
    font-family: 'Prompt', sans-serif;
}
nav {
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 400;
}
.navbar-profile-image {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: cover;
    border-radius: 50%;
}
.navbar-profile-image:hover{
  transition: all 0.3s;
  transform: scale(1.1);
}
.navbar-link {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: .25rem;
}
.navbar-link:hover {
    background-color: var(--bs-gray-200);
}

@media (min-width: 576px) {
    
}

@media (min-width: 768px) {
    .sidebar-overlay {
        opacity: 0;
        visibility: hidden;
    }
    .sidebar.collapsed {
        width: 4.75rem;
        left: 0;
    }
    .sidebar.collapsed .sidebar-logo {
        display: none;
    }
    .sidebar.collapsed:hover .sidebar-logo {
        display: block;
    }
    .sidebar.collapsed:hover .sidebar-toggle {
        margin-left: auto;
        margin-right: 0;
    }
    .sidebar.collapsed .sidebar-toggle {
        margin: 0 auto;
        transform: rotateZ(180deg);
    }
    .sidebar.collapsed:hover .sidebar-menu-divider {
        font-size: .75rem;
        color: var(--bs-gray-600);
        transition: opacity .2s;
        opacity: 1;
        visibility: visible;
    }
    .sidebar.collapsed .sidebar-menu-divider {
        opacity: 0;
        visibility: hidden;
    }

    main {
        transition: padding-left .2s;
        padding-left: 16rem;
    }
    .sidebar.collapsed ~ main {
        padding-left: 4.75rem;
    }
}

@media (min-width: 992px) {
    
}

@media (min-width: 1200px) {
    
}

@media (min-width: 1400px) {
    
}

.box-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-auto-rows: minmax(100px, auto); 
  grid-gap: 20px;
  margin-left: -30px;
  align-items: start; 
}

.box-info li {
  padding: 20px;
  background: var(--light);
  border-radius: 20px;
  display: flex;
  align-items: center;
  grid-gap: 24px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}
.box-info li:hover {
  transform: scale(1.05);
  box-shadow: rgba(50, 50, 93, 0.25) 0px 30px 60px -12px inset, rgba(0, 0, 0, 0.3) 0px 18px 36px -18px inset;
}
.box-info li i {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  font-size: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.box-info li:nth-child(1),
.box-info li:nth-child(1) i {
  background: var(--box1);
}
.box-info li:nth-child(2),
.box-info li:nth-child(2) i {
  background: var(--box2);
}
.box-info li:nth-child(3),
.box-info li:nth-child(3) i {
  background: var(--box3);
}
.box-info li:nth-child(4),
.box-info li:nth-child(4) i {
  background: var(--box4);
}
.box-info li:nth-child(1) i, 
.box-info li:nth-child(2) i, 
.box-info li:nth-child(3) i, 
.box-info li:nth-child(4) i {
  color: #fff;
}
.box-info li .text h3 {
  font-size: 30px;
  font-weight: 500;
  color: #fff
}
.box-info li .text p {
  color: #fff
}

.toast-container {
  position: fixed;
  top: 40px;
  z-index: 4000;
  right: 20px;
}

.imageuser {
  transition: filter 300ms;
}
.imageuser:hover {
  transform: scale(1.08);
}
#reviewdivprofile:has(.imageuser:hover)
.imageuser:not(:hover) {
  filter: grayscale(100%) brightness(50%);
}
#reviewNewprofile:has(.imageuser:hover)
.imageuser:not(:hover) {
  filter: grayscale(100%) brightness(50%);
}

.dropdown-menu {
  z-index: 999;
  background-color: var(--bs-light);
}
.dropdown-menu h6 {
  color: var(--dark);
}
.dropdown-menu a {
  color: var(--dark);
  font-size: 12px;
}
.dropdown-menu span {
  font-weight: 300;
  font-size: 14px;
}
.dropdown-menu a .fw-semibold {
  font-weight: 300;
  font-size: 14px;
}
.dropdown-menu a span {
  font-weight: 300;
  font-size: 12px;
}
.dark .dropdown-content .dropdown-item {
  color: var(--bs-light);
}
.dropdown-content .dropdown-item :hover {
  color: var(--bs-set);
}
.dropdown-content {
  overflow-y: auto;
  max-height: 400px;
}
.dropdown-content .message-body .w-75 h6 {
  font-size: 14px;
  font-weight: 300;
}
.dropdown-content .message-body .w-75 span {
  font-size: 12px;
}
.dropdown-content .message-body .dropdown-item .bg-opacity-25 {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dropdown-content .ms-3 span {
  margin-top: 2px;
}
.dropdown-content .profile-user {
  width: 80px;
  height: 80px;
}
/* .message-body {
  transition: all 0.3s;
}
.message-body:hover {
  transition: all 0.3s;
  transform: scale(1.1);
} */
.edit-button{
  background-color: var(--bs-edit);
  color: var(--bs-light);
  transition: all 0.3s;
}
.edit-button:hover{
  background-color: var(--bs-upload);
  color: var(--bs-light);
  transition: all 0.3s;
  transform: scale(1.1);
}
.del-button{
  background-color: var(--bs-del);
  color: var(--bs-light);
  transition: all 0.3s;
}
.del-button:hover{
  background-color: var(--bs-upload);
  color: var(--bs-light);
  transition: all 0.3s;
  transform: scale(1.1);
}
.set-button{
  background-color: var(--bs-set);
  color: var(--bs-light);
  transition: all 0.3s;
}
.set-button:hover{
  background-color: var(--bs-upload);
  color: var(--bs-light);
  transition: all 0.3s;
  transform: scale(1.1);
}
.upload-button{
  background-color: var(--bs-upload);
  color: var(--bs-light);
  transition: all 0.3s;
}
.upload-button:hover{
  background-color: var(--bs-edit);
  color: var(--bs-light);
  transition: all 0.3s;
  transform: scale(1.1);
}
.set-icons-menu{
  color: var(--bs-set);
  transition: all 0.3s;
}
.set-icons-menu:hover{
  color: var(--bs-upload);
  transition: all 0.3s;
  transform: scale(1.1);
}
.set-icons{
  color: var(--bs-set);
  transition: all 0.3s;
}
.set-icons:hover{
  color: var(--bs-upload);
  transition: all 0.3s;
  transform: scale(1.1);
}
.set-icons-folder1 img {
    transition: all 0.3s;
}
.set-icons-folder1:hover img {
    transform: scale(1.1);
}
.file-preview img {
    transition: all 0.3s;
}
.file-preview:hover img {
    transform: scale(1.1);
}
.custom-table thead th {
  position: sticky;
  top: 0;
  background-color: white;
  z-index: 1;
}
.todo-container {
  max-width: 600px;
  margin: auto;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
}
.todo-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #ddd;
}
.todo-item:last-child {
  border-bottom: none;
}
.header-item {
  background-color: var(--box1);
  color: var(--box3);
  position: sticky;
  top: 0;
  z-index: 1;
}
.todo-list {
  max-height: 400px;
  overflow-y: auto;
}
.custom-tooltip {
  --bs-tooltip-bg: var(--bs-edit);
  --bs-tooltip-color: var(--bs-white);
}
table tbody tr:hover {
  cursor: pointer;
}

.custom-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 25px;
}

.custom-switch-input {
  opacity: 0;
  width: 0;
  height: 0;
}

.custom-switch-label {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--box4);
  border-radius: 25px;
  transition: background-color 0.4s;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.custom-switch-label:before {
  position: absolute;
  content: "";
  height: 21px;
  width: 21px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.4s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2),
              inset 0 -1px 2px rgba(0, 0, 0, 0.1);
}

.custom-switch-input:checked + .custom-switch-label {
  background-color: var(--box1);
}

.custom-switch-input:checked + .custom-switch-label:before {
  transform: translateX(25px);
}


:root {
  --ink: #1f3a68;        /* หมึกน้ำเงิน: ปุ่มหลัก ลิงก์ หัวตาราง */
  --ink-deep: #13284a;   /* แถบเมนู */
  --seal: #9f1d2b;       /* ครั่ง/ตราประทับ: ลบ ด่วน ยกเลิก */
  --ochre: #9a6a12;      /* เกษียน / รอดำเนินการ */
  --done: #2e6b4e;       /* เสร็จสิ้น */
  --desk: #eef1f5;       /* พื้นหลัง */
  --paper: #ffffff;
  --line: #dfe4ec;
  --text: #1c2533;
  --muted: #5b6577;
  --brand: var(--ink);
  --box1: var(--ink); --box2: var(--done); --box3: var(--ochre); --box4: var(--seal);
  --bs-set: var(--ink); --bs-edit: var(--ink); --bs-del: var(--seal); --bs-upload: var(--muted);
  --bs-body-font-family: 'Sarabun', 'Prompt', sans-serif;
  --bs-link-color: var(--ink);
}
html, body { background: var(--desk); }
body, main, .modal, .form-control, .form-select, .btn, table, .dropdown-menu, .toast {
  font-family: 'Sarabun', 'Prompt', sans-serif !important;
}
body { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
main.bg-light { background: var(--desk) !important; }
h1, h2, h3, h4, h5, h6, .card-header { font-weight: 600; letter-spacing: 0; color: var(--text); }

/* ---------- แถบเมนูซ้าย ---------- */
.sidebar { background: var(--ink-deep) !important; border-right: 0 !important; box-shadow: none !important; }
.sidebar .sidebar-logo, .sidebar #textSystem { color: #fff !important; font-weight: 700; letter-spacing: .2px; text-transform: none !important; }
.sidebar .sidebar-toggle { color: rgba(255,255,255,.7); }
.sidebar-menu-divider { color: rgba(255,255,255,.45) !important; font-size: .78rem !important; text-transform: none !important; letter-spacing: 0; }
.sidebar-menu-item > a, .sidebar-menu-item a, .sidebar-dropdown-menu-item a { color: rgba(255,255,255,.86) !important; font-size: .92rem; transform: none !important; box-shadow: none !important; }
.sidebar-menu-item > a:hover, .sidebar-menu-item.focused > a { background: rgba(255,255,255,.08) !important; color: #fff !important; }
.sidebar-dropdown-menu-item a:hover, .sidebar-dropdown-menu-item.focused > a { color: #fff !important; }
.sidebar-dropdown-menu-item.active > a { color: #fff !important; font-weight: 600; box-shadow: inset 3px 0 0 #d9b25a !important; padding-left: .6rem !important; }
.sidebar-menu-item.active-home a { background: rgba(255,255,255,.12) !important; color: #fff !important; }
.sidebar-menu-item.active-home.active a, .sidebar-menu-item.active-home a:hover { box-shadow: inset 3px 0 0 #d9b25a !important; }
.sidebar-menu-item.active-close a { background: transparent !important; color: #f3b4ba !important; border: 1px solid rgba(243,180,186,.35); }
.sidebar-menu-item.active-close a:hover { background: var(--seal) !important; color: #fff !important; }
.sidebar-dropdown-menu .sidebar-dropdown-menu { list-style-type: none; }

/* ---------- แถบบน ---------- */
nav.bg-white, nav { background: var(--paper) !important; border: 1px solid var(--line); box-shadow: none !important; border-radius: 12px !important; }
#nameSystem { color: var(--ink); font-weight: 700; }

/* ---------- การ์ดตัวเลข: กระดาษขาว + เส้นสีบอกความหมาย ---------- */
.box-info { margin-left: 0 !important; padding-left: 0; grid-gap: 14px !important; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important; }
.box-info li { background: var(--paper) !important; border-radius: 12px !important; box-shadow: none !important; border: 1px solid var(--line);
  border-left: 4px solid var(--ink); padding: 14px 18px !important; grid-gap: 14px !important; transform: none !important; }
.box-info li:hover { transform: none !important; box-shadow: 0 2px 10px rgba(19,40,74,.08) !important; }
.box-info li:nth-child(2) { border-left-color: var(--done); }
.box-info li:nth-child(3) { border-left-color: var(--ochre); }
.box-info li:nth-child(4) { border-left-color: var(--seal); }
.box-info li lord-icon { width: 46px !important; height: 46px !important; }
.box-info li .text p { color: var(--muted) !important; margin: 0; font-size: 14px; }
.box-info li .text h3 { color: var(--text) !important; font-size: 28px !important; font-weight: 700 !important; margin: 0; }
.box-info li .text h3 span { color: var(--muted); font-weight: 400; }
.box-info li[role=button] { cursor: pointer; }

/* ---------- การ์ด / ตาราง ---------- */
.card { border: 1px solid var(--line) !important; border-radius: 12px !important; box-shadow: none !important; }
.card-header { background: var(--paper) !important; border-bottom: 1px solid var(--line) !important; padding: .8rem 1rem; border-radius: 12px 12px 0 0 !important; }
.card-body.rounded-4 { border-radius: 0 0 12px 12px !important; }
table.dataTable thead th, .table thead th { color: var(--muted); font-weight: 600; font-size: 13.5px; border-bottom: 1px solid var(--line) !important; background: #f7f8fb; white-space: nowrap; }
table.dataTable tbody td, .table td { border-color: #edf0f4 !important; vertical-align: middle; }
table tbody tr:hover > * { background: #f5f7fb !important; }
.dataTables_wrapper .dataTables_filter input, .dataTables_wrapper .dataTables_length select { border-radius: 8px; border: 1px solid var(--line); }
.page-item.active .page-link { background: var(--ink) !important; border-color: var(--ink) !important; }
.page-link { color: var(--ink); }

/* เลขทะเบียน = ตรารับ (จุดเด่นเดียวของธีม) */
.reg-stamp { display: inline-block; color: var(--ink); font-weight: 700; font-size: 13.5px; letter-spacing: .4px;
  border: 1.5px solid var(--ink); border-radius: 4px; padding: 0 7px; line-height: 1.55;
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px rgba(31,58,104,.35); background: var(--paper); }

/* ---------- ปุ่ม: เรียบ ไม่เด้ง ---------- */
.btn { border-radius: 8px; font-weight: 500; }
.set-button, .edit-button, .del-button, .upload-button, .kasian-button, .route-button { transition: background-color .15s, color .15s, border-color .15s !important; transform: none !important; }
.set-button { background: var(--ink) !important; color: #fff !important; border: 1px solid var(--ink) !important; }
.set-button:hover { background: var(--ink-deep) !important; color: #fff !important; }
.edit-button { background: #fff !important; color: var(--ink) !important; border: 1px solid #b9c5da !important; }
.edit-button:hover { background: #eef2f9 !important; border-color: var(--ink) !important; }
.del-button { background: #fff !important; color: var(--seal) !important; border: 1px solid #e3b5ba !important; }
.del-button:hover { background: var(--seal) !important; color: #fff !important; border-color: var(--seal) !important; }
.upload-button { background: #fff !important; color: var(--text) !important; border: 1px solid var(--line) !important; }
.upload-button:hover { background: #f3f5f9 !important; border-color: #b9c5da !important; }
.kasian-button { background: #fff !important; color: var(--ochre) !important; border: 1px solid #e2cfa5 !important; }
.kasian-button:hover { background: #fbf4e4 !important; border-color: var(--ochre) !important; }
.dept-button { background: #eef2f9 !important; color: var(--ink) !important; border: 1px solid #c9d4e8 !important; transition: background-color .15s !important; }
.dept-button:hover { background: var(--ink) !important; color: #fff !important; }
.route-button { background: #fff !important; color: var(--ink) !important; border: 1px solid var(--line) !important; }
.route-button:hover { border-color: var(--ink) !important; }
.btn:focus-visible, .form-control:focus, .form-select:focus { outline: none; box-shadow: 0 0 0 3px rgba(31,58,104,.22) !important; border-color: var(--ink) !important; }

/* ปุ่มในตาราง: แถวเดียว กะทัดรัด */
table.dataTable td .btn.btn-sm, .table td .btn.btn-sm { padding: 3px 7px; margin-right: 3px !important; font-size: 13px; line-height: 1.3; }
table.dataTable td:last-child { white-space: nowrap; }
/* ช่อง "ไม่มีไฟล์" ไม่ใช่ปุ่มลบ -> สีจาง */
a.del-button[href="#"] { color: #b8c0cc !important; border-color: #e6e9ef !important; background: #fafbfc !important; pointer-events: none; }

/* ---------- ฟอร์ม / หน้าต่าง ---------- */
.modal-content.rounded-5, .modal-content { border-radius: 16px !important; border: 0; box-shadow: 0 20px 50px rgba(19,40,74,.25); }
.modal-body h5 { color: var(--text) !important; }
.form-control, .form-select { border-radius: 8px; border-color: #cfd6e2; }
.control-label, .form-label { font-weight: 500; color: var(--text); margin-bottom: 4px; }
.form-check-input:checked { background-color: var(--ink); border-color: var(--ink); }
.nav-pills .nav-link.active, .dept-tabs .nav-link.active { background: var(--ink) !important; }

/* ---------- อื่นๆ ---------- */
.custom-tooltip { --bs-tooltip-bg: var(--ink-deep); }
.text-indigo { color: var(--ink) !important; }
.badge.text-bg-warning { background: #fbf0d9 !important; color: var(--ochre) !important; }
.badge.text-bg-danger { background: #f8e4e6 !important; color: var(--seal) !important; }
.custom-switch-input:checked + .custom-switch-label { background-color: var(--ink) !important; }
::-webkit-scrollbar-thumb { background: #c3cbd8 !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }


:root {
  --ink: #1b2f57; --ink-deep: #0c1630; --night: #070e20;
  --gold: #c9a24a; --gold-2: #e8cf8a; --gold-deep: #9c7a2c;
  --desk: #f3f1ec; --line: #e4dfd3; --paper: #fffefb;
  --lux-shadow: 0 10px 30px -12px rgba(12,22,48,.28);
  --gold-grad: linear-gradient(135deg, #f3e2a9 0%, #c9a24a 45%, #9c7a2c 100%);
}
html, body, main.bg-light { background: var(--desk) !important; }
body { background-image: radial-gradient(1200px 500px at 100% -10%, rgba(201,162,74,.10), transparent 60%), radial-gradient(900px 400px at -10% 110%, rgba(27,47,87,.07), transparent 60%) !important; background-attachment: fixed !important; }
h1, h2, h3, h4, .lux-title, .trk-hero h4, .dept-head h4, #nameSystem { font-family: 'Trirong', 'Sarabun', serif !important; letter-spacing: .2px; }

/* แถบเมนู: น้ำเงินเที่ยงคืน ลายทองบาง */
.sidebar { background: linear-gradient(180deg, var(--ink-deep) 0%, var(--night) 100%) !important; }
.sidebar::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: radial-gradient(400px 200px at 0% 0%, rgba(201,162,74,.22), transparent 70%); }
.sidebar .sidebar-logo { border-bottom: 1px solid rgba(201,162,74,.25); }
.sidebar #textSystem { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent !important; }
.sidebar-dropdown-menu-item.active > a, .sidebar-menu-item.active-home.active a { box-shadow: inset 3px 0 0 var(--gold) !important; background: linear-gradient(90deg, rgba(201,162,74,.16), transparent) !important; }
.sidebar-menu-divider { color: rgba(232,207,138,.55) !important; }

/* แถบบน + การ์ด */
nav.bg-white, nav { background: rgba(255,254,251,.85) !important; backdrop-filter: blur(8px); border: 1px solid var(--line); }
#nameSystem { color: var(--ink-deep) !important; }
.card, .box-info li, .trk-card, .wf-panel { box-shadow: var(--lux-shadow) !important; border-color: var(--line) !important; background: var(--paper) !important; }
.box-info li { border-left: 0 !important; position: relative; overflow: hidden; }
.box-info li::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--gold-grad); }
.card-header { background: linear-gradient(180deg, #fffdf6, var(--paper)) !important; }

/* ปุ่มหลัก: น้ำเงินขอบทอง */
.set-button { background: linear-gradient(180deg, #24407a, var(--ink)) !important; border: 1px solid var(--ink-deep) !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 0 0 1px rgba(201,162,74,.0); }
.set-button:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 0 0 2px rgba(201,162,74,.55) !important; }
.kasian-button { color: var(--gold-deep) !important; border-color: #e3d2a3 !important; }
.kasian-button:hover { background: var(--gold-grad) !important; color: var(--night) !important; }
.reg-stamp { color: var(--ink-deep); border-color: var(--ink-deep); }
.st-reserve { color: var(--gold-deep); font-size: 14px; font-weight: 600; }
.modal-content { background: var(--paper) !important; }
.modal-content::before { content: ''; display: block; height: 4px; border-radius: 16px 16px 0 0; background: var(--gold-grad); }
.nav-pills .nav-link.active, .dept-tabs .nav-link.active { background: var(--ink-deep) !important; box-shadow: inset 0 -2px 0 var(--gold); }
.form-check-input:checked { background-color: var(--ink-deep); border-color: var(--ink-deep); }
.home-flow .card-body { background: linear-gradient(135deg, #fffaf0, #fff); }

/* ================= หน้าเข้าสู่ระบบ ================= */
#pageformLogin { position: fixed; inset: 0; z-index: 1050; background: var(--night); overflow: auto; }
.lx-login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.lx-art { position: relative; overflow: hidden; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(900px 600px at 20% 10%, #1e3768 0%, var(--ink-deep) 45%, var(--night) 100%); }
.lx-art::before { content: ''; position: absolute; inset: 0; opacity: .14;
  background-image: repeating-linear-gradient(45deg, var(--gold) 0 1px, transparent 1px 22px), repeating-linear-gradient(-45deg, var(--gold) 0 1px, transparent 1px 22px); mask-image: radial-gradient(circle at 70% 60%, #000 0, transparent 70%); -webkit-mask-image: radial-gradient(circle at 70% 60%, #000 0, transparent 70%); }
.lx-orb { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .55; animation: lxFloat 14s ease-in-out infinite; }
.lx-orb.o1 { width: 340px; height: 340px; right: -80px; top: 18%; background: radial-gradient(circle at 30% 30%, rgba(243,226,169,.55), rgba(201,162,74,.05) 70%); }
.lx-orb.o2 { width: 180px; height: 180px; left: 12%; bottom: 14%; background: radial-gradient(circle at 30% 30%, rgba(120,160,255,.35), transparent 70%); animation-delay: -6s; }
@keyframes lxFloat { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-22px) } }
.lx-brand { display: flex; align-items: center; gap: 14px; position: relative; }
.lx-brand img { width: 58px; height: 58px; border-radius: 14px; object-fit: contain; background: rgba(255,255,255,.06); padding: 6px; border: 1px solid rgba(201,162,74,.45); }
.lx-brand .en { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--gold-2); }
.lx-hero { position: relative; max-width: 520px; }
.lx-hero h1 { font-size: clamp(30px, 3.6vw, 50px); line-height: 1.2; margin: 0 0 14px; color: #fff; font-weight: 600; }
.lx-hero h1 span { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lx-hero p { color: rgba(255,255,255,.72); font-size: 16px; }
.lx-feats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.lx-feats span { border: 1px solid rgba(201,162,74,.4); color: var(--gold-2); border-radius: 999px; padding: 5px 14px; font-size: 13px; background: rgba(201,162,74,.06); }
.lx-foot { position: relative; color: rgba(255,255,255,.45); font-size: 12.5px; }
.lx-form { background: var(--paper); display: flex; align-items: center; justify-content: center; padding: 40px 28px; position: relative; }
.lx-card { width: 100%; max-width: 400px; }
.lx-card .seal { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 18px; background: var(--gold-grad); box-shadow: 0 8px 24px -8px rgba(156,122,44,.7); color: var(--night); font-size: 26px; }
.lx-card h2 { font-size: 30px; margin: 0 0 4px; color: var(--ink-deep); }
.lx-card .sub { color: #6b7280; margin-bottom: 26px; }
.lx-field { position: relative; margin-bottom: 16px; }
.lx-field input { width: 100%; height: 56px; border: 1.5px solid #ddd6c6; border-radius: 14px; padding: 20px 46px 6px 46px; font-size: 16px; background: #fffdf8; transition: border-color .2s, box-shadow .2s; }
.lx-field input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201,162,74,.18); background: #fff; }
.lx-field label { position: absolute; left: 46px; top: 17px; color: #8a8f99; font-size: 15px; pointer-events: none; transition: all .18s; }
.lx-field input:focus + label, .lx-field input:not(:placeholder-shown) + label { top: 7px; font-size: 11.5px; color: var(--gold-deep); letter-spacing: .3px; }
.lx-field .ic { position: absolute; left: 16px; top: 18px; color: var(--ink); opacity: .7; }
.lx-field .eye { position: absolute; right: 12px; top: 12px; border: 0; background: transparent; color: #6b7280; padding: 6px 8px; border-radius: 8px; }
.lx-field .eye:hover { background: #f3efe4; }
.lx-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; margin: 4px 2px 20px; color: #4b5563; }
.lx-caps { color: #9f1d2b; font-size: 13px; display: none; margin: -8px 0 10px 4px; }
.lx-btn { width: 100%; height: 54px; border: 0; border-radius: 14px; font-size: 17px; font-weight: 600; color: #fff; letter-spacing: .3px; position: relative; overflow: hidden;
  background: linear-gradient(180deg, #24407a, var(--ink-deep)); box-shadow: 0 10px 24px -10px rgba(12,22,48,.6), inset 0 1px 0 rgba(255,255,255,.15); }
.lx-btn::after { content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(90deg, transparent, rgba(232,207,138,.45), transparent); transform: skewX(-20deg); animation: lxShine 3.8s ease-in-out infinite; }
@keyframes lxShine { 0%, 60% { left: -60% } 100% { left: 130% } }
.lx-btn:hover { box-shadow: 0 0 0 3px rgba(201,162,74,.45), 0 10px 24px -10px rgba(12,22,48,.6); }
.lx-note { margin-top: 22px; font-size: 12.5px; color: #8a8f99; text-align: center; }
.lx-shake { animation: lxShake .4s; }
@keyframes lxShake { 20%, 60% { transform: translateX(-8px) } 40%, 80% { transform: translateX(8px) } }
@media (max-width: 900px) {
  .lx-login { grid-template-columns: 1fr; }
  .lx-art { padding: 28px 22px; min-height: auto; }
  .lx-hero h1 { font-size: 28px; } .lx-hero p, .lx-feats, .lx-foot, .lx-orb { display: none; }
  .lx-form { padding: 28px 16px 40px; }
}


/* พื้นหลังแบบ fixed ทำให้เลื่อนจอหน่วง (ต้องวาดใหม่ทุกครั้ง) -> เลิกใช้ */
body { background-attachment: scroll !important; }
nav.bg-white, nav { backdrop-filter: none !important; background: var(--paper) !important; }

/* เมนูชั้นเดียว */
.sidebar-menu.flat .sidebar-menu-item { margin-bottom: 2px; }
.sidebar-menu.flat .sidebar-menu-item > a { gap: 2px; padding: .5rem .75rem; border-radius: 10px; transform: none !important; }
.sidebar-menu.flat .sidebar-menu-item > a span { overflow: hidden; text-overflow: ellipsis; }
.sidebar-menu.flat .sidebar-menu-item.active > a { background: linear-gradient(90deg, rgba(201,162,74,.22), rgba(201,162,74,.04)) !important; color: #fff !important; box-shadow: inset 3px 0 0 var(--gold) !important; font-weight: 600; }
.sidebar-menu.flat .sidebar-menu-item > a:hover { background: rgba(255,255,255,.07) !important; }
.sidebar-menu.flat .sidebar-menu-item.active-home > a { background: rgba(255,255,255,.08) !important; }
.sidebar-menu.flat .sidebar-menu-item.active-home.active > a { background: linear-gradient(90deg, rgba(201,162,74,.22), rgba(201,162,74,.04)) !important; box-shadow: inset 3px 0 0 var(--gold) !important; }
.sidebar-menu.flat .sidebar-menu-divider { margin-top: 14px !important; padding-left: .75rem; font-size: .74rem !important; letter-spacing: .3px; }
.sidebar-menu.flat .sidebar-dropdown-menu { padding-left: 2.6rem; list-style: none; }
.sidebar-menu.flat .sidebar-dropdown-menu-item a { padding: .3rem 0; font-size: .86rem; }
@media (min-width: 768px) {
  .sidebar.collapsed:not(:hover) .sidebar-menu.flat .sidebar-menu-item > a { justify-content: center; padding: .55rem 0; }
  .sidebar.collapsed:not(:hover) .sidebar-menu.flat .sidebar-menu-item > a span,
  .sidebar.collapsed:not(:hover) .sidebar-menu.flat .sidebar-menu-item-accordion { display: none; }
  .sidebar.collapsed:not(:hover) .sidebar-menu.flat .sidebar-menu-item-icon { margin: 0; }
  .sidebar.collapsed:hover { box-shadow: 12px 0 30px -12px rgba(0,0,0,.45) !important; }
}

/* การ์ดตัวเลขแบบใหม่ */
.box-info li { align-items: center; }
.box-info li .text h3 { font-family: 'Trirong', 'Sarabun', serif !important; }

/* หน้าล็อกอิน: เส้นทางหนังสือย่อ */
.lx-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 18px; }
.lx-flow span { background: rgba(255,255,255,.07); border: 1px solid rgba(232,207,138,.35); color: #fff; border-radius: 10px; padding: 6px 10px; font-size: 13px; }
.lx-flow i { color: var(--gold-2); font-style: normal; }
.lx-flow span { animation: lxStep 6s ease-in-out infinite; }
.lx-flow span:nth-of-type(2) { animation-delay: 1s; } .lx-flow span:nth-of-type(3) { animation-delay: 2s; }
.lx-flow span:nth-of-type(4) { animation-delay: 3s; } .lx-flow span:nth-of-type(5) { animation-delay: 4s; } .lx-flow span:nth-of-type(6) { animation-delay: 5s; }
@keyframes lxStep { 0%, 12% { background: rgba(201,162,74,.35); border-color: #e8cf8a; } 20%, 100% { background: rgba(255,255,255,.07); } }
@media (max-width: 900px) { .lx-flow { display: none; } }
