/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Glassmorphism utilities */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Animations */
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.toast-enter {
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
.toast-exit {
  animation: fadeOut 0.3s ease-in forwards;
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.page-enter {
  animation: fadeInScale 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Input fields custom focus (Vanilla CSS conversion) */
.input-field {
  width: 100%;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0; /* border-slate-200 */
  background-color: rgba(255, 255, 255, 0.5); /* bg-white/50 */
  transition: all 0.2s;
  outline: none;
  color: #334155; /* text-slate-700 */
}
.input-field:focus {
  background-color: #ffffff; /* focus:bg-white */
  border-color: #3b82f6; /* focus:border-primary-500 */
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2); /* focus:ring-2 focus:ring-primary-500/20 */
}

.btn-primary {
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  background-color: #2563eb; /* bg-primary-600 */
  color: #ffffff;
  font-weight: 500;
  transition: background-color 0.2s;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05), 0 4px 6px -1px rgba(37, 99, 235, 0.3); /* shadow-sm shadow-primary-600/30 */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
}
.btn-primary:hover {
  background-color: #1d4ed8; /* hover:bg-primary-700 */
}
.btn-primary:active {
  background-color: #1e40af; /* active:bg-primary-800 */
}

.btn-secondary {
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  background-color: #ffffff;
  border: 1px solid #e2e8f0; /* border-slate-200 */
  color: #334155; /* text-slate-700 */
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
}
.btn-secondary:hover {
  background-color: #f8fafc; /* hover:bg-slate-50 */
  color: #0f172a; /* hover:text-slate-900 */
}
.btn-secondary:active {
  background-color: #f1f5f9; /* active:bg-slate-100 */
}

.animate-fade-in {
  animation: fadeInScale 0.3s ease forwards;
}

/* ==========================================
 * A4 列印報表樣式（直式 A4）
 * ========================================== */
.a4-report {
  font-family: '標楷體', 'DFKai-SB', 'BiauKai', 'KaiTi', 'serif';
  font-size: 10.5px;
  color: #000;
  width: 100%;
  font-weight: normal;
}
.a4-report .co-name {
  text-align: center;
  font-size: 17px;
  font-weight: bold;
  letter-spacing: 2px;
  margin-bottom: 2px;
  color: #000;
}
.a4-report .rpt-title {
  text-align: center;
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 6px;
  color: #000;
}
.a4-report .rpt-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: normal;
  color: #000;
}
.a4-report table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.a4-report th {
  border: 1px solid #000;
  padding: 3px 2px;
  text-align: center;
  vertical-align: middle;
  font-size: 10px;
  font-weight: bold;
  line-height: 1.4;
  word-break: break-all;
  background: #f0f0f0;
  color: #000;
}
.a4-report td {
  border: 1px solid #000;
  padding: 2px 3px;
  vertical-align: middle;
  word-break: break-all;
  white-space: normal;
  overflow-wrap: break-word;
  min-height: 2.6em;
  height: 2.6em;
  line-height: 1.4;
  font-size: 11.5px;
  font-weight: normal;
  color: #000;
}
.a4-report td.center  { text-align: center; }
.a4-report td.left    { text-align: left; }
.a4-report td.right   { text-align: right; }
/* 六日變淺橘色 */
.a4-report tr.weekend td { background: #fff4e5; }
.a4-report td.total-label {
  text-align: right;
  font-weight: bold;
  padding-right: 8px;
  background: #f5f5f5;
  color: #000;
  font-size: 11px;
}
.a4-report td.total-hours {
  font-weight: bold;
  font-size: 12px;
  text-align: center;
  background: #f5f5f5;
  color: #000;
}
.a4-report td.stamp-cell {
  background: #fafafa;
}

/* 各欄寬（直式 A4 = ~190mm 可用，共8欄） */
.a4-report .col-date  { width: 10%; text-align: center; }
.a4-report .col-loc   { width: 14%; text-align: left; }
.a4-report .col-slots { width: 24%; text-align: left; }
.a4-report .col-rsn   { width: 17%; text-align: left; }
.a4-report .col-inst  { width: 8%;  text-align: center; font-size: 10px; }
.a4-report .col-hrs   { width: 6%;  text-align: center; }
.a4-report .col-cfm   { width: 11%; text-align: center; font-size: 10px; }
.a4-report .col-apv   { width: 10%; text-align: center; }

@media print {
  body > * { display: none !important; }
  #print-overlay { display: block !important; }
  #print-overlay * { display: revert !important; }
  #print-overlay .no-print { display: none !important; }
  @page { size: A4 portrait; margin: 10mm 12mm; }
}
