/**
 * 主要樣式表
 * 薪俸資訊系統
 */

/* 引入報表和表單樣式 */
@import url("forms.css");
@import url("reports.css");

/* 全域設定 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #3b82f6; /* 柔和藍色 */
  --primary-hover: #2563eb; /* 較深的藍色 */
  --success-color: #22c55e; /* 清新綠色 */
  --warning-color: #f59e0b; /* 溫暖橙色 */
  --danger-color: #ef4444; /* 鮮明紅色 */
  --info-color: #06b6d4; /* 亮藍色 */
  --text-color: #111827; /* 深灰色文字 */
  --text-light: #6b7280; /* 淺灰色文字 */
  --border-color: #e5e7eb; /* 淺灰色邊框 */
  --bg-color: #f3f4f6; /* 柔和背景色 */
  --white: #ffffff; /* 純白 */
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 柔和陰影 */
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15); /* 較強陰影 */
}

body {
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  transition: all 0.3s ease;
}

/* 搜尋框樣式調整 */
.search-box {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-form .form-control {
  width: 300px;
  padding: 12px 16px;
  font-size: 16px;
}

/* 編輯區域樣式 */
.edit-section {
  background: var(--white);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.edit-section h3 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
}

/* 表單排版 */
.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

/* 登入頁面 */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #93c5fd 0%, #3b82f6 100%); /* 柔和漸層 */
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 480px;
  padding: 30px;
}

.login-box {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 48px;
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-header h1 {
  font-size: 32px;
  color: var(--primary-color);
  font-weight: 700;
  margin-bottom: 12px;
}

.login-header p {
  color: var(--text-light);
  font-size: 15px;
}

/* 表單樣式 */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--text-color);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 15px;
  background-color: #f9fafb;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* 驗證碼 */
.captcha-group {
  margin-bottom: 24px;
}

.captcha-container {
  display: flex;
  gap: 12px;
  align-items: center;
}

.captcha-input {
  flex: 1;
  text-transform: uppercase;
}

.captcha-display {
  padding: 12px 24px;
  background: #e0f2fe;
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 5px;
  color: var(--primary-color);
  user-select: none;
}

.btn-refresh-captcha {
  padding: 12px 16px;
  background: var(--info-color);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-refresh-captcha:hover {
  background: #0e7490;
  transform: scale(1.05);
}

/* 按鈕樣式 */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.btn, .btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-primary1 {
  background: var(--white);
  color: var(--primary-color);
}

.btn-primary1:hover {
  transform: translateY(-2px);
}

.btn-success {
  background: var(--success-color);
  color: var(--white);
  border-color: var(--success-color);
}

.btn-success:hover {
  background: #16a34a;
  border-color: #16a34a;
  transform: translateY(-2px);
}

.btn-info {
  background: var(--info-color);
  color: var(--white);
  border-color: var(--info-color);
}

.btn-info:hover {
  background: #0e7490;
  border-color: #0e7490;
  transform: translateY(-2px);
}

.btn-secondary {
  background: #6b7280;
  color: var(--white);
  border-color: #6b7280;
}

.btn-secondary:hover {
  background: #4b5563;
  border-color: #4b5563;
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--danger-color);
  color: var(--white);
  border-color: var(--danger-color);
}

.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

/* 提示訊息 */
.alert {
  padding: 14px 20px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-weight: 500;
}

.alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* 導覽列 */
.navbar {
  background: var(--white);
  box-shadow: 0 1px 0 var(--border-color), 0 2px 8px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 16px;
}

.nav-brand h1 {
  font-size: 24px;
  color: var(--primary-color);
  font-weight: 700;
  white-space: nowrap;
}

/* 漢堡選單按鈕 */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.nav-hamburger:hover { background: var(--bg-color); }
.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-color);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2px;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.nav-menu > li > a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  color: var(--text-light);
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-menu > li > a:hover {
  background: var(--bg-color);
  color: var(--primary-color);
}

