/* AUTHENTICATED PAGES (DASHBOARD, GOALS, STATS, SETTINGS, ACCOUNT) SPECIFIC STYLES */

/* APP LAYOUT */
.app-main{
  padding:24px 20px;
}
.app-container{
  max-width:700px;
  margin:0 auto;
}
.app-container--wide{
  max-width:900px;
}
.app-page-header{
  margin-bottom:24px;
}
.app-page-title{
  font-size:28px;
  font-weight:800;
  letter-spacing:-0.02em;
  margin-bottom:6px;
}
.app-page-subtitle{
  color:var(--muted);
  font-size:15px;
}
.section-title{
  font-size:18px;
  font-weight:800;
  letter-spacing:-0.01em;
  margin-bottom:14px;
}

/* GOAL CARDS */
.goal-card{
  background:var(--bg2);
  border:1px solid var(--border);
  border-radius:var(--radius2);
  padding:16px;
  margin-bottom:12px;
}
.goal-card.goal-overdue{
  border-color:var(--danger);
  background:rgba(239,68,68,.05);
}
.goal-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:12px;
}
.goal-title{
  font-size:16px;
  font-weight:700;
  margin:0;
}
.goal-description{
  font-size:14px;
  color:var(--muted);
  margin-bottom:12px;
  line-height:1.5;
}
.goal-point-a{
  background:rgba(37,99,235,.08);
  border:1px solid rgba(37,99,235,.18);
  border-radius:12px;
  padding:12px;
  margin-bottom:12px;
}
.goal-point-a .point-label{
  font-size:11px;
  font-weight:800;
  color:var(--accent2);
  text-transform:uppercase;
  letter-spacing:0.5px;
  display:block;
  margin-bottom:4px;
}
.goal-point-a .point-text{
  font-size:13px;
  color:var(--text);
  margin:0;
}

/* GOAL & TASK BADGES */
.goal-badge,
.task-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
  font-weight:800;
  color:var(--text);
  font-size:12px;
  white-space:nowrap;
}
.goal-badge.badge-active,
.task-badge.badge-active{
  background: rgba(37,99,235,.18);
  border-color: rgba(37,99,235,.35);
  color:var(--accent2);
}
.goal-badge.badge-completed,
.task-badge.badge-completed{
  background: rgba(22,163,74,.18);
  border-color: rgba(22,163,74,.35);
  color:var(--ok);
}
.goal-badge.badge-failed,
.task-badge.badge-failed{
  background: rgba(239,68,68,.18);
  border-color: rgba(239,68,68,.35);
  color:var(--danger);
}
.goal-badge.badge-ignored,
.task-badge.badge-ignored{
  background: rgba(245,158,11,.18);
  border-color: rgba(245,158,11,.35);
  color:var(--warn);
}
.goal-badge.badge-danger,
.task-badge.badge-danger{
  background: rgba(239,68,68,.18);
  border-color: rgba(239,68,68,.35);
  color:var(--danger);
}
.goal-badge.badge-success,
.task-badge.badge-success{
  background: rgba(22,163,74,.18);
  border-color: rgba(22,163,74,.35);
  color:var(--ok);
}
.goal-badge.badge-warning,
.task-badge.badge-warning{
  background: rgba(245,158,11,.18);
  border-color: rgba(245,158,11,.35);
  color:var(--warn);
}

/* TASK CARDS */
.task-card{
  background:var(--bg2);
  border:1px solid var(--border);
  border-radius:var(--radius2);
  padding:16px;
  margin-bottom:12px;
}
.task-card.task-completed{
  border-color:var(--ok);
  background:rgba(22,163,74,.05);
}
.task-card.task-failed{
  border-color:var(--danger);
  background:rgba(239,68,68,.05);
}
.task-card.task-ignored{
  border-color:var(--warn);
  background:rgba(245,158,11,.05);
}
.task-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:12px;
}
.task-title{
  font-size:16px;
  font-weight:700;
  margin:0;
}
.task-description{
  font-size:14px;
  color:var(--muted);
  margin-bottom:12px;
  line-height:1.5;
  white-space:pre-line;
}
.task-criteria{
  background:#fff;
  border-radius:10px;
  padding:10px 12px;
  margin-bottom:12px;
  border:1px solid var(--border);
}
.criteria-label{
  font-size:11px;
  font-weight:800;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:0.5px;
  display:block;
  margin-bottom:4px;
}
.criteria-text{
  font-size:13px;
  color:var(--text);
  margin:0;
}
.task-motivation{
  display:flex;
  align-items:flex-start;
  gap:8px;
  margin-bottom:12px;
}
.motivation-icon{
  flex-shrink:0;
  font-size:16px;
}
.motivation-text{
  flex:1;
  font-size:14px;
  color:var(--muted);
  margin:0;
  line-height:1.5;
}

