/*
 * N-SIGHTS Planner
 * © 2024 N-SIGHTS. All rights reserved.
 */

:root {
  --bg: #0a0e27;
  --card-bg: #151a2e;
  --text: #e0e7ff;
  --text-dim: #94a3b8;
  --primary: #00ff88;
  --accent: #00d4ff;
  --danger: #ff6348;
  --warning: #f59e0b;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: rgba(0, 0, 0, 0.5);
}

body.light {
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-dim: #64748b;
  --border: rgba(0, 0, 0, 0.1);
  --shadow: rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
  min-height: 100vh;
}

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

/* ============ AUTH MODAL ============ */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 1;
  visibility: visible;
  transition: all 0.3s ease;
}

.auth-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-modal {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  animation: modalSlideIn 0.4s ease;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h2 {
  font-size: 28px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--text-dim);
  font-size: 14px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.auth-input {
  padding: 14px 16px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  transition: all 0.3s;
}

.auth-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 255, 136, 0.1);
}

.auth-input::placeholder {
  color: var(--text-dim);
}

.auth-btn {
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--bg);
  border: none;
}

.auth-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 255, 136, 0.3);
}

.auth-switch {
  text-align: center;
  font-size: 14px;
  color: var(--text-dim);
}

.auth-switch a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-skip {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  margin-top: 16px;
  transition: color 0.3s;
}

.auth-skip:hover {
  color: var(--text);
}

/* ============ LOADING OVERLAY ============ */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.loading-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-overlay p {
  margin-top: 16px;
  color: var(--text);
  font-size: 16px;
}

/* ============ HEADER ============ */
.header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px var(--shadow);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  max-width: 300px;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.header-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
}

.header-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.5s ease;
  width: 0%;
}

.header-progress-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  min-width: 35px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 24px;
  border: 1px solid var(--border);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-btn {
  background: var(--primary);
  color: var(--bg);
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s;
}

.menu-btn:hover {
  background: var(--accent);
  transform: scale(1.05);
}

/* ============ THEME TOGGLE ============ */
.switch {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 28px;
}

.switch.small {
  width: 44px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 28px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

.switch.small .slider:before {
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
}

input:checked + .slider {
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

input:checked + .slider:before {
  transform: translateX(28px);
}

.switch.small input:checked + .slider:before {
  transform: translateX(22px);
}

/* ============ SIDEBAR ============ */
.sidebar {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  height: 100vh;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  padding: 24px;
  overflow-y: auto;
  z-index: 200;
  transition: left 0.3s ease;
  box-shadow: 4px 0 20px var(--shadow);
  display: flex;
  flex-direction: column;
}

.sidebar.visible {
  left: 0;
}

.sidebar h2 {
  font-size: 24px;
  margin-bottom: 24px;
  color: var(--primary);
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-section h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--text-dim);
}

.close-sidebar {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--danger);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.close-sidebar:hover {
  transform: rotate(90deg);
}

/* User Section */
.user-section {
  padding: 16px;
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(0, 212, 255, 0.1));
  border-radius: 12px;
  border: 1px solid var(--border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.user-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.user-card-info h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.user-card-info p {
  font-size: 12px;
  color: var(--text-dim);
}

.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Sync Section */
.sync-section {
  padding: 16px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.sync-section .btn {
  width: 100%;
  margin-top: 8px;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.sync-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
}

.sync-indicator.synced {
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}

.live-clock {
  text-align: center;
  padding: 16px;
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(0, 212, 255, 0.1));
  border-radius: 12px;
  border: 1px solid var(--border);
}

/* ============ MAIN CONTENT ============ */
.main-content {
  padding: 32px 20px;
}

.today-label {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--bg);
  padding: 12px 24px;
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
}

/* ============ PLANNER SECTION ============ */
.planner-full {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: 0 4px 20px var(--shadow);
  border: 1px solid var(--border);
}

.view-switcher {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.view-btn {
  flex: 1;
  min-width: 120px;
  padding: 12px 20px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.view-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.view-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--bg);
  border-color: transparent;
}

.controls {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-group label {
  font-weight: 600;
  color: var(--text-dim);
}

.input-field {
  padding: 10px 14px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  transition: all 0.3s;
}

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

.actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 20px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.btn.primary {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
}

.btn.success {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
}

.btn.danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

/* ============ GRID WRAPPER ============ */
.grid-wrapper {
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.grid-container {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 60vh;
  min-height: 300px;
}

.grid-table {
  display: table;
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
}

.grid-row {
  display: table-row;
}

.grid-cell {
  display: table-cell;
  padding: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
  min-width: 45px;
  max-width: 60px;
  font-size: 14px;
}

.grid-cell.header-cell {
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(0, 212, 255, 0.2));
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 10;
  font-size: 12px;
}

.grid-cell.header-cell.today {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--bg);
}

.grid-cell.habit-name {
  text-align: left;
  font-weight: 600;
  min-width: 150px;
  max-width: 200px;
  position: sticky;
  left: 0;
  z-index: 5;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.toggleBtn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggleBtn:hover {
  transform: scale(1.1);
  border-color: var(--primary);
}

.toggleBtn.done {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--bg);
  border-color: transparent;
  font-weight: bold;
}

.note-btn, .trash-btn {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.3s;
  font-size: 12px;
}

.note-btn:hover {
  background: var(--accent);
  transform: scale(1.05);
}

.trash-btn:hover {
  background: var(--danger);
  transform: scale(1.05);
}

.mental-input {
  width: 50px;
  padding: 6px;
  text-align: center;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s;
}

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

/* ============ PROGRESS SECTION ============ */
.progress-section {
  margin-top: 32px;
}

.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px var(--shadow);
  border: 1px solid var(--border);
}

