:root {
  --primary: #007C00;
  --primary-hover: #005f00;
  --primary-light: rgba(0, 124, 0, 0.12);
  --surface: #FFFFFF;
  --bg: #F4F6F8;
  --sidebar-bg: #007C00;
  --sidebar-text: #FFFFFF;
  --sidebar-active-bg: #FFFFFF;
  --sidebar-active-text: #007C00;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.15);
  --danger: #D32F2F;
  --danger-light: rgba(211, 47, 47, 0.12);
  --warning: #F57C00;
  --warning-light: rgba(245, 124, 0, 0.12);
  --text-primary: #1A1A1A;
  --text-secondary: #5A5A5A;
  --text-placeholder: #AAAAAA;
  --border: #E2E8F0;
  --divider: #F0F0F0;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  --shadow-deep: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-sidebar: 4px 0 24px rgba(0, 0, 0, 0.08);
  --radius-card: 16px;
  --radius-input: 10px;
  --radius-badge: 999px;
  --font: 'Poppins', sans-serif;
  --sidebar-width: 240px;
  --topbar-height: 64px;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg);
  font-size: 14px;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.app-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sidebar);
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-header {
  padding: 32px 24px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sidebar-text);
  font-weight: 700;
  font-size: 22px;
}

.logo i {
  width: 24px;
  height: 24px;
}

.sidebar-kicker {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-nav::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.nav-group-label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 16px 12px 6px;
  margin-top: 8px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-bottom: 4px;
}

.sidebar-nav a:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-text);
  transform: translateX(2px);
}

.sidebar-nav a.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
}

