/* ============================================================
   Vishnu Guest House Plugin — vgh-style.css
   Clean, warm, mobile-first
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;600;700&family=Tiro+Devanagari+Sanskrit&display=swap');

:root {
  --vgh-primary:   #b5451b;
  --vgh-secondary: #e07b39;
  --vgh-gold:      #d4a017;
  --vgh-bg:        #fdf6ee;
  --vgh-card:      #ffffff;
  --vgh-border:    #e2cbb0;
  --vgh-text:      #2c1a0e;
  --vgh-muted:     #7a5c44;
  --vgh-success:   #2e7d32;
  --vgh-warning:   #e65100;
  --vgh-danger:    #c62828;
  --vgh-radius:    10px;
  --vgh-shadow:    0 2px 12px rgba(0,0,0,0.10);
  --vgh-font:      'Noto Sans', sans-serif;
  --vgh-base-size: 16px;
}

/* ── Wrap ── */
.vgh-wrap {
  font-family: var(--vgh-font);
  font-size: var(--vgh-base-size);
  color: var(--vgh-text);
  background: var(--vgh-bg);
  max-width: 820px;
  margin: 0 auto 2rem auto;
  padding: 1.5rem;
  border-radius: var(--vgh-radius);
  box-shadow: var(--vgh-shadow);
  border: 1px solid var(--vgh-border);
}

/* ── Header ── */
.vgh-header {
  text-align: center;
  margin-bottom: 1.4rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--vgh-border);
}
.vgh-logo { font-size: 2.6rem; margin-bottom: 0.3rem; }
.vgh-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--vgh-primary);
  margin: 0 0 0.2rem;
  letter-spacing: 0.5px;
}
.vgh-subtitle {
  font-size: 1rem;
  color: var(--vgh-muted);
  margin: 0;
}

/* ── Meta bar ── */
.vgh-meta-bar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
  background: #fff3e0;
  border: 1px solid var(--vgh-border);
  border-radius: 6px;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  margin-bottom: 1.4rem;
}

/* ── Form layout ── */
.vgh-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}
.vgh-row .vgh-field { flex: 1; min-width: 200px; }

.vgh-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
  position: relative;
}
.vgh-field label {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  color: var(--vgh-text);
}
.req { color: var(--vgh-danger); }