.progress-card h2 {
  font-size: 24px;
  margin-bottom: 20px;
  color: var(--primary);
}

.progress-bar-wrapper {
  margin-bottom: 16px;
}

.css-progress {
  width: 100%;
  height: 24px;
  background: var(--bg);
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border);
}

.css-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.5s ease;
  width: 0%;
}

.progress-info {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

/* ============ CHARTS ============ */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.chart-card h3 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--accent);
}

canvas {
  max-width: 100%;
  height: auto !important;
}

/* ============ WEEKLY VIEW ============ */
.week-selector {
  margin-bottom: 24px;
}

.week-selector h3 {
  font-size: 20px;
  margin-bottom: 16px;
  color: var(--primary);
}

.week-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.week-btn {
  flex: 1;
  min-width: 150px;
  padding: 12px 20px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.week-btn:hover {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--bg);
  border-color: transparent;
  transform: translateY(-2px);
}

.week-detail-container {
  margin-top: 24px;
}

.week-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.week-header h3 {
  font-size: 22px;
  color: var(--primary);
}

.week-navigation {
  display: flex;
  gap: 12px;
}

.mini-tracker {
  margin-bottom: 24px;
  overflow-x: auto;
}

.mini-grid {
  font-size: 14px;
}

.mini-grid .grid-cell {
  padding: 8px;
  min-width: 50px;
}

.mini-toggle {
  width: 32px;
  height: 32px;
  font-size: 16px;
}

.weekly-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

/* ============ DAILY VIEW ============ */
.daily-view-container {
  padding: 24px;
}

.daily-header {
  margin-bottom: 32px;
}

.daily-navigation {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.daily-date {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.daily-habits-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.daily-habit-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.3s;
  gap: 20px;
}

.daily-habit-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow);
  border-color: var(--primary);
}

.daily-habit-info {
  flex: 1;
}

.daily-habit-info h4 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text);
}

.daily-habit-info p {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.daily-habit-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.daily-habit-toggle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--border);
  background: var(--card-bg);
  color: var(--text-dim);
  font-size: 32px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.daily-habit-toggle:hover {
  transform: scale(1.1);
  border-color: var(--primary);
}

.daily-habit-toggle.done {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--bg);
  border-color: transparent;
}

/* ============ NOTIFICATIONS ============ */
.notification {
  position: fixed;
  top: 100px;
  right: 20px;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  z-index: 9999;
  font-weight: 600;
  animation: slideIn 0.3s ease;
}

.notification.success {
  background: var(--primary);
  color: var(--bg);
}

.notification.error {
  background: var(--danger);
  color: white;
}

