:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg-light: #fafafa;
  --bg-white: #ffffff;
  --bg-gray: #f5f5f5;
  --text-dark: #1f2937;
  --text-gray: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  --shadow-lg: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg-light);
  color: var(--text-dark);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0.6rem 0;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-dark);
}

h1 {
  font-size: 1.875rem;
  font-weight: 600;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

p {
  margin: 0.5rem 0;
}

fieldset {
  border: 1px solid var(--border);
  padding: 20px;
  margin: 16px 0;
  background: var(--bg-white);
  border-radius: 8px;
}

legend {
  font-weight: 600;
  padding: 0 8px;
  font-size: 0.95rem;
  color: var(--text-dark);
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 10px;
  margin-bottom: 6px;
  color: var(--text-dark);
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  background: var(--bg-white);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  margin-right: 6px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin: 12px 0;
}

.col {
  flex: 1 1 280px;
  min-width: 260px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

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

@media (max-width: 820px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

button:not([class*="btn"]) {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  background: var(--primary);
  color: var(--bg-white);
  font-family: inherit;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

button:not([class*="btn"]):hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-lg);
}

button:not([class*="btn"]):disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn {
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
}

.box {
  background: var(--bg-white);
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card {
  background: var(--bg-white);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
  border: 1px solid var(--border);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  background: var(--bg-white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

th,
td {
  border-bottom: 1px solid var(--border);
  text-align: right;
  padding: 12px 16px;
  font-size: 0.875rem;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  background: var(--bg-gray);
  color: var(--text-dark);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
}

tbody tr:hover {
  background: var(--bg-light);
}

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

td:first-child {
  font-weight: 500;
  color: var(--text-dark);
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--border-light);
  color: var(--text-dark);
}

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

.badge-success {
  background: var(--secondary);
  color: white;
}

.badge-danger {
  background: var(--danger);
  color: white;
}

.badge-warning {
  background: var(--warning);
  color: white;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-muted {
  color: var(--text-muted);
}

.text-gray {
  color: var(--text-gray);
}

.text-primary {
  color: var(--primary);
}

.text-success {
  color: var(--secondary);
}

.text-danger {
  color: var(--danger);
}

.text-warning {
  color: var(--warning);
}

.font-bold {
  font-weight: 600;
}

.font-semibold {
  font-weight: 500;
}

.font-light {
  font-weight: 300;
}

.small {
  font-size: 0.8125rem;
}

.muted {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.note {
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 12px;
  border-radius: 6px;
  font-size: 0.875rem;
}

.actions {
  margin: 18px 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  h3 {
    font-size: 1.125rem;
  }

  .actions {
    flex-direction: column;
  }

  button,
  .btn {
    width: 100%;
  }
}

.loading {
  opacity: 0.6;
  pointer-events: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spinner {
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}