﻿@import url('../fonts/fonts.css');

:root {
    --text-black: black;
    --text-gray: #CCC;
    --border-color: #CCC;
    --button-light: #CACACA;
    --button-light-hover: #D9D9D9;
    --table-line: #D6D6D6;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Prompt', sans-serif;
    font-size: 20px;    
}

.logo {
    height: 52px;
}

.table.gy-5 th, .table.gy-5 td {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.app-content {
    padding: 10px 0;
}

.py-5 {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
}

.table {
    margin-bottom: 0.25rem;
    margin-top: 0.25rem;
}

.text-red {
    color: red !important;
}

.app-header {
    height: 75px;
}

.app-toolbar {
    height: 75px;
}


.staff-header {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 18px;
}

.staff-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    max-width: 420px; /* ปรับขนาดรวม */
}

.staff-item {
    display: flex;
    align-items: center;
    flex: 1 1 calc(50% - 8px); /* 2 ต่อแถว */
    gap: 6px;
    min-width: 0;
}

.staff-index {
    width: 20px;
    text-align: right;
    font-weight: bold;
    font-size: 14px;
}

.custom-btn {
    background-color: #fff;
    border: 2px solid #156082;
    color: black;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 32px;
    max-width: 150px;
    flex: 1;
}

.custom-btn.active {
    background-color: #c4c4c4;
}


.car-section {
    max-width: 100%;
    margin: 0 auto;
    font-family: sans-serif;
}

.car-header {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 18px;
}

.car-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.car-btn {
    background-color: #fff;
    border: 2px solid #156082;
    color: black;
    padding: 4px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 calc(100% - 12px); /* default 1 column */
    max-width: 240px;
    height: 32px;
    margin: 5px
}

.car-btn.active {
    background-color: #c4c4c4;
}

.summary-box {
    margin: 20px auto; /* จัดให้อยู่ตรงกลาง */
    max-width: 500px; /* ปรับขนาดกล่อง */
    border: 1px solid #dee2e6; /* ขอบบาง */
    border-radius: 8px; /* มุมโค้ง */
    padding: 15px 20px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* เพิ่มความนุ่ม */
    font-family: sans-serif;
    font-size: 14px;
    color: #6c757d;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed #eee;
}

.summary-row.center-text {
	display: flex;
	justify-content: center;
	padding: 6px 0;
	border-bottom: 1px dashed #eee;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-col {
    flex: 1;
}

.text-end {
    text-align: right;
}

.fw-bold {
    font-weight: bold;
}

.header {
    font-weight: bold;
    color: #999;
}

.form-locked {
    background-color: var(--bs-gray-100);
    border-color: var(--bs-gray-100);
    color: var(--bs-gray-700);
    transition: color 0.2s ease;
}

.toast-notify {
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 20px;
    display: none;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
    position: fixed;
    z-index: 9999;
    max-width: 400px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* ✅ Success (Top-Right) */
.toast-notify.top-right {
    top: 20px;
    right: 20px;
}

/* ✅ Error (Centered) */
.toast-notify.center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ✅ Toast Message */
.toast-notify .toast-message {
    flex-grow: 1;
}

.toast-notify .toast-actions .btn-ok {
    background-color: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
}

div.alert {
    display: none;
}

.form-control-solid {
    border-color: var(--border-color) !important;
}

.form-select-solid {
    border-color: var(--border-color) !important;
}

.btn-gray {
    background-color: var(--button-light);
    color: var(--text-black);
    min-width: 120px;
}

.btn-gray:hover {
    background-color: var(--button-light-hover);
    color: var(--text-black);
}

.btn-graysm {
    background-color: var(--button-light);
    color: var(--text-black);
}

.btn-graysm:hover {
    background-color: var(--button-light-hover);
    color: var(--text-black);
}

.table:not(.table-bordered).table-row-dashed tr {
    border-bottom-color: var(--table-line);
    height: 55px;
}

.btn-primary {
    min-width: 120px;
}

.icon-delete {
    bottom: 20px;
    left: 25px !important;
}

.select2-container .select2-dropdown {
	background-color: #F8F8F8;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	border: none;
	border-radius: 0.5rem;
}

/* ✅ ปรับ input และขอบ */
.ts-wrapper.single .ts-control {
	border: 1px solid var(--border-color);
	border-radius: 0.475rem;
	background-color: #f5f8fa;
	min-height: 42px;
	padding: 0.375rem 0.75rem;
	font-size: 14px;
	color: #181c32;
	box-shadow: none;
}

/* ✅ ปรับ dropdown */
.ts-dropdown {
	border-radius: 0.475rem;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
	border: 1px solid #e4e6ef;
	z-index: 1055;
}

/* ✅ hover / active item */
.ts-dropdown .option:hover,
.ts-dropdown .option.active {
	background-color: #f1faff;
	color: #0d6efd;
}

/* ✅ ตัวเลือกที่เลือกแล้ว */
.ts-control .item {
	border-radius: 0.25rem;
	padding: 0.25rem 0.5rem;
	font-size: 14px;
    color: var(--bs-gray-700);
}

.flatpickr-input:invalid {
	border-color: #f1416c !important; /* แดง Bootstrap */
}

input[readonly] {
    background-color: #E9E9E9 !important;
}

.readonly {
    background-color: #E9E9E9 !important;
}

.label-info {
    display: inline-block;
    margin-right: 50px;
}

.status-normal {
    display: inline-block;
    color: green;
}

textarea[readonly].form-control {
    resize: none;
    background-color: #E9E9E9 !important;
}

.tb-full {
    width: 100%;
}

.customer-action .btn-sm {
    margin-right: 10px;
}

.image-upload-box {
    width: 100%;
}

.image-preview {
    width: 100%;
    height: 120px;
    border: 2px dashed #ccc;
    background-color: #f5f5f5;
    border-radius: 6px;
    position: relative;
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    display: none;
}

.image-preview.has-image {
    border-style: solid;
    background-color: #fff;
}

.upload-loading {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #666;
    z-index: 5;
}

.placeholder-text {
    color: #999;
    font-size: 14px;
}

.btn-upload-image:hover,
.btn-upload-image:focus {
    color: #fff !important;
}

/* Responsive: 3 buttons per row on wider screens */
@media (min-width: 768px) {
    .car-btn {
        flex: 1 1 calc(33.333% - 12px);
    }
}

@media (max-width: 768px) {
    .car-section {
        margin-top: 25px;
    }
    .car-btn {
        max-width: 132px;
    }
}

#kt_app_header_menu_wrapper {
    margin-left: -190px;
}

.gallery-image {
    width: 100%;
    aspect-ratio: 1 / 1;          /* กรอบสี่เหลี่ยมเท่ากันทุกใบ */
    display: flex;
    align-items: center;          /* กลางแนวตั้ง */
    justify-content: center;      /* กลางแนวนอน */
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 10px;
}

/* กรณี ImageBox output เป็น <img> */
.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;            /* ครอบเต็มกรอบ */
    object-position: center;      /* กึ่งกลางภาพ */
}
