/* ============================================
   DentLog - iPhone Themed CSS
   ============================================ */

:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --text: #1c1c1e;
  --text-secondary: #8e8e93;
  --text-tertiary: #aeaeb2;
  --separator: #c6c6c8;
  --blue: #007aff;
  --green: #34c759;
  --red: #ff3b30;
  --orange: #ff9500;
  --yellow: #ffcc00;
  --purple: #af52de;
  --pink: #ff2d55;
  --teal: #30b0c7;
  --indigo: #5856d6;
  --radius: 14px;
  --radius-lg: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-h: 56px;
  --tabbar-h: 80px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- SCREENS ---- */
.screen { display: none; min-height: 100vh; min-height: 100dvh; }
.screen.active { display: flex; flex-direction: column; }

/* ---- LOGIN ---- */
.login-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: linear-gradient(160deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  min-height: 100dvh;
}

.login-logo {
  text-align: center;
  margin-bottom: 48px;
}

.logo-icon {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 40px;
  color: #fff;
}

.login-logo h1 {
  font-size: 34px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.login-logo p {
  font-size: 15px;
  color: rgba(255,255,255,0.7);
  margin-top: 4px;
}

.login-form {
  width: 100%;
  max-width: 340px;
}

.input-group {
  position: relative;
  margin-bottom: 14px;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 16px 16px 16px 44px;
  border: none;
  border-radius: 14px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: background 0.2s;
}

.input-group input::placeholder { color: rgba(255,255,255,0.6); }
.input-group select { appearance: none; }
.input-group select option { color: #333; background: #fff; }
.input-group input:focus,
.input-group select:focus { background: rgba(255,255,255,0.28); }

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 16px;
}

.btn-primary {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 14px;
  background: #fff;
  color: #764ba2;
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.15s, opacity 0.15s;
}

.btn-primary:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.error-text {
  color: #ffcdd2;
  text-align: center;
  margin-top: 12px;
  font-size: 14px;
  min-height: 20px;
}

/* ---- HEADER ---- */
#app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
}

.header-blur {
  position: absolute;
  inset: 0;
  background: rgba(242, 242, 247, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid rgba(0,0,0,0.1);
}

.header-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 16px;
}

.header-content h2 {
  font-size: 17px;
  font-weight: 600;
}

.header-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: var(--blue);
  font-size: 20px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.badge {
  position: absolute;
  top: 0;
  right: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- SIDEBAR ---- */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

#sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100%;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  z-index: 201;
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
}

#sidebar.open {
  transform: translateX(280px);
}

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 0.5px solid var(--separator);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
}

.user-name { font-weight: 600; font-size: 16px; }
.user-role { font-size: 13px; color: var(--text-secondary); }

.menu-list {
  list-style: none;
  padding: 8px 10px;
  flex: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 16px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}

.menu-item i { width: 24px; text-align: center; color: var(--text-secondary); font-size: 18px; }
.menu-item.active { background: rgba(0,122,255,0.1); color: var(--blue); }
.menu-item.active i { color: var(--blue); }
.menu-item:active { background: rgba(0,0,0,0.05); }

.sidebar-footer {
  padding: 16px 20px;
  padding-bottom: calc(16px + var(--safe-bottom));
  border-top: 0.5px solid var(--separator);
}

.logout-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: rgba(255,59,48,0.1);
  color: var(--red);
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}

/* ---- PAGE CONTAINER ---- */
#page-container {
  padding-top: calc(var(--header-h) + var(--safe-top));
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom));
  min-height: 100vh;
  min-height: 100dvh;
}

.page { display: none; padding: 16px; }
.page.active { display: block; }

/* ---- TAB BAR ---- */
#tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid rgba(0,0,0,0.1);
  z-index: 99;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 10px;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s;
}

.tab i { font-size: 22px; height: 28px; display: flex; align-items: center; }
.tab.active { color: var(--blue); }

/* ---- CARDS ---- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
}

/* ---- STATS GRID ---- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ---- LIST ---- */
.list-group {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.list-header {
  padding: 12px 16px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.list-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-top: 0.5px solid var(--separator);
  cursor: pointer;
  transition: background 0.15s;
  gap: 12px;
}

.list-item:first-child { border-top: none; }
.list-item:active { background: rgba(0,0,0,0.04); }

.list-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}

.list-item-content { flex: 1; min-width: 0; }
.list-item-title { font-size: 16px; font-weight: 500; }
.list-item-sub { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.list-item-chevron { color: var(--text-tertiary); font-size: 14px; }

/* ---- JOB CARD ---- */
.job-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: transform 0.15s;
  border-left: 4px solid var(--blue);
}

.job-card:active { transform: scale(0.98); }

.job-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.job-patient { font-size: 16px; font-weight: 600; }

.job-priority {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.job-type {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.job-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.job-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 8px;
}

.job-deadline {
  font-size: 12px;
  color: var(--text-secondary);
}

.job-deadline.overdue { color: var(--red); font-weight: 600; }

/* ---- KANBAN ---- */
.kanban-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 16px;
}