.nav-menu > li.active > a {
  background: #eff6ff;
  color: var(--primary-color);
  font-weight: 600;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.user-name {
  color: var(--text-color);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}

.btn-logout {
  padding: 10px 20px;
  background: var(--white);
  color: var(--danger-color);
  text-decoration: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s ease;
  border: 1.5px solid var(--danger-color);
  white-space: nowrap;
}

.btn-logout:hover {
  background: var(--danger-color);
  color: var(--white);
}

/* ── 下拉選單 ── */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  cursor: pointer;
  user-select: none;
}

.dropdown-arrow {
  font-size: 10px;
  opacity: 0.5;
  transition: transform 0.25s ease;
  display: inline-block;
  line-height: 1;
}

.nav-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
  opacity: 0.8;
}

.nav-dropdown-menu {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  min-width: 172px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
  list-style: none;
  padding: 14px 6px 6px 6px; /* 上方 padding 填補空隙，避免 hover 中斷 */
  z-index: 2000;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.nav-dropdown.open .nav-dropdown-menu {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu li a {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  color: var(--text-color);
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-dropdown-menu li a:hover {
  background: #eff6ff;
  color: var(--primary-color);
}

.nav-dropdown-menu li a.active {
  background: var(--primary-color);
  color: var(--white);
  font-weight: 600;
}

.nav-dropdown.active > .nav-dropdown-toggle {
  background: #eff6ff;
  color: var(--primary-color);
  font-weight: 600;
}

/* 容器 */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 24px;
  min-height: calc(100vh - 160px);
}

/* 儀表板 */
.dashboard h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--text-color);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.stat-card {
  background: var(--white);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 24px;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
}

.stat-icon {
  font-size: 56px;
  color: var(--primary-color);
}

.stat-content h3 {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 10px;
}

.stat-number {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
}

.stat-label {
  font-size: 15px;
  color: var(--text-light);
}

.dashboard-section {
  background: var(--white);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}

.dashboard-section h3 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text-color);
}

/* 表格 */
.table-container {
  text-align: center;
}

.table-responsive {
  overflow-x: auto;
  display: inline-block;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.data-table thead {
  background: var(--bg-color);
}

.data-table th {
  padding: 16px 20px;
  text-align: left;
  font-weight: 600;
  color: var(--text-color);
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  min-width: 80px; /* 確保每個欄位有最小寬度 */
  text-align: left; /* 統一左對齊 */
}

.data-table tbody tr:hover {
  background: #f0f9ff;
}

.actions {
  white-space: nowrap;
}

/* 快速操作 */
.quick-actions {
  background: var(--white);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.quick-actions h3 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text-color);
}

.action-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* 分頁 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.page-link {
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.3s ease;
}

.page-link:hover {
  background: var(--primary-color);
  color: var(--white);
}

.page-link.active {
  background: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}

/* 頁尾 */
.footer {
  background: var(--white);
  border-top: 1px solid var(--border-color);
  padding: 24px 0;
  margin-top: 48px;
}

.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
  color: var(--text-light);
  font-size: 15px;
}

