/* Modern Top-Class UI Styles */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --primary-solid: #667eea;
  --secondary: #764ba2;
  --accent: #f093fb;
  --light: #f8f9ff;
  --dark: #2d3748;
  --muted: #718096;
  --card: #ffffff;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --border: #e2e8f0;
  --success: #48bb78;
  --danger: #f56565;
  --warning: #ed8936;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--light);
  color: var(--dark);
  line-height: 1.6;
}

.topbar {
  background: var(--primary);
  color: #fff;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}

.topbar h1 {
  font-weight: 600;
  font-size: 1.5rem;
}

.btn {
  background: var(--primary-solid);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn.secondary {
  background: #e2e8f0;
  color: var(--dark);
}

.btn.secondary:hover {
  background: #cbd5e0;
}

.whatsapp-btn {
  background: #25d366;
  color: #fff;
}

.whatsapp-btn:hover {
  background: #128c7e;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Tabs */
.tabs {
  display: flex;
  background: var(--card);
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 0;
}

.tab-btn {
  flex: 1;
  padding: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.tab-btn.active {
  background: var(--primary-solid);
  color: #fff;
}

.tab-btn:not(.active):hover {
  background: rgba(102, 126, 234, 0.1);
}

.tab-content {
  background: var(--card);
  border-radius: 0 0 12px 12px;
  box-shadow: var(--shadow);
  padding: 2rem;
  display: none;
}

.tab-content.active {
  display: block;
}

.panel {
  background: var(--card);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.panel h2 {
  color: var(--dark);
  margin-bottom: 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel h2 i {
  color: var(--primary-solid);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

input, select, textarea {
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-solid);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  justify-content: flex-end;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
}

.filters .form-group {
  flex: 1;
  min-width: 150px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.summary-item {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: var(--shadow);
}

.summary-item h3 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.summary-item p {
  font-weight: 500;
  opacity: 0.9;
}

.table-container {
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  position: sticky;
  top: 0;
}

tbody tr:hover {
  background: rgba(102, 126, 234, 0.05);
}

.action-btns {
  display: flex;
  gap: 0.5rem;
}

.settle-badge {
  background: var(--success);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.settle-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
}

.search-container {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#searchBox {
  flex: 1;
  max-width: 300px;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--card);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  width: 90%;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal.active .modal-content {
  transform: scale(1);
}

.modal h3 {
  margin-bottom: 1rem;
  color: var(--dark);
  font-weight: 600;
}

.modal-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* Login Page */
.centered {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--primary);
}

.card {
  background: var(--card);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.error {
  background: #fed7d7;
  color: #c53030;
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 500;
}

.muted {
  color: var(--muted);
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 0.5rem;
  }

  .panel {
    padding: 1rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tabs {
    flex-direction: column;
  }

  .tab-btn {
    text-align: center;
  }
}
