* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #2f241d;
  background: linear-gradient(180deg, #fffaf3 0%, #f6ddbd 100%);
}
a {
  color: inherit;
  text-decoration: none;
}
.app {
  min-height: calc(100vh - 56px);
}
.site-header {
  background: #fffaf3;
  border-bottom: 1px solid #ead6bd;
}
.site-header-inner {
  width: min(100% - 40px, 1080px);
  margin: 0 auto;
  padding: 18px 0 20px;
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 20px;
  font-weight: 700;
  color: #6b3a18;
}
.nav-toggle {
  display: none;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid #ead6bd;
  border-radius: 999px;
  background: #fffaf3;
  color: #5a3a29;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.nav a {
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  color: #4b3528;
}
.nav a:hover {
  background: #f3dfcd;
}
.nav a.active {
  background: #f3ddc6;
  color: #6b3a18;
  font-weight: 700;
}
.nav-dropdown {
  position: relative;
}
.nav-dropdown-button {
  position: relative;
  min-height: 40px;
  padding: 10px 42px 10px 16px;
  border: 0;
  border-radius: 999px;
  background: #faddb3;
  color: #4b3528;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}
.nav-dropdown-button::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  transition: transform .2s ease;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%236b3a18' d='M5.23 7.21a.75.75 0 011.06.02L10 11.17l3.71-3.94a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E");
}
.nav-dropdown.active .nav-dropdown-button, .nav-dropdown.is-open .nav-dropdown-button, .nav-dropdown-button:hover {
  background: #f3ddc6;
  color: #6b3a18;
  font-weight: 700;
}
.nav-dropdown.is-open .nav-dropdown-button::after {
  transform: translateY(-50%) rotate(180deg);
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  padding: 8px;
  border: 1px solid #ead6bd;
  border-radius: 18px;
  background: #fffaf3;
  z-index: 9999;
}
.nav-dropdown.is-open .nav-dropdown-menu {
  display: grid;
  gap: 4px;
}
.nav-dropdown-menu a {
  display: block;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14px;
}
.nav-dropdown-menu a:hover, .nav-dropdown-menu a.active {
  background: #f3ddc6;
  color: #6b3a18;
  font-weight: 700;
}
.container {
  width: min(100% - 24px, 1180px);
  margin: 30px auto;
}
.card {
  width: 100%;
  background: rgba(255, 253, 249, 0.9);
  border: 1px solid #ead6bd;
  border-radius: 20px;
  padding: 22px 20px 28px;
}
.page-title {
  margin: 0 0 10px;
  font-size: 23px;
  line-height: 1.4;
  color: #2f241d;
}
.page-subtitle {
  margin: 0 0 24px;
  color: #6f5c4e;
  font-size: 14px;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.message {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #e6c7a8;
  background: #fff4e9;
  color: #7a321c;
  font-size: 14px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 48px;
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #a55d32 0%, #d28a4b 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover {
  opacity: 0.9;
}
.btn-secondary {
  background: linear-gradient(135deg, #7b6657 0%, #a78a72 100%);
}
.btn-small {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 13px;
  white-space: nowrap;
}
.full-btn {
  width: 100%;
}
.footer {
  min-height: 56px;
  display: grid;
  place-items: center;
  color: #8a7666;
  font-size: 12px;
  text-align: center;
}
/* dashboard */
.menu-grid {
  display: grid;
  gap: 14px;
}
.menu-card {
  display: block;
  padding: 18px;
  border: 1px solid #ead6bd;
  border-radius: 18px;
  background: rgba(255, 253, 249, 0.78);
}
.menu-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 17px;
  color: #4a2f1f;
}
.menu-card span {
  color: #7a6658;
  font-size: 14px;
}
/* punch */
.punch-list {
  display: grid;
  gap: 28px;
}
.punch-box {
  padding: 24px 18px 26px;
  border: 1px solid #ead6bd;
  border-radius: 18px;
  background: rgba(255, 253, 249, 0.78);
  text-align: center;
}
.punch-box span {
  display: block;
  margin-bottom: 12px;
  color: #7a6658;
  font-size: 14px;
}
.punch-box strong {
  display: block;
  margin-bottom: 26px;
  color: #2f241d;
  font-size: 24px;
  line-height: 1;
}
/* monthly */
.month-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 22px 0;
  flex-wrap: wrap;
}
.month-nav a {
  padding: 9px 14px;
  border: 1px solid #ead6bd;
  border-radius: 999px;
  background: #fffaf3;
  color: #5a3a29;
  font-size: 14px;
}
/* table */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrap table {
  width: 100%;
  min-width: 760px;
}
.table-wrap.table-md table {
  min-width: 880px;
}
.table-wrap.table-lg table {
  min-width: 1040px;
}
.table-wrap.table-xl table {
  min-width: 1180px;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #fffdf9;
}
th, td {
  padding: 12px 10px;
  border-bottom: 1px solid #ead6bd;
  text-align: center;
  font-size: 14px;
  vertical-align: middle;
}
th {
  background: #f4dfc8;
  color: #4a2f1f;
}
td {
  color: #3b3028;
}
.inline-action-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.action-stack {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.monthly-action-form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
}
/* login */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(100%, 420px);
  padding: 30px 24px;
  border: 1px solid #ead6bd;
  border-radius: 22px;
  background: rgba(255, 253, 249, 0.92);
}
.login-title {
  margin: 0 0 8px;
  font-size: 26px;
  color: #2f241d;
  text-align: center;
}
.login-subtitle {
  margin: 0 0 26px;
  color: #6f5c4e;
  font-size: 14px;
  text-align: center;
}
/* form */
.form-group {
  margin-bottom: 18px;
}
.form-label {
  display: block;
  margin-bottom: 8px;
  color: #4b3528;
  font-size: 14px;
  font-weight: 700;
}
.form-input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid #e0c5ab;
  border-radius: 14px;
  background: #fffaf3;
  color: #2f241d;
  font-size: 16px;
  outline: none;
}
.form-input:focus {
  border-color: #b87548;
}
select.form-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #fffaf3;
  border: 1px solid #e0c5ab;
  color: #4a2f1f;
  padding-right: 60px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath fill='%23705A48' d='M7 8L0 0h14z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 28px center;
  background-size: 14px;
}
select.form-input:focus {
  outline: none;
  border-color: #c57a45;
  background-color: #fffdf9;
}
select.form-input option {
  background: #fffaf3;
  color: #4a2f1f;
}
.custom-select {
  position: relative;
  width: 100%;
}
.custom-select-hidden {
  display: none;
}
.select-selected {
  width: 100%;
  min-height: 56px;
  padding: 14px 24px;
  border: 1px solid #e0c5ab;
  border-radius: 14px;
  background: #fffaf3;
  color: #4a2f1f;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.select-selected::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid #7a6658;
  border-bottom: 2px solid #7a6658;
  transform: rotate(45deg);
  margin-right: 6px;
}
.custom-select.active .select-selected::after {
  transform: rotate(-135deg);
}
.select-items {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fffaf3;
  border: 1px solid #e0c5ab;
  border-radius: 14px;
  overflow: hidden;
  z-index: 9999;
}
.custom-select.active .select-items {
  display: block;
}
.select-option {
  padding: 14px 24px;
  cursor: pointer;
  transition: .15s;
  background: #fffaf3;
  color: #4a2f1f;
}
.select-option:hover {
  background: #f7eadc;
}
.select-option.active {
  background: #f3ddc6;
  color: #6b3a18;
  font-weight: 700;
}
/* error */
.form-error-box {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #e8b5a0;
  border-radius: 14px;
  background: #fff1e8;
  color: #8a321c;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}
.form-error-box ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.form-error-box li + li {
  margin-top: 6px;
}
.form-input.is-error, .custom-select.is-error .select-selected {
  border-color: #d36b45;
  background: #fff7f2;
}
.form-field-error {
  display: none;
  margin-top: 7px;
  color: #a53a20;
  font-size: 13px;
  font-weight: 700;
}
.form-field-error.is-show {
  display: block;
}
/* summary */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 22px 0;
}
.summary-card {
  padding: 14px;
  border: 1px solid #ead6bd;
  border-radius: 16px;
  background: rgba(255, 253, 249, 0.78);
}
.summary-card span {
  display: block;
  margin-bottom: 6px;
  color: #7a6658;
  font-size: 13px;
  font-weight: 700;
}
.summary-card strong {
  display: block;
  color: #3f2a1d;
  font-size: 22px;
  line-height: 1.2;
}
/* leave alert */
.leave-alert {
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
}
.leave-alert-warning {
  border: 1px solid #e2b36f;
  background: #fff4dc;
  color: #7a4a10;
}
.leave-alert-danger {
  border: 1px solid #df9b8d;
  background: #fff0eb;
  color: #8a2d1f;
}
/* responsive */
@media (min-width: 769px) {
  .container {
    width: min(100% - 48px, 1180px);
  }
  .punch-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}
