/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-dark: #006e33;
  --green: #1a8a4a;
  --green-light: #e8f5ee;
  --red: #e53e3e;
  --purple: #7b2d8b;
  --orange: #dd6b20;
  --gold: #d4a017;
  --gray-100: #f7f8fa;
  --gray-200: #edf0f3;
  --gray-400: #9aa5b4;
  --gray-700: #3d4a5c;
  --white: #fff;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--gray-100);
  color: var(--gray-700);
  line-height: 1.5;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== HEADER ===== */
.header {
  background: var(--green-dark);
  color: var(--white);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.header-inner {
  display: flex;
  align-items: center;
  height: 60px;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}
.logo-icon { font-size: 1.5rem; }
.logo-img { width: 36px; height: 36px; border-radius: 8px; object-fit: contain; }

/* ===== ĐỒNG HỒ HEADER ===== */
.header-clock {
  display: flex;
  align-items: center;
  gap: 0;
  font-family: 'Courier New', monospace;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--white);
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  padding: 4px 14px;
  flex-shrink: 0;
  user-select: none;
}
.clock-h { color: #fff; min-width: 2ch; text-align: center; }
.clock-m { color: #fff; min-width: 2ch; text-align: center; }
.clock-s {
  color: #a8edbc;
  min-width: 2ch;
  text-align: center;
  transition: color .3s;
}
.clock-sep {
  color: rgba(255,255,255,.6);
  margin: 0 1px;
  animation: clockBlink 1s step-end infinite;
}
@keyframes clockBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .25; }
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav-link {
  color: rgba(255,255,255,.85);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: .9rem;
  transition: background .2s;
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,.15);
  color: var(--white);
}
.menu-toggle {
  display: none;
  color: white;
  font-size: 1.4rem;
  padding: 4px 8px;
}

/* ===== ĐỔI LỊCH SECTION ===== */
.doilich-section {
  display: none;
  background: #f4f7f5;
  min-height: calc(100vh - 60px);
  padding: 40px 0 64px;
}
.doilich-section.visible { display: block; }

.dl-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Sub-tabs */
.dl-tabs {
  display: flex;
  gap: 0;
  background: #e2ede8;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
}
.dl-tab {
  flex: 1;
  padding: 11px 0;
  border-radius: 9px;
  font-size: .95rem;
  font-weight: 600;
  color: #5a7a6a;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all .2s;
}
.dl-tab.active {
  background: #fff;
  color: var(--green-dark);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* Input card */
.dl-card {
  background: #fff;
  border-radius: 16px;
  padding: 28px 28px 24px;
  box-shadow: 0 2px 16px rgba(0,0,0,.07);
  margin-bottom: 20px;
}
.dl-form-title {
  font-size: .95rem;
  color: #718096;
  margin-bottom: 20px;
}
.dl-form-title strong { color: #1a202c; }

.dl-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 12px;
  margin-bottom: 20px;
}
.dl-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dl-input-group label {
  font-size: .78rem;
  font-weight: 600;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.dl-select {
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: .95rem;
  color: #1a202c;
  background: #fff;
  cursor: pointer;
  appearance: none;
  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='%23718096' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color .2s;
}
.dl-select:focus {
  outline: none;
  border-color: var(--green);
}

.dl-leap-row { margin-bottom: 20px; }
.dl-leap-note {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
  padding: 6px 10px;
  background: #f7fafc;
  border-radius: 6px;
  border-left: 3px solid #90cdf4;
}
.dl-leap-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  color: #4a5568;
  cursor: pointer;
  user-select: none;
}
.dl-leap-label input { accent-color: var(--green); width: 16px; height: 16px; cursor: pointer; }

.dl-btn {
  width: 100%;
  padding: 14px;
  background: var(--green-dark);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .1s;
  letter-spacing: .02em;
}
.dl-btn:hover { background: var(--green); }
.dl-btn:active { transform: scale(.98); }

/* Result */
.dl-result {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,.07);
  overflow: hidden;
  animation: dlSlideIn .3s ease;
}
@keyframes dlSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dl-result-header {
  background: var(--green-dark);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dl-result-icon { font-size: 1.2rem; }
.dl-result-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.dl-result-body { padding: 8px 0; }

/* Result rows */
.dl-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid #f0f4f1;
}
.dl-row:last-child { border-bottom: none; }
.dl-row-icon { font-size: 1.1rem; width: 24px; flex-shrink: 0; text-align: center; }
.dl-row-content { flex: 1; min-width: 0; }
.dl-row-label {
  font-size: .73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #a0aec0;
  margin-bottom: 3px;
}
.dl-row-value {
  font-size: .97rem;
  color: #1a202c;
  font-weight: 500;
  line-height: 1.5;
}
.dl-row-value strong { color: var(--green-dark); }
.dl-row-value .dl-tag {
  display: inline-block;
  background: #ebf8f1;
  color: var(--green-dark);
  border-radius: 6px;
  padding: 2px 9px;
  font-size: .82rem;
  font-weight: 600;
  margin: 2px 3px 2px 0;
}
.dl-row-value .dl-tag.xau {
  background: #fff5f5;
  color: #c53030;
}