/* HISTORY */
.task-history{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.history-item{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px;
  border-radius:12px;
  background:var(--bg2);
  border:1px solid var(--border);
}
.history-date{
  font-weight:700;
  font-size:13px;
  color:var(--muted);
  min-width:50px;
}
.history-content{
  flex:1;
}
.history-title{
  font-size:14px;
  font-weight:650;
  margin-bottom:4px;
}
.history-status{
  font-size:12px;
}

/* STATS */
.stats-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(150px, 1fr));
  gap:14px;
  margin-bottom:20px;
}
.stat-card{
  background:#fff;
  border-radius:var(--radius2);
  padding:18px;
  text-align:center;
  border:1px solid var(--border);
  box-shadow:var(--shadow2);
}
.stat-value{
  font-size:32px;
  font-weight:800;
  color:var(--text);
  line-height:1.2;
  margin:8px 0;
}
.stat-label{
  font-size:13px;
  color:var(--muted);
  margin-top:4px;
}
.stat-detail{
  font-size:12px;
  color:var(--muted2);
  margin-top:6px;
}
.summary-grid{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:10px;
  margin-bottom:16px;
}
.summary-item{
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:14px;
  border-radius:12px;
  background:#fff;
  border:1px solid var(--border);
}
.summary-count{
  font-size:24px;
  font-weight:800;
  color:var(--text);
}
.summary-label{
  font-size:11px;
  color:var(--muted2);
  margin-top:4px;
  text-align:center;
}

