@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');

/* ===== เปลี่ยนสีหลักเป็นม่วง-เหลือง ===== */
:root {
  --primary: #6b4cff;
  --primary-light: #f3f0ff;
  --primary-mid: #5438cc;
  --primary-dark: #3d2899;
  
  --accent: #f5b800;
  --accent-light: #fffbeb;
  --accent-mid: #cc9a00;
  
  --danger: #c0392b;
  --danger-light: #fdecea;
  
  --gray-50: #f8f9fa;
  --gray-100: #f1f3f5;
  --gray-200: #e9ecef;
  --gray-300: #d1d5db;
  --gray-400: #adb5bd;
  --gray-500: #6c757d;
  --gray-600: #6b7280;
  --gray-700: #495057;
  --gray-900: #212529;
  
  --white: #ffffff;
  --radius: 10px;
  --radius-sm: 6px;
  
  --shadow: 0 2px 12px rgba(107, 76, 255, 0.08);
  --shadow-lg: 0 8px 32px rgba(107, 76, 255, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Sarabun', sans-serif; background: var(--gray-50); color: var(--gray-900); font-size: 15px; line-height: 1.6; }

/* ===== HEADER (ม่วง) ===== */
.header { 
  background: var(--primary); 
  color: white; 
  padding: 0 24px; 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  height: 60px; 
  position: sticky; 
  top: 0; 
  z-index: 100; 
  box-shadow: 0 2px 8px rgba(107, 76, 255, 0.3); 
}
.header-brand { display: flex; align-items: center; gap: 10px; }
.header-logo { 
  width: 36px; 
  height: 36px; 
  border-radius: 8px; 
  background: white; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
}
.header-logo svg { width: 22px; height: 22px; }
.header-title { font-size: 16px; font-weight: 600; }
.header-sub { font-size: 12px; opacity: .75; }

/* ===== NAV BUTTONS ===== */
.header-nav { display: flex; gap: 4px; }
.nav-btn { 
  padding: 6px 14px; 
  border-radius: 6px; 
  font-size: 13px; 
  font-weight: 500; 
  cursor: pointer; 
  border: none; 
  font-family: inherit; 
  color: rgba(255,255,255,.8); 
  background: transparent; 
  transition: all .15s; 
}
.nav-btn:hover { background: rgba(255,255,255,.15); color: white; }
.nav-btn.active { 
  background: rgba(255,255,255,.2); 
  color: white; 
  border-bottom: 2px solid var(--accent);
}

/* ===== CONTAINER ===== */
.container { max-width: 900px; margin: 0 auto; padding: 28px 20px; }
.page { display: none; }
.page.active { display: block; }

/* ===== PAGE TITLE ===== */
.page-title { 
  font-size: 22px; 
  font-weight: 600; 
  color: var(--primary); 
  margin-bottom: 6px; 
}
.page-sub { font-size: 14px; color: var(--gray-500); margin-bottom: 24px; }

/* ============================================
   CARDS
   ============================================ */
.card { 
  background: white; 
  border-radius: var(--radius); 
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06); 
  padding: 28px; 
  margin-bottom: 20px; 
  border: 1.5px solid #e5e7eb;
}
.card-title { 
  font-size: 16px; 
  font-weight: 600; 
  color: var(--gray-700); 
  margin-bottom: 18px; 
  padding-bottom: 12px; 
  border-bottom: 2.5px solid var(--primary-light); 
}

/* ============================================
   FORM - ให้เส้นขอบเด่นชัดขึ้น
   ============================================ */

/* --- พื้นฐานฟิลด์ทั้งหมด --- */
.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.field input[type=text], 
.field input[type=date], 
.field textarea,
.field select,
.filter-bar select,
.filter-bar input {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-family: inherit;
  border: 2px solid #d1d5db;
  border-radius: var(--radius-sm);
  background: white;
  color: var(--gray-900);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* --- เมื่อโฟกัส --- */
.field input[type=text]:focus, 
.field input[type=date]:focus, 
.field textarea:focus,
.field select:focus,
.filter-bar select:focus,
.filter-bar input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(107, 76, 255, 0.15);
}

/* --- select dropdown --- */
.field select,
.filter-bar select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236c757d' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

/* --- select optgroup และ option --- */
.field select optgroup {
  font-weight: 600;
  color: var(--gray-700);
  font-style: normal;
}

.field select optgroup option {
  padding-left: 24px;
}

.field select option[disabled] {
  color: var(--gray-500);
}

.field select option:first-child {
  color: var(--gray-500);
}

/* --- select เมื่อ disabled --- */
.field select:disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.8;
}