/* Divider tiêu đề nhóm */
.dl-group-title {
  padding: 10px 24px 4px;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #a0aec0;
}

/* Responsive */
@media (max-width: 500px) {
  .dl-card { padding: 20px 16px; }
  .dl-inputs { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .dl-row { padding: 10px 16px; }
  .dl-group-title { padding-left: 16px; }
}

/* ===== ỨNG DỤNG / LANDING PAGE ===== */
.ungdung-section { display: none; width: 100%; }
.ungdung-section.visible { display: block; }

/* ===== CÀI ĐẶT ===== */
.caidat-section { display: none; width: 100%; padding: 24px 0 48px; }
.caidat-section.visible { display: block; }
.caidat-container { max-width: 600px; margin: 0 auto; padding: 0 16px; }
.caidat-title { font-size: 1.3rem; font-weight: 700; color: var(--gray-700); margin-bottom: 20px; }
.caidat-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.caidat-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.caidat-card-icon { font-size: 1.6rem; }
.caidat-card-name { font-weight: 600; font-size: .95rem; color: var(--gray-700); }
.caidat-card-desc { font-size: .8rem; color: var(--gray-400); margin-top: 2px; }

/* Lưới màu */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.theme-swatch-color {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 16px;
  position: relative;
  transition: transform .15s, box-shadow .15s;
}
.theme-swatch:hover .theme-swatch-color {
  transform: scale(1.04);
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.theme-swatch.active .theme-swatch-color::after {
  content: '✓';
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2196f3;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-swatch-name {
  font-size: .8rem;
  color: var(--gray-700);
  text-align: center;
}

/* Shared layout */
.lp-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}
.lp-section-label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 8px;
}
.lp-section-title {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 16px;
  line-height: 1.2;
}
.lp-section-title.lp-dark { color: #1a202c; }

/* ── HERO ── */
.lp-hero {
  background: linear-gradient(135deg, #1a3a2a 0%, #2d6a4f 60%, #40916c 100%);
  padding: 80px 0 60px;
  overflow: hidden;
}
.lp-hero-inner {
  display: flex;
  align-items: center;
  gap: 48px;
}
.lp-hero-text { flex: 1; min-width: 0; }
.lp-hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.15);
  color: #a8edbc;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
}
.lp-hero-title {
  font-size: 3.2rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  margin: 0 0 16px;
}
.lp-hero-title span { color: #a8edbc; }
.lp-hero-desc {
  font-size: 1.05rem;
  color: rgba(255,255,255,.8);
  line-height: 1.7;
  margin: 0 0 32px;
  max-width: 480px;
}
.lp-badges { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.lp-badges-center { justify-content: center; }
.lp-badge-link { display: inline-block; transition: transform .2s; }
.lp-badge-link:hover { transform: translateY(-2px); }
.lp-badge-img { height: 44px; width: auto; display: block; }

/* Phone mockup */
.lp-hero-mockup {
  flex-shrink: 0;
  position: relative;
  width: 240px;
  display: flex;
  justify-content: center;
}
.lp-mockup-bg {
  position: absolute;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(168,237,188,.35) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  border-radius: 50%;
}
.lp-phone-wrap {
  position: relative;
  z-index: 1;
}
.lp-phone-frame {
  width: 180px;
  height: 370px;
  background: #111;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.5), 0 0 0 2px rgba(255,255,255,.1);
  border: 3px solid #333;
}
.lp-phone-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── QUOTE BAND ── */
.lp-quote-band {
  background: linear-gradient(90deg, var(--green) 0%, #40916c 100%);
  padding: 40px 0;
  text-align: center;
}
.lp-quote-text {
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  font-style: italic;
  line-height: 1.6;
  max-width: 720px;
  margin: 0 auto;
}

/* ── FEATURES ── */
.lp-features {
  background: #f7faf8;
  padding: 72px 0;
  text-align: center;
}
.lp-features .lp-section-label { text-align: center; }
.lp-features .lp-section-title { color: #1a202c; text-align: center; margin-bottom: 48px; }
.lp-feat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.lp-feat-card {
  background: #fff;
  border-radius: 16px;
  padding: 32px 20px;
  box-shadow: 0 2px 16px rgba(0,0,0,.06);
  transition: transform .2s, box-shadow .2s;
}
.lp-feat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,.1);
}
.lp-feat-icon {
  font-size: 2.4rem;
  margin-bottom: 14px;
}
.lp-feat-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 8px;
}
.lp-feat-card p {
  font-size: .88rem;
  color: #718096;
  line-height: 1.6;
  margin: 0;
}

/* ── DETAIL FEATURES ── */
.lp-detail {
  background: #fff;
  padding: 72px 0;
}
.lp-detail-inner {
  display: flex;
  gap: 56px;
  align-items: flex-start;
}
.lp-detail-content { flex: 1; min-width: 0; }
.lp-detail-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 24px;
}
.lp-detail-group-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 10px;
  letter-spacing: .04em;
}
.lp-detail-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.lp-detail-group ul li {
  font-size: .88rem;
  color: #4a5568;
  line-height: 1.7;
  padding-left: 14px;
  position: relative;
}
.lp-detail-group ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}
.lp-detail-img {
  flex-shrink: 0;
  width: 240px;
}
.lp-detail-img img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,.12);
}

