:root{
  --bg:#f6f8fb;
  --card:#ffffff;
  --muted:#6b7280;
  --primary:#0b74de;
  --accent:#0b74de;
  --danger:#e02424;
  --success:#16a34a;
  --radius:8px;
  --shadow: 0 6px 18px rgba(15,23,42,0.06);
  --max-width:1200px;
  --gap:16px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font-sans);
  background:linear-gradient(180deg,var(--bg),#eef3fb);
  color:#0f172a;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.45;
  padding:24px;
}

/* Layout container */
.container{
  max-width:var(--max-width);
  margin:0 auto;
  padding:20px;
  
}

/* Header / Nav */
.app-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:20px;
}
.brand{
  display:flex;
  align-items:center;
  gap:12px;
}
.brand .logo {
  width:55px;
  height:55px;
  background-image: url("/images/logoWsTU.png"); 
  border: 2px solid #e02424;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 50px 50px;
  padding:  20px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-weight:500;
  box-shadow:var(--shadow);
}
.brand h1{
  margin:0;
  font-size:18px;
  letter-spacing:0.2px;
}
.header-actions{display:flex;gap:8px;align-items:center}

/* Card */
.card{
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:18px;
  margin-bottom:var(--gap);
}

/* Grid */
.grid{
  display:grid;
  grid-template-columns:1fr 360px;
  gap:var(--gap);
}
@media (max-width:980px){ .grid{grid-template-columns:1fr} }

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:8px;
  border:0;
  cursor:pointer;
  font-weight:600;
  background:var(--primary);
  color:#fff;
  box-shadow:0 6px 14px rgba(11,116,222,0.12);
}
.btn.ghost{background:transparent;color:var(--primary);box-shadow:none;border:1px solid rgba(11,116,222,0.12)}
.btn.danger{background:var(--danger);box-shadow:0 6px 14px rgba(224,36,36,0.12)}
.btn.small{padding:6px 8px;font-size:13px;border-radius:6px}