.vgh-field input,
.vgh-field textarea,
.vgh-field select {
  font-family: var(--vgh-font);
  font-size: 1rem;
  padding: 0.6rem 0.9rem;
  border: 1.5px solid var(--vgh-border);
  border-radius: 6px;
  background: #fff;
  color: var(--vgh-text);
  transition: border-color 0.2s;
  box-sizing: border-box;
  width: 100%;
}
.vgh-field input:focus,
.vgh-field textarea:focus,
.vgh-field select:focus {
  border-color: var(--vgh-secondary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(224,123,57,0.15);
}
.vgh-hint { font-size: 0.82rem; color: var(--vgh-muted); margin-top: 2px; }

/* ── Buttons ── */
.vgh-btn {
  font-family: var(--vgh-font);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  display: inline-block;
  text-align: center;
}
.vgh-btn:active { transform: scale(0.97); }
.vgh-btn-primary  { background: var(--vgh-primary);   color: #fff; }
.vgh-btn-secondary{ background: #e8d8c4;               color: var(--vgh-text); }
.vgh-btn-success  { background: var(--vgh-success);   color: #fff; }
.vgh-btn-warning  { background: var(--vgh-warning);   color: #fff; }
.vgh-btn-danger   { background: var(--vgh-danger);    color: #fff; }
.vgh-btn:hover    { opacity: 0.88; }

/* ── Messages ── */
.vgh-msg {
  margin-top: 1rem;
  padding: 0.7rem 1rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
}
.vgh-msg.success { background: #e8f5e9; color: var(--vgh-success); border-left: 4px solid var(--vgh-success); }
.vgh-msg.error   { background: #ffebee; color: var(--vgh-danger);  border-left: 4px solid var(--vgh-danger); }
.vgh-err { color: var(--vgh-danger); font-size: 0.95rem; margin-top: 0.4rem; }

/* ── Autocomplete suggest ── */
.vgh-suggest-box {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: #fff;
  border: 1.5px solid var(--vgh-border);
  border-radius: 6px;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  max-height: 220px;
  overflow-y: auto;
}
.vgh-suggest-item {
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-size: 0.95rem;
  border-bottom: 1px solid #f0e6d8;
}
.vgh-suggest-item:hover { background: #fff3e0; }
.vgh-suggest-item span { display: block; font-size: 0.82rem; color: var(--vgh-muted); }

/* ── Attendance ── */
.vgh-search-bar {
  display: flex;
  gap: 0.7rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.vgh-search-bar input { flex: 1; min-width: 180px; font-size: 1rem; padding: 0.6rem 0.9rem; border: 1.5px solid var(--vgh-border); border-radius: 6px; }
.vgh-att-result-list { margin-bottom: 1rem; }
.vgh-att-result-item {
  padding: 0.6rem 1rem;
  border: 1.5px solid var(--vgh-border);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s;
}
.vgh-att-result-item:hover { background: #fff3e0; }
.vgh-att-result-item strong { color: var(--vgh-primary); }
.vgh-att-result-item small  { color: var(--vgh-muted); }

.vgh-selected-visitor {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: #fff3e0;
  border-radius: 6px;
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 1.05rem;
}
.vgh-badge {
  background: var(--vgh-primary);
  color: #fff;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.vgh-meal-grid {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.vgh-meal-card {
  flex: 1;
  min-width: 140px;
  background: #fff;
  border: 1.5px solid var(--vgh-border);
  border-radius: 8px;
  padding: 0.8rem;
  text-align: center;
}
.vgh-meal-card span { display: block; font-weight: 600; font-size: 1rem; margin-bottom: 0.6rem; }
.vgh-toggle-group { display: flex; gap: 0.5rem; justify-content: center; }
.vgh-toggle {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  border: 1.5px solid var(--vgh-border);
  background: #fdf6ee;
  transition: all 0.15s;
}
.vgh-toggle input { cursor: pointer; }
.vgh-toggle:has(input:checked) {
  background: var(--vgh-primary);
  color: #fff;
  border-color: var(--vgh-primary);
}

/* ── Admin ── */
.vgh-pin-wrap {
  max-width: 320px;
  margin: 0 auto;
  text-align: center;
  padding: 2rem 1rem;
}
.vgh-pin-wrap label { display: block; font-weight: 600; font-size: 1.1rem; margin-bottom: 0.7rem; }
.vgh-pin-wrap input {
  font-size: 1.6rem;
  letter-spacing: 0.5rem;
  text-align: center;
  width: 100%;
  padding: 0.6rem;
  border: 2px solid var(--vgh-border);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.vgh-admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1rem;
}
.vgh-stats {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.vgh-stat-box {
  background: #fff;
  border: 1.5px solid var(--vgh-border);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  text-align: center;
  min-width: 80px;
}
.vgh-stat-box strong { display: block; font-size: 1.4rem; color: var(--vgh-primary); }
.vgh-stat-box span   { font-size: 0.8rem; color: var(--vgh-muted); }

.vgh-filter-bar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
  background: #fff;
  padding: 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--vgh-border);
}
.vgh-filter-bar input,
.vgh-filter-bar select {
  font-size: 0.95rem;
  padding: 0.45rem 0.7rem;
  border: 1.5px solid var(--vgh-border);
  border-radius: 6px;
  background: #fdf6ee;
  flex: 1;
  min-width: 120px;
}

.vgh-bulk-bar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

/* ── Table ── */
.vgh-table-wrap { overflow-x: auto; }
table.vgh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}
table.vgh-table thead tr { background: var(--vgh-primary); color: #fff; }
table.vgh-table th, table.vgh-table td {
  padding: 0.55rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid #f0e6d8;
  word-break: break-word;
  vertical-align: middle;
}
table.vgh-table tbody tr:nth-child(even) { background: #fdf6ee; }
table.vgh-table tbody tr:hover { background: #fff3e0; }

.vgh-status-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}
.vgh-status-Approved { background: #e8f5e9; color: #2e7d32; }
.vgh-status-Pending  { background: #fff8e1; color: #f57f17; }
.vgh-status-Rejected { background: #ffebee; color: #c62828; }

.vgh-row-btns { display: flex; gap: 0.3rem; flex-wrap: nowrap; }
.vgh-row-btn {
  font-size: 0.78rem;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
.vgh-row-btn.approve { background: #2e7d32; color: #fff; }
.vgh-row-btn.edit    { background: #e65100; color: #fff; }
.vgh-row-btn.delete  { background: #c62828; color: #fff; }

/* ── Edit Modal ── */
.vgh-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.vgh-modal-box {
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  max-height: 90vh;
  overflow-y: auto;
}
.vgh-modal-box h3 { margin: 0 0 1rem; color: var(--vgh-primary); }
.vgh-modal-btns { display: flex; gap: 0.7rem; margin-top: 1rem; }

/* ── Public report ── */
.vgh-date-select {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.vgh-date-select label { font-weight: 600; }
.vgh-date-select input { padding: 0.5rem 0.8rem; border: 1.5px solid var(--vgh-border); border-radius: 6px; font-size: 1rem; }
.vgh-no-data { text-align: center; padding: 2rem; color: var(--vgh-muted); font-size: 1rem; }

/* ── Mobile enhancements ── */
@media (max-width: 600px) {
  :root { --vgh-base-size: 17px; }

  .vgh-wrap { padding: 1rem; }

  .vgh-header h2    { font-size: 1.5rem; }
  .vgh-logo         { font-size: 2.2rem; }

  .vgh-field input,
  .vgh-field textarea,
  .vgh-field select { font-size: 1.1rem; padding: 0.75rem 1rem; }

  .vgh-btn { font-size: 1.1rem; padding: 0.75rem 1.2rem; width: 100%; margin-bottom: 0.4rem; }

  .vgh-bulk-bar .vgh-btn { font-size: 0.9rem; padding: 0.55rem 0.8rem; width: auto; }

  .vgh-meta-bar { font-size: 0.92rem; flex-direction: column; }

  table.vgh-table th,
  table.vgh-table td { font-size: 12px; padding: 0.4rem 0.5rem; }

  .vgh-row-btn { font-size: 0.72rem; }

  .vgh-stat-box strong { font-size: 1.2rem; }

  .vgh-meal-grid { gap: 0.5rem; }
  .vgh-meal-card { min-width: 100px; }

  .vgh-filter-bar { flex-direction: column; }
  .vgh-filter-bar input,
  .vgh-filter-bar select { min-width: unset; width: 100%; }
}