/* ── DOWNLOAD CTA ── */
.lp-download {
  background: linear-gradient(135deg, #1a3a2a 0%, #2d6a4f 60%, #40916c 100%);
  padding: 72px 0;
  text-align: center;
}
.lp-download-title {
  font-size: 2.4rem;
  font-weight: 900;
  color: #fff;
  margin: 0 0 12px;
}
.lp-download-sub {
  font-size: 1rem;
  color: rgba(255,255,255,.75);
  margin: 0 0 36px;
}

/* ── LP FOOTER ── */
.lp-footer {
  background: #111;
  padding: 32px 0;
  text-align: center;
}
.lp-footer p {
  color: rgba(255,255,255,.5);
  font-size: .82rem;
  margin: 0 0 10px;
}
.lp-footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: .82rem;
}
.lp-footer-links a {
  color: rgba(255,255,255,.55);
  transition: color .2s;
}
.lp-footer-links a:hover { color: #fff; }
.lp-footer-links span { color: rgba(255,255,255,.25); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .lp-hero-inner { flex-direction: column; text-align: center; }
  .lp-hero-desc { max-width: 100%; }
  .lp-badges { justify-content: center; }
  .lp-hero-mockup { width: 180px; }
  .lp-phone-frame { width: 150px; height: 310px; }
  .lp-feat-grid { grid-template-columns: repeat(2, 1fr); }
  .lp-detail-inner { flex-direction: column; }
  .lp-detail-img { width: 100%; max-width: 280px; margin: 0 auto; }
  .lp-hero-title { font-size: 2.2rem; }
}
@media (max-width: 560px) {
  .lp-feat-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .lp-feat-card { padding: 22px 14px; }
  .lp-detail-cols { grid-template-columns: 1fr; }
  .lp-hero-title { font-size: 1.9rem; }
  .lp-download-title { font-size: 1.8rem; }
  .lp-section-title { font-size: 1.6rem; }
}

/* ===== MAIN LAYOUT ===== */
.main { padding: 24px 0 48px; }
.layout {
  display: block;
  max-width: 720px;
  margin: 0 auto;
}

/* ===== TODAY CARD ===== */
/* ===== TODAY CARD — layout mới ===== */
.today-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px 20px;
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
/* Cột trái — dương lịch */
.tc-solar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding-right: 20px;
  gap: 2px;
}
.tc-weekday {
  font-size: .8rem;
  color: #aaa;
  font-weight: 500;
}
.tc-day {
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 1;
  color: var(--green-dark, #1b5e20);
  margin: 2px 0;
}
.tc-my {
  font-size: .95rem;
  font-weight: 700;
  color: #222;
}
.tc-label {
  font-size: .72rem;
  color: #aaa;
  margin-top: 2px;
}
/* Đường kẻ dọc */
.tc-vline {
  width: 1px;
  background: #e8e8e8;
  margin: 0 20px;
  align-self: stretch;
}
/* Cột phải — âm lịch */
.tc-lunar {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.tc-lunar-date {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1.2;
}
.tc-lunar-year {
  font-size: .88rem;
  color: #888;
}
.tc-hline {
  height: 1px;
  background: #efefef;
  margin: 4px 0;
}
.tc-cachi {
  font-size: .88rem;
  color: #555;
  line-height: 1.6;
}
.tc-cachi strong {
  color: #1a1a1a;
  font-weight: 700;
}

/* ===== CALENDAR CARD ===== */
.calendar-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-200);
}
.cal-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-100);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  line-height: 1;
}
.cal-btn:hover { background: var(--green-light); color: var(--green-dark); }
.cal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green-dark);
}
/* ===== CALENDAR WEEKDAY HEADER ===== */
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}
.cal-wd {
  text-align: center;
  padding: 10px 2px;
  font-size: .72rem;
  font-weight: 700;
  color: #aaa;
  letter-spacing: .03em;
}
.cal-wd.sun,
.cal-wd.sat { color: #e53e3e; }

/* ===== CALENDAR GRID ===== */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #fff;
}
.cal-cell {
  padding: 10px 4px 8px;
  min-height: 66px;
  cursor: pointer;
  transition: background .12s;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.cal-cell:hover { background: #f5f5f5; }
.cal-cell.empty { cursor: default; opacity: .35; }

/* Today: blue rounded rectangle outline */
.cal-cell.today::before {
  content: '';
  position: absolute;
  inset: 4px 2px;
  border: 2px solid #1a73e8;
  border-radius: 12px;
  pointer-events: none;
}

/* Selected: nền xanh nhạt, không đè lên today */
.cal-cell.selected:not(.today) {
  background: #e8f5e9;
}
.cal-cell.selected:not(.today)::before {
  content: '';
  position: absolute;
  inset: 4px 2px;
  border: 2px solid var(--green-dark, #1b5e20);
  border-radius: 12px;
  pointer-events: none;
}

/* Solar number */
.solar-num {
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
  line-height: 1;
  color: #1a1a1a;
}

/* Sat / Sun → red */
.cal-cell.is-sun .solar-num,
.cal-cell.is-sat .solar-num { color: #e53e3e; }

/* Lunar number */
.lunar-num {
  font-size: .68rem;
  text-align: center;
  color: #bbb;
  line-height: 1;
  font-weight: 500;
}
.cal-cell.is-sun .lunar-num,
.cal-cell.is-sat .lunar-num { color: #f9a8a8; }

/* Lunar 1 marker */
.cal-cell .lunar-1 {
  color: #e53e3e !important;
  font-weight: 700;
}

/* Dot indicator */
.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-top: 1px;
  flex-shrink: 0;
}
.cal-dot.dot-none  { background: transparent; }
.cal-dot.dot-hoang { background: #e53e3e; }   /* Hoàng Đạo → đỏ */
.cal-dot.dot-hac   { background: #1a1a1a; }   /* Hắc Đạo  → đen */

/* ===== SIDEBAR WIDGETS ===== */
.sidebar { display: flex; flex-direction: column; gap: 16px; }
.widget {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.widget-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.widget-icon { font-size: 1rem; }

/* Giờ Hoàng Đạo */
/* ===== GIỜ HOÀNG ĐẠO — card mới ===== */
.gio-hd-card {
  background: #edf7f2 !important;
  position: relative;
  overflow: hidden;
}
.gio-hd-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.gio-hd-icon {
  width: 32px;
  height: 32px;
  background: #c8e6c9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.gio-hd-title {
  font-size: 1rem;
  font-weight: 700;
  color: #2e4a3a;
}
.gio-hd-decor {
  position: absolute;
  top: -6px;
  right: -4px;
  font-size: 5rem;
  opacity: .18;
  pointer-events: none;
  line-height: 1;
  transform: rotate(15deg);
}
.gio-hd-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.gio-hd-list::-webkit-scrollbar { display: none; }
.gio-hd-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 64px;
}
.gio-hd-animal {
  width: 58px;
  height: 58px;
  background: #fff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.gio-hd-chi {
  font-size: .88rem;
  font-weight: 700;
  color: #1a1a1a;
}
.gio-hd-range {
  font-size: .75rem;
  color: #777;
}

/* Việc nên/tránh */
.viec-list { display: flex; flex-direction: column; gap: 5px; }
.viec-list li {
  font-size: .82rem;
  padding: 5px 8px;
  border-radius: 6px;
  background: #f0faf4;
  color: var(--green-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}
.viec-list li::before { content: '✓'; color: var(--green); font-weight: 700; }
.viec-tranh li { background: #fff5f5; color: #742a2a; }
.viec-tranh li::before { content: '✗'; color: var(--red); }

/* Day detail */
.day-detail .hint {
  color: var(--gray-400);
  font-size: .85rem;
  text-align: center;
  padding: 8px 0;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-200);
  font-size: .85rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--gray-400); }
.detail-val { font-weight: 600; color: var(--gray-700); }
.detail-tot { color: var(--red) !important; }
.detail-xau { color: var(--purple) !important; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white;
  border-radius: var(--radius);
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-100);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: var(--gray-200); }
.modal-header {
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  color: white;
  padding: 24px 20px 20px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.modal-date-solar { font-size: 1.8rem; font-weight: 900; }
.modal-date-lunar { font-size: .9rem; opacity: .85; margin-top: 4px; }
.modal-body { padding: 16px; }
.modal-section { margin-bottom: 16px; }
.modal-section-title {
  font-weight: 700;
  color: var(--green-dark);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}
.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
}
.tag-tot { background: #fff0f0; color: var(--red); border: 1px solid #fed7d7; }
.tag-xau { background: #faf5ff; color: var(--purple); border: 1px solid #e9d8fd; }
.tag-gio { background: var(--green-light); color: var(--green-dark); border: 1px solid #c6f6d5; }

/* ===== BACH KY TAGS ===== */
.tag-rattot { background: #fff0f0; color: #c53030; border: 1px solid #fed7d7; }
.tag-tot2   { background: #e8f5ee; color: var(--green-dark); border: 1px solid #c6f6d5; }
.tag-xau2   { background: #faf5ff; color: var(--purple); border: 1px solid #e9d8fd; }
.tag-ratxau { background: #fff5f5; color: #742a2a; border: 1px solid #fed7d7; }

/* ===== MODAL DETAIL SECTIONS ===== */
.modal-body { padding: 0; }

.detail-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-200);
}
.detail-section:last-child { border-bottom: none; }
.detail-section-title {
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gray-400);
  margin-bottom: 10px;
}

/* ===== CAN CHI — layout mới ===== */
.cc-section { padding: 0 !important; }
.cc-cols {
  display: flex;
  align-items: stretch;
}
.cc-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 8px 16px;
  gap: 6px;
}
.cc-col-divider {
  width: 1px;
  background: #ebebeb;
  margin: 12px 0;
}
.cc-col-label {
  font-size: .68rem;
  font-weight: 700;
  color: #aaa;
  letter-spacing: .08em;
  display: flex;
  align-items: center;
  gap: 5px;
}
.cc-col-num {
  font-size: 2rem;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1;
}
.cc-col-cachi {
  font-size: .82rem;
  color: #555;
  font-weight: 500;
}
/* Dot Hoàng/Hắc trong phần Can Chi */
.cc-hd-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cc-hd-dot.dot-hoang { background: #e53e3e; }
.cc-hd-dot.dot-hac   { background: #1a1a1a; }

/* Bach Ky list */
/* ===== SAO TỐT XẤU ===== */
.sao-wrap { display: flex; flex-direction: column; gap: 12px; }
.sao-group-title {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 8px;
}
.sao-tot-title { color: #2b6cb0; }
.sao-xau-title { color: #c53030; }
.sao-list { display: flex; flex-direction: column; gap: 5px; }
.sao-item {
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .83rem;
  line-height: 1.5;
}
.sao-tot {
  background: #ebf8ff;
  border-left: 3px solid #3182ce;
  color: #1a365d;
}
.sao-xau {
  background: #fff5f5;
  border-left: 3px solid #e53e3e;
  color: #742a2a;
}
.sao-ten { font-weight: 600; }
.sao-mota { color: inherit; opacity: .8; font-size: .8rem; }

/* ===== NGÀY NÀY NĂM XƯA ===== */
.nnnx-group { margin-bottom: 14px; }
.nnnx-group:last-child { margin-bottom: 0; }
.nnnx-group-title {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #2d3748;
  margin-bottom: 8px;
}
.nnnx-list { display: flex; flex-direction: column; gap: 8px; }
.nnnx-item {
  font-size: .85rem;
  color: #444;
  line-height: 1.6;
  padding: 10px 12px;
  background: #f7f9fc;
  border-left: 3px solid #4299e1;
  border-radius: 0 8px 8px 0;
}

/* ===== SỰ KIỆN THEO NGÀY ===== */
.sukien-section {}
.sukien-group { margin-bottom: 14px; }
.sukien-group:last-child { margin-bottom: 0; }
.sukien-group-title {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #2d3748;
  margin-bottom: 8px;
}
.sukien-item {
  font-size: .85rem;
  color: #444;
  line-height: 1.6;
  padding: 9px 12px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 6px;
}
.sukien-item:last-child { margin-bottom: 0; }
.sukien-lunar {
  background: #f0f7ff;
  border-left: 3px solid #4a90d9;
}
.sukien-solar {
  background: #fff8f0;
  border-left: 3px solid #e8943a;
}

.bach-ky-list { display: flex; flex-direction: column; gap: 8px; }
.bach-ky-item {
  border-radius: 8px;
  padding: 10px 12px;
  border-left: 4px solid;
}
.tag-binh { background: #f5f5f5; border: 1px solid #ddd; color: var(--gray-700); }
.bach-ky-item.rattot { background: #fff5f5; border-color: #c53030; }
.bach-ky-item.tot    { background: #e8f5ee; border-color: var(--green); }
.bach-ky-item.xau    { background: #faf5ff; border-color: var(--purple); }
.bach-ky-item.ratxau { background: #fff0f0; border-color: #c53030; }
.bach-ky-ten {
  font-weight: 700;
  font-size: .85rem;
}
.bach-ky-item.rattot .bach-ky-ten,
.bach-ky-item.ratxau .bach-ky-ten { color: #c53030; }
.bach-ky-item.tot .bach-ky-ten    { color: var(--green-dark); }
.bach-ky-item.xau .bach-ky-ten    { color: var(--purple); }
.bach-ky-mota { font-size: .78rem; color: var(--gray-700); margin-top: 2px; }

/* Trực nhật */
.truc-box {
  background: var(--gray-100);
  border-radius: 8px;
  padding: 12px;
}
.truc-name {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.truc-name.good { color: var(--green-dark); }
.truc-name.bad  { color: var(--red); }
.truc-name.normal { color: var(--gray-700); }
.truc-row { margin-bottom: 8px; }
.truc-row-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-400);
  margin-bottom: 3px;
}
.truc-row-text { font-size: .82rem; color: var(--gray-700); line-height: 1.5; }

/* Giờ Lý Thuần Phong */
.gltp-list { display: flex; flex-direction: column; gap: 10px; }
.gltp-item {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--gray-200);
}
.gltp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
}
.gltp-header.good { background: #1a8a4a; color: white; }
.gltp-header.bad  { background: #c53030; color: white; }
.gltp-title { font-weight: 700; font-size: .88rem; }
.gltp-times { font-size: .75rem; opacity: .9; }
.gltp-body { padding: 10px 12px; background: var(--gray-100); }
.gltp-tho {
  font-size: .78rem;
  color: var(--gray-700);
  white-space: pre-line;
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 6px;
}
.gltp-desc { font-size: .78rem; color: var(--gray-400); line-height: 1.5; }

/* Modal larger on desktop */
@media (min-width: 769px) {
  .modal {
    max-width: 580px;
  }
}

/* ===== DAY DETAIL PANEL (inline below calendar) ===== */
.day-detail-panel {
  display: none;
  margin-top: 16px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,.12);
  overflow: hidden;
  animation: slideDown .25s ease;
}
.day-detail-panel.open { display: block; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ddp-header {
  background: var(--green-dark);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ddp-solar {
  font-size: 1.15rem;
  font-weight: 700;
}
.ddp-lunar {
  font-size: .82rem;
  opacity: .85;
  margin-top: 3px;
}
.ddp-close {
  background: rgba(255,255,255,.18);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  transition: background .15s;
}
.ddp-close:hover { background: rgba(255,255,255,.32); }
.ddp-body { /* dùng lại các class .detail-section đã có */ }

/* ===== HƯỚNG XUẤT HÀNH ===== */
.huong-grid {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}
.huong-item {
  flex: 1;
  background: var(--gray-100);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
  border: 1px solid var(--gray-200);
}
.huong-icon { font-size: 1.5rem; margin-bottom: 4px; }
.huong-label { font-size: .72rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: .04em; }
.huong-val { font-size: 1rem; font-weight: 700; color: var(--green-dark); margin-top: 2px; }
.huong-note { font-size: .8rem; color: var(--gray-700); line-height: 1.5; }

/* ===== TIẾT KHÍ ===== */
/* ===== TIẾT KHÍ SLIDER ===== */
.tietKhi-slider-wrap {
  padding: 4px 0 8px;
}
.tietKhi-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.tietKhi-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  width: 80px;
}
.tietKhi-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  border: 3px solid #ccc;
  background: #f5f5f5;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.tietKhi-circle-cur {
  background: #fff8e1;
  border-color: #f9a825;
}
.tietKhi-circle-next {
  background: #e8f5e9;
  border-color: #43a047;
}
.tietKhi-end-name {
  font-weight: 700;
  font-size: .88rem;
  text-align: center;
  color: #222;
  line-height: 1.2;
}
.tietKhi-end-date {
  font-size: .75rem;
  color: #777;
  text-align: center;
}
.tietKhi-bar-col {
  flex: 1;
  padding: 0 2px;
}
.tietKhi-bar {
  position: relative;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
}
.tietKhi-bar-fill {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  background: linear-gradient(90deg, #f9a825, #43a047);
  border-radius: 4px;
  transition: width .3s;
}
.tietKhi-knob {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  background: #fff;
  border: 3px solid #2e7d32;
  border-radius: 50%;
  box-shadow: 0 1px 5px rgba(0,0,0,.25);
}
.tietKhi-note {
  font-size: .8rem;
  color: #666;
  text-align: center;
  line-height: 1.5;
  padding: 0 4px;
}

/* ===== NGŨ HÀNH ===== */
.ngu-hanh-box {
  background: var(--gray-100);
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid var(--gray-200);
}
.ngu-hanh-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 6px;
}
.ngu-hanh-desc {
  font-size: .82rem;
  color: var(--gray-700);
  line-height: 1.6;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--green-dark);
  color: rgba(255,255,255,.7);
  text-align: center;
  padding: 16px;
  font-size: .85rem;
}

/* ===== FLOATING TODAY BUTTON ===== */
.fab-today {
  position: fixed;
  bottom: 28px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--green-dark, #1b5e20);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 12px 20px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  z-index: 999;
  opacity: 0;
  transform: translateY(16px) scale(.92);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.fab-today.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.fab-today:hover {
  background: var(--green, #2e7d32);
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
}
.fab-today:active { transform: scale(.96); }
.fab-icon { font-size: 1rem; line-height: 1; }
.fab-label { letter-spacing: .01em; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .nav { display: none; }
  .header-clock { font-size: 1.05rem; padding: 3px 10px; }
  .menu-toggle { display: block; margin-left: auto; }
  .today-card { padding: 16px 14px; }
  .tc-solar { min-width: 90px; padding-right: 14px; }
  .tc-day { font-size: 3.5rem; }
  .tc-vline { margin: 0 14px; }
  .tc-lunar-date { font-size: 1.05rem; }
  .today-divider { width: 60px; height: 1px; }
  .lunar-can-chi { justify-content: center; }
  /* sidebar theo sau lịch trên mobile */
  .cal-cell { min-height: 52px; padding: 8px 2px 6px; }
  .solar-num { font-size: 1rem; }
  .lunar-num { font-size: .6rem; }
}

@media (max-width: 400px) {
  .cal-cell { min-height: 44px; padding: 6px 1px 4px; }
  .solar-num { font-size: .88rem; }
  .lunar-num { font-size: .55rem; }
  .cal-dot { width: 4px; height: 4px; }
}
