* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body {
  background: #0a0e1a; color: #e8eaf2;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
#app { height: 100vh; width: 100%; max-width: 480px; margin: 0 auto; position: relative; }

/* SCREENS */
.screen {
  position: fixed; inset: 0; display: none; flex-direction: column;
  background: #0a0e1a; overflow: hidden;
}
.screen.active { display: flex; }

/* LOGIN */
.login-hero {
  text-align: center; padding: 60px 20px 30px;
}
.logo-icon { font-size: 48px; margin-bottom: 12px; }
.login-hero h1 { font-size: 24px; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
.login-hero p { color: #4a5568; font-size: 13px; margin-top: 4px; }
.login-card {
  background: #111827; border-radius: 20px 20px 0 0; padding: 24px 20px;
  border-top: 1px solid #1e2d45; flex: 1; overflow-y: auto;
}
.tab-row { display: flex; background: #0d1120; border-radius: 10px; margin-bottom: 20px; }
.tab {
  flex: 1; padding: 12px; text-align: center; border: none; background: transparent;
  color: #4a5568; font-weight: 600; font-size: 14px; border-radius: 10px; cursor: pointer;
}
.tab.active { background: #00d4aa; color: #001a14; }
label { display: block; color: #8892a4; font-size: 12px; margin-bottom: 6px; margin-top: 14px; font-weight: 500; }
input, select, textarea {
  width: 100%; background: #0d1120; border: 1px solid #1e2d45; border-radius: 10px;
  padding: 12px 14px; color: #fff; font-size: 15px; outline: none; transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus { border-color: #00d4aa; }
input::placeholder, textarea::placeholder { color: #4a5568; }
.btn-primary {
  width: 100%; background: #00d4aa; border: none; border-radius: 10px; padding: 14px;
  color: #001a14; font-weight: 700; font-size: 15px; margin-top: 20px; cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
}
.btn-primary:active { transform: scale(0.98); opacity: 0.9; }
.btn-outline {
  width: 100%; background: transparent; border: 1px solid #1e3a5f; border-radius: 10px;
  padding: 12px; color: #4a90e2; font-weight: 600; cursor: pointer; margin-top: 10px;
}
.btn-danger {
  width: 100%; background: #ff3366; border: none; border-radius: 10px; padding: 14px;
  color: #fff; font-weight: 700; font-size: 15px; margin-top: 20px; cursor: pointer;
}
.msg { padding: 12px; border-radius: 10px; margin-top: 14px; font-size: 13px; text-align: center; }
.msg.success { background: rgba(0,212,170,0.1); color: #00d4aa; border: 1px solid rgba(0,212,170,0.2); }
.msg.error { background: rgba(255,51,102,0.1); color: #ff3366; border: 1px solid rgba(255,51,102,0.2); }
.hidden { display: none !important; }

/* MAIN APP */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
  background: #0a0e1a; border-bottom: 1px solid #1e2d45;
  position: sticky; top: 0; z-index: 10;
}
.header-title { font-size: 18px; font-weight: 700; color: #fff; }
.icon-btn {
  background: transparent; border: none; color: #8892a4; font-size: 20px;
  padding: 6px; cursor: pointer; position: relative;
}
.badge {
  position: absolute; top: 2px; right: 2px; background: #ff3366; color: #fff;
  font-size: 10px; font-weight: 700; width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* CONTENT */
.content {
  flex: 1; overflow-y: auto; padding: 16px; padding-bottom: 80px;
  -webkit-overflow-scrolling: touch;
}
.view { display: none; }
.view.active { display: block; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.stat-card {
  background: #111827; border-radius: 14px; padding: 16px; text-align: center;
  border: 1px solid #1e2d45;
}
.stat-value { font-size: 28px; font-weight: 800; color: #00d4aa; }
.stat-label { font-size: 12px; color: #4a5568; margin-top: 4px; }

/* SECTIONS */
.section-title { font-size: 14px; font-weight: 700; color: #fff; margin: 20px 0 10px; }

/* QUICK ACTIONS */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-btn {
  background: #111827; border: 1px solid #1e2d45; border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: #e8eaf2; font-size: 12px; font-weight: 500; cursor: pointer;
}
.quick-icon { font-size: 24px; }

/* LISTS */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  background: #111827; border-radius: 14px; padding: 14px 16px;
  border: 1px solid #1e2d45; cursor: pointer; transition: transform 0.1s;
}
.list-item:active { transform: scale(0.99); }
.item-title { font-weight: 600; font-size: 15px; color: #fff; margin-bottom: 4px; }
.item-sub { font-size: 12px; color: #4a5568; }
.item-meta { display: flex; gap: 8px; margin-top: 8px; }
.badge-status {
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px;
}
.badge-pending { background: rgba(234,179,8,0.15); color: #eab308; }
.badge-confirmed { background: rgba(0,212,170,0.15); color: #00d4aa; }
.badge-inprogress { background: rgba(59,130,246,0.15); color: #3b82f6; }
.badge-completed { background: rgba(16,185,129,0.15); color: #10b981; }
.badge-cancelled { background: rgba(255,51,102,0.15); color: #ff3366; }

/* CALENDAR */
.calendar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 20px;
}
.cal-day-header { text-align: center; font-size: 11px; color: #4a5568; padding: 6px; }
.cal-day {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 10px; font-size: 13px; cursor: pointer; background: #111827; color: #e8eaf2;
  border: 1px solid transparent;
}
.cal-day:hover { background: #1e2d45; }
.cal-day.today { border-color: #00d4aa; color: #00d4aa; font-weight: 700; }
.cal-day.has-event::after {
  content: ''; width: 4px; height: 4px; background: #00d4aa; border-radius: 50%; margin-top: 2px;
}
.cal-day.has-pending { border-color: #eab308; color: #eab308; }
.cal-day.has-pending::after { background: #eab308; }
.cal-day.has-confirmed { border-color: #00d4aa; color: #00d4aa; }
.cal-day.has-confirmed::after { background: #00d4aa; }
.cal-day.has-cancelled { border-color: #ff3366; color: #ff3366; opacity: 0.6; }
.cal-day.has-cancelled::after { background: #ff3366; }
.cal-day.other { color: #4a5568; background: transparent; }

/* FORMS */
.form-card {
  background: #111827; border-radius: 16px; padding: 20px;
  border: 1px solid #1e2d45;
}
.form-card h3 { font-size: 18px; margin-bottom: 16px; }

/* MATERIAL ROWS */
.material-row {
  display: grid; grid-template-columns: 2fr 1fr 1fr 30px; gap: 8px; margin-bottom: 8px;
}
.material-row input { padding: 8px; font-size: 13px; }
.material-del { background: transparent; border: none; color: #ff3366; font-size: 18px; cursor: pointer; }

/* FILTERS */
.filter-row { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.filter-btn {
  background: #111827; border: 1px solid #1e2d45; border-radius: 20px;
  padding: 6px 14px; color: #8892a4; font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.filter-btn.active { background: #00d4aa; color: #001a14; border-color: #00d4aa; }

/* PROFILE */
.profile-header { text-align: center; padding: 30px 20px; }
.profile-avatar { font-size: 48px; margin-bottom: 10px; }
.profile-name { font-size: 18px; font-weight: 700; color: #fff; }
.profile-email { font-size: 13px; color: #4a5568; margin-top: 4px; }
.profile-card {
  background: #111827; border-radius: 16px; padding: 8px 16px;
  border: 1px solid #1e2d45; margin-bottom: 16px;
}
.profile-row {
  display: flex; justify-content: space-between; padding: 12px 0;
  border-bottom: 1px solid #1e2d45;
}
.profile-row:last-child { border-bottom: none; }
.profile-row span:first-child { color: #8892a4; font-size: 13px; }
.profile-row span:last-child { color: #fff; font-size: 13px; font-weight: 500; }

/* FAB */
.fab {
  position: fixed; bottom: 80px; right: 16px;
  width: 56px; height: 56px; border-radius: 50%;
  background: #00d4aa; border: none; color: #001a14;
  font-size: 28px; font-weight: 300; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,212,170,0.3);
  display: flex; align-items: center; justify-content: center;
}

/* EMPTY STATE */
.empty-state {
  text-align: center; padding: 40px 20px; color: #4a5568; font-size: 14px;
}

/* BOTTOM NAV */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-around;
  background: rgba(10,14,26,0.95); backdrop-filter: blur(10px);
  border-top: 1px solid #1e2d45; padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 8px 4px; background: transparent; border: none; color: #4a5568;
  font-size: 10px; cursor: pointer; transition: color 0.2s;
}
.nav-item.active { color: #00d4aa; }
.nav-icon { font-size: 20px; margin-bottom: 2px; }

/* ANIMATIONS */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.view.active { animation: fadeIn 0.25s ease; }

/* ACTIVITY */
.activity-item {
  display: flex; align-items: center; gap: 12px;
  background: #111827; border-radius: 12px; padding: 12px 16px;
  border: 1px solid #1e2d45; margin-bottom: 8px;
}
.activity-icon { font-size: 20px; }
.activity-text { flex: 1; }
.activity-title { font-size: 13px; font-weight: 600; color: #fff; }
.activity-time { font-size: 11px; color: #4a5568; }

/* NOTIFICATION ITEM */
.notif-item {
  display: flex; gap: 12px;
  background: #111827; border-radius: 12px; padding: 12px 16px;
  border: 1px solid #1e2d45; margin-bottom: 8px;
}
.notif-item.unread { border-left: 3px solid #00d4aa; }
.notif-title { font-size: 13px; font-weight: 600; color: #fff; }
.notif-msg { font-size: 12px; color: #8892a4; margin-top: 2px; }
.notif-time { font-size: 11px; color: #4a5568; margin-top: 4px; }
