/* ============================================================
   IDS Daily Reporting System — Stylesheet
   Aesthetic: Clean institutional with warm, human accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:        #F7F5F0;
  --surface:   #FFFFFF;
  --border:    #E2DDD6;
  --border-focus: #7B6EA6;
  --text:      #1C1A17;
  --muted:     #6B6560;
  --accent:    #7B6EA6;
  --accent-light: #EDE9F7;
  --success:   #3D8C6F;
  --success-light: #E6F4EE;
  --warning:   #C4793A;
  --warning-light: #FDF0E6;
  --danger:    #B84646;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --radius:    10px;
  --radius-lg: 16px;
  --transition: 0.18s ease;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'DM Serif Display', serif;
  line-height: 1.2;
  font-weight: 400;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.main-content.wide {
  max-width: 1100px;
}

/* ── Topbar / Nav ───────────────────────────────────────────── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
}

.brand-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 400;
  display: block;
  margin-top: -2px;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-btn {
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: all var(--transition);
  font-family: inherit;
}

.nav-btn:hover { background: var(--bg); color: var(--text); }
.nav-btn.active { background: var(--accent-light); color: var(--accent); }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.25rem 0.75rem 0.25rem 0.35rem;
  font-size: 0.8rem;
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  flex-shrink: 0;
}

.role-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--accent-light);
  color: var(--accent);
}

.role-badge.manager { background: var(--success-light); color: var(--success); }

.btn-signout {
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.btn-signout:hover { border-color: var(--danger); color: var(--danger); }

/* ── Login Screen ───────────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 50% at 20% 20%, rgba(123,110,166,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 80% 80%, rgba(61,140,111,0.06) 0%, transparent 60%);
  padding: 2rem;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 3rem 2.5rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.login-logo {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--accent), #5C4E9E);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: 'DM Serif Display', serif;
  font-size: 1.8rem;
  margin: 0 auto 1.5rem;
  box-shadow: 0 4px 20px rgba(123,110,166,0.3);
}

.login-card h1 { font-size: 1.6rem; margin-bottom: 0.4rem; }
.login-card p { color: var(--muted); font-size: 0.9rem; margin-bottom: 2rem; }

.btn-microsoft {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.btn-microsoft:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(123,110,166,0.15);
  transform: translateY(-1px);
}

.ms-logo { width: 20px; height: 20px; flex-shrink: 0; }

.login-note {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.page-header h2 { font-size: 1.8rem; margin-bottom: 0.3rem; }
.page-header p { color: var(--muted); font-size: 0.9rem; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-header h3 { font-size: 1rem; font-family: 'DM Sans', sans-serif; font-weight: 600; }
.card-body { padding: 1.25rem; }

.section-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.section-label h3 {
  font-size: 1rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  color: var(--text);
}

.section-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ── Form Elements ──────────────────────────────────────────── */
.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.form-group { margin-bottom: 1rem; }
.form-group:last-child { margin-bottom: 0; }

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}

.label-hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.78rem;
  margin-left: 0.3rem;
}

input[type="text"],
input[type="date"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(123,110,166,0.1);
}

textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6560' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.2rem;
  cursor: pointer;
}

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

@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* Radio / Checkbox groups */
.radio-group, .check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.radio-option, .check-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition);
  background: var(--bg);
  user-select: none;
}

.radio-option:hover, .check-option:hover { border-color: var(--accent); background: var(--accent-light); }
.radio-option.selected, .check-option.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 500;
}

.radio-option input, .check-option input { display: none; }

/* ── Signature Pad ───────────────────────────────────────────── */
.signature-wrap {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #FAFAFA;
}

.signature-wrap canvas {
  display: block;
  width: 100%;
  cursor: crosshair;
  touch-action: none;
}

.signature-controls {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: 7px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(123,110,166,0.25);
}
.btn-primary:hover {
  background: #6B5E96;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(123,110,166,0.3);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--border);
}
.btn-danger:hover { background: #FEF2F2; border-color: var(--danger); }

.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; }
.btn-full { width: 100%; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Alerts / Toasts ────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #B6DDD0; }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid #F0CFA8; }
.alert-error { background: #FEF2F2; color: var(--danger); border: 1px solid #FECACA; }
.alert-info { background: var(--accent-light); color: var(--accent); border: 1px solid #C4BAE8; }

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--text);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
  max-width: 300px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Loading ────────────────────────────────────────────────── */
.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Table ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  text-align: left;
  padding: 0.65rem 0.85rem;
  background: var(--bg);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg); }

/* ── Status Pills ───────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.pill-success { background: var(--success-light); color: var(--success); }
.pill-warning { background: var(--warning-light); color: var(--warning); }
.pill-neutral { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.pill-accent  { background: var(--accent-light); color: var(--accent); }

/* ── Form Submit Area ───────────────────────────────────────── */
.form-actions {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 -1px;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.04);
}

/* ── Person selector card ───────────────────────────────────── */
.person-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.person-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--surface);
}
.person-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(123,110,166,0.1); }
.person-card.selected { border-color: var(--accent); background: var(--accent-light); }

.person-card-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.2rem; }
.person-card-id { font-size: 0.75rem; color: var(--muted); }

/* ── Goal tags ──────────────────────────────────────────────── */
.goal-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.goal-tag {
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.8rem;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--surface);
}
.goal-tag:hover { border-color: var(--success); color: var(--success); }
.goal-tag.active { border-color: var(--success); background: var(--success-light); color: var(--success); font-weight: 500; }

/* ── Dashboard stats ────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
}

.stat-value { font-size: 1.8rem; font-family: 'DM Serif Display', serif; line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--muted); margin-top: 0.3rem; font-weight: 500; }


/* ── Strategy 3-col responsive grid ────────────────────────── */
@media (max-width: 700px) {
  .strategy-row > div { grid-template-columns: 1fr !important; }
  .activity-row .form-row { grid-template-columns: 1fr !important; }
}
/* ── Print styles ───────────────────────────────────────────── */
@media print {
  .topbar, .no-print { display: none !important; }
  body { background: white; }
  .card, .form-section { box-shadow: none; border: 1px solid #ddd; }
  .main-content { max-width: 100%; padding: 0; }
}

/* ── Utility ────────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
