@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap');

:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --accent: #0ea5e9;
  --accent-glow: rgba(14, 165, 233, 0.12);
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.12);
  --accent-success: #10b981;
  --accent-danger: #ef4444;
  --accent-warning: #f59e0b;
  --border: rgba(15, 23, 42, 0.08);
  --shadow: rgba(15, 23, 42, 0.06);
  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  filter: brightness(1.2);
}

/* Glassmorphism layouts (light mode optimized) */
.glass {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px 0 var(--shadow);
  border-radius: var(--border-radius);
}

/* Auth Pages */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 2rem;
  background: radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 40%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 3rem 2.5rem;
  transition: var(--transition);
}

.auth-card:hover {
  box-shadow: 0 0 40px 0 rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.3);
}

.auth-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  color: #fff;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
}

.auth-header h1 {
  font-size: 2rem;
  background: linear-gradient(to right, #0f172a, #475569);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.85rem 1.2rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: #ffffff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.8rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  color: #fff;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.35);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-primary);
  border-color: var(--accent);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: 8px;
}

/* Alert Notification */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
}

/* Dashboard Layout */
.layout-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-header .logo {
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(to right, var(--accent), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-menu {
  list-style: none;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.2rem;
  color: var(--text-secondary);
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
}

.sidebar-link:hover, .sidebar-link.active {
  color: var(--accent);
  background: rgba(14, 165, 233, 0.08);
}

.sidebar-link.active {
  border-left: 3px solid var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.admin-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Main Workspace */
.main-content {
  flex: 1;
  padding: 2.5rem;
  overflow-y: auto;
  background: radial-gradient(circle at 90% 10%, rgba(139, 92, 246, 0.03) 0%, transparent 40%);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}

.page-title h2 {
  font-size: 1.8rem;
  background: linear-gradient(to right, #0f172a, #475569);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-title p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

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

.stat-card {
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(6, 182, 212, 0.2);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.stat-icon.cyan {
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent);
}

.stat-icon.purple {
  background: rgba(168, 85, 247, 0.1);
  color: var(--accent-purple);
}

.stat-icon.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-success);
}

.stat-icon.danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-danger);
}

.stat-info h3 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.stat-info p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Content Layout Columns */
.columns-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

@media(max-width: 1024px) {
  .columns-grid {
    grid-template-columns: 1fr;
  }
}

/* Data Tables */
.card {
  padding: 2rem;
  margin-bottom: 2rem;
}

.card-title {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 1.2rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Status Badges */
.badge {
  display: inline-flex;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
}

.badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.badge-suspended {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.badge-trial {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.badge-expired {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.badge-pending {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
}

/* Key Display code style */
.key-code {
  font-family: 'Fira Code', monospace;
  font-weight: 500;
  background: rgba(15, 23, 42, 0.04);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

/* Generate Key Display Box */
.generated-box {
  background: rgba(14, 165, 233, 0.08);
  border: 1px dashed var(--accent);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
  font-size: 1.25rem;
  font-family: 'Fira Code', monospace;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

/* Modal Popup simulation (Plain forms) */
.form-card {
  padding: 2rem;
  max-width: 600px;
  margin: 0 auto;
}
