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

:root {
  --green: #5A9E6F;
  --green-light: #F0F7F2;
  --green-border: #C8E2CF;
  --blue: #5B7FB5;
  --blue-light: #F0F4FA;
  --blue-border: #C8D8EC;
  --yellow: #C4943A;
  --yellow-light: #FDF8EE;
  --yellow-border: #F0E2C1;
  --coral: #D4836E;
  --coral-light: #FDF5F2;
  --coral-border: #F0D9CF;
  --red: #D4564E;
  --red-light: #FDF2F1;
  --red-border: #F5D5D3;
  --gray-50: #FAFAF8;
  --gray-100: #F5F5F2;
  --gray-200: #E2E3DE;
  --gray-300: #D5D6D1;
  --gray-400: #9B9B9B;
  --gray-500: #6B6B6B;
  --gray-600: #4B4B4B;
  --gray-700: #3A3A3A;
  --gray-800: #1A1A1A;
  --gray-900: #1A1A1A;
}

* {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  background: #EDEEE9;
  color: var(--gray-800);
}

/* App layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 240px;
  background: #E6E7E2;
  border-right: 1px solid var(--gray-200);
  padding: 24px 16px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 40;
}

.app-main {
  margin-left: 240px;
  flex: 1;
  min-height: 100vh;
}

.app-topbar {
  height: 64px;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.app-content {
  padding: 32px;
}

/* Sidebar nav */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--gray-900);
  margin-bottom: 32px;
  text-decoration: none;
}

.sidebar-logo img {
  width: 32px;
  height: 32px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--gray-600);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}

.sidebar-link:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.sidebar-link.active {
  background: rgba(212, 131, 110, 0.12);
  color: var(--gray-900);
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 16px 12px 8px;
}

.sidebar-bottom {
  border-top: 1px solid var(--gray-200);
  padding-top: 16px;
  margin-top: auto;
}

/* Stat cards */
.stat-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 24px;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--gray-900);
}

.stat-card .stat-label {
  font-size: 14px;
  color: var(--gray-500);
  margin-top: 4px;
}

.stat-card .stat-change {
  font-size: 13px;
  font-weight: 500;
  margin-top: 8px;
}

.stat-change.up { color: var(--green); }
.stat-change.down { color: var(--red); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: #c0755f;
}

.btn-secondary {
  background: white;
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

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

.btn-ghost:hover {
  background: var(--gray-100);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
}

.badge-green {
  background: var(--green-light);
  color: var(--green);
}

.badge-blue {
  background: var(--blue-light);
  color: var(--blue);
}

.badge-yellow {
  background: var(--yellow-light);
  color: var(--yellow);
}

.badge-gray {
  background: var(--gray-100);
  color: var(--gray-500);
}

/* Table */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
}

.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--gray-100);
}

.data-table tr:hover td {
  background: var(--gray-50);
}

/* Cards */
.card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
}

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
}

.page-subtitle {
  font-size: 14px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* Search input */
.search-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 14px;
  width: 280px;
}

.search-input input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 14px;
  color: var(--gray-800);
}

.search-input input::placeholder {
  color: var(--gray-400);
}

/* Avatar */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  display: none;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 24px;
}

.tab {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}

.tab:hover {
  color: var(--gray-700);
}

.tab.active {
  color: var(--coral);
  border-bottom-color: var(--coral);
}

/* Form elements */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 14px;
  color: var(--gray-800);
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(212, 131, 110, 0.15);
}

.form-input::placeholder {
  color: var(--gray-400);
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  font-size: 13px;
  color: var(--gray-400);
  margin-top: 4px;
}

/* Toggle switch */
.toggle {
  width: 44px;
  height: 24px;
  background: var(--gray-300);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle.active {
  background: var(--coral);
}

.toggle::after {
  content: '';
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle.active::after {
  transform: translateX(20px);
}

/* Utility */
.text-green { color: var(--green); }
.text-blue { color: var(--blue); }
.text-yellow { color: var(--yellow); }
.bg-green-light { background: var(--green-light); }
.bg-blue-light { background: var(--blue-light); }
.bg-yellow-light { background: var(--yellow-light); }

/* Responsive */
@media (max-width: 768px) {
  .app-sidebar {
    display: none;
  }
  .app-main {
    margin-left: 0;
  }
  .app-content {
    padding: 16px;
  }
}
