/* ============================================================
   HCMNJ Portal — styles.css
   Warm, human, brand-aligned. Inspired by hcmnj.com + Overflow Coffee.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg:       #FAFAF8;
  --surface:  #FFFFFF;
  --surface2: #F4F2EE;
  --surface3: #EDE9E1;
  --border:   #E2DDD5;
  --text:     #1A1A1A;
  --muted:    #6B6866;
  --accent:   #3D7A5A;
  --accent2:  #2E5E44;
  --red:      #C0392B;
  --amber:    #C87D0E;
  --blue:     #2563A8;
  --green:    #3D7A5A;

  --radius:   10px;
  --shadow:   0 1px 4px rgba(0,0,0,0.06), 0 2px 12px rgba(0,0,0,0.04);
  --shadow-md:0 2px 8px rgba(0,0,0,0.08), 0 4px 24px rgba(0,0,0,0.06);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* ── HEADER ── */
.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 1px 0 var(--border);
}
.portal-logo {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
}
.portal-logo span { color: var(--accent); }
.portal-user {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
}
.portal-signout {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 5px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: all 0.15s;
}
.portal-signout:hover { color: var(--text); border-color: var(--text); }

/* ── TABS ── */
.portal-tabs {
  display: flex;
  gap: 0;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  overflow-x: auto;
}
.portal-tab {
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  user-select: none;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.portal-tab:hover { color: var(--text); }
.portal-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ── PAGES ── */
.portal-page { display: none; padding: 28px; max-width: 1100px; margin: 0 auto; }
.portal-page.active { display: block; }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card-header {
  padding: 13px 18px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body { padding: 18px; }

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61,122,90,0.1);
}
.form-textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B6866' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  letter-spacing: -0.1px;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface3); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 6px 13px; font-size: 12px; }

/* ── BADGES ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-green  { background: #E8F5EE; color: #2E5E44; }
.badge-red    { background: #FDECEA; color: #9B2219; }
.badge-amber  { background: #FDF3E3; color: #974A0A; }
.badge-blue   { background: #EBF2FC; color: #1A4A82; }
.badge-muted  { background: var(--surface2); color: var(--muted); }
.badge-accent { background: #E8F5EE; color: var(--accent); }

/* ── TABLE ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--surface2); }

/* ── FLAG ROWS ── */
.flag-row {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.flag-row:last-child { border-bottom: none; }
.flag-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.flag-title { font-size: 13px; font-weight: 500; color: var(--text); }
.flag-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── STATUS ROWS ── */
.status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.status-row:last-child { border-bottom: none; }
.status-name { flex: 1; font-weight: 500; font-size: 13px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: var(--green); }
.dot-red   { background: var(--red); }
.dot-amber { background: var(--amber); }

/* ── KANBAN ── */
.kanban-col { min-height:120px; background:var(--surface2); border:2px dashed var(--border); border-radius:10px; padding:10px; transition:border-color 0.15s,background 0.15s; }
.kanban-col.drag-over { border-color:var(--accent); background:#eef6f1; }
.kanban-card { background:#fff; border:1px solid var(--border); border-radius:8px; padding:11px 13px; margin-bottom:8px; cursor:grab; box-shadow:0 1px 4px rgba(0,0,0,0.06); transition:box-shadow 0.15s,transform 0.1s; user-select:none; }
.kanban-card:hover { box-shadow:0 3px 10px rgba(0,0,0,0.1); transform:translateY(-1px); }
.kanban-card:active { cursor:grabbing; }
.kanban-card-title { font-weight:600; font-size:13px; color:var(--text); }
.kanban-card-client { font-size:11px; color:var(--accent); font-weight:500; margin-top:2px; }
.kanban-card-desc { font-size:12px; color:var(--muted); margin-top:4px; }

/* ── TOAST ── */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 9999;
  max-width: 320px;
}
#toast.show { opacity: 1; transform: translateY(0); }
#toast.success { background: var(--accent); }
#toast.error   { background: var(--red); }

/* ── LOGIN PAGE ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
}
.login-logo { font-size: 22px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.login-logo span { color: var(--accent); }
.login-sub { color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.login-tabs { display: flex; gap: 4px; margin-bottom: 24px; background: var(--surface2); border-radius: 8px; padding: 3px; }
.login-tab {
  flex: 1;
  padding: 7px;
  text-align: center;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
  font-family: inherit;
  border: none;
  background: none;
}
.login-tab.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.login-error { color: var(--red); font-size: 12px; margin-top: -8px; margin-bottom: 12px; font-weight: 500; }

/* ── UPLOAD ZONE ── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface2);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent);
  background: #F0F8F4;
}
.upload-zone p { color: var(--muted); font-size: 13px; margin-top: 8px; }

/* ── CLIENT GRID ── */
.client-status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.client-status-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.client-status-pills { display: flex; gap: 10px; font-size: 12px; flex-wrap: wrap; }
.pill { display: flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-weight: 500; }
.pill-done { background: #E8F5EE; color: #2E5E44; }
.pill-todo { background: var(--surface2); color: var(--muted); }

/* ── DASHBOARD GRID ── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.dash-grid .full-width { grid-column: 1 / -1; }
@media (max-width: 700px) { .dash-grid { grid-template-columns: 1fr; } .dash-grid .full-width { grid-column: 1; } }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .portal-header { padding: 12px 16px; }
  .portal-tabs { padding: 0 12px; }
  .portal-page { padding: 16px; }
  .login-box { padding: 28px 20px; }
  .portal-tab { padding: 10px 12px; font-size: 12px; }
}

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ── SECTION HEADER ── */
.section-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  margin-bottom: 12px;
  margin-top: 20px;
}
.section-header:first-child { margin-top: 0; }

/* ── APPROVAL ITEM ── */
.approval-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.approval-item:last-child { border-bottom: none; }
.approval-name { font-weight: 600; font-size: 14px; }
.approval-email { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* ── EVENT ROW ── */
.event-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.event-row:last-child { border-bottom: none; }
.event-time { font-size: 11px; color: var(--muted); font-family: monospace; white-space: nowrap; padding-top: 2px; min-width: 70px; }
.event-name { font-size: 13px; font-weight: 500; }
.event-sub  { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* ── TASK ITEM ── */
.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.task-item:last-child { border-bottom: none; }
.task-cat {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.cat-hcmnj   { background: #E8F5EE; color: #2E5E44; }
.cat-shm     { background: #EBF2FC; color: #1A4A82; }
.cat-personal{ background: var(--surface2); color: var(--muted); }
.cat-house   { background: #FDF3E3; color: #974A0A; }
