/* ============================================================
   Daily Activities Manager — White & Gray Theme
   ============================================================ */

:root {
  --sidebar-width:  240px;
  --navbar-height:  58px;

  /* Gray scale */
  --gray-900: #1a1a1a;
  --gray-800: #2d2d2d;
  --gray-700: #444444;
  --gray-600: #606060;
  --gray-500: #808080;
  --gray-400: #a0a0a0;
  --gray-300: #c8c8c8;
  --gray-200: #e0e0e0;
  --gray-100: #efefef;
  --gray-50:  #f7f7f7;

  /* Semantic aliases */
  --primary:      #2d2d2d;
  --primary-dark: #1a1a1a;
  --bg:           #f5f5f5;
  --card-bg:      #ffffff;
  --text:         #1a1a1a;
  --muted:        #808080;
  --border:       #e0e0e0;

  --sidebar-bg:   #2d2d2d;
  --sidebar-text: rgba(255,255,255,.72);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: .9rem; }
a { color: var(--gray-700); text-decoration: none; }
a:hover { color: var(--gray-900); }

/* ── Navbar ───────────────────────────────────────────────── */
.app-navbar {
  background: #ffffff;
  height: var(--navbar-height);
  z-index: 1030;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.brand-icon {
  width: 34px; height: 34px; background: var(--gray-800); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: #fff;
}
.brand-name { font-weight: 700; font-size: 1rem; color: var(--gray-800); letter-spacing: -.3px; }
.sidebar-toggle-btn {
  background: none; border: none; color: var(--gray-600); font-size: 1.15rem;
  cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: all .2s;
}
.sidebar-toggle-btn:hover { background: var(--gray-100); color: var(--gray-900); }
.btn-accent { background: var(--gray-800); border-color: var(--gray-800); color: #fff; font-size: .8rem; }
.btn-accent:hover { background: var(--gray-900); border-color: var(--gray-900); color: #fff; }
.user-avatar-btn { background: none; border: none; cursor: pointer; display: flex; align-items: center; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gray-700);
  color: #fff; font-weight: 700; font-size: .85rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
/* Override navbar link colors since navbar is now white */
.app-navbar .dropdown-toggle { color: var(--gray-700) !important; }
.app-navbar .text-light-50 { color: var(--gray-500) !important; }

/* ── Layout ───────────────────────────────────────────────── */
.app-wrapper { display: flex; padding-top: var(--navbar-height); min-height: 100vh; }
.app-sidebar {
  width: var(--sidebar-width); min-height: calc(100vh - var(--navbar-height));
  background: var(--sidebar-bg); position: fixed; top: var(--navbar-height);
  left: 0; z-index: 1020; transition: transform .25s ease; overflow-y: auto;
  display: flex; flex-direction: column;
}
.app-main { margin-left: var(--sidebar-width); flex: 1; min-width: 0; transition: margin-left .25s ease; }
.page-content { padding: 1.5rem; max-width: 1400px; }

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar-inner { display: flex; flex-direction: column; height: 100%; padding: 1rem 0; }
.sidebar-user { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem 1rem; }
.sidebar-user-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--gray-600);
  color: #fff; font-weight: 700; font-size: 1rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-user-name { color: #fff; font-weight: 600; font-size: .875rem; }
.role-badge { font-size: .7rem; background: rgba(255,255,255,.12); color: rgba(255,255,255,.8); padding: 1px 8px; border-radius: 20px; }
.sidebar-divider { border-top: 1px solid rgba(255,255,255,.08); margin: 0 1rem; }
.sidebar-nav { padding: .75rem .75rem 0; flex: 1; }
.nav-section-label { font-size: .65rem; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,.32); padding: .5rem .5rem .25rem; font-weight: 600; }
.nav-link {
  display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem;
  border-radius: 8px; color: var(--sidebar-text); font-size: .875rem;
  font-weight: 500; margin-bottom: 2px; transition: all .15s; position: relative;
}
.nav-link i { width: 18px; text-align: center; font-size: .9rem; flex-shrink: 0; }
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link.active { background: rgba(255,255,255,.13); color: #fff; }
.nav-link.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 60%; background: #fff; border-radius: 0 2px 2px 0; }
.nav-badge { background: var(--gray-600); color: #fff; font-size: .65rem; padding: 1px 6px; border-radius: 20px; margin-left: auto; font-weight: 700; }
.text-danger-soft { color: rgba(200,80,80,.85) !important; }
.text-danger-soft:hover { color: #c05050 !important; background: rgba(200,80,80,.08) !important; }
.sidebar-footer { padding: .75rem; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-version { font-size: .65rem; color: rgba(255,255,255,.22); text-align: center; margin-top: .5rem; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1015; }

@media (max-width: 991px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-main { margin-left: 0; }
  .app-sidebar.open { transform: translateX(0); }
  .sidebar-overlay.visible { display: block; }
}

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: .75rem;
}
.page-title { font-size: 1.2rem; font-weight: 700; margin: 0; color: var(--gray-900); }
.breadcrumb { font-size: .8rem; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--gray-400); }

/* ── Admin Reward Chip ─────────────────────────────────────── */
.reward-chip { display:flex; align-items:center; gap:.55rem; padding:.35rem .85rem .35rem .45rem; border-radius:50px; border:1.5px solid #e0e0e0; background:#f8f8f8; transition:all .25s; }
.reward-chip.partial { background:linear-gradient(135deg,#fffdf0,#fff9e0); border-color:#e8c840; }
.reward-chip.earned  { background:linear-gradient(135deg,#fff9dc,#fff5c8); border-color:#d4a017; box-shadow:0 2px 8px rgba(212,160,23,.18); }
.reward-chip-icon { width:32px; height:32px; border-radius:50%; background:#e0e0e0; display:flex; align-items:center; justify-content:center; color:#999; font-size:.8rem; flex-shrink:0; transition:all .25s; }
.reward-chip.partial .reward-chip-icon { background:#e8a020; color:#fff; }
.reward-chip.earned  .reward-chip-icon { background:#d4a017; color:#fff; }
.reward-chip-body { line-height:1.15; }
.reward-chip-amount { font-size:1rem; font-weight:800; color:#aaa; }
.reward-chip.partial .reward-chip-amount { color:#c09000; }
.reward-chip.earned  .reward-chip-amount { color:#b07800; }
.reward-chip-label { font-size:.62rem; color:#aaa; font-weight:600; text-transform:uppercase; letter-spacing:.4px; }
.reward-chip.partial .reward-chip-label { color:#b08000; }
.reward-chip.earned  .reward-chip-label { color:#a07000; }
.breadcrumb-item.active { color: var(--muted); }
.breadcrumb-item a { color: var(--gray-600); }
.breadcrumb-item a:hover { color: var(--gray-900); }

/* ── Cards ────────────────────────────────────────────────── */
.card { background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.card-header { background: #fff; border-bottom: 1px solid var(--border); padding: .875rem 1.25rem; font-weight: 600; color: var(--gray-800); border-radius: 12px 12px 0 0; }
.card-body { padding: 1.25rem; }
.card-footer { background: var(--gray-50); border-top: 1px solid var(--border); padding: .75rem 1.25rem; border-radius: 0 0 12px 12px; }

/* ── Stat Cards ───────────────────────────────────────────── */
.stat-card {
  background: #fff; border-radius: 12px; padding: 1.1rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,.05);
  border-left: 4px solid var(--gray-400);
}
.stat-card.stat-total    { border-left-color: var(--gray-700); }
.stat-card.stat-pending  { border-left-color: var(--gray-400); }
.stat-card.stat-progress { border-left-color: var(--gray-500); }
.stat-card.stat-done     { border-left-color: var(--gray-800); }
.stat-icon {
  width: 46px; height: 46px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
  background: var(--gray-100); color: var(--gray-600);
}
.stat-total .stat-icon    { background: var(--gray-900); color: #fff; }
.stat-done  .stat-icon    { background: var(--gray-700); color: #fff; }
.stat-value { font-size: 1.65rem; font-weight: 800; line-height: 1; color: var(--gray-900); }
.stat-label { font-size: .74rem; color: var(--muted); font-weight: 500; margin-top: 3px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-xs { padding: .2rem .5rem; font-size: .75rem; border-radius: 6px; }
.btn-primary { background: var(--gray-800) !important; border-color: var(--gray-800) !important; color: #fff !important; }
.btn-primary:hover { background: var(--gray-900) !important; border-color: var(--gray-900) !important; }
.btn-primary:focus { box-shadow: 0 0 0 3px rgba(45,45,45,.2) !important; }
.btn-outline-primary { color: var(--gray-800) !important; border-color: var(--gray-400) !important; }
.btn-outline-primary:hover { background: var(--gray-800) !important; border-color: var(--gray-800) !important; color: #fff !important; }
.btn-outline-secondary { color: var(--gray-600) !important; border-color: var(--gray-300) !important; }
.btn-outline-secondary:hover { background: var(--gray-100) !important; color: var(--gray-900) !important; }
.btn-outline-success { color: var(--gray-700) !important; border-color: var(--gray-300) !important; }
.btn-outline-success:hover { background: var(--gray-700) !important; border-color: var(--gray-700) !important; color: #fff !important; }
.btn-outline-info { color: var(--gray-600) !important; border-color: var(--gray-300) !important; }
.btn-outline-info:hover { background: var(--gray-600) !important; color: #fff !important; }
.btn-outline-warning { color: var(--gray-700) !important; border-color: var(--gray-300) !important; }
.btn-outline-warning:hover { background: var(--gray-700) !important; color: #fff !important; }
.btn-outline-danger { color: var(--gray-600) !important; border-color: var(--gray-300) !important; }
.btn-outline-danger:hover { background: #c05050 !important; border-color: #c05050 !important; color: #fff !important; }
.btn-danger { background: #c05050 !important; border-color: #c05050 !important; }
.btn-danger:hover { background: #a03838 !important; border-color: #a03838 !important; }
.btn-secondary { background: var(--gray-200) !important; border-color: var(--gray-300) !important; color: var(--gray-800) !important; }
.btn-secondary:hover { background: var(--gray-300) !important; }

/* ── Badges ───────────────────────────────────────────────── */
.badge { font-weight: 600; letter-spacing: .2px; }
.badge.bg-primary   { background: var(--gray-800) !important; }
.badge.bg-secondary { background: var(--gray-400) !important; }
.badge.bg-success   { background: var(--gray-700) !important; }
.badge.bg-info      { background: var(--gray-500) !important; }
.badge.bg-warning   { background: var(--gray-500) !important; color: #fff !important; }
.badge.bg-danger    { background: #c05050 !important; }

/* ── Forms ────────────────────────────────────────────────── */
.form-label.required::after { content: ' *'; color: #c05050; }
.form-control, .form-select { border-color: var(--border); border-radius: 8px; font-size: .875rem; }
.form-control:focus, .form-select:focus { border-color: var(--gray-600); box-shadow: 0 0 0 3px rgba(80,80,80,.1); }
.input-group-text { background: var(--gray-50); border-color: var(--border); color: var(--muted); }
.form-check-input:checked { background-color: var(--gray-800); border-color: var(--gray-800); }
.form-switch .form-check-input:checked { background-color: var(--gray-700); border-color: var(--gray-700); }

/* ── Tables ───────────────────────────────────────────────── */
.table th { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.table-light { background: var(--gray-50) !important; }
.table-dark th { background: var(--gray-800) !important; color: #fff; }
.table-hover tbody tr:hover { background: var(--gray-50); }
.table-secondary { background: var(--gray-100) !important; }
.priority-row-high   td { border-left: 3px solid var(--gray-700); }
.priority-row-medium td { border-left: 3px solid var(--gray-400); }
.priority-row-low    td { border-left: 3px solid var(--gray-200); }

/* ── Alerts ───────────────────────────────────────────────── */
.alert-info    { background: var(--gray-50); border-color: var(--gray-300); color: var(--gray-700); }
.alert-success { background: #f8f8f8; border-color: var(--gray-300); color: var(--gray-800); }
.alert-danger  { background: #fdf5f5; border-color: #e0b0b0; color: #8a3535; }
.alert-warning { background: var(--gray-50); border-color: var(--gray-300); color: var(--gray-700); }

/* ── Progress bars ────────────────────────────────────────── */
.progress { background: var(--gray-100); }
.progress-bar { background: var(--gray-700) !important; }
.progress-bar.bg-success { background: var(--gray-800) !important; }
.progress-bar.bg-warning { background: var(--gray-500) !important; }
.progress-bar.bg-danger  { background: #c05050 !important; }

/* ── User avatar blocks ───────────────────────────────────── */
.user-avatar-sm {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gray-500); color: #fff; font-weight: 700; font-size: .7rem;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.user-avatar-lg {
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--gray-600); color: #fff; font-weight: 700; font-size: 1.25rem;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}

/* ── User Progress Rows ───────────────────────────────────── */
.user-progress-row {
  display: flex; align-items: center; gap: .875rem;
  padding: .875rem 1.25rem; border-bottom: 1px solid var(--border);
}
.user-progress-row:last-child { border-bottom: none; }
.user-progress-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--gray-600); color: #fff; font-weight: 700; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
}
.user-progress-body { flex: 1; min-width: 0; }

/* ── Feed ─────────────────────────────────────────────────── */
.feed-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1.25rem; border-bottom: 1px solid var(--border); font-size: .875rem;
}
.feed-item:last-child { border-bottom: none; }
.feed-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--gray-500); color: #fff; font-weight: 700; font-size: .75rem;
  display: flex; align-items: center; justify-content: center;
}
.feed-body { flex: 1; min-width: 0; }
.feed-time { flex-shrink: 0; white-space: nowrap; }

/* ── Priority badges (gray shades) ───────────────────────── */
.badge-priority-high   { background: var(--gray-800) !important; color: #fff; }
.badge-priority-medium { background: var(--gray-500) !important; color: #fff; }
.badge-priority-low    { background: var(--gray-300) !important; color: var(--gray-800); }

/* ── Toast ────────────────────────────────────────────────── */
#toastContainer { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: .5rem; }
.toast-msg {
  min-width: 280px; padding: .875rem 1.1rem; border-radius: 10px;
  background: var(--gray-900); color: #fff; font-size: .875rem;
  display: flex; align-items: center; gap: .75rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.18); animation: slideIn .25s ease;
}
.toast-msg.toast-success { border-left: 4px solid #aaa; }
.toast-msg.toast-danger  { border-left: 4px solid #c05050; }
.toast-msg.toast-info    { border-left: 4px solid #888; }
.toast-msg.toast-warning { border-left: 4px solid #999; }
@keyframes slideIn { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state i { display: block; margin-bottom: .75rem; color: var(--gray-300); }

/* ── Timeline ─────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before { content: ''; position: absolute; left: .5rem; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 1rem; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; position: absolute; left: -1.1rem; top: .25rem; border: 2px solid #fff; box-shadow: 0 0 0 2px var(--gray-400); background: var(--gray-400); }
.timeline-body { font-size: .85rem; }

/* ── Dropdowns ────────────────────────────────────────────── */
.dropdown-menu { border-color: var(--border); box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.dropdown-item:hover { background: var(--gray-100); color: var(--gray-900); }
.dropdown-header { color: var(--gray-700); }

/* ── Modal ────────────────────────────────────────────────── */
.modal-header.bg-danger { background: #c05050 !important; }

/* ── Login Page ───────────────────────────────────────────── */
.login-body { background: var(--gray-100); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrapper { position: relative; z-index: 1; width: 100%; max-width: 420px; padding: 1rem; }
.login-card {
  background: #ffffff; border: 1px solid var(--border);
  border-radius: 16px; padding: 2.5rem 2rem;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-icon {
  width: 58px; height: 58px; background: var(--gray-800); border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #fff; margin-bottom: 1rem;
}
.login-logo h2 { color: var(--gray-900); font-weight: 700; font-size: 1.4rem; margin-bottom: .25rem; }
.login-logo p { color: var(--muted); font-size: .85rem; }
.login-card .form-label { color: var(--gray-700); font-size: .875rem; font-weight: 500; }
.login-card .form-control { background: var(--gray-50); border-color: var(--border); color: var(--gray-900); }
.login-card .form-control:focus { background: #fff; border-color: var(--gray-600); color: var(--gray-900); }
.login-card .input-group-text { background: var(--gray-100); border-color: var(--border); color: var(--gray-500); cursor: pointer; }
.btn-eye { cursor: pointer; }
.btn-login {
  background: var(--gray-800); border: none; color: #fff;
  padding: .75rem; font-weight: 600; font-size: .95rem; border-radius: 10px;
  transition: all .2s;
}
.btn-login:hover { background: var(--gray-900); transform: translateY(-1px); color: #fff; }
.login-footer { text-align: center; margin-top: 1.5rem; }
/* Hide decorative login BG shapes */
.login-bg, .login-shapes { display: none; }

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .app-navbar, .app-sidebar, .sidebar-overlay, .d-print-none { display: none !important; }
  .app-main { margin-left: 0 !important; }
  .page-content { padding: 0; max-width: 100%; }
  .card { border: 1px solid #ccc; box-shadow: none; }
  body { background: #fff; }
}