/* --- input เมื่อ disabled --- */
.field input:disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.8;
}

/* --- textarea --- */
.field textarea {
  resize: vertical;
  min-height: 80px;
}

/* --- ฟิลด์ที่มีข้อผิดพลาด --- */
.field.error input,
.field.error select,
.field.error textarea {
  border-color: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

/* --- ฟิลด์ที่สำเร็จ --- */
.field.success input,
.field.success select,
.field.success textarea {
  border-color: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

/* --- HINT --- */
.field .hint {
  font-size: 13px;
  color: #6b7280;
  margin-top: 6px;
  font-style: italic;
}

/* --- REQUIRED --- */
.req {
  color: #dc2626;
  margin-left: 2px;
  font-weight: 700;
}

/* --- ROW2 --- */
.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ============================================
   REPORT TABS - ให้เห็นชัดเจนขึ้น
   ============================================ */
.report-tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.report-tab {
  flex: 1;
  min-width: 130px;
  padding: 16px 14px;
  font-size: 15px;
  font-weight: 500;
  border: 2.5px solid #d1d5db;
  border-radius: var(--radius-sm);
  background: white;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.report-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(107, 76, 255, 0.15);
}

.report-tab.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(107, 76, 255, 0.2);
}

.report-tab .tab-icon {
  font-size: 26px;
  display: block;
  margin-bottom: 6px;
}

/* ============================================
   TYPE WARNING
   ============================================ */
.type-warning {
  font-size: 14px;
  color: #dc2626;
  margin-top: 10px;
  display: none;
  font-weight: 500;
  background: #fef2f2;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border-left: 4px solid #dc2626;
}

/* ============================================
   EVIDENCE PANELS
   ============================================ */
.evid-panel { display: none; }
.evid-panel.active { display: block; }

/* ============================================
   UPLOAD AREA
   ============================================ */
.upload-area {
  border: 2.5px dashed #d1d5db;
  border-radius: var(--radius-sm);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  color: #6b7280;
  font-size: 14px;
  transition: all 0.2s ease;
  margin-top: 10px;
  background: #fafafa;
}

.upload-area:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.01);
}

.upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
  display: block;
}

/* ============================================
   PREVIEW IMAGES
   ============================================ */
.preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.img-wrap {
  position: relative;
}

.preview-img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #e5e7eb;
  transition: all 0.2s ease;
}

.preview-img:hover {
  transform: scale(1.05);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.del-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  font-size: 12px;
  border: 2px solid white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: all 0.2s ease;
}

.del-btn:hover {
  transform: scale(1.15);
  background: #e74c3c;
}

/* ============================================
   BUTTON
   ============================================ */
.btn-primary {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--primary-mid);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(107, 76, 255, 0.3);
}

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

/* ============================================
   STAT CARDS
   ============================================ */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  border-top: 3px solid var(--primary);
}

