/* ===== apt_mgr LIFF Shared Styles ===== */
/* Mobile-first, LINE-platform community management SaaS */

/* --- Design Tokens --- */
:root {
  --green:  #06C755;   /* LINE brand color */
  --dark:   #111111;
  --gray:   #666666;
  --light:  #F7F7F7;
  --white:  #FFFFFF;
  --danger: #FF4444;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

body {
  font-family: -apple-system, "Noto Sans TC", sans-serif;
  background: var(--light);
  color: var(--dark);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* --- Layout --- */
.container { max-width: 480px; margin: 0 auto; padding: 16px; }

/* --- Buttons --- */
.btn-primary {
  width: 100%; padding: 14px; background: var(--green);
  color: white; border: none; border-radius: var(--radius);
  font-size: 16px; font-weight: 600; cursor: pointer;
}
.btn-primary:active { background: #05a948; }
.btn-primary:disabled { background: #a0d8b5; cursor: not-allowed; }

.btn-secondary {
  width: 100%; padding: 14px; background: white; color: var(--dark);
  border: 2px solid #ddd; border-radius: var(--radius);
  font-size: 16px; cursor: pointer;
}
.btn-secondary:active { background: #f0f0f0; }

.btn-danger {
  width: 100%; padding: 14px; background: var(--danger);
  color: white; border: none; border-radius: var(--radius);
  font-size: 16px; font-weight: 600; cursor: pointer;
}
.btn-danger:active { background: #dd3333; }
.btn-danger:disabled { background: #ff9999; cursor: not-allowed; }

/* --- Back-to-home nav button --- */
.btn-back-home {
  width: 36px; height: 36px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--white); border: 1px solid #e5e5e5; border-radius: 50%;
  color: var(--dark); text-decoration: none;
  font-size: 18px; line-height: 1; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.btn-back-home:hover { background: #f5f5f5; }
.btn-back-home:active { background: #ececec; transform: scale(0.94); }
.btn-back-home svg { width: 18px; height: 18px; display: block; }

.page-title-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.page-title-row .page-title,
.page-title-row h1 {
  margin: 0;
}

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

/* --- Tabs --- */
.tab-bar { display: flex; border-bottom: 2px solid #eee; margin-bottom: 16px; }
.tab { flex: 1; padding: 10px; text-align: center; cursor: pointer; }
.tab.active { border-bottom: 2px solid var(--green); color: var(--green); font-weight: 600; }

/* --- Badges --- */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 99px;
  font-size: 12px; font-weight: 600;
}
.badge-owner     { background: #FFF3CD; color: #856404; }
.badge-secretary { background: #D1ECF1; color: #0C5460; }

/* --- Status Badges --- */
.status-badge         { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.status-draft         { background: #E2E3E5; color: #383D41; }
.status-processing    { background: #CCE5FF; color: #004085; }
.status-completed     { background: #D4EDDA; color: #155724; }
.status-error         { background: #F8D7DA; color: #721C24; }

/* --- Forms --- */
.input {
  width: 100%; padding: 12px; border: 1.5px solid #ddd;
  border-radius: var(--radius); font-size: 15px;
  background: var(--white); color: var(--dark);
  outline: none; transition: border-color 0.2s;
}
.input:focus { border-color: var(--green); }
.input::placeholder { color: #aaa; }

.textarea {
  width: 100%; padding: 12px; border: 1.5px solid #ddd;
  border-radius: var(--radius); font-size: 15px;
  background: var(--white); color: var(--dark);
  outline: none; resize: vertical; min-height: 100px;
  font-family: inherit; transition: border-color 0.2s;
}
.textarea:focus { border-color: var(--green); }
.textarea::placeholder { color: #aaa; }

/* --- Loading Spinner --- */
.loading-spinner {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.7);
}
.loading-spinner::after {
  content: ''; width: 40px; height: 40px;
  border: 4px solid #ddd; border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Toast --- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  padding: 12px 24px; border-radius: var(--radius);
  color: white; font-size: 14px; font-weight: 500;
  z-index: 10000; opacity: 0; transition: opacity 0.3s;
  max-width: calc(100vw - 32px); text-align: center;
  pointer-events: none;
}
.toast.show { opacity: 1; }
.toast-info    { background: #333; }
.toast-success { background: var(--green); }
.toast-error   { background: var(--danger); }
.toast-warning { background: #E6A817; }

/* --- Modal --- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 8000;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal {
  background: white; border-radius: var(--radius);
  width: 100%; max-width: 400px; padding: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.modal-title {
  font-size: 18px; font-weight: 700; margin-bottom: 12px;
}
.modal-body {
  font-size: 15px; color: var(--gray); margin-bottom: 20px; line-height: 1.6;
}
.modal-actions {
  display: flex; gap: 10px;
}
.modal-actions .btn-primary,
.modal-actions .btn-secondary,
.modal-actions .btn-danger {
  flex: 1;
}

/* --- Summary Card --- */
.summary-card {
  background: white; border-radius: var(--radius);
  padding: 20px; margin-bottom: 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px;
}
.summary-card .summary-label {
  font-size: 13px; color: var(--gray); font-weight: 500;
}
.summary-card .summary-value {
  font-size: 22px; font-weight: 700; color: var(--dark);
}

/* --- Table --- */
.table {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
.table th, .table td {
  padding: 10px 8px; text-align: left; border-bottom: 1px solid #eee;
}
.table th {
  font-weight: 600; color: var(--gray); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.table tr:last-child td { border-bottom: none; }

/* --- Upload Area --- */
.upload-area {
  border: 2px dashed #ccc; border-radius: var(--radius);
  padding: 32px 16px; text-align: center; cursor: pointer;
  color: var(--gray); font-size: 14px;
  transition: border-color 0.2s, background 0.2s;
}
.upload-area:active,
.upload-area.dragover {
  border-color: var(--green); background: #f0faf4;
}

/* --- Progress Bar --- */
.progress-bar {
  width: 100%; height: 8px; background: #eee;
  border-radius: 4px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; background: var(--green);
  border-radius: 4px; width: 0%;
  transition: width 0.3s ease;
}

/* --- Floating Action Button --- */
.fab {
  position: fixed; bottom: 24px; right: 24px;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--green); color: white;
  border: none; font-size: 28px; line-height: 56px;
  text-align: center; cursor: pointer;
  box-shadow: 0 4px 12px rgba(6,199,85,0.35);
  z-index: 5000;
}
.fab:active { background: #05a948; transform: scale(0.95); }

/* --- Utility --- */
.hidden { display: none; }

/* --- Async Job Progress Indicator --- */
/* Used by liff/shared/job_tracker.js to surface in-flight AI work
   without blocking the page. Shown at the top of pages that opt-in. */
.job-progress {
  display: flex; align-items: center; gap: 8px;
  background: #fff8e1; border: 1px solid #ffd54f; color: #5d4037;
  padding: 8px 12px; border-radius: var(--radius);
  margin-bottom: 12px; font-size: 13px;
}
.job-progress.hidden { display: none; }
.job-progress .job-spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(93, 64, 55, 0.25);
  border-top-color: #5d4037;
  animation: job-progress-spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes job-progress-spin { to { transform: rotate(360deg); } }