@media (max-width: 768px) {
  .site-header-inner {
    width: calc(100% - 24px);
    padding: 14px 0;
  }
  .header-top {
    align-items: center;
  }
  .logo {
    margin-bottom: 0;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .nav {
    display: none;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid #ead6bd;
    border-radius: 18px;
    background: rgba(255, 253, 249, 0.86);
  }
  .nav.is-open {
    display: grid;
    gap: 8px;
  }
  .nav a, .nav-dropdown-button {
    width: 100%;
    justify-content: flex-start;
    border-radius: 14px;
  }
  .nav-dropdown {
    width: 100%;
  }
  .nav-dropdown-menu {
    position: static;
    min-width: 0;
    margin-top: 8px;
    border-radius: 14px;
  }
  .container {
    width: calc(100% - 16px);
    margin: 12px auto 32px;
  }
  .card {
    padding: 18px 14px 22px;
    border-radius: 18px;
  }
  .page-title {
    font-size: 21px;
  }
  .page-header {
    align-items: stretch;
  }
  .page-actions, .page-actions .btn {
    width: 100%;
  }
  .page-actions .btn {
    min-width: 0;
  }
  th, td {
    padding: 10px 8px;
    font-size: 13px;
  }
  .monthly-action-form {
    flex-direction: column;
    gap: 6px;
  }
  .monthly-action-form .monthly-select {
    width: 132px;
    min-width: 132px;
  }
  .monthly-action-form .btn-small, .monthly-request-cell .btn-small {
    width: 72px;
    min-width: 72px;
  }
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .summary-card {
    padding: 12px;
  }
  .summary-card strong {
    font-size: 19px;
  }
}
.page-top {
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  right: 20px;
  bottom: 80px;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #c57a45 0%, #e29a5c 100%);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(197, 122, 69, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity .25s ease, transform .25s ease, visibility .25s ease;
  z-index: 999;
}
.page-top span {
  display: block;
  width: 12px;
  height: 12px;
  border-top: 3px solid #fff;
  border-left: 3px solid #fff;
  transform: rotate(45deg) translate(2px, 2px);
  margin: 0;
}
.page-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(197, 122, 69, 0.45);
}
.page-top.is-show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
@media (max-width: 768px) {
  .page-top {
    right: 20px;
    bottom: 80px;
    width: 46px;
    height: 46px;
    font-size: 18px;
  }
}
.monthly-custom-select {
  width: 150px;
  min-width: 150px;
}

.monthly-custom-select .select-selected {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 12px;
}

.monthly-custom-select .select-items {
  min-width: 150px;
}

.monthly-custom-select .select-option {
  padding: 10px 12px;
  font-size: 13px;
}

@media (max-width: 768px) {
  .monthly-custom-select {
    width: 132px;
    min-width: 132px;
  }
}