/* === Buttons === */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border: 0;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-accent {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: var(--shadow-accent);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #d96626, #9d4414);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-outline:hover {
  background: rgba(62, 43, 29, 0.04);
  border-color: var(--muted);
}

.btn-leaf {
  color: #fff;
  background: linear-gradient(135deg, var(--leaf), #163b31);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: rgba(62, 43, 29, 0.04);
  color: var(--ink);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

/* === Cards === */

.card {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 251, 246, 0.9);
  box-shadow: var(--shadow-card);
}

/* === Stat Cards === */

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 251, 246, 0.9);
  box-shadow: var(--shadow-card);
}

.stat-card__icon {
  font-size: 1.2rem;
  margin-bottom: 0.15rem;
  color: var(--accent);
}

.stat-card__value {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}

.stat-card__label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.stat-card__trend {
  font-size: 0.75rem;
  font-weight: 600;
}

.stat-card__trend--up {
  color: var(--leaf);
}

.stat-card__trend--alert {
  color: var(--accent-deep);
}

.stat-card--green .stat-card__icon,
.stat-card--green .stat-card__value { color: var(--leaf); }

.stat-card--blue .stat-card__icon,
.stat-card--blue .stat-card__value { color: #2d6adf; }

.stat-card--accent .stat-card__icon,
.stat-card--accent .stat-card__value { color: var(--accent); }

/* === Badges === */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge--active { background: rgba(33, 88, 73, 0.12); color: var(--leaf); }
.badge--sold { background: rgba(45, 106, 223, 0.12); color: #2d6adf; }
.badge--unlisted { background: rgba(62, 43, 29, 0.08); color: var(--muted); }
.badge--draft { background: rgba(230, 184, 78, 0.18); color: #8a6600; }
.badge--disputed { background: rgba(223, 109, 45, 0.14); color: var(--accent-deep); }
.badge--accent { background: rgba(223, 109, 45, 0.12); color: var(--accent-deep); }

/* === Form Controls === */

.form-group {
  display: grid;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
}

.form-control {
  width: 100%;
  min-height: 50px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: rgba(33, 88, 73, 0.4);
  box-shadow: 0 0 0 0.18rem rgba(33, 88, 73, 0.12);
}

.form-control::placeholder {
  color: var(--muted);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.form-check input[type="checkbox"] {
  accent-color: var(--leaf);
  width: 16px;
  height: 16px;
}

.input-icon {
  position: relative;
}

.input-icon .form-control {
  padding-left: 2.75rem;
}

.input-icon i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.1rem;
}

/* === Table Panel === */

.table-panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 251, 246, 0.9);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

.table-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.table-panel__head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.table-panel__action {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--accent-deep);
}

.table-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
}

.table-row:last-child {
  border-bottom: 0;
}

.table-row:hover {
  background: rgba(62, 43, 29, 0.025);
}

.table-row__main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.table-row__info {
  font-weight: 600;
  font-size: 0.9rem;
}

.table-row__meta {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

/* === Data Table (full-width, for list views) === */

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 0.7rem 1.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: rgba(62, 43, 29, 0.02);
}

.data-table td {
  padding: 0.75rem 1.25rem;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tr.clickable {
  cursor: pointer;
  transition: background 0.12s ease;
}

.data-table tr.clickable:hover {
  background: rgba(62, 43, 29, 0.03);
}

.data-table__primary {
  font-weight: 600;
  color: var(--ink);
}

.data-table__muted {
  font-size: 0.84rem;
  color: var(--muted);
}

.data-table__amount {
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

/* === Pagination === */

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.pagination-bar__info {
  color: var(--muted);
  font-size: 0.84rem;
}

.pagination-bar__links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pagination-bar__current {
  font-weight: 700;
  font-size: 0.84rem;
  padding: 0 0.5rem;
}

/* === Detail Grid (for detail views) === */

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  padding: 1.25rem;
}

.detail-grid__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.25rem;
  font-weight: 700;
}

.detail-grid__value {
  font-weight: 600;
  font-size: 0.92rem;
}

/* === Filter Pills === */

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  align-items: center;
}

.filter-pills__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  padding: 0.25rem 0.5rem;
}

.filter-pill {
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(62, 43, 29, 0.05);
  color: var(--muted);
  transition: all 0.15s ease;
}

.filter-pill:hover {
  background: rgba(62, 43, 29, 0.1);
  color: var(--ink);
}

.filter-pill.is-active {
  background: var(--accent);
  color: #fff;
}

/* === Tabs === */

.tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.3rem;
  background: rgba(62, 43, 29, 0.04);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.tabs__tab {
  padding: 0.55rem 1rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  font-family: var(--font-body);
}

.tabs__tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
}

.tabs__tab.is-active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 3px rgba(62, 43, 29, 0.08);
}

.tabs__tab .badge {
  font-size: 0.68rem;
  padding: 0.15rem 0.55rem;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

/* === Table Wrap (responsive horizontal scroll) === */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* === Card Table (single container, no nested cards) === */

.card-table {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 251, 246, 0.9);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

.card-table__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.card-table__head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

/* === Search Bar === */

.search-bar {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 251, 246, 0.85);
  overflow: hidden;
  transition: border-color 0.2s;
}

.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(116, 97, 58, 0.1);
}

.search-bar__icon {
  padding: 0 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.search-bar__input {
  flex: 1;
  border: 0;
  outline: 0;
  padding: 0.65rem 0;
  font-size: 0.9rem;
  font-family: var(--font-body);
  background: transparent;
  color: var(--text);
  min-width: 0;
}

.search-bar__input::placeholder {
  color: var(--muted);
}

.search-bar__clear {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: color 0.15s;
}

.search-bar__clear:hover {
  color: var(--accent-deep);
}

/* === Empty State === */

.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--muted);
}

.empty-state__icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.75rem;
  opacity: 0.6;
}

.empty-state__text {
  margin: 0;
  font-size: 0.9rem;
}

/* === Form Grid (2-column form layout) === */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-grid__full {
  grid-column: 1 / -1;
}

@media (max-width: 767px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid__full {
    grid-column: 1;
  }
}

/* === Stat Grid Responsive === */

.stat-grid--responsive {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

/* === Spin animation === */

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin-icon {
  display: inline-block;
  animation: spin 1s linear infinite;
}

/* === Profile Header === */

.profile-header {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.profile-header__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-header__body {
  flex: 1;
  min-width: 0;
}

.profile-header__name {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 600;
  font-family: var(--font-heading);
}

.profile-detail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.profile-detail__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.profile-detail__item i {
  color: var(--muted);
  width: 1.1rem;
  flex-shrink: 0;
}

/* === Component Responsive === */

@media (max-width: 767px) {
  .profile-detail {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .tabs__tab {
    padding: 0.4rem 0.65rem;
    font-size: 0.74rem;
  }

  .profile-header__avatar {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }

  .profile-header__name {
    font-size: 1rem;
  }

  .profile-detail__item {
    font-size: 0.82rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.55rem 0.75rem;
    font-size: 0.78rem;
  }
}

/* === Section Nav === */

.section-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.84rem;
}

.section-nav__link {
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.section-nav__link:hover {
  color: var(--accent-deep);
}

.section-nav__link.is-active {
  color: var(--ink);
}

.section-nav__sep {
  color: var(--line);
  font-weight: 400;
}

/* === Success Banner === */

.success-banner {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.error-banner {
  background:#fef2f2;
  color:#991b1b;
  border:1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}