.sidebar-nav a i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-badge);
  background: rgba(255, 255, 255, 0.22);
  color: var(--sidebar-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  animation: pulse 2s infinite;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-user-card {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: var(--sidebar-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar-user-name {
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
}

.logout-btn {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
}

.logout-btn:hover {
  background: var(--surface);
  color: var(--primary);
  border-color: var(--surface);
  transform: scale(1.02);
}

.sidebar-overlay {
  display: none;
}

.main-wrapper {
  margin-left: 0;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

.topbar {
  min-height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left,
.topbar-right,
.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.page-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
}

.breadcrumb {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.topbar-right .user-name,
.topbar-divider {
  display: none;
}

.topbar-divider {
  width: 1px;
  height: 28px;
  background: var(--divider);
}

.hamburger,
.icon-btn {
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hamburger {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--text-primary);
  background: var(--bg);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
  position: relative;
}

.icon-btn:hover {
  transform: scale(1.12);
}

.notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 17px;
  height: 17px;
  border-radius: var(--radius-badge);
  background: var(--danger);
  color: var(--surface);
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notif-btn:hover i {
  animation: bellWiggle 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.page-content {
  padding: 16px;
  flex: 1;
  max-width: 100%;
  overflow-x: hidden;
  animation: fadeInUp 0.35s ease forwards;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--text-secondary);
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

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

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

.card,
.stat-card,
.table-card,
.form-card,
.chart-card,
.property-card,
.notice-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card:hover,
.stat-card:hover,
.property-card:hover,
.notice-card:hover {
  box-shadow: var(--shadow-deep);
  transform: translateY(-2px);
}

.stat-card {
  padding: 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-label {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.stat-value {
  margin: 4px 0;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0;
}

.stat-trend {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
}

.chart-card,
.table-card,
.form-card,
.notice-card {
  padding: 20px;
}

.chart-card canvas {
  width: 100%;
  max-height: 300px;
}

.property-card {
  overflow: hidden;
}

.property-top {
  padding: 20px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.property-body {
  padding: 20px;
  display: grid;
  gap: 10px;
  color: var(--text-secondary);
}

.property-title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.property-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar,
.table-toolbar,
.form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.table-toolbar {
  margin-bottom: 16px;
}

.table-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
}

.table-wrapper {
  overflow-x: hidden;
  max-width: 100%;
}

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

.data-table th {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--divider);
  overflow-wrap: anywhere;
}

.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
  overflow-wrap: anywhere;
}

tr {
  transition: background 0.15s ease;
}

tr:hover {
  background: rgba(0, 124, 0, 0.04);
}

.action-btns {
  display: flex;
  gap: 8px;
}

.icon-btn-edit {
  background: var(--primary-light);
  color: var(--primary);
}

.icon-btn-view {
  background: rgba(107, 107, 107, 0.1);
  color: var(--text-secondary);
}

.icon-btn-delete {
  background: var(--danger-light);
  color: var(--danger);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-badge);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.badge-paid,
.badge-active,
.badge-rented,
.badge-resolved {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-owing,
.badge-overdue,
.badge-open,
.badge-high {
  background: var(--danger-light);
  color: var(--danger);
}

.badge-pending,
.badge-vacant,
.badge-progress,
.badge-medium {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-inactive,
.badge-low {
  background: rgba(107, 107, 107, 0.12);
  color: var(--text-secondary);
}

.btn {
  min-height: 40px;
  border-radius: var(--radius-input);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn:hover {
  transform: scale(1.03);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: var(--surface);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outlined {
  background: var(--surface);
  color: var(--primary);
  border-color: var(--border);
}

.form-card {
  max-width: 660px;
  margin: 0 auto;
}

.form-card.wide {
  max-width: 860px;
}

.form-card-header {
  margin-bottom: 20px;
}

.form-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.form-subtitle {
  margin: 6px 0 0;
  color: var(--text-secondary);
}

.form-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.form-group {
  display: grid;
  gap: 7px;
}

.form-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-input,
input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--surface);
  color: var(--text-primary);
  padding: 10px 12px;
  font-family: var(--font);
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 124, 0, 0.1);
  outline: none;
}

.form-footer {
  margin-top: 22px;
  justify-content: flex-end;
}

.span-2 {
  grid-column: 1 / -1;
}

.spacer {
  height: 20px;
}

.table-heading {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.table-subtitle {
  margin: 4px 0 0;
  color: var(--text-secondary);
}

.rent-value {
  font-size: 18px;
}

.check-row {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--text-secondary);
}

.check-row input {
  width: auto;
  min-height: auto;
}

.status-banner {
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  animation: slideDown 0.3s ease forwards;
}

.status-banner-error {
  background: var(--danger-light);
  color: var(--danger);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  animation: slideDown 0.3s ease forwards;
}

.status-banner-warning {
  background: var(--warning-light);
  color: var(--warning);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  animation: slideDown 0.3s ease forwards;
}

.feed {
  display: grid;
  gap: 12px;
}

.notice-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.notice-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notice-card h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.notice-card p {
  margin: 5px 0;
  color: var(--text-secondary);
}

.notice-time {
  color: var(--text-placeholder);
  font-size: 12px;
}

.auth-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.auth-card {
  max-width: 960px;
  width: 95%;
  min-height: 600px;
  display: flex;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.auth-left {
  min-width: 380px;
  background: var(--primary);
  padding: 48px;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 24px;
  color: var(--surface);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.auth-left::before {
  content: "";
  position: absolute;
  inset: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
}

.auth-left i {
  width: 86px;
  height: 86px;
  position: relative;
  z-index: 1;
}

.auth-left h1,
.auth-left p {
  position: relative;
  z-index: 1;
  margin: 0;
}

.auth-right {
  flex: 1;
  padding: 32px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
}

.auth-right h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.auth-right p {
  margin: 6px 0 0;
  color: var(--text-secondary);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }
}

@keyframes bellWiggle {
  0% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(12deg);
  }

  75% {
    transform: rotate(-12deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 1000;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
  }

  .sidebar-overlay.active {
    display: block;
  }

  .main-wrapper {
    margin-left: 0;
  }

  .hamburger {
    display: flex;
  }

  .data-table thead {
    display: none;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table tr {
    border: 1px solid var(--divider);
    border-radius: var(--radius-input);
    margin-bottom: 12px;
    padding: 8px 0;
    background: var(--surface);
  }

  .data-table td {
    border-bottom: 0;
    padding: 8px 12px;
    display: grid;
    grid-template-columns: minmax(96px, 38%) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    overflow-wrap: anywhere;
  }

  .data-table td::before {
    content: attr(data-label);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .data-table td:last-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .data-table td:last-child::before {
    content: attr(data-label);
  }

  .action-btns {
    justify-content: flex-end;
    flex-wrap: wrap;
  }
}

@media (min-width: 641px) {
  .auth-left {
    display: flex;
  }

  .auth-right {
    padding: 48px;
  }
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .property-grid,
  .rent-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-body.two {
    grid-template-columns: repeat(2, 1fr);
  }

  .topbar-right .user-name,
  .topbar-divider {
    display: inline-flex;
  }
}

@media (min-width: 769px) {
  .hamburger {
    display: none;
  }

  .sidebar-overlay {
    display: none !important;
  }

  .main-wrapper {
    margin-left: var(--sidebar-width);
  }

  .page-content {
    padding: 32px 24px;
  }

  .page-title {
    font-size: 24px;
  }
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .property-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .charts-grid {
    grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr);
  }

  .rent-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}