/* 響應式設計 */
@media (max-width: 768px) {
  /* 顯示漢堡按鈕 */
  .nav-hamburger {
    display: flex;
  }

  /* 頂部列固定高度，不換行 */
  .nav-container {
    height: 64px;
    padding: 0 16px;
    flex-wrap: nowrap;
    gap: 8px;
  }

  /* 隱藏桌面選單 */
  .nav-menu {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 999;
    padding: 12px;
    gap: 2px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }

  .nav-menu.mobile-open {
    display: flex;
  }

  .nav-menu > li {
    width: 100%;
  }

  .nav-menu > li > a {
    width: 100%;
    padding: 13px 16px;
    font-size: 16px;
    border-radius: 8px;
    justify-content: space-between;
    color: var(--text-color);
  }

  .nav-menu > li.active > a {
    background: #eff6ff;
    color: var(--primary-color);
  }

  /* 手機版下拉選單：inline 展開，不用 hover */
  .nav-dropdown-menu {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: static !important;
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 8px !important;
    background: var(--bg-color) !important;
    padding: 4px 0 4px 12px !important;
    margin-top: 2px !important;
    display: none !important;
    transition: none !important;
  }

  .nav-dropdown.open .nav-dropdown-menu {
    display: block !important;
  }

  .nav-dropdown:not(.open):hover .nav-dropdown-menu {
    display: none !important;
  }

  .nav-dropdown-menu li a {
    padding: 11px 14px;
    font-size: 15px;
    color: var(--text-light);
    border-radius: 6px;
  }

  .nav-dropdown-menu li a:hover,
  .nav-dropdown-menu li a.active {
    background: #eff6ff;
    color: var(--primary-color);
  }

  /* 使用者區塊：精簡 */
  .nav-user {
    gap: 8px;
    flex-shrink: 0;
  }

  .user-name {
    display: none;
  }

  .btn-logout {
    padding: 8px 14px;
    font-size: 14px;
  }

  /* 其他 RWD */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .action-buttons {
    flex-direction: column;
  }

  .action-buttons .btn {
    width: 100%;
  }

  .login-box {
    padding: 32px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .edit-section {
    padding: 20px;
  }
}


/*備份/復原*/






/* 淺灰質感：日期顯示 */
.date-display {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 0.8rem 1rem;
    background: #f8f9fa;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    border: 1px solid #e5e7eb;
	margin-top:0.5rem;
}
.date-display span:first-child { 
    color: #6b7280; 
    font-weight: 600;
}
.date-display span:last-child { 
    color: #1f2937; 
    font-weight: 600;
}

/* 表格：節次欄位淺灰 */
.table-container {
    overflow-x: auto;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.table-container table {
    width: 100%;
    border-collapse: collapse;
}
.table-container th {
    background: #f1f5f9;
    color: #1e293b;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}
.period-col {
    width: 90px;
    background: #f8f9fa !important;
    font-weight: 600;
    color: #475569;
}
.morning-row {
    background: #fff8f0 !important;
}
.mtable td{
    padding:5px;
}
.table-input, .subject-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: white;
}

/* 節次標籤 */
.period-tag_v1 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 18px;
    font-weight: 700;
    color: white;
}
.period-tag_v1.morning { background: linear-gradient(to right, #fb923c, #f43f5e); }
.period-tag_v1.normal { background: linear-gradient(to right, #0d9488, #0891b2); }

/* 總節數：淺灰質感卡片 */
.summary-box {
    margin-top: 1.5rem;
    text-align: right;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-radius: 0.75rem;
    font-weight: 600;
    color: #374151;
    border: 1px solid #e5e7eb;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}
.summary-box span { 
    font-size: 1.5rem; 
    font-weight: 800; 
    color: var( --primary-color ); 
}

/* 代課類型 */
.type-toggle {
    display: inline-flex;
    background: #e5e5e5;
    border-radius: 9999px;
    padding: 0.375rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.type-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    transition: all 0.3s;
    min-width: 100px;
    text-align: center;
	border-width:0px;
}
.type-btn.active {
    background: var( --primary-color );
    color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.type-btn:not(.active) {
    color: #4b5563;
}



.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    margin-top: 2rem;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}
@media (min-width: 768px) {
    .checkbox-grid { grid-template-columns: repeat(4, 1fr); }
}

.custom-checkbox {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    color: #374151;
}
.custom-checkbox input { position: absolute; opacity: 0; cursor: pointer; }
.custom-checkbox .checkmark {
    width: 28px;
    height: 28px;
    background: white;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    margin-right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.custom-checkbox input:checked ~ .checkmark {
    background: var( --primary-color );
    border-color: var( --primary-color );
}
.custom-checkbox .checkmark:after {
    content: "✓";
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    display: none;
}
.custom-checkbox input:checked ~ .checkmark:after { display: block; }



/*早修 第一節~第七節*/
.schedule-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
	width:100%;
}
 .schedule-half {
	 width:calc( 50% - 10px );
	 margin:5px;
 }
/* 手機版：上下排列 */
@media (max-width: 768px) {
    .schedule-container {
        flex-direction: column;
    }
    .schedule-half {
        width: 100%;
		margin:0px;
    }
}