.notification.info {
  background: var(--accent);
  color: var(--bg);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .grid-container {
    max-height: 50vh;
  }
  
  .grid-cell {
    min-width: 40px;
    padding: 6px;
    font-size: 12px;
  }
  
  .grid-cell.habit-name {
    min-width: 120px;
    max-width: 150px;
    font-size: 12px;
  }
  
  .toggleBtn {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
}

@media (max-width: 768px) {
  .header .container {
    flex-direction: row;
    align-items: center;
    padding: 0 12px;
  }

  .logo {
    font-size: 18px;
  }
  
  .logo-section {
    max-width: 200px;
  }
  
  .user-info {
    display: none;
  }
  
  .header-progress {
    display: none;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .control-group {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .actions {
    flex-direction: column;
  }
  
  .actions .btn {
    width: 100%;
    justify-content: center;
  }
  
  .grid-container {
    max-height: 45vh;
  }

  .grid-cell.habit-name {
    min-width: 100px;
    max-width: 120px;
    font-size: 11px;
  }
  
  .grid-cell {
    min-width: 35px;
    padding: 4px;
    font-size: 11px;
  }
  
  .toggleBtn {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }
  
  .mental-input {
    width: 40px;
    padding: 4px;
    font-size: 12px;
  }
  
  .note-btn, .trash-btn {
    padding: 3px 6px;
    font-size: 10px;
  }

  .charts-grid, .weekly-charts {
    grid-template-columns: 1fr;
  }

  .week-buttons {
    flex-direction: column;
  }

  .week-btn {
    min-width: 100%;
  }

  .daily-habit-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .daily-habit-toggle {
    align-self: center;
    width: 56px;
    height: 56px;
    font-size: 28px;
  }
  
  .daily-date {
    font-size: 22px;
  }
  
  .daily-navigation .btn {
    padding: 10px 14px;
    font-size: 12px;
  }
  
  .auth-modal {
    margin: 16px;
    padding: 24px;
  }
  
  .auth-header h2 {
    font-size: 22px;
  }
  
  .view-switcher {
    gap: 8px;
  }
  
  .view-btn {
    min-width: 90px;
    padding: 10px 12px;
    font-size: 14px;
  }
  
  .today-label {
    font-size: 14px;
    padding: 10px 16px;
  }
  
  .card {
    padding: 16px;
  }
  
  .progress-card h2 {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 10px;
  }
  
  .main-content {
    padding: 16px 10px;
  }
  
  .planner-full {
    padding: 16px;
  }
  
  .logo {
    font-size: 16px;
  }
  
  .menu-btn {
    padding: 8px 12px;
    font-size: 18px;
  }
  
  .grid-container {
    max-height: 40vh;
  }
  
  .grid-cell.habit-name {
    min-width: 80px;
    max-width: 100px;
    font-size: 10px;
  }
  
  .grid-cell {
    min-width: 30px;
    padding: 3px;
  }
  
  .toggleBtn {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }
  
  .view-btn {
    min-width: 70px;
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* ============ SCROLLBAR ============ */
.grid-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.grid-container::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 4px;
}

.grid-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.grid-container::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.grid-container {
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg);
}

/* ============ INSTALL PROMPT ============ */
.install-prompt {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 24px;
  box-shadow: 0 8px 32px var(--shadow);
  z-index: 1001;
  animation: slideUp 0.3s ease;
}

.install-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.install-buttons {
  display: flex;
  gap: 8px;
}

@keyframes slideUp {
  from {
    transform: translateX(-50%) translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* ============ SYNC STATUS ============ */
.sync-status-header {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 24px;
  border: 1px solid var(--border);
}

.sync-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: all 0.3s;
}

.sync-dot.synced {
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

.sync-dot.syncing {
  background: var(--warning);
  animation: pulse 1s infinite;
}

.sync-dot.error {
  background: var(--danger);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.sync-toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sync-toggle-wrapper label {
  font-weight: 600;
  color: var(--text);
}

.sync-indicator.syncing {
  background: var(--warning);
  animation: pulse 1s infinite;
}

.sync-indicator.error {
  background: var(--danger);
}

.last-sync-time {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
  text-align: center;
}

#syncNowBtn, #pullDataBtn {
  width: 100%;
  margin-top: 8px;
}


.password-field {
  display: flex;
  align-items: center;
  gap: 5px; 
}

.password-field input {
  flex: 1;*/
  padding: 8px;
  font-size: 14px;
}


.password-field button {
  background: none;      
  border: 1px solid #ccc; 
  cursor: pointer;       */
  padding: 5px 8px;
  font-size: 16px;
  border-radius: 4px;   
}
