/* =================================================
   GLOBAL THEME
================================================= */

:root{
  --bg-main:#0A0F2C;
  --bg-card:#121A3A;
  --bg-hover:#1B2550;

  --primary:#2563eb;
  --primary-glow:#3b82f6;

  --text-main:#E5E7EB;
  --text-sub:#9CA3AF;

  --border:#1F2A5A;
}

/* =================================================
   BASE
================================================= */

html, body {
  height: 100%;
  overflow: hidden;
}

*{
  box-sizing:border-box;
}

body{
  margin:0;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
  background:linear-gradient(135deg,#050816,#0A0F2C);
  color:var(--text-main);
  overflow-y:auto;
}


/* =================================================
   APP LAYOUT
================================================= */

.app{
  display:flex;
  min-height:100vh;
}

/* =================================================
   MAIN CONTENT
================================================= */

.main{
  flex:1;
  padding:30px;
  min-height:100vh;
  background:transparent;
  overflow-x:auto;
}

.main h1{
  margin-bottom:6px;
  color:#ffffff;
}

.main p{
  margin-top:0;
  margin-bottom:25px;
  color:var(--text-sub);
}

/* =================================================
   DASHBOARD CARDS
================================================= */

.cards{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:20px;
  margin-top:20px;
  
}

.cards .card{
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.cards .card h4{
  margin:0;
  font-size:14px;
  color:#e5e7eb;
  font-weight:500;
}

.cards .card strong{
  display:block;
  margin-top:6px;
  font-size:28px;
  font-weight:700;
  color:#8EB5DE;
}

.cards .icon{
  font-size:28px;
  opacity:.8;
}

/* สี card */

.cards .card:nth-child(1){
  border-left:5px solid #3b82f6;
}

.cards .card:nth-child(2){
  border-left:5px solid #0ea5e9;
}

.cards .card:nth-child(3){
  border-left:5px solid #22c55e;
}

.cards .card:nth-child(4){
  border-left:5px solid #6366f1;
}

.card{
  background:rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:16px;
  padding:20px;
  justify-content:space-between;
  align-items:center;
  transition:all .25s ease;
  position:relative;
  overflow:hidden;
}



@keyframes fadeUp{
  to{
    opacity:1;
    transform:translateY(0);
  }
}
/* =================================================
   CARD
================================================= */

.card:hover{
  transform:translateY(-4px);
  box-shadow:0 0 30px rgba(37,99,235,0.35);
}

/* =================================================
   TABLE
================================================= */

.table-wrapper{
  width:100%;
  overflow-x:auto;
}

.table{
  width:100%;
  min-width:1200px;
  border-collapse:collapse;
  background:var(--bg-card);
  border:1px solid var(--border);
}

th,td{
  padding:12px;
  border-bottom:1px solid var(--border);
  text-align:left;
  font-size:14px;
  white-space:nowrap;
}

th{
  color:#93c5fd;
  font-weight:600;
  background:#0f172a;
}

td{
  color:var(--text-main);
}

tr{
  transition:0.15s;
}

tr:hover{
  background:#1B2550;
  box-shadow:inset 3px 0 0 #3b82f6;
}

/* =================================================
   BADGE STATUS
================================================= */

.badge{
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:500;
  color:#fff;
  box-shadow:0 0 6px rgba(255,255,255,0.2);
}

.status-RECEIVED{ background:#64748b; }
.status-REPAIRING{ background:#f59e0b; }
.status-FOREIGN_CONTACT{ background:#0ea5e9; }
.status-QUOTATION{ background:#8b5cf6; }
.status-APPROVED{ background:#22c55e; }
.status-WAITING_PART{ background:#a16207; }
.status-WAITING_CLAIM{ background:#ec4899; }
.status-DONE{ background:#16a34a; }
.status-CANCELLED{ background:#dc2626; }

/* =================================================
   ACTION MENU
================================================= */

.action-cell{
  position:relative;
  text-align:center;
}

.action-btn{
  background:transparent;
  border:none;
  font-size:22px;
  cursor:pointer;
  padding:4px 8px;
  border-radius:6px;
  line-height:1;
  color:#93c5fd;
}

.action-btn:hover{
  background:#1e293b;
}

.action-dropdown{
  position:absolute;
  right:8px;
  top:32px;
  min-width:150px;

  background:#0f172a;
  border:1px solid var(--border);
  border-radius:10px;

  box-shadow:0 10px 30px rgba(0,0,0,0.5);

  visibility:hidden;
  opacity:0;
  pointer-events:none;

  transform:translateY(-4px);
  transition:all .15s ease;

  z-index:9999;
}

.action-dropdown a{
  display:block;
  padding:10px 14px;
  font-size:14px;
  color:#e5e7eb;
  text-decoration:none;
}

.action-dropdown a:hover{
  background:#1e293b;
}

.action-dropdown a.danger{
  color:#f87171;
}

.action-dropdown a.danger:hover{
  background:#7f1d1d;
}

.action-menu.open .action-dropdown{
  visibility:visible;
  opacity:1;
  pointer-events:auto;
  transform:translateY(0);
}

/* =================================================
   PAGINATION
================================================= */

.pagination{
  display:flex;
  gap:6px;
  margin-top:20px;
}

.pagination a{
  padding:6px 10px;
  border:1px solid var(--border);
  border-radius:6px;
  text-decoration:none;
  font-size:14px;
  color:#cbd5f5;
  background:#0f172a;
}

.pagination a:hover{
  background:#1e293b;
}

.pagination a.active{
  background:linear-gradient(135deg,#2563eb,#3b82f6);
  color:#ffffff !important;
  border:none !important;
  font-weight:600;
  box-shadow:0 0 10px rgba(37,99,235,.6);
}

/* =================================================
   RESPONSIVE
================================================= */

@media (max-width:900px){

  .cards{
    grid-template-columns:1fr;
  }

}

/* ===== Graph Box ===== */
.box {
  background: linear-gradient(145deg, #020617, #0f172a);
  padding: 20px;
  border-radius: 14px;
  border: 1px solid #1e293b;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

/* หัวข้อ */
.box h3 {
  margin-bottom: 10px;
  font-weight: 600;
  color: #e2e8f0;
}

/* canvas */
#monthlyChart {
  margin-top: 10px;
}
/* ===== Year Filter ===== */
.year-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0f172a;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid #1e293b;
}

.year-filter label {
  color: #94a3b8;
  font-size: 14px;
}

.year-filter select {
  background: #020617;
  color: #fff;
  border: 1px solid #334155;
  padding: 6px 12px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  transition: 0.2s;
}

.year-filter select:hover {
  border-color: #3b82f6;
}

.year-filter select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.3);
}

/* ===== Custom Scrollbar ===== */

/* Chrome, Edge, Safari */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #020617; /* พื้นหลังเข้ม */
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  border-radius: 10px;
  border: 2px solid #020617; /* ทำให้มีขอบ */
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

/* ===== Firefox ===== */
* {
  scrollbar-width: thin;
  scrollbar-color: #3b82f6 #020617;
}

