/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --green: #1D9E75;
  --green-dark: #0F6E56;
  --green-light: #E1F5EE;
  --blue: #185FA5;
  --blue-light: #E6F1FB;
  --amber: #BA7517;
  --amber-light: #FAEEDA;
  --red: #A32D2D;
  --red-light: #FCEBEB;
  --gray-50: #F7F6F3;
  --gray-100: #EDECEA;
  --gray-200: #D5D4D0;
  --gray-400: #9B9A96;
  --gray-600: #5C5B58;
  --gray-900: #1A1917;
  --sidebar-w: 210px;
  --font: 'DM Sans', sans-serif;
  --font-serif: 'DM Serif Display', serif;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
}
html, body { height: 100%; font-family: var(--font); color: var(--gray-900); background: var(--gray-50); font-size: 14px; line-height: 1.5; }
.hidden { display: none !important; }

/* ── Login ── */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #0a1a14; position: relative; overflow: hidden; }
.login-bg { position: absolute; inset: 0; }
.login-paw-bg { position: absolute; right: -60px; bottom: -60px; font-size: 400px; opacity: .04; transform: rotate(-15deg); pointer-events: none; }
.login-card { position: relative; background: white; border-radius: 18px; padding: 40px 44px; width: 420px; box-shadow: var(--shadow-lg); animation: fadeUp .5s ease both; }
@keyframes fadeUp { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.logo-mark { width: 44px; height: 44px; }
.logo-mark svg { width: 100%; height: 100%; }
.login-brand { font-family: var(--font-serif); font-size: 22px; color: var(--gray-900); }
.login-tagline { font-size: 11px; color: var(--gray-400); letter-spacing: .06em; text-transform: uppercase; }
.login-title { font-family: var(--font-serif); font-size: 26px; color: var(--gray-900); margin-bottom: 6px; }
.login-sub { font-size: 13px; color: var(--gray-400); margin-bottom: 24px; }
.login-error { background: var(--red-light); color: var(--red); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--gray-600); margin-bottom: 6px; letter-spacing: .02em; }
.form-input { width: 100%; padding: 10px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); font-family: var(--font); font-size: 14px; color: var(--gray-900); background: var(--gray-50); outline: none; transition: border-color .15s, box-shadow .15s; }
.form-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(29,158,117,.12); background: white; }
.form-input.error { border-color: var(--red); }
select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; min-height: 80px; }
.btn-login { width: 100%; padding: 12px; background: var(--green); color: white; border: none; border-radius: var(--radius-sm); font-family: var(--font); font-size: 14px; font-weight: 500; cursor: pointer; transition: background .15s, transform .1s; margin-top: 4px; }
.btn-login:hover { background: var(--green-dark); }
.btn-login:active { transform: scale(.99); }
.login-hint { font-size: 12px; color: var(--gray-400); text-align: center; margin-top: 14px; }

/* ── App Shell ── */
.app { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ── */
.sidebar { width: var(--sidebar-w); background: #0d1f18; color: white; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-top { flex: 1; overflow-y: auto; padding: 0 0 12px; }
.app-logo { display: flex; align-items: center; gap: 9px; padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.06); margin-bottom: 8px; }
.logo-mark-sm { width: 30px; height: 30px; flex-shrink: 0; }
.logo-mark-sm svg { width: 100%; height: 100%; }
.logo-text { font-family: var(--font-serif); font-size: 18px; color: white; }
.nav-section-label { font-size: 10px; color: rgba(255,255,255,.3); text-transform: uppercase; letter-spacing: .08em; padding: 14px 16px 4px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 16px; font-size: 13px; color: rgba(255,255,255,.55); text-decoration: none; border-left: 2px solid transparent; transition: all .15s; cursor: pointer; }
.nav-item:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.05); }
.nav-item.active { color: white; background: rgba(29,158,117,.18); border-left-color: var(--green); font-weight: 500; }
.nav-icon { width: 15px; height: 15px; flex-shrink: 0; opacity: .7; }
.nav-item.active .nav-icon { opacity: 1; }
.sidebar-bottom { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.06); }
.integrations-label { font-size: 10px; color: rgba(255,255,255,.3); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.integration-pill { display: flex; align-items: center; gap: 7px; font-size: 11px; color: rgba(255,255,255,.5); margin-bottom: 5px; }
.int-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.user-row { display: flex; align-items: center; gap: 9px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.06); }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--green); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: white; flex-shrink: 0; }
.user-name { font-size: 12px; font-weight: 500; color: rgba(255,255,255,.8); }
.user-role { font-size: 10px; color: rgba(255,255,255,.35); text-transform: capitalize; }
.logout-btn { margin-left: auto; background: none; border: none; color: rgba(255,255,255,.35); cursor: pointer; padding: 4px; border-radius: 4px; display: flex; align-items: center; }
.logout-btn:hover { color: rgba(255,255,255,.7); background: rgba(255,255,255,.08); }