.kanban-column {
  width: 100%;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px 12px 0 0;
  background: var(--card);
}

.kanban-col-count {
  font-size: 12px;
  font-weight: 600;
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--text-secondary);
}

.kanban-col-body {
  background: rgba(0,0,0,0.02);
  border-radius: 0 0 12px 12px;
  padding: 8px;
  min-height: 100px;
}

.kanban-card {
  background: var(--card);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.kanban-card:active {
  transform: scale(0.97);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.kanban-card-patient { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.kanban-card-type { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-tertiary);
}

/* ---- MODAL (Bottom Sheet) ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 92vh;
  background: var(--bg);
  border-radius: 14px 14px 0 0;
  z-index: 301;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--safe-bottom);
}

.modal.active { transform: translateY(0); }

.modal-handle {
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: var(--separator);
  margin: 8px auto;
}

#modal-content { padding: 8px 16px 24px; }

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}

/* ---- FORM ---- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  padding-left: 4px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--separator);
  border-radius: 10px;
  background: var(--card);
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--blue);
}

.form-textarea { min-height: 80px; resize: vertical; }
.form-select { appearance: none; }

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

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

.btn:active { transform: scale(0.97); opacity: 0.85; }

.btn-blue { background: var(--blue); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--blue); color: var(--blue); }
.btn-ghost { background: rgba(0,122,255,0.1); color: var(--blue); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 8px; }

/* ---- FAB ---- */
.fab {
  position: fixed;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,122,255,0.4);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.fab:active { transform: scale(0.9); }

/* ---- TIMELINE ---- */
.timeline { padding-left: 20px; }

.timeline-item {
  position: relative;
  padding: 0 0 20px 24px;
  border-left: 2px solid var(--separator);
}

.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -8px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--card);
}

.timeline-dot.completed { background: var(--green); }
.timeline-dot.current { background: var(--blue); box-shadow: 0 0 0 4px rgba(0,122,255,0.2); }
.timeline-dot.pending { background: var(--separator); }

.timeline-title { font-size: 14px; font-weight: 600; }
.timeline-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ---- CALENDAR ---- */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-header-cell {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 0;
}

.cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 6px 2px;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}

.cal-cell:active { background: rgba(0,0,0,0.05); }
.cal-cell.today { background: rgba(0,122,255,0.1); }
.cal-cell.other-month { opacity: 0.3; }

.cal-day { font-size: 14px; font-weight: 500; }

.cal-dots {
  display: flex;
  gap: 2px;
  margin-top: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.cal-nav-title { font-size: 17px; font-weight: 600; }

.cal-nav-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(0,122,255,0.1);
  color: var(--blue);
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- SEARCH ---- */
.search-bar {
  position: relative;
  margin-bottom: 16px;
}

.search-bar input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: none;
  border-radius: 10px;
  background: rgba(118,118,128,0.12);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  color: var(--text);
}

.search-bar i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 14px;
}

/* ---- SEGMENT CONTROL ---- */
.segment-control {
  display: flex;
  background: rgba(118,118,128,0.12);
  border-radius: 10px;
  padding: 2px;
  margin-bottom: 16px;
}

.segment-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s;
}

.segment-btn.active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ---- TAGS ---- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

/* ---- FILE UPLOAD ---- */
.file-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.file-thumb {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background: var(--bg);
}

.file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-thumb-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 6px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-upload-btn {
  aspect-ratio: 1;
  border: 2px dashed var(--separator);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  background: none;
  transition: border-color 0.2s;
}

.file-upload-btn:active { border-color: var(--blue); color: var(--blue); }
.file-upload-btn i { font-size: 20px; }

/* ---- TOAST ---- */
.toast {
  position: fixed;
  top: calc(var(--header-h) + var(--safe-top) + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: rgba(30,30,30,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  z-index: 500;
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  max-width: 90%;
  text-align: center;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 15px; }

/* ---- WARNING CARD ---- */
.warning-card {
  background: rgba(255,149,0,0.1);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.warning-card.danger { background: rgba(255,59,48,0.1); }
.warning-card i { font-size: 20px; color: var(--orange); }
.warning-card.danger i { color: var(--red); }
.warning-card-text { font-size: 13px; flex: 1; }

/* ---- LOADING ---- */
.loading {
  text-align: center;
  padding: 32px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--separator);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- SECTION HEADER ---- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.section-link {
  font-size: 14px;
  color: var(--blue);
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

/* ---- CHIP ---- */
.chip-group {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  border: 1.5px solid var(--separator);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  transition: all 0.15s;
}

.chip.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

/* ---- REPORT CHART ---- */
.chart-bar-container { margin-top: 12px; }

.chart-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.chart-bar-label {
  width: 90px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: right;
  flex-shrink: 0;
}

.chart-bar-track {
  flex: 1;
  height: 24px;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
}

.chart-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}

/* ---- UTILITY ---- */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- RESPONSIVE ---- */
@media (min-width: 768px) {
  #page-container { max-width: 600px; margin: 0 auto; }
  .kanban-container { padding: 0 16px; }
}

@media (min-width: 1024px) {
  #page-container { max-width: 800px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
