/* Bizzby Admin Dashboard Styles */

:root {
  --cream: #FDF8F3;
  --purple: #2C2438;
  --terracotta: #D4654A;
  --purple-light: #3D3449;
  --purple-lighter: #4E455A;
  --gray: #666;
  --gray-light: #E5E5E5;
  --white: #FFFFFF;
  --error: #DC2626;
  --success: #16A34A;
  --warning: #F59E0B;
  --info: #3B82F6;
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--cream);
  color: var(--purple);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'DM Serif Display', serif;
  font-weight: normal;
  line-height: 1.2;
}

/* Navigation */
.nav {
  background: var(--purple);
  color: var(--white);
  padding: 1rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-logo img {
  height: 32px;
}

.admin-badge {
  background: var(--terracotta);
  color: var(--white);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-menu {
  display: flex;
  gap: 2rem;
}

.nav-menu a {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
  opacity: 1;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

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

.kpi-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.kpi-label {
  font-size: 0.875rem;
  color: var(--gray);
  margin-bottom: 0.5rem;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--purple);
}

.kpi-change {
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.kpi-change.positive {
  color: var(--success);
}

.kpi-change.negative {
  color: var(--error);
}

/* Alert Banner */
.alert-banner {
  background: var(--warning);
  color: var(--white);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alert-banner.critical {
  background: var(--error);
}

/* Tables */
.table-container {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
}

.table-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-header h2 {
  font-size: 1.5rem;
}

.search-filter {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.search-filter input,
.search-filter select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-light);
  border-radius: 6px;
  font-family: inherit;
}

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

thead {
  background: var(--cream);
}

th {
  text-align: left;
  padding: 1rem 1.5rem;
  font-weight: 600;
  color: var(--gray);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-light);
}

tbody tr {
  cursor: pointer;
  transition: background 0.2s;
}

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

/* Status badges */
.status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status.active {
  background: #D1FAE5;
  color: #065F46;
}

.status.trial {
  background: #DBEAFE;
  color: #1E40AF;
}

.status.inactive {
  background: #FEE2E2;
  color: #991B1B;
}

.status.critical {
  background: var(--error);
  color: var(--white);
}

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

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

/* Buttons */
.btn-primary {
  background: var(--terracotta);
  color: var(--white);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary:hover {
  background: #C35541;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--purple);
  color: var(--white);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-secondary:hover {
  background: var(--purple-light);
}

.btn-text {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.2s;
  font-family: inherit;
}

.btn-text:hover {
  opacity: 1;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Loading state */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--gray);
}

.loading::after {
  content: '...';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

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

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
}

.login-box {
  background: var(--white);
  padding: 3rem 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  text-align: center;
}

.login-logo {
  height: 48px;
  margin-bottom: 1.5rem;
}

.login-box h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: var(--gray);
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-light);
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
}

.login-box .btn-primary {
  width: 100%;
}

.message {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
}

.message.success {
  background: #D1FAE5;
  color: #065F46;
}

.message.error {
  background: #FEE2E2;
  color: #991B1B;
}

/* Detail page */
.detail-header {
  background: var(--white);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 2rem;
}

.detail-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.detail-meta {
  color: var(--gray);
  font-size: 0.875rem;
}

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

.detail-section {
  background: var(--white);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.detail-section h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--gray-light);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-light);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 600;
  color: var(--gray);
}

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

/* Messages list */
.messages-list {
  max-height: 400px;
  overflow-y: auto;
}

.message-item {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-light);
}

.message-item:last-child {
  border-bottom: none;
}

.message-role {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--terracotta);
}

.message-content {
  color: var(--purple);
  font-size: 0.875rem;
}

.message-time {
  font-size: 0.75rem;
  color: var(--gray);
  margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-container {
    flex-wrap: wrap;
  }
  
  .nav-menu {
    width: 100%;
    margin-top: 1rem;
    justify-content: center;
  }
  
  .kpi-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  
  .table-container {
    overflow-x: auto;
  }
}
