

/* =========================
   GLOBAL FORM THEME
   Trinergymedia
========================= */

.tm-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ----- Group ----- */
.tm-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ----- Label ----- */
.tm-form label {
  font-size: 13px;
  font-weight: 500;
  color: #9ca3af;
  letter-spacing: .2px;
}

/* ===== HARD OVERRIDE (ชนะ dashboard.css) ===== */
.tm-form input,
.tm-form select,
.tm-form textarea {
  background: linear-gradient(
    180deg,
    #020617,
    #020617cc
  ) !important;

  border: 1px solid #1e293b !important;
  border-radius: 14px !important;
  padding: 12px 14px !important;
  font-size: 14px !important;
  color: #e5e7eb !important;
  outline: none !important;
}

/* Placeholder */
.tm-form input::placeholder {
  color: #64748b;
}

/* Focus Glow */
.tm-form input:focus,
.tm-form select:focus,
.tm-form textarea:focus {
  border-color: #38bdf8 !important;
  box-shadow:
    0 0 0 1px rgba(56,189,248,.4),
    0 0 18px rgba(56,189,248,.25) !important;
}

/* Readonly */
.tm-form input[readonly] {
  background: linear-gradient(
    180deg,
    #020617aa,
    #02061766
  ) !important;
  color: #38bdf8 !important;
  cursor: not-allowed;
}

/* Highlight */
.tm-form .highlight input {
  color: #f59e0b !important;
  font-weight: 600;
  box-shadow: 0 0 16px rgba(245,158,11,.15);
}

/* ----- Grid ----- */

.tm-form .grid-2 {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 24px;
  align-items: start;
}

.tm-form .grid-2 > .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 !important;
}

/* Label alignment fix */
.tm-form .grid-2 label {
  min-height: 18px;
  line-height: 1.2;
}


/* Compact mileage section */
.tm-form .form-section {
  padding: 22px 24px;
}


/* ----- Button ----- */
.tm-form .btn-primary {
  margin-top: 15px;
  padding: 14px;
  border-radius: 14px;
  border: none;
  font-weight: 600;
  font-size: 15px;
  color: #020617;
  cursor: pointer;

  background: linear-gradient(135deg, #38bdf8, #22d3ee);
  box-shadow:
    0 8px 24px rgba(56,189,248,.35),
    inset 0 1px 0 rgba(255,255,255,.25);
}

.tm-form .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(56,189,248,.45);
}

/* ===== FORM SECTION ===== */
/* ===== ENHANCED FORM SECTION ===== */
.tm-form .form-section {
  background:
    linear-gradient(
      180deg,
      rgba(15,23,42,.9),
      rgba(2,6,23,.85)
    );

  border: 1px solid rgba(56,189,248,.15);
  border-radius: 20px;
  padding: 26px;
  margin-bottom: 26px;

  box-shadow:
    0 20px 40px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.04);
}

