/* ?? Card ?? */
.card {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 16px;
  transition: box-shadow var(--transition); min-width: 0;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-title { display: flex; align-items: center; gap: 7px; font-size: 0.88rem; font-weight: 700; margin-bottom: 14px; }
.card-title i { color: var(--primary); }
.card h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 700; }
.card h4 { margin: 0 0 10px; font-size: 0.88rem; font-weight: 700; }

/* ?? Buttons ?? */
.btn-primary {
  background: var(--primary); color: #fff; border: 1px solid var(--primary);
  padding: 7px 15px; border-radius: var(--r-sm); font-size: 0.82rem; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: var(--transition); font-family: inherit; text-decoration: none;
}
.btn-primary:hover { background: var(--primary-light); box-shadow: 0 4px 12px rgba(26,58,92,0.25); color: #fff; }
.btn-ghost {
  background: var(--surface); color: var(--text-secondary); border: 1px solid var(--border);
  padding: 7px 15px; border-radius: var(--r-sm); font-size: 0.82rem; font-weight: 500;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: var(--transition); font-family: inherit; text-decoration: none;
}
.btn-ghost:hover { border-color: var(--primary-light); color: var(--primary); background: var(--primary-lighter); }
.btn-success { background: var(--secondary); border-color: var(--secondary); }
.btn-success:hover { background: var(--secondary-light); box-shadow: 0 4px 12px rgba(13,124,102,0.25); }
.btn-accent { background: var(--accent); border-color: var(--accent); }
.btn-accent:hover { background: #d08a35; }
.btn-danger {
  background: var(--danger); color: #fff; border: 1px solid var(--danger);
  padding: 7px 15px; border-radius: var(--r-sm); font-size: 0.82rem; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: var(--transition); font-family: inherit;
}
.btn-danger:hover { background: #c53030; box-shadow: 0 4px 12px rgba(229,62,62,0.3); }

/* ?? Page tag ?? */
.page-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 5px; background: var(--primary-lighter);
  color: var(--primary); font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 5px;
}

/* ?? Badges ?? */
.badge-t { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 600; }
.badge-membership { background: #f5f3ff; color: #805ad5; }
.badge-income     { background: var(--success-light); color: var(--success); }
.badge-expense    { background: var(--danger-light); color: var(--danger); }
.badge-paid       { background: var(--success-light); color: var(--success); }
.badge-info       { background: var(--info-light); color: var(--info); }
.badge-warn       { background: var(--warning-light); color: var(--warning); }
.badge-gold       { background: var(--accent-light); color: #9a6808; }

/* ?? Summary strip ?? */
.sum-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.sum-tile {
  padding: 11px 13px; border-radius: var(--r-md); border: 1px solid var(--border-light);
  background: var(--surface); box-shadow: var(--shadow-sm); border-left: 3px solid;
}
.sum-tile.green  { border-left-color: var(--success); }
.sum-tile.blue   { border-left-color: var(--info); }
.sum-tile.red    { border-left-color: var(--danger); }
.sum-tile.gold   { border-left-color: var(--accent); }
.sum-tile.purple { border-left-color: #805ad5; }
.st-label { font-size: 0.68rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.st-value { font-size: 1rem; font-weight: 700; margin-top: 2px; }

/* ?? Active badge ?? */
.active-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--success-light); color: var(--success);
  font-size: 0.7rem; font-weight: 700;
}

/* ?? Table Loader ?? */
.tbl-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 36px 20px;
  color: var(--muted);
  font-size: 0.82rem;
}
.tbl-loader-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: tbl-spin 0.65s linear infinite;
  flex-shrink: 0;
}
@keyframes tbl-spin {
  to { transform: rotate(360deg); }
}
.tbl-loader-text {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}
/* Skeleton shimmer rows for table tbody */
.tbl-skeleton-row td {
  padding: 10px 12px;
}
.tbl-skeleton-cell {
  height: 13px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: tbl-shimmer 1.2s ease-in-out infinite;
}
@keyframes tbl-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ?? Callout ?? */
.callout {
  border-left: 3px solid var(--accent); background: var(--accent-light);
  padding: 10px 13px; border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: #7c5c1e; font-size: 0.82rem;
}

/* ?? Dialog ?? */
.dialog {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px); display: none; align-items: center;
  justify-content: center; padding: 20px; z-index: 70;
}
.dialog.open { display: flex; }
.dialog-box {
  max-width: 360px; width: 100%; background: var(--surface);
  border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-lg);
}

/* ?? Panel backdrop ?? */
.panel-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.18); z-index: 55; display: none; }
.panel-backdrop.show { display: block; }

/* ?? Login ?? */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, rgba(13,22,35,0.97), rgba(26,58,92,0.95));
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
  width: min(380px, 100%); background: var(--surface); padding: 28px;
  border-radius: var(--r-xl); box-shadow: 0 20px 50px rgba(0,0,0,0.28);
}
.login-logo {
  width: 42px; height: 42px; border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; color: #fff; margin: 0 auto 11px;
}
.login-card h2 { text-align: center; margin: 0 0 3px; font-size: 1.25rem; }
.login-card > p { text-align: center; margin: 0 0 18px; color: var(--muted); font-size: 0.82rem; }
.lf { margin-bottom: 11px; }
.lf label { display: block; font-size: 0.74rem; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.lf input {
  width: 100%; padding: 8px 11px; border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: 0.88rem; transition: var(--transition); font-family: inherit;
}
.lf input:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(26,58,92,0.1); }
.login-btn {
  width: 100%; padding: 9px; background: var(--primary); color: #fff; border: none;
  border-radius: var(--r-sm); font-size: 0.88rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-family: inherit; transition: var(--transition); margin-top: 4px;
}
.login-btn:hover { background: var(--primary-light); }
.login-msg { font-size: 0.75rem; text-align: center; min-height: 16px; color: var(--muted); margin: 7px 0; }
.login-error { color: var(--danger); }

/* ?? Footer ?? */
footer { color: var(--muted); font-size: 0.75rem; text-align: center; padding: 10px 0 18px; }
