/* Modern Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #60a5fa;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
  font-size: 15px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header */
.site-header {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand a {
  color: var(--gray-900);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand a:before {
  content: '🏠';
  font-size: 1.5rem;
}

.main-nav {
  display: flex;
  gap: 0.25rem;
}

.main-nav a {
  color: var(--gray-600);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all 0.2s;
}

.main-nav a:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.main-nav a.active {
  background: var(--primary);
  color: white;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--gray-200);
  margin-top: 4rem;
  padding: 2rem 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--gray-500);
  background: white;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gray-200);
}

.page-header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius);
  padding: 0.625rem 1.25rem;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: white;
  color: var(--gray-700);
  border-color: var(--gray-300);
  box-shadow: var(--shadow-sm);
}

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

.btn-danger {
  background: var(--danger);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-small {
  font-size: 0.8125rem;
  padding: 0.375rem 0.75rem;
}

/* Cards */
.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
}

.card h3 {
  margin: 1.5rem 0 1rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-800);
}

/* Forms */
.form-row {
  margin-bottom: 1.25rem;
}

.form-row label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--gray-700);
  font-size: 0.9375rem;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row input[type="number"],
.form-row input[type="date"],
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  transition: all 0.2s;
  background: white;
}

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

.form-row textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

.form-row input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  cursor: pointer;
  margin-right: 0.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

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

.table thead {
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
}

.table th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-900);
}

.table tbody tr {
  transition: background 0.15s;
}

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

.table tbody tr:last-child td {
  border-bottom: none;
}

.table-compact td,
.table-compact th {
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
}

.table-compact input,
.table-compact select {
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
}

.table-compact input:focus,
.table-compact select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Summary Box */
.summary-box {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  margin: 2rem 0;
}

.summary-box > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1rem;
}

.summary-box > div:last-child {
  border-bottom: none;
  font-size: 1.25rem;
  font-weight: 700;
  padding-top: 1rem;
}

.summary-box strong {
  font-weight: 600;
}

/* Error Messages */
.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

/* Filter Section */
.filter-section {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.filter-section .grid-2 {
  margin-bottom: 1rem;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-content h3 {
  margin: 0 0 1.5rem 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gray-900);
}

.close-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--gray-100);
  border: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--gray-600);
  transition: all 0.2s;
}

.close-button:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

/* Action Buttons */
.actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Badge/Status */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
}

.badge-draft {
  background: var(--gray-200);
  color: var(--gray-700);
}

.badge-sent {
  background: #dbeafe;
  color: #1e40af;
}

.badge-accepted {
  background: #d1fae5;
  color: #065f46;
}

.badge-rejected {
  background: #fee2e2;
  color: #991b1b;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--gray-500);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  margin: 0 0 0.5rem 0;
  color: var(--gray-700);
  font-size: 1.25rem;
}

.empty-state p {
  margin: 0 0 1.5rem 0;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

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

  .table {
    font-size: 0.875rem;
  }

  .header-inner {
    flex-direction: column;
    height: auto;
    padding: 1rem;
    gap: 1rem;
  }

  .main-nav {
    width: 100%;
    flex-wrap: wrap;
  }
}

/* Print Styles */
@media print {
  .site-header,
  .site-footer,
  .btn,
  .actions {
    display: none !important;
  }

  .container {
    max-width: 100%;
  }

  .card {
    box-shadow: none;
    border: 1px solid var(--gray-300);
  }
}