.stat-label {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.stat-sub {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 4px;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-fb { background: #e7f0fd; color: #1877f2; }
.badge-file { background: #fdecea; color: #c0392b; }
.badge-other { background: var(--primary-light); color: var(--primary); }

/* ============================================
   BADGE ประเภทงาน
   ============================================ */
.badge-work-level {
  background: #e3f2fd;
  color: #0d47a1;
  border: 1px solid #90caf9;
}

.badge-work-lifelong {
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #a5d6a7;
}

.badge-work-self {
  background: #f3e5f5;
  color: #4a148c;
  border: 1px solid #ce93d8;
}

.badge-work-royal {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
}

.badge-work-other {
  background: #fff8e1;
  color: #f57f17;
  border: 1px solid #ffd54f;
}

.badge-work-unknown {
  background: #f5f5f5;
  color: #616161;
  border: 1px solid #e0e0e0;
}

.badge-work-level,
.badge-work-lifelong,
.badge-work-self,
.badge-work-royal,
.badge-work-other,
.badge-work-unknown {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s ease;
}

.badge-work-level:hover,
.badge-work-lifelong:hover,
.badge-work-self:hover,
.badge-work-royal:hover,
.badge-work-other:hover,
.badge-work-unknown:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ============================================
   CHART - แนวนอน
   ============================================ */
.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}

.bar-label {
  width: 120px;
  flex-shrink: 0;
  color: var(--gray-700);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  flex: 1;
  background: var(--gray-100);
  border-radius: 4px;
  height: 14px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width .4s ease;
}

.bar-count {
  width: 28px;
  text-align: right;
  color: var(--gray-500);
  flex-shrink: 0;
}

/* ============================================
   CHART - แนวตั้ง
   ============================================ */
.vertical-chart {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  height: 200px;
  padding: 10px 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 10px;
  gap: 8px;
}

.vertical-chart .bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.vertical-chart .bar-wrapper {
  width: 100%;
  max-width: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 160px;
  justify-content: flex-end;
}

.vertical-chart .bar-fill-vertical {
  width: 100%;
  min-height: 4px;
  border-radius: 4px 4px 0 0;
  transition: height 0.8s ease;
  background: var(--primary);
  position: relative;
}

.vertical-chart .bar-fill-vertical:hover {
  opacity: 0.8;
}

.vertical-chart .bar-label {
  font-size: 11px;
  color: var(--gray-600);
  text-align: center;
  margin-top: 6px;
  word-break: break-word;
  max-width: 80px;
  line-height: 1.3;
}

.vertical-chart .bar-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}

.vertical-chart .bar-fill-vertical.color-1 { background: #6b4cff; }
.vertical-chart .bar-fill-vertical.color-2 { background: #f5b800; }
.vertical-chart .bar-fill-vertical.color-3 { background: #34a853; }
.vertical-chart .bar-fill-vertical.color-4 { background: #ea4335; }
.vertical-chart .bar-fill-vertical.color-5 { background: #4285f4; }
.vertical-chart .bar-fill-vertical.color-6 { background: #fa7b17; }

/* ============================================
   TODAY CARD GRID
   ============================================ */
.today-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

#recentList {
  max-height: 600px;
  overflow-y: auto;
}

#recentList::-webkit-scrollbar {
  width: 4px;
}
#recentList::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 4px;
}
#recentList::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}
#recentList::-webkit-scrollbar-thumb:hover {
  background: var(--primary-mid);
}

.today-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 12px;
  gap: 12px;
  border: 1px solid #e5e7eb;
}

.today-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.card-media {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-icon {
  font-size: 48px;
  color: var(--primary);
}

.card-info {
  flex: 1;
  min-width: 0;
}

.card-info .card-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--gray-900);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-info .card-location {
  font-size: 12px;
  color: var(--gray-500);
}

.card-info .card-reporter {
  font-size: 11px;
  color: var(--gray-400);
}

/* ============================================
   TODAY ACTIVITY LIST
   ============================================ */
.today-activity-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 15px;
  border: 1px solid #e5e7eb;
}

.today-activity-card:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-lg);
  background: var(--primary-light);
  border-color: var(--primary);
}

.today-activity-icon {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  border-radius: 12px;
  overflow: hidden;
}

.today-activity-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.today-activity-card:hover .today-activity-icon img {
  transform: scale(1.05);
  transition: transform 0.2s ease;
}

.today-activity-content {
  flex: 1;
}

.today-activity-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}

.today-activity-meta {
  font-size: 12px;
  color: var(--gray-500);
}

/* ============================================
   FILTER BAR
   ============================================ */
/* ===== Filter Bar ===== */
.filter-bar {
    background: #f8f9fa;
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}
.filter-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.filter-row:last-child {
    margin-bottom: 0;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 150px;
    flex: 1;
}
.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
}
.filter-group select,
.filter-group input[type="date"] {
    padding: 8px 12px;
    border: 1.5px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.filter-group select:focus,
.filter-group input[type="date"]:focus,
.filter-group input[type="text"]:focus {
    border-color: #6b4cff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(107, 76, 255, 0.1);
}
.filter-group input[type="text"] {
    padding: 8px 12px;
    border: 1.5px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    flex: 1;
}
.btn-search {
    padding: 8px 20px;
    background: #6b4cff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.2s;
}
.btn-search:hover {
    background: #5a3ee0;
}
.btn-clear {
    padding: 8px 16px;
    background: #e9ecef;
    color: #495057;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}
.btn-clear:hover {
    background: #dee2e6;
}

@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
        gap: 10px;
    }
    .filter-group {
        min-width: 100%;
    }
    .filter-group input[type="text"] {
        width: 100%;
    }
}

.filter-bar select,
.filter-bar input {
  flex: 1;
  min-width: 130px;
  padding: 10px 14px;
  font-size: 14px;
  border: 2px solid #d1d5db;
  border-radius: var(--radius-sm);
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-bar select:focus,
.filter-bar input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(107, 76, 255, 0.12);
}

/* ============================================
   LIST CARD GRID
   ============================================ */
.list-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 10px;
}

.list-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
}

.list-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.list-card-image {
  width: 100%;
  height: 200px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.list-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-card-image .card-icon-large {
  font-size: 64px;
  color: var(--primary);
  opacity: 0.5;
}

.list-card-image .card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
}