.tm-form .form-section-title {
  font-size: 25px;
  font-weight: 600;
  color: #38bdf8;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}




/* ===== DATE / FLATPICKR FIX ===== */
.tm-form input[type="date"],
.tm-form .flatpickr-input {
  background: linear-gradient(
    180deg,
    #020617,
    #020617cc
  ) !important;

  border: 1px solid #1e293b !important;
  color: #e5e7eb !important;
}

/* ===== BETTER VERTICAL RHYTHM ===== */
.tm-form .form-group {
  gap: 8px;
}

.tm-form .form-group + .form-group {
  margin-top: 10px;
}


/* =========================
   MILEAGE PAGE BACKGROUND FIX
========================= */

.page-mileage {
  background: radial-gradient(
    circle at top,
    #0b1220,
    #020617
  );
}

/* card หลัก */
.page-mileage .card {
  background: transparent !important;
  box-shadow: none;
  padding: 0;
}

/* ให้ form-section เป็นตัว card จริง */
.page-mileage .form-section {
  margin-left: 0;
  margin-right: 0;
}

.page-mileage {
  min-height: calc(100vh - 120px);
}



/* กันพื้นที่ขาวจาก body */
.page-mileage + footer,
.page-mileage footer {
  background: transparent;
}

/* =========================
   FINAL WHITE BACKGROUND KILL
========================= */

.page-mileage {
  background: radial-gradient(circle at top, #0b1220, #020617) !important;
  min-height: 100vh;
}

/* dashboard-wrapper ของระบบเดิมมักเป็นสีขาว -> ต้องทับ */
.page-mileage .dashboard-wrapper {
  background: transparent !important;
}

/* card ชั้นนอกไม่ต้องมีพื้นหลัง */
.page-mileage .card {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

body.page-mileage-body {
  background: radial-gradient(circle at top, #0b1220, #020617) !important;
}

/* =========================
   CONTENT WIDTH CONTROL
   Mileage Claim
========================= */

.page-mileage .dashboard-wrapper {
  max-width: 1100px;   /* ปรับได้: 1000 / 1100 / 1200 */
  margin: 0 auto;      /* จัดกึ่งกลาง */
  padding-left: 24px;
  padding-right: 24px;
}


.page-mileage .page-title {
  color: #38bdf8;
  font-weight: 700;
  letter-spacing: .3px;

  text-shadow:
    0 0 12px rgba(56,189,248,.35),
    0 0 28px rgba(56,189,248,.15);
}

.page-mileage .btn-primary {
  width: 260px;
  align-self: center;
  padding: 12px 0;

  letter-spacing: .3px;
  text-transform: uppercase;
}

/* =========================
   SELECT DROPDOWN DARK MODE
========================= */

/* ตัว select */
.page-mileage select {
  background-color: #020617 !important;
  color: #e5e7eb !important;
}

/* option ภายใน dropdown */
.page-mileage select option {
  background-color: #020617 !important;
  color: #e5e7eb !important;
}

/* option ที่ hover / เลือก */
.page-mileage select option:hover,
.page-mileage select option:checked {
  background-color: #1e293b !important;
  color: #38bdf8 !important;
}

/* =========================
   MILEAGE PAGE WIDTH FIX
========================= */

.page-mileage .dashboard-wrapper {
  max-width: 960px;      /* ปรับได้ 900–1000 */
  margin: 0 auto;
}


/* =========================
   GRID 3 COLUMNS (Mileage)
========================= */

.tm-form .grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr; /* Total กว้างนิดนึง */
  gap: 24px;
  align-items: end;
}

/* จัด label + input ให้เรียบร้อย */
.tm-form .grid-3 .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tm-form .grid-3 .form-group label {
  min-height: 18px;
  line-height: 1.2;
}

.tm-form input[type="number"] {
  height: 48px;
}

/* Total เด่นกว่า */
.tm-form .grid-3 .form-group:last-child input {
  color: #f59e0b !important;
  font-weight: 600;
  text-align: right;
}

/* Mobile: เรียงลง */
@media (max-width: 900px) {
  .tm-form .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* =========================
   Latest Mileage Claims
========================= */
.mileage-latest table {
  width: 100%;
  border-collapse: collapse;
}

.mileage-latest thead th {
  background: rgba(56, 189, 248, 0.15); /* ฟ้าใส */
  color: #e5f6ff;
  font-weight: 600;
  padding: 10px;
  text-align: left;
}

.mileage-latest tbody td {
  color: #e5e7eb; /* เทาอ่อน อ่านชัด */
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.mileage-latest tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.03);
}

.mileage-latest tbody tr:hover {
  background: rgba(56,189,248,0.12);
}

/* link ด้านล่าง */
.mileage-latest .btn-link,
.mileage-latest a {
  color: #38bdf8;
}

.mileage-latest .card-header h3 {
  color: #38bdf8;
}

.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}

.pagination a {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  color: #cbd5e1;
  text-decoration: none;
}

.pagination a.active {
  background: #38bdf8;
  color: #020617;
  font-weight: 600;
}

.pagination a.disabled {
  opacity: .4;
  pointer-events: none;
}

/* ===== Fix datetime-local picker on dark theme ===== */
input[type="datetime-local"] {
  color-scheme: light; /* ⭐ บังคับให้ picker เป็นสีสว่าง */
}

input[type="datetime-local"] {
  background-color: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

input[type="datetime-local"]:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.85;
  cursor: pointer;
}

/* =========================
   GLOBAL BACKGROUND FIX
========================= */
html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: radial-gradient(circle at top, #0b1220, #020617);
  color: #e5e7eb;
}

/* =========================
   OT Latest Table
========================= */

.table-ot {
  width: 100%;
  border-collapse: collapse;
}

.table-ot thead th {
  background: rgba(56,189,248,.15);
  color: #e5f6ff;
  font-weight: 600;
  padding: 12px;
  text-align: left;
}

.table-ot tbody td {
  padding: 12px;
  color: #e5e7eb;
  border-top: 1px solid rgba(255,255,255,.08);
}

.table-ot tbody tr:nth-child(even) {
  background: rgba(255,255,255,.03);
}

.table-ot tbody tr:hover {
  background: rgba(56,189,248,.12);
}

/* Amount */
.table-ot td.amount {
  text-align: right;
  font-weight: 600;
  color: #facc15;
}

/* Badge */
.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-green {
  background: rgba(34,197,94,.15);
  color: #22c55e;
}

.badge-blue {
  background: rgba(56,189,248,.15);
  color: #38bdf8;
}

/* =========================
   OT SUBMIT BUTTON FIX
========================= */

.ot-submit-wrapper {
  display: flex;
  justify-content: center;
  margin: 30px 0 10px;
}

.btn-ot-submit {
  width: 320px;              /* ⭐ ปรับได้ 280–360 */
  max-width: 90%;
  padding: 14px 0;
  font-size: 15px;
  letter-spacing: .3px;
   background: linear-gradient(135deg, #22d3ee, #38bdf8);
   align-self: center;
}

/* =========================
   OT PAGE WIDTH CONTROL
========================= */

body.page-ot-body .dashboard-wrapper {
  max-width: 1100px;      /* ⭐ ปรับได้ 1000 / 1100 / 1200 */
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* card ภายในไม่ให้ดันเต็ม */
body.page-ot-body .card {
  width: 100%;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

.btn-danger:hover {
  box-shadow: 0 0 12px rgba(239,68,68,.5);
}

/* ===== Fix calendar icon color (Chrome) ===== */
input[type="month"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.2);
  cursor: pointer;
  opacity: 0.85;
}
