:root {
  --primary: #1976D2;
  --primary-light: #BBDEFB;
  --bg: #f5f5f5;
  --surface: #ffffff;
  --text: #212121;
  --text-secondary: #757575;
  --divider: #e0e0e0;
  --success: #4CAF50;
  --error: #f44336;
  --warning: #FFC107;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.app-bar {
  background: var(--primary);
  color: white;
  padding: 12px 16px;
  font-size: 18px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.app-bar a { color: white; text-decoration: none; }
.app-bar input::placeholder { color: rgba(255,255,255,0.5); }
.app-bar input { color: white; }

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

.card {
  background: var(--surface);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card-tap { cursor: pointer; transition: background 0.2s; }
.card-tap:hover { background: #f8f9fa; }

.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-primary { background: var(--primary); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-danger { background: var(--error); color: white; }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--divider);
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 12px;
}

.input:focus { outline: none; border-color: var(--primary); }

.label { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; display: block; }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: 1fr 1fr; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 8px; font-size: 12px; color: var(--text-secondary); border-bottom: 2px solid var(--divider); }
.table td { padding: 8px; font-size: 14px; border-bottom: 1px solid var(--divider); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
}
.badge-success { background: #E8F5E9; color: var(--success); }
.badge-danger { background: #FFEBEE; color: var(--error); }
.badge-warning { background: #FFF8E1; color: var(--warning); }

.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 14px;
}
.alert-danger { background: #FFEBEE; color: var(--error); }
.alert-success { background: #E8F5E9; color: var(--success); }
.alert-warning { background: #FFF8E1; color: var(--warning); }

.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  z-index: 99;
}

.pagenav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.empty {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 14px;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.calendar .day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 13px;
}
.calendar .day.checked { background: var(--success); color: white; }

.calendar .day.today { border: 2px solid #FF9800; }
.calendar .header { font-weight: bold; color: var(--text-secondary); }
.calendar .day.clickable { cursor: pointer; }
.calendar .day.clickable:active { opacity: 0.6; }

.confirm-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.4); z-index: 9998;
  display: flex; align-items: center; justify-content: center;
}
.confirm-box {
  background: #fff; border-radius: 8px; padding: 24px;
  max-width: 300px; width: 90%; text-align: center;
}
.confirm-box .msg { font-size: 15px; margin-bottom: 20px; line-height: 1.5; }
.confirm-box .btns { display: flex; gap: 12px; justify-content: center; }

.stat-row {
  display: flex;
  justify-content: space-around;
  text-align: center;
}
.stat-row .stat-num { font-size: 24px; font-weight: bold; color: var(--primary); }
.stat-row .stat-label { font-size: 12px; color: var(--text-secondary); }

.menu-item {
  display: flex;
  align-items: center;
  padding: 16px;
  text-decoration: none;
  color: var(--text);
}
.menu-item .icon { font-size: 28px; margin-right: 16px; }
.menu-item .title { font-size: 16px; font-weight: 500; }
.menu-item .desc { font-size: 12px; color: var(--text-secondary); }
.menu-item .arrow { margin-left: auto; color: var(--text-secondary); }