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

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: #F5F3EF;
  color: #2B2B28;
}
input, select, button { font-family: 'Inter', sans-serif; }
input:focus, select:focus { outline: 2px solid #3E7C6B; outline-offset: 1px; }
button:focus-visible { outline: 2px solid #3E7C6B; outline-offset: 2px; }
::placeholder { color: #A8A29E; }
.dim { color: #A29C90; }

/* ---------- login ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: #FFFFFF;
  border: 1px solid #ECE8E0;
  border-radius: 16px;
  padding: 32px 28px;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-card .logo-dot {
  width: 40px; height: 40px; border-radius: 10px;
  background: #3E7C6B; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; margin-bottom: 4px;
}
.login-card h1 { font-size: 20px; margin: 0; }
.login-card p { margin: 0 0 6px; font-size: 13px; }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: #8A8479; }
.login-card input {
  border: 1px solid #E4E0D8; border-radius: 8px; padding: 10px 12px; font-size: 14px; background: #FFFFFF;
}
.login-card button {
  margin-top: 6px; background: #3E7C6B; color: #fff; border: none; border-radius: 8px;
  padding: 11px 14px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.login-card .error { color: #B5555D; font-size: 12.5px; min-height: 16px; }

/* ---------- dashboard shell ---------- */
.page { min-height: 100vh; padding: 22px 28px 60px; }
.shell { width: 100%; max-width: 1280px; margin: 0 auto; }

.topbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.brand-row { display: flex; align-items: center; gap: 10px; }
.logo-dot { width: 34px; height: 34px; border-radius: 9px; background: #3E7C6B; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; }
#companyInput { font-size: 21px; font-weight: 800; background: transparent; border: none; color: #2B2B28; padding: 0; min-width: 100px; }
.owner-row { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.owner-row input { background: #FFFFFF; border: 1px solid #E4E0D8; border-radius: 6px; padding: 5px 8px; width: 88px; font-size: 12.5px; }
.owner-tag { background: #EAF1EE; color: #3E7C6B; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 20px; margin-left: 4px; }
.logout-btn { background: transparent; border: 1px solid #E4E0D8; border-radius: 8px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; color: #6B6558; margin-left: 6px; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
.stat-card { background: #FFFFFF; border: 1px solid #ECE8E0; border-radius: 14px; padding: 16px 18px; display: flex; gap: 12px; align-items: flex-start; }
.stat-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px; }
.stat-label { font-size: 12.5px; color: #8A8479; margin-bottom: 3px; }
.stat-value { font-size: 20px; font-weight: 700; }
.stat-sub { font-size: 11.5px; color: #A29C90; margin-top: 2px; }

.mid-row { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(280px, 1.3fr); gap: 14px; margin-bottom: 20px; }
.card { background: #FFFFFF; border: 1px solid #ECE8E0; border-radius: 14px; padding: 18px; }
.card-head-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-title { font-size: 14.5px; font-weight: 700; }

.currency-toggle { display: flex; gap: 3px; background: #F0EEE9; border-radius: 8px; padding: 3px; }
.currency-toggle button { border: none; background: transparent; padding: 4px 10px; border-radius: 6px; font-size: 12px; cursor: pointer; color: #8A8479; font-weight: 600; }
.currency-toggle button.active { background: #FFFFFF; color: #2B2B28; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }

.donut-row { display: flex; gap: 18px; align-items: center; }
.donut { width: 110px; height: 110px; border-radius: 50%; flex-shrink: 0; position: relative;
  background: conic-gradient(#3E7C6B 0% 50%, #B5793A 50% 100%); }
.donut::after { content: ""; position: absolute; inset: 17px; border-radius: 50%; background: #FFFFFF; }
.donut-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 11.5px; font-weight: 700; color: #6B6558; z-index: 2; }
.owner-stats { flex: 1; min-width: 0; }
.owner-stat-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.owner-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.owner-name { font-size: 13.5px; font-weight: 600; flex: 1; }
.owner-amt { font-size: 14px; font-weight: 700; }
.owner-foot { font-size: 11px; color: #A29C90; margin-top: 8px; line-height: 1.5; }

.bar-list { display: flex; flex-direction: column; gap: 9px; }
.bar-row-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 3px; }
.bar-track { height: 8px; border-radius: 4px; background: #F0EEE9; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; }
.empty-chart { color: #A29C90; font-size: 13px; padding: 30px 0; text-align: center; }

.tabs { display: flex; gap: 4px; margin-bottom: 14px; background: #EAE7E0; border-radius: 10px; padding: 4px; width: fit-content; }
.tabs button { border: none; background: transparent; padding: 7px 18px; border-radius: 7px; font-size: 13.5px; cursor: pointer; color: #8A8479; font-weight: 600; }
.tabs button.active { background: #FFFFFF; color: #2B2B28; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }

.lower-grid { display: grid; grid-template-columns: 320px 1fr; gap: 14px; align-items: start; }
.form { display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field span.label { font-size: 11.5px; color: #8A8479; }
.field input, .field select { border: 1px solid #E4E0D8; border-radius: 8px; padding: 8px 10px; font-size: 13.5px; background: #FFFFFF; width: 100%; }
.amount-group { display: flex; }
.amount-group input { border-radius: 8px 0 0 8px; border-right: none; }
.amount-group select { border-radius: 0 8px 8px 0; width: 64px; background: #F7F5F1; }
.add-btn { background: #3E7C6B; color: #fff; border: none; border-radius: 8px; padding: 9px 14px; font-size: 13.5px; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 2px; }

.table-wrap { display: flex; flex-direction: column; }
.table-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid #F5F3EF; }
.table-head { color: #A29C90; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; border-bottom: 1px solid #ECE8E0; }
.col-date { width: 84px; flex-shrink: 0; font-size: 12.5px; color: #6B6558; }
.col-cat { width: 130px; flex-shrink: 0; }
.col-client { width: 160px; flex-shrink: 0; min-width: 0; }
.col-note { flex: 1; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-amt { width: 100px; flex-shrink: 0; text-align: right; font-size: 13.5px; font-weight: 700; }
.col-del { width: 26px; flex-shrink: 0; }
.cat-tag { color: #fff; font-size: 10.5px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.client-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-phone { font-size: 11px; color: #A29C90; margin-top: 1px; }
.rm-btn { background: transparent; border: none; color: #C9C3B8; cursor: pointer; padding: 4px; font-size: 14px; }
.empty-row { color: #A8A29E; font-size: 13px; padding: 18px 0; text-align: center; }

@media (max-width: 800px) {
  .mid-row, .lower-grid { grid-template-columns: 1fr; }
  .col-client { display: none; }
}
