/* ============================================================
   Mentis Reminders — app stylesheet
   Mobile-first, clean card-based design
   ============================================================ */

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

:root {
  --blue:    #2563eb;
  --blue-dk: #1d4ed8;
  --green:   #16a34a;
  --red:     #dc2626;
  --orange:  #ea580c;
  --gray-50: #f9fafb;
  --gray-100:#f3f4f6;
  --gray-200:#e5e7eb;
  --gray-400:#9ca3af;
  --gray-600:#4b5563;
  --gray-800:#1f2937;
  --radius:  8px;
  --shadow:  0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Navbar ------------------------------------------------ */
.navbar {
  background: var(--blue);
  color: #fff;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.navbar-brand {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -.3px;
}
.navbar-nav { display: flex; align-items: center; gap: 16px; }
.nav-user { font-size: 13px; opacity: .8; }
.nav-link { color: rgba(255,255,255,.9); text-decoration: none; font-size: 14px; }
.nav-link:hover { color: #fff; text-decoration: underline; }

/* ---- Layout ------------------------------------------------ */
.main-content {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
}

.site-footer {
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-200);
  margin-top: auto;
}

/* ---- Cards ------------------------------------------------- */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--gray-800);
}

/* ---- Auth pages -------------------------------------------- */
.auth-wrap {
  max-width: 420px;
  margin: 40px auto;
  padding: 0 16px;
}
.auth-wrap .card { padding: 32px; }
.auth-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}
.auth-links {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--gray-600);
}
.auth-links a { color: var(--blue); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

/* ---- Forms ------------------------------------------------- */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.form-control {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 15px;
  color: var(--gray-800);
  background: #fff;
  transition: border-color .15s;
  -webkit-appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

/* Toggle / checkbox */
.toggle-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.toggle-label { font-size: 14px; color: var(--gray-600); }
.toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--gray-200);
  border-radius: 24px;
  cursor: pointer;
  transition: .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}
.toggle input:checked + .toggle-slider { background: var(--blue); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ---- Buttons ----------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
}
.btn-primary   { background: var(--blue);  color: #fff; }
.btn-primary:hover { background: var(--blue-dk); }
.btn-success   { background: var(--green); color: #fff; }
.btn-danger    { background: var(--red);   color: #fff; }
.btn-secondary { background: var(--gray-200); color: var(--gray-800); }
.btn-secondary:hover { background: var(--gray-200); opacity: .8; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---- Alerts ------------------------------------------------ */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert-warning { background: #fef9c3; color: #854d0e; border: 1px solid #fef08a; }

/* ---- Tabs -------------------------------------------------- */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px;
  gap: 0;
}
.tab-btn {
  padding: 10px 20px;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-400);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.tab-btn.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- Item cards -------------------------------------------- */
.item-list { display: flex; flex-direction: column; gap: 12px; }
.item-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.item-icon.cat-id       { background: #dbeafe; }
.item-icon.cat-personal { background: #fce7f3; }
.item-body { flex: 1; min-width: 0; }
.item-title {
  font-weight: 600;
  font-size: 15px;
  word-break: break-word;
}
.item-subtitle { font-size: 13px; color: var(--gray-400); margin-top: 2px; }
.item-notes    { font-size: 13px; color: var(--gray-600); margin-top: 4px; font-style: italic; }
.item-actions { display: flex; gap: 8px; flex-shrink: 0; align-self: center; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}
.badge-blue   { background: #dbeafe; color: var(--blue); }
.badge-green  { background: #dcfce7; color: var(--green); }
.badge-red    { background: #fee2e2; color: var(--red); }
.badge-orange { background: #ffedd5; color: var(--orange); }
.badge-gray   { background: var(--gray-100); color: var(--gray-600); }

/* Days-until indicator */
.days-chip {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
}
.days-overdue { background: #fecaca; color: #b91c1c; }
.days-today   { background: #fee2e2; color: #dc2626; }
.days-week    { background: #ffedd5; color: #c2410c; }
.days-month   { background: #fef9c3; color: #92400e; }
.days-soon    { background: #d1fae5; color: #065f46; }
.days-clear   { background: #e0f2fe; color: #0369a1; }

/* ---- Section header row ------------------------------------ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title { font-size: 18px; font-weight: 700; }

/* ---- Admin table ------------------------------------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--gray-200); }
th { font-weight: 700; color: var(--gray-600); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; background: var(--gray-50); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* ---- Pending banner ---------------------------------------- */
.pending-banner {
  background: #fef9c3;
  border: 1px solid #fef08a;
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}
.pending-banner h2 { font-size: 20px; margin-bottom: 8px; }
.pending-banner p  { color: var(--gray-600); }

/* ---- Empty state ------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-400);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ---- Modal overlay ----------------------------------------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-md);
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ---- Uniform action buttons -------------------------------- */
.action-btn {
  min-width: 48px;
  text-align: center;
}

/* ---- + Add dropdown ---------------------------------------- */
.add-dropdown { position: relative; }
.add-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 180px;
  z-index: 50;
  overflow: hidden;
}
.add-menu.open { display: block; }
.add-menu a,
.add-menu a:link,
.add-menu a:visited {
  display: block;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-800) !important;
  text-decoration: none !important;
  transition: background .12s;
}
.add-menu a:hover { background: var(--gray-100); }
.add-menu a + a { border-top: 1px solid var(--gray-100); }

/* ---- Responsive -------------------------------------------- */
@media (min-width: 600px) {
  .main-content { padding: 32px 24px; }
  .item-card { padding: 18px 24px; }
}
