/* ========================================
   LUMINA 給料計算システム - スタイル
   ======================================== */

:root {
  --primary: #2c3e50;
  --primary-light: #34495e;
  --accent: #c9a96e;
  --accent-hover: #b8944f;
  --success: #27ae60;
  --danger: #e74c3c;
  --warning: #f39c12;
  --bg: #f5f5f5;
  --card-bg: #fff;
  --text: #333;
  --text-light: #666;
  --border: #ddd;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ヘッダー */
.header {
  background: var(--primary);
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.header h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 2px;
}

.header h1 span {
  color: var(--accent);
}

.header-nav a {
  color: #fff;
  text-decoration: none;
  margin-left: 16px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.header-nav a:hover {
  opacity: 1;
}

/* メインコンテンツ */
.container {
  max-width: 960px;
  margin: 32px auto;
  padding: 0 24px;
}

/* カード */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.card h2 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--primary);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 8px;
}

/* フォーム */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 14px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

/* ボタン */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #c0392b;
}

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

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--bg);
}

/* 進捗バー */
.progress-container {
  display: none;
  margin-top: 16px;
}

.progress-container.active {
  display: block;
}

.progress-bar-wrapper {
  background: #e0e0e0;
  border-radius: 20px;
  overflow: hidden;
  height: 24px;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  border-radius: 20px;
  width: 0%;
  transition: width 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  min-width: 40px;
}

.progress-message {
  font-size: 14px;
  color: var(--text-light);
}

.progress-bar.error {
  background: var(--danger);
}

/* テーブル */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

tr:hover {
  background: #f9f9f9;
}

/* タブ（管理画面用） */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}

.tab {
  padding: 12px 24px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.tab:hover {
  color: var(--primary);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--accent);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ダウンロードリンク */
.download-area {
  display: none;
  margin-top: 16px;
  padding: 16px;
  background: #e8f5e9;
  border-radius: var(--radius);
  text-align: center;
}

.download-area.active {
  display: block;
}

.download-area a {
  color: var(--success);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
}

.download-area a:hover {
  text-decoration: underline;
}

/* ログインフォーム */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-box {
  background: #fff;
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  width: 360px;
}

.login-box h2 {
  text-align: center;
  margin-bottom: 24px;
  color: var(--primary);
}

/* アラート */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-error {
  background: #fde8e8;
  color: var(--danger);
  border: 1px solid #f5c6c6;
}

.alert-success {
  background: #e8f5e9;
  color: var(--success);
  border: 1px solid #c8e6c9;
}

/* モーダル */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #fff;
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  width: 480px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}

.modal h3 {
  margin-bottom: 16px;
  color: var(--primary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* ユーティリティ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.hidden { display: none; }

/* レスポンシブ */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

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

  .header h1 {
    font-size: 16px;
  }

  .tabs {
    overflow-x: auto;
  }

  .tab {
    padding: 10px 16px;
    font-size: 13px;
    white-space: nowrap;
  }
}
