/* Whatbot Admin Styles */

:root {
  --primary: #075e54;
  --primary-dark: #054a40;
  --success: #25d366;
  --danger: #e74c3c;
  --info: #3498db;
  --muted: #95a5a6;
  --light: #f5f5f5;
  --border: #ddd;
  --text: #333;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--light);
  color: var(--text);
  line-height: 1.5;
}

/* Navbar */
.navbar {
  background: var(--primary);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: bold;
}

.navbar-menu {
  display: flex;
  gap: 0.5rem;
  flex: 1;
}

.nav-link {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255,255,255,0.2);
  color: white;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

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

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

h1 {
  color: var(--primary);
  margin-bottom: 1.5rem;
}

h2 {
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

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

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

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

.stat-number {
  font-size: 3rem;
  font-weight: bold;
  color: var(--success);
}

.stat-label {
  color: var(--muted);
  margin-top: 0.5rem;
}

.stat-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--primary);
  text-decoration: none;
}

.stat-link:hover {
  text-decoration: underline;
}

/* Stats Row (import results) */
.stats-row {
  display: flex;
  gap: 2rem;
  margin: 1.5rem 0;
}

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

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary);
}

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

.form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
}

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

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--light);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn:hover {
  background: #eee;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
}

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

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

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

.btn-block {
  display: block;
  width: 100%;
}

/* 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 var(--border);
}

.table th {
  background: var(--light);
  font-weight: 600;
}

.table tbody tr:hover {
  background: #fafafa;
}

.row-disabled {
  opacity: 0.5;
}

.text-truncate {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actions {
  white-space: nowrap;
}

.actions form {
  margin-right: 0.25rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 4px;
}

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

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

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

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

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

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

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

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Text utilities */
.text-danger {
  color: var(--danger);
}

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

/* Help text */
.help-text {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.help-text code {
  background: #eee;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

/* Info box */
.info-box {
  background: var(--light);
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

/* Error list */
.error-list {
  list-style: none;
  padding: 0;
}

.error-list li {
  padding: 0.5rem;
  background: #fff5f5;
  border-left: 3px solid var(--danger);
  margin-bottom: 0.5rem;
}

/* Quick actions */
.quick-actions {
  margin-top: 2rem;
}

.action-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Login page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-container {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.login-container h1 {
  text-align: center;
  margin-bottom: 2rem;
}

/* Error page */
.error-page {
  text-align: center;
  padding: 4rem 2rem;
}

.error-page h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.error-page p {
  margin-bottom: 2rem;
  color: var(--muted);
}

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

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

  .container {
    padding: 1rem;
  }

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

  .form-row {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}
