/* ===== 폰트 통일 ===== */
@import url('https://cdn.jsdelivr.net/npm/pretendard/dist/web/static/pretendard.css');

:root {
  --font: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  font-family: var(--font);
  font-size: 14px;
  color: #1f2937;
}

/* ===== 기본 ===== */
:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ===== 로그인 ===== */
.login-container {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #4f46e5, #22d3ee);
}

.login-card {
  width: 340px;
  padding: 32px;
  border-radius: 18px;
  background: white;
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.login-card h1 {
  font-size: 20px;
  margin-bottom: 6px;
}

.subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form input {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.login-form input:focus {
  border: 1px solid var(--primary);
  outline: none;
}

.full {
  width: 100%;
}

/* ===== 레이아웃 ===== */
.layout {
  display: flex;
}

/* ===== 사이드바 ===== */
.sidebar {
  width: 250px;
  height: 100vh;
  background: #0f172a;
  color: #cbd5f5;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.sidebar h2 {
  color: white;
  margin-bottom: 18px;
}

.sidebar button {
  all: unset;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 6px;
}

.sidebar button:hover {
  background: rgba(255,255,255,0.08);
}

.sidebar button.active {
  background: var(--primary);
  color: white;
}

.logout-btn {
  margin-top: auto;
  color: #f87171;
}

/* ===== 메인 ===== */
main {
  flex: 1;
  padding: 32px;
}

/* ===== 카드 ===== */
.card {
  background: var(--card);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
  transition: 0.2s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.05);
}

/* ===== KPI ===== */
.kpi {
  font-size: 26px;
  font-weight: 600;
  margin-top: 5px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

/* ===== 그리드 ===== */
.grid {
  display: grid;
  gap: 20px;
}

.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* ===== 테이블 ===== */
.table-wrap {
  margin-top: 10px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: #f1f5f9;
}

th {
  font-size: 12px;
  color: var(--muted);
  text-align: left;
  padding: 12px;
}

td {
  padding: 14px;
  border-top: 1px solid var(--border);
}

tr:hover {
  background: #f8fafc;
}

/* ===== 버튼 ===== */
.btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  font-size: 12px;
  cursor: pointer;
}

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

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

.btn.secondary {
  background: #e5e7eb;
}

.btn.danger {
  background: #ef4444;
  color: white;
}

/* ===== 상태 ===== */
.status-pending { color: #f59e0b; }
.status-approved { color: #10b981; }
.status-rejected { color: #ef4444; }

/* ===== 애니메이션 ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px);}
  to { opacity: 1; transform: translateY(0);}
}
/* ===== 대시보드 표 개선 ===== */

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #6366f1;
  color: white;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.num {
  text-align: right;
  font-weight: 500;
}

.highlight {
  color: #4f46e5;
  font-weight: 600;
}

.expiring {
  color: #ef4444;
}

/* ===== 상태 배지 ===== */
.badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.badge.success {
  background: #dcfce7;
  color: #16a34a;
}

.badge.warning {
  background: #fef3c7;
  color: #d97706;
}

.badge.danger {
  background: #fee2e2;
  color: #dc2626;
}

/* ===== 차트 ===== */
.chart-grid {
  display: block;
  margin-top: 20px;
}

.chart-grid canvas {
  width: 100% !important;
  height: 360px !important;
  background: white;
  border-radius: 12px;
  padding: 16px;
}

/* ===== 상단 메뉴 ===== */
.topbar {
  height: 60px;
  background: white;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 20px;
}

.logo {
  font-weight: 800;
  font-size: 18px;
}

.top-menu {
  display: flex;
  gap: 10px;
}

.top-menu button {
  all: unset;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight : 600;
  line-height : 1;
}

.top-menu button:hover {
  background: #f1f5f9;
}

.top-menu button.active {
  background: #4f46e5;
  color: white;
}

.user-area {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logout-btn {
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  background: #ef4444;
  color: white;
  cursor: pointer;
}

/* 공통 섹션 */
.section-card {
  padding: 22px;
  margin-top: 16px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.section-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  color: #6b7280;
}

.grid {
  display: grid;
  gap: 20px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid.cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #dbe3ef;
  background: #fff;
  font-size: 14px;
  transition: all .18s ease;
}

.field textarea {
  resize: vertical;
  min-height: 88px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: #7c6cff;
  box-shadow: 0 0 0 4px rgba(124, 108, 255, 0.10);
}

.field-wide {
  grid-column: span 2;
}

.full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 4px;
}

/* 테이블 개선 */
.pretty-table {
  width: 100%;
  border-collapse: collapse;
}

.pretty-table thead {
  background: #f3f6fb;
}

.pretty-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
}

.pretty-table td {
  font-size: 13px;
  padding: 12px 10px;
  border-top: 1px solid #edf2f7;
  vertical-align: top;
}

.pretty-table tbody tr:hover {
  background: #fafcff;
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.avatar.small {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6d5dfc, #8b7dff);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.work-main {
  font-weight: 700;
  margin-bottom: 6px;
  color: #1e293b;
}

.work-sub {
  color: #475569;
  line-height: 1.5;
  white-space: pre-line;
  font-size: 12px;
  color: #6b7280;
}

.work-title {
  font-size: 14px;
  font-weight: 600;
}

.work-date {
  font-size: 12px;
  color: #94a3b8;
}

.date-range {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #334155;
}

.point-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 180px;
}

.point-line strong {
  color: #4f46e5;
}

/* 상태 pill */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pill.neutral {
  background: #eef2ff;
  color: #4f46e5;
}

.pill.status-pending {
  background: #fff7ed;
  color: #ea580c;
}

.pill.status-approved {
  background: #ecfdf5;
  color: #059669;
}

.pill.status-rejected {
  background: #fef2f2;
  color: #dc2626;
}

/* 내 마일리지 */
.mileage-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 20px;
}

.mileage-big {
  background: linear-gradient(135deg, #5b4df9, #7d6bff);
  color: #fff;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 18px 40px rgba(91, 77, 249, 0.18);
}

.mileage-big .label {
  font-size: 14px;
  opacity: .9;
}

.mileage-big .value {
  margin-top: 12px;
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}

.mileage-mini {
  background: #fff;
  border: 1px solid #e7edf5;
  border-radius: 20px;
  padding: 24px;
}

.mileage-mini .label {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.mileage-mini .value {
  margin-top: 12px;
  font-size: 32px;
  font-weight: 800;
  color: #111827;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  display: grid;
  grid-template-columns: 110px 1fr 90px 90px;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid #edf2f7;
  border-radius: 14px;
  background: #fff;
}

.history-item .date {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.history-item .desc {
  color: #334155;
}

.history-item .point {
  text-align: right;
  font-weight: 800;
}

.history-item .balance {
  text-align: right;
  color: #4f46e5;
  font-weight: 800;
}

/* 반응형 */
@media (max-width: 1200px) {
  .form-grid.cols-4,
  .form-grid.cols-5,
  .mileage-hero {
    grid-template-columns: 1fr 1fr;
  }

  .field-wide {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .form-grid.cols-4,
  .form-grid.cols-5,
  .mileage-hero {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: span 1;
  }

  .history-item {
    grid-template-columns: 1fr;
  }
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal-content {
  background: white;
  padding: 24px;
  border-radius: 16px;
  width: 500px;
  max-width: 90%;
}

.btn.success {
  background: #10b981;
  color: white;
}

.btn.success:hover {
  background: #059669;
}

.chart-card {
  padding: 20px;
}

.chart-wrap {
  height: 320px;
  margin-top: 10px;
}

.chart-card h3 {
  font-size: 16px;
  font-weight: 600;
}

/* ===== KPI 4칸 ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.kpi-title {
  font-size: 13px;
  color: #6b7280;
}

.kpi-value {
  font-size: 22px;
  font-weight: 600;
  margin-top: 6px;
}

/* ===== 차트 ===== */
.chart-card {
  padding: 20px;
  margin-bottom: 20px;
}

.full-width {
  width: 100%;
}

.chart-wrap {
  height: 350px;
  margin-top: 10px;
}

.chart-card h3 {
  font-size: 16px;
  font-weight: 600;
}

/* 취소 버튼 */
.btn.warning {
  background: #f59e0b;
  color: white;
}

.btn.warning:hover {
  background: #d97706;
}

/* 취소 상태 표시 */
.pill.status-cancelled {
  background: #e5e7eb;
  color: #374151;
}

button {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
}