/* TABLES */
.table-wrapper{
  overflow-x:auto;
  margin:-8px;
  padding:8px;
}
.stats-table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}
.stats-table th,
.stats-table td{
  padding:10px 8px;
  text-align:left;
  border-bottom:1px solid var(--border);
}
.stats-table th{
  font-weight:700;
  color:var(--muted);
  background:var(--bg2);
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:0.5px;
}
.stats-table tbody tr:hover{
  background:var(--bg2);
}
.date-cell{
  white-space:nowrap;
  font-family:monospace;
  color:var(--muted2);
}
.title-cell{
  max-width:200px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* SETTINGS */
.pressure-options{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-bottom:20px;
}
.pressure-option{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:14px;
  border:2px solid var(--border);
  border-radius:12px;
  cursor:pointer;
  transition:all .15s ease;
  background:#fff;
}
.pressure-option:hover{
  border-color:var(--accent);
  background:rgba(37,99,235,.03);
}
.pressure-option.selected{
  border-color:var(--accent);
  background:rgba(37,99,235,.08);
}
.pressure-content{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.pressure-label{
  font-weight:700;
  color:var(--text);
}
.pressure-description{
  font-size:13px;
  color:var(--muted);
}
.boundaries-section{
  margin-top:20px;
  padding-top:20px;
  border-top:1px solid var(--border);
}
.boundaries-section .subsection-title{
  margin-top:0;
  margin-bottom:8px;
}
.subsection-title{
  font-size:16px;
  font-weight:700;
  margin-top:16px;
  margin-bottom:8px;
}
.checkbox-group{
  margin-bottom:20px;
}
.checkbox-group .checkbox-label{
  display:flex;
  align-items:flex-start;
  gap:10px;
  margin-bottom:16px;
  cursor:pointer;
}
.checkbox-group .checkbox-label:last-child{
  margin-bottom:0;
}
.checkbox-group .checkbox-label input[type="checkbox"]{
  width:18px;
  height:18px;
  margin-top:2px;
  flex-shrink:0;
  cursor:pointer;
}
.checkbox-group .checkbox-label > span{
  display:flex;
  flex-direction:column;
  flex:1;
}
.checkbox-group .checkbox-text{
  font-size:14px;
  color:var(--text);
  font-weight:650;
  line-height:1.4;
}
.checkbox-group .checkbox-hint{
  font-size:12px;
  color:var(--muted2);
  margin-top:4px;
  font-weight:400;
  line-height:1.4;
}

/* UTILITIES */
.button-group{
  margin-top:12px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.back-link{
  margin-top:24px;
  text-align:center;
}
.empty-state{
  text-align:center;
  padding:40px 20px;
}
.empty-icon{
  font-size:48px;
  display:block;
  margin-bottom:16px;
  opacity:0.5;
}
.empty-text{
  color:var(--muted);
  font-size:16px;
  margin-bottom:8px;
}
.empty-hint{
  color:var(--muted2);
  font-size:13px;
}
.form-inline{
  display:inline;
}
.form-spacing{
  margin-top:12px;
}
.section-description{
  font-size:14px;
  color:var(--muted);
  margin-bottom:16px;
}
.status-banner{
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px;
  border-radius:14px;
  margin-bottom:16px;
}
.status-banner.status-active{
  background:rgba(22,163,74,.08);
  border:1px solid rgba(22,163,74,.2);
}
.status-banner.status-paused{
  background:rgba(245,158,11,.08);
  border:1px solid rgba(245,158,11,.2);
}
.status-banner.status-inactive{
  background:var(--bg2);
  border:1px solid var(--border);
}
.status-banner .status-icon{
  font-size:24px;
}
.status-banner .status-text{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.status-banner .status-text strong{
  font-size:16px;
}
.status-banner .status-detail{
  font-size:13px;
  opacity:0.8;
}

/* TIME SELECTOR */
.time-selector{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:20px;
  flex-wrap:wrap;
}
.time-selector-label{
  color:var(--muted);
  font-size:14px;
}

/* PRIVACY PAGE */
.privacy-main{padding:40px 20px;}
.privacy-title{font-size:32px; margin-bottom:20px;}
.privacy-content{line-height:1.7;}
.privacy-content section,
.landing-content section{
  padding:16px 0;
  margin:0;
}
.privacy-content section h2,
.landing-content section h2{
  margin-top:0;
  margin-bottom:12px;
}

/* MODAL */
.modal{
  position:fixed;
  top:0;
  left:0;
  right:0;
  bottom:0;
  z-index:2000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
}
.modal-overlay{
  position:absolute;
  top:0;
  left:0;
  right:0;
  bottom:0;
  background:rgba(0,0,0,0.5);
  backdrop-filter:blur(4px);
}
.modal-content{
  position:relative;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:0 10px 40px rgba(0,0,0,0.2);
  max-width:500px;
  width:100%;
  max-height:90vh;
  overflow-y:auto;
  z-index:1;
}
.modal-header{
  padding:20px 24px;
  border-bottom:1px solid var(--border);
}
.modal-title{
  font-size:20px;
  font-weight:800;
  margin:0;
}
.modal-body{
  padding:24px;
}
.modal-footer{
  padding:20px 24px;
  border-top:1px solid var(--border);
  display:flex;
  justify-content:flex-end;
  gap:12px;
}
.modal-footer form{
  display:flex;
  gap:12px;
  width:100%;
  justify-content:flex-end;
}
.warning-box{
  background:rgba(239,68,68,0.1);
  border:1px solid rgba(239,68,68,0.3);
  border-radius:var(--radius);
  padding:16px;
}
.warning-box p{
  margin:0 0 12px 0;
  line-height:1.6;
  color:var(--text);
}
.warning-box p:last-child{
  margin-bottom:0;
}
.warning-box strong{
  color:var(--danger);
}
.app-card--danger{
  border-color:rgba(239,68,68,0.3);
}
.btn-danger{
  background:var(--danger);
  color:white;
  border-color:var(--danger);
}
.btn-danger:hover{
  background:#dc2626;
  border-color:#dc2626;
}

/* FLATPICKR CUSTOMIZATION */
.flatpickr-calendar{
  background:var(--card);
  border-color:var(--border);
}
.flatpickr-day.selected{
  background:var(--accent);
  border-color:var(--accent);
}

/* RESPONSIVE */
@media (max-width: 920px){
  .summary-grid{grid-template-columns:repeat(2, 1fr);}
}
@media (max-width: 780px){
  .app-main{padding:20px 16px;}
  .summary-grid{grid-template-columns:1fr;}
}