/* ── Main Content ── */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--gray-50); }
.page { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

/* ── Page Header ── */
.page-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; background: white; border-bottom: 1px solid var(--gray-100); flex-shrink: 0; }
.page-title { font-family: var(--font-serif); font-size: 20px; color: var(--gray-900); }
.header-actions { display: flex; align-items: center; gap: 8px; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); background: white; color: var(--gray-600); font-family: var(--font); font-size: 13px; cursor: pointer; transition: all .15s; font-weight: 400; }
.btn:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn-primary { background: var(--green); color: white; border-color: var(--green); font-weight: 500; }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-danger { background: var(--red-light); color: var(--red); border-color: transparent; }
.btn-danger:hover { background: #f7d0d0; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px; border-radius: var(--radius-sm); }

/* ── Content Area ── */
.content { flex: 1; overflow-y: auto; padding: 20px 24px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Stat Cards ── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-card { background: white; border: 1px solid var(--gray-100); border-radius: var(--radius); padding: 14px 16px; }
.stat-label { font-size: 11px; color: var(--gray-400); margin-bottom: 5px; font-weight: 500; letter-spacing: .02em; }
.stat-value { font-size: 26px; font-family: var(--font-serif); color: var(--gray-900); line-height: 1; }
.stat-sub { font-size: 11px; color: var(--gray-400); margin-top: 4px; }

/* ── Cards ── */
.card { background: white; border: 1px solid var(--gray-100); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--gray-100); }
.card-title { font-size: 13px; font-weight: 600; color: var(--gray-600); }
.section-heading { font-size: 12px; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }

/* ── Table Rows ── */
.row-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--gray-100); transition: background .1s; cursor: pointer; }
.row-item:last-child { border-bottom: none; }
.row-item:hover { background: var(--gray-50); }
.row-item.no-hover { cursor: default; }
.row-item.no-hover:hover { background: white; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.badge-green { background: var(--green-light); color: var(--green-dark); }
.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-amber { background: var(--amber-light); color: var(--amber); }
.badge-red { background: var(--red-light); color: var(--red); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-paid { background: #EAF3DE; color: #3B6D11; }
.badge-unpaid { background: var(--red-light); color: var(--red); }

/* ── Pet Avatar ── */
.pet-emoji { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.avatar-circle { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; color: white; }

/* ── Sync Banner ── */
.sync-banner { display: flex; align-items: center; gap: 8px; background: var(--green-light); border: 1px solid #9FE1CB; border-radius: var(--radius-sm); padding: 8px 12px; font-size: 12px; color: var(--green-dark); margin-bottom: 14px; }
.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.sync-banner.qb-banner { background: var(--blue-light); border-color: #B5D4F4; color: var(--blue); }

/* ── Search ── */
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--gray-400); pointer-events: none; }
.search-input { padding: 7px 10px 7px 32px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); font-family: var(--font); font-size: 13px; color: var(--gray-900); background: var(--gray-50); outline: none; width: 220px; transition: border-color .15s; }
.search-input:focus { border-color: var(--green); background: white; }

/* ── Calendar ── */
.cal-wrapper { background: white; border: 1px solid var(--gray-100); border-radius: var(--radius); padding: 16px; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-month { font-family: var(--font-serif); font-size: 18px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-head { font-size: 11px; color: var(--gray-400); text-align: center; padding: 4px 0; font-weight: 500; }
.cal-day { min-height: 68px; padding: 5px 6px; border-radius: 6px; background: var(--gray-50); cursor: pointer; transition: background .1s; }
.cal-day:hover { background: var(--gray-100); }
.cal-day.today { background: var(--green-light); }
.cal-day.other-month { opacity: .4; }
.cal-day-num { font-size: 12px; font-weight: 500; color: var(--gray-600); margin-bottom: 3px; }
.cal-day.today .cal-day-num { color: var(--green-dark); }
.cal-event { font-size: 10px; padding: 1px 5px; border-radius: 3px; margin-bottom: 2px; background: var(--green); color: white; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event.board { background: var(--blue); }
.cal-event.bath { background: var(--amber); }
.cal-legend { display: flex; gap: 14px; margin-top: 12px; font-size: 11px; color: var(--gray-400); }
.cal-legend-item { display: flex; align-items: center; gap: 5px; }
.cal-legend-dot { width: 10px; height: 10px; border-radius: 2px; }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 1000; animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.modal-box { background: white; border-radius: var(--radius); width: 500px; max-width: 95vw; max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slideUp .2s ease; }
@keyframes slideUp { from { opacity:0; transform: translateY(16px); } to { opacity:1; transform: translateY(0); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--gray-100); flex-shrink: 0; }
.modal-title { font-family: var(--font-serif); font-size: 17px; }
.modal-close { background: none; border: none; font-size: 16px; color: var(--gray-400); cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.modal-close:hover { background: var(--gray-100); color: var(--gray-600); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--gray-100); display: flex; gap: 8px; justify-content: flex-end; flex-shrink: 0; }

/* ── Toast ── */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--gray-900); color: white; padding: 10px 18px; border-radius: var(--radius-sm); font-size: 13px; z-index: 2000; box-shadow: var(--shadow); animation: toastIn .2s ease; }
.toast.success { background: var(--green-dark); }
.toast.error { background: var(--red); }
@keyframes toastIn { from { opacity:0; transform: translateY(10px); } to { opacity:1; transform: translateY(0); } }

/* ── Reminder items ── */
.reminder-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--gray-100); }
.reminder-row:last-child { border-bottom: none; }
.reminder-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.reminder-info { flex: 1; }
.reminder-title { font-size: 13px; font-weight: 500; }
.reminder-sub { font-size: 11px; color: var(--gray-400); margin-top: 2px; }
.reminder-time { font-size: 11px; color: var(--gray-400); white-space: nowrap; }

/* ── Admin table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: .05em; padding: 8px 16px; border-bottom: 1px solid var(--gray-100); background: var(--gray-50); }
.data-table td { padding: 10px 16px; border-bottom: 1px solid var(--gray-100); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-50); }

/* ── Empty states ── */
.empty-state { padding: 40px; text-align: center; color: var(--gray-400); font-size: 13px; }

/* ── Loading ── */
.loading { padding: 30px; text-align: center; color: var(--gray-400); font-size: 13px; }
