/* Samay Wasi Check-in — Shared Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:  #1F2A44;
  --gold:  #B08D57;
  --gold2: #C9A96E;
  --cream: #F6F2E9;
  --line:  #E8E2D9;
  --grey:  #8A8A8A;
  --red:   #B23A2E;
  --green: #2E7D52;
  --amber: #C9892B;
  --white: #FFFFFF;
  --card:  #FFFFFF;
  --bg:    #F4F1EB;
}

html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--navy); font-size: 15px; line-height: 1.5; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
input, textarea, select { font-family: inherit; font-size: 14px; width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; color: var(--navy); outline: none; transition: border-color .2s; }
input:focus, textarea:focus, select:focus { border-color: var(--gold); }
textarea { resize: vertical; min-height: 80px; }
label { font-size: 13px; font-weight: 600; color: var(--grey); display: block; margin-bottom: 4px; }
.field { margin-bottom: 14px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 20px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: all .15s; -webkit-tap-highlight-color: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.gold { background: var(--gold); color: #fff; }
.btn.gold:hover:not(:disabled) { background: var(--gold2); }
.btn.navy { background: var(--navy); color: #fff; }
.btn.navy:hover:not(:disabled) { background: #2a3a5c; }
.btn.ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--line); }
.btn.ghost:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.btn.red { background: var(--red); color: #fff; }
.btn.full { width: 100%; }
.btn.sm { padding: 7px 14px; font-size: 12px; border-radius: 7px; }

/* Cards */
.card { background: var(--card); border-radius: 14px; border: 1px solid var(--line); overflow: hidden; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.card-body { padding: 20px; }

/* Nav / Header */
.app-header { background: var(--navy); padding: 0 20px; display: flex; align-items: center; justify-content: space-between; height: 58px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 12px rgba(0,0,0,.15); }
.app-header .logo { display: flex; align-items: center; gap: 10px; }
.app-header .logo img { height: 32px; }
.app-header .logo-text { font-size: 15px; font-weight: 700; color: #fff; }
.app-header .logo-sub { font-size: 10px; color: var(--gold); letter-spacing: .5px; display: block; }

/* Tabs */
.tab-bar { display: flex; background: var(--navy); border-bottom: 2px solid var(--gold); overflow-x: auto; }
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn { padding: 12px 20px; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.6); cursor: pointer; white-space: nowrap; border: none; background: transparent; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .2s; }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }

/* Page */
.page-content { max-width: 900px; margin: 0 auto; padding: 20px 16px 80px; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { background: var(--cream); color: var(--grey); font-weight: 600; padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #faf8f4; }

/* Badges */
.badge { display: inline-block; padding: 3px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge.green { background: #E3F4EC; color: var(--green); }
.badge.amber { background: #FEF4E3; color: var(--amber); }
.badge.red { background: #FDE9E7; color: var(--red); }
.badge.grey { background: var(--cream); color: var(--grey); }
.badge.navy { background: var(--navy); color: #fff; }

/* 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-box { background: #fff; border-radius: 18px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-head h3 { font-size: 17px; color: var(--navy); }
.modal-close { width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--cream); cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.modal-body { padding: 20px 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

/* Toast */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 20px; border-radius: 30px; font-size: 13px; font-weight: 500; z-index: 999; opacity: 0; transition: opacity .3s; pointer-events: none; white-space: nowrap; }
#toast.show { opacity: 1; }

/* Avatar */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); background: var(--cream); display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--grey); overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

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

/* Spinner */
.spinner { width: 32px; height: 32px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; margin: 32px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Utils */
.muted { color: var(--grey); font-size: 13px; }
.bold { font-weight: 700; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.flex1 { flex: 1; }
.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; }
.center { text-align: center; }
.red-text { color: var(--red); }
.green-text { color: var(--green); }
.gold-text { color: var(--gold); }

/* Photo upload */
.photo-upload { border: 2px dashed var(--line); border-radius: 10px; padding: 20px; text-align: center; cursor: pointer; transition: border-color .2s; }
.photo-upload:hover { border-color: var(--gold); }
.photo-upload input { display: none; }
.photo-preview { width: 100%; max-height: 180px; object-fit: cover; border-radius: 8px; margin-top: 10px; }

/* Stats row */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-align: center; }
.stat-card .val { font-size: 28px; font-weight: 700; color: var(--navy); }
.stat-card .lbl { font-size: 11px; color: var(--grey); margin-top: 2px; }

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

@media (max-width: 600px) {
  .page-content { padding: 12px 12px 80px; }
  .modal-box { max-height: 95vh; border-radius: 18px 18px 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .data-table th, .data-table td { padding: 10px 10px; }
}