.list-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.list-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.list-card-meta {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 4px;
}

.list-card-meta i {
  width: 16px;
  margin-right: 4px;
}

.list-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--gray-100);
  margin-top: auto;
}

.list-card-date {
  font-size: 12px;
  color: var(--gray-400);
}

/* ============================================
   PAGINATION
   ============================================ */
.list-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.list-pagination button {
  padding: 8px 16px;
  border: 2px solid #d1d5db;
  border-radius: var(--radius-sm);
  background: white;
  color: var(--gray-700);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  transition: all 0.15s ease;
}

.list-pagination button:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.list-pagination button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.list-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex !important; }
.modal-box {
  background: white;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  border: 2px solid var(--primary);
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #e9ecef;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.modal-close:hover {
  background: var(--danger);
  color: white;
}
.modal-imgs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.modal-imgs img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
}

/* ============================================
   ALERT
   ============================================ */
#alertModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}
#alertModal.open { display: flex !important; }
#alertModal .modal-box { max-width: 400px; text-align: center; }
#alertModal .btn-primary { width: auto; padding: 8px 20px; margin-top: 10px; }

/* ============================================
   EMPTY
   ============================================ */
.empty { text-align: center; padding: 48px 20px; color: var(--gray-500); }
.empty-icon { font-size: 40px; margin-bottom: 10px; }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: linear-gradient(135deg, #1e1b28 0%, #322e3d 50%, #1e1b28 100%);
  color: rgba(255, 255, 255, 0.7);
  padding: 16px 0;
  margin-top: 40px;
  border-top: 3px solid var(--primary);
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
  background-size: 200% 100%;
  animation: footerGradient 3s ease infinite;
}

@keyframes footerGradient {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 0%; }
  100% { background-position: 0% 0%; }
}

.footer-container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  flex-wrap: wrap;
  gap: 8px;
}

.footer-bottom-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.footer-bottom-left strong {
  color: rgba(255, 255, 255, 0.7);
}

.footer-bottom-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-divider {
  color: rgba(255, 255, 255, 0.15);
}

.version-badge {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.footer-bottom-right strong {
  color: var(--primary);
  font-weight: 600;
}

/* ============================================
   PROGRESS MODAL
   ============================================ */
#progressModal .modal-box {
  background: white;
  border-radius: 12px;
  padding: 30px;
  max-width: 450px;
  width: 90%;
}

#progressBarFill {
  transition: width 0.5s ease;
}

#progressStatus {
  min-height: 24px;
}

#progressDetail {
  min-height: 20px;
}

/* ============================================
   LOGIN
   ============================================ */
.user-info {
  display: none;
  color: white;
  font-size: 13px;
  margin-right: 15px;
  align-items: center;
  gap: 8px;
}

.logout-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 2px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background: rgba(255,255,255,0.3);
}

/* ============================================
   MOBILE NAV
   ============================================ */
.mob-nav {
  flex: 1;
  padding: 10px 4px;
  font-size: 12px;
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: #6c757d;
  border-bottom: 2px solid transparent;
  font-weight: 400;
  transition: all 0.2s ease;
}

.mob-nav.active {
  color: #6b4cff;
  border-bottom-color: #6b4cff;
  font-weight: 600;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .list-card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .row2 { grid-template-columns: 1fr; }
  .header-nav { display: none; }
  .container { padding: 16px 12px; }
  .card { padding: 18px; }
  .stat-value { font-size: 26px; }
  .report-tab { min-width: 80px; font-size: 13px; padding: 12px 8px; }
  .report-tab .tab-icon { font-size: 20px; }
  .today-card-grid { grid-template-columns: 1fr; }
  .today-card { padding: 10px; }
  .card-media { width: 60px; height: 60px; }
  .card-icon { font-size: 36px; }
  .list-card-grid { grid-template-columns: 1fr; }
  .list-card-image { height: 160px; }
  
  .footer {
    padding: 12px 0;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    padding: 4px 0;
    gap: 4px;
    font-size: 12px;
  }
  .footer-bottom-right {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .vertical-chart {
    height: 160px;
    gap: 4px;
  }
  .vertical-chart .bar-wrapper {
    max-width: 30px;
    height: 120px;
  }
  .vertical-chart .bar-label {
    font-size: 9px;
    max-width: 50px;
  }
  .vertical-chart .bar-value {
    font-size: 10px;
  }
}
.page-dots {
  padding: 8px 10px;
  color: #6c757d;
}