/* Reset y base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navbar */
.navbar {
  background-color: #2c3e50;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand a {
  color: #fff;
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: bold;
  padding: 1rem 0;
  display: block;
}

.navbar-menu {
  list-style: none;
  display: flex;
  gap: 0.5rem;
}

.navbar-menu li a {
  color: #ecf0f1;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.navbar-menu li a:hover {
  background-color: #34495e;
}

.navbar-menu li a.logout {
  color: #e74c3c;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  flex: 1;
}

/* Login */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
}

.login-box {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 400px;
}

.login-box h1 {
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

.login-box .subtitle {
  color: #7f8c8d;
  margin-bottom: 1.5rem;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #555;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #3498db;
}

.form-inline {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-inline .form-group {
  flex: 1;
  min-width: 200px;
}

.form-vertical {
  max-width: 400px;
}

.inline-form {
  display: inline-block;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

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

.btn-primary {
  background-color: #3498db;
  color: #fff;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-secondary {
  background-color: #95a5a6;
  color: #fff;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.btn-danger {
  background-color: #e74c3c;
  color: #fff;
}

.btn-danger:hover {
  background-color: #c0392b;
}

.btn-block {
  width: 100%;
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.875rem;
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.alert-error {
  background-color: #fdeaea;
  color: #c0392b;
  border: 1px solid #f5c6cb;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.stat-card {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stat-card h3 {
  font-size: 0.875rem;
  color: #7f8c8d;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: #2c3e50;
}

.stat-card a {
  color: #3498db;
  text-decoration: none;
  font-size: 0.875rem;
}

/* Section */
.section {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.section h2 {
  color: #2c3e50;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}

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

.table th,
.table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.table th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #555;
}

.table tr:hover {
  background-color: #f8f9fa;
}

.table tr.inactive {
  opacity: 0.6;
}

.table .actions {
  white-space: nowrap;
}

.table .actions form {
  margin-right: 0.5rem;
}

/* Token display */
.token-display {
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.75rem;
  background: #f8f9fa;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  word-break: break-all;
}

/* Badge */
.badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-success {
  background-color: #d4edda;
  color: #155724;
}

.badge-danger {
  background-color: #f8d7da;
  color: #721c24;
}

/* Empty state */
.empty-state {
  text-align: center;
  color: #7f8c8d;
  padding: 2rem;
}

/* Info list */
.info-list {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 0.5rem 1rem;
}

.info-list dt {
  font-weight: 500;
  color: #7f8c8d;
}

.info-list dd {
  color: #2c3e50;
}

/* Code blocks */
pre {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1rem 0;
}

pre code {
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.875rem;
}

/* Footer */
.footer {
  text-align: center;
  padding: 1rem;
  color: #7f8c8d;
  font-size: 0.875rem;
  border-top: 1px solid #eee;
  background: #fff;
}

/* Headings */
h1 {
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

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

  .navbar-menu {
    flex-wrap: wrap;
    justify-content: center;
  }

  .container {
    padding: 1rem;
  }

  .form-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .info-list {
    grid-template-columns: 1fr;
  }
}