/* Table */
.table{
  width:100%;
  border-collapse:collapse;
  font-size:14px;
}
.table thead tr{background:#f3f6fb}
.table th, .table td{
  padding:12px 10px;
  text-align:left;
  border-bottom:1px solid #eef2f7;
}
.table tbody tr:hover{background:#fbfdff}

/* Form */
.form-row{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.form-field{flex:1;min-width:180px}
label{display:block;font-size:13px;color:var(--muted);margin-bottom:6px}
input[type="text"], input[type="email"], input[type="number"], input[type="date"], select, textarea{
  width:100%;
  padding:10px 12px;
  border-radius:8px;
  border:1px solid #e6eef8;
  background:#fff;
  font-size:14px;
  outline:none;
}
textarea{min-height:100px;resize:vertical}
input:focus, select:focus, textarea:focus{box-shadow:0 6px 18px rgba(11,116,222,0.06);border-color:var(--accent)}

/* Modal */
.modal-backdrop{
  position:fixed;inset:0;background:rgba(2,6,23,0.45);display:none;align-items:center;justify-content:center;padding:20px;z-index:60;
}
.modal{
  width:100%;max-width:760px;background:var(--card);border-radius:12px;padding:18px;box-shadow:0 20px 60px rgba(2,6,23,0.3);
}

/* Small UI helpers */
.kv{font-size:13px;color:var(--muted)}
.row{display:flex;gap:12px;align-items:center}
.badge{display:inline-block;padding:6px 8px;border-radius:999px;font-size:12px;background:#f1f5f9;color:#0f172a}
.img-thumb{width:60px;height:40px;object-fit:cover;border-radius:6px;border:1px solid #eef2f7}

/* Footer */
.app-footer{margin-top:20px;text-align:center;color:var(--muted);font-size:13px}

/* Responsive tweaks */
@media (max-width:640px){
  .brand h1{font-size:16px}
  .btn{padding:8px 10px}
  .table th, .table td{padding:10px 8px}
}
.links {
    display: inline-flex;
    flex-direction:column;
    gap: 20px;
    padding: 20px;
   
}

.style1 {
  display: inline-block;
  padding: 12px 24px;
  width: 150px;
  height: 60px;
  margin: 8px;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  background-color: #e9ecef;
  color: #212529;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  cursor: pointer;
  text-transform: none;
}
.style1:hover {
  background-color: #dee2e6;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}
.style1:active {
  background-color: #ced4da;
  transform: translateY(0px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.style1:focus-visible {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}
.style2 {
  display: inline-block;
  padding: 14px 28px;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  background-image: linear-gradient(to right, #6a11cb 0%, #2575fc 100%);
  color: #ffffff;
  font-weight: 600;
  font-size: 1.05rem;
  border-radius: 30px;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-position 0.5s ease;
  background-size: 150% auto;
  background-position: 0% 0%;
  cursor: pointer;
  text-align: center;
}
.style2:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.2);
  background-position: 100% 0%;
}
.style2:active {
  transform: translateY(0px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  background-position: 50% 0%;
}
.style2:focus-visible {
  outline: 2px solid #80bdff;
  outline-offset: 2px;
}
.style3 {
  display: inline-block;
  padding: 12px 25px;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  background-color: #e74c3c;
  color: #ffffff;
  font-weight: 500;
  font-size: 1rem;
  border-radius: 6px;
  border: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: background-color 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.style3:hover {
  background-color: #c0392b;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.style3:active {
  background-color: #a93226;
  transform: translateY(0px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.style3:focus-visible {
  outline: 2px solid #f1948a;
  outline-offset: 2px;
}
ul li {
  list-style-type: none;
}
ul {
  column-count: 2;
  column-gap: 10px;
  padding: 0;
}
/* Navbar */
.navbar {
  background-color: #333333;
  color: white;
  height: 30px;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Menu links */
.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
}

.nav-links li a {
  color: white;
  text-decoration: none;
}

/* Hamburger icon */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.hamburger span {
  height: 3px;
  width: 25px;
  background: white;
  margin: 1px 0;
  transition: 0.3s;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 60px;
    right: 0;
    background: #333;
    flex-direction: column;
    width: 200px;
    display: none;
    padding: 20px;
  }

  .nav-links.active {
    display: flex;
  }

  .hamburger {
    display: flex;
  }
}
.btn-home {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 22px;
}

.btn-home:hover {
  background: #273c75;
}
.profile-section {
  background: #f8f9fa;
  padding: 5px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  
  
}
/* public/css/main.css */
.money-input {
    text-align: right;           /* ตัวเลขการเงินควรชิดขวา */
    font-family: 'Courier New', monospace; /* ออปชันเสริม: ช่วยให้หลักตัวเลขตรงกัน */
    font-weight: bold;
    color: #2c3e50;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border-left: 5px solid #3498db;
}

.stat-card h3 { font-size: 0.9rem; color: #7f8c8d; margin-bottom: 10px; }
.stat-card .value { font-size: 1.5rem; font-weight: bold; color: #2c3e50; }

.stat-card.success { border-left-color: #2ecc71; }
.stat-card.warning { border-left-color: #f1c40f; }
.stat-card.danger { border-left-color: #e74c3c; }

.badge.danger {
    background-color: #fdeaea;
    color: #dc3545;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
}
.charts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 30px 0;
}

.chart-item {
    flex: 1;
    min-width: 300px;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.chart-item.full-width {
    flex: 1 1 100%; /* กราฟแท่งให้กว้างเต็มหน้าจอ */
}
.todo-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e2e8f0;
}
.todo-container {
    max-height: 300px;
    overflow-y: auto;
}
.todo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    margin-bottom: 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.todo-item.danger { border-left: 4px solid #ef4444; }
.todo-item.info { border-left: 4px solid #3b82f6; }
/* เอฟเฟกต์เมื่อเอาเมาส์ไปวางที่รูปภาพ */
.photo-card:hover {
  transform: scale(1.05);
  border-color: #3498db;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
}

#existingPhotos {
  background-color: #f9f9f9;
  padding: 15px;
  border-radius: 10px;
}

  /* ซ่อนปฏิทินวันที่เมื่อเลือกรายปี */
  .only-year-view .flatpickr-innerContainer,
  .only-year-view .flatpickr-weekdays {
    display: none !important;
  }
  .only-year-view .flatpickr-month {
    height: 75px;
    padding-top: 10px;
  }
.stat-card.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card.clickable:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    border-color: #007bff;
}

.stat-link {
    font-size: 0.75rem;
    color: #007bff;
    margin-top: 10px;
    text-align: right;
    font-weight: bold;
}

.stat-card.success { border-left: 5px solid #28a745; }
/* เพิ่มใน css/main.css */
.btn-view {
    background-color: #f0f4f8;
    border: 1px solid #d1d9e6;
    color: #4a5568;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-view:hover {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.text-right { text-align: right; }
.text-center { text-align: center; }
.badge.bg-success { background-color: #28a745; color: white; }
.badge.bg-secondary { background-color: #6c757d; color: white; }
/* ปรับแต่ง Flatpickr Month Select ให้กว้างขึ้นรองรับ พ.ศ. */
.flatpickr-monthSelect-month {
    padding: 10px 5px !important;
}
.flatpickr-calendar.only-year-view .flatpickr-months .flatpickr-month {
    height: 60px;
}
.btn-view { background-color: #6c757d; color: white; border:none; padding:5px 10px; border-radius:4px; cursor:pointer; margin-right:5px; font-size: 0.8em; }
.btn-edit { background-color: #ffc107; color: black; border:none; padding:5px 10px; border-radius:4px; cursor:pointer; margin-right:5px; font-size: 0.8em; }
/* คลาสสำหรับปุ่มสีส้ม */
.btn-orange {
    background-color: #ff8c00 !important; /* สีส้ม DarkOrange */
    color: white !important;
    border: none;
}

.btn-orange:hover {
    background-color: #e67e00 !important; /* ส้มเข้มขึ้นเมื่อเอาเมาส์วาง */
    cursor: pointer;
}

/* กรณีต้องการให้ปุ่มขนาดเล็ก (small) ดูพอดี */
.btn.small {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}