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

:root {
  /* Color Palette - Premium Dark Mode with Neon Blue/Purple accents */
  --bg-dark: hsl(222, 47%, 7%);
  --bg-card: hsla(222, 47%, 11%, 0.7);
  --bg-sidebar: hsla(222, 47%, 9%, 0.85);
  
  --border-color: hsla(222, 47%, 25%, 0.5);
  --border-light: hsla(0, 0%, 100%, 0.08);
  
  --text-main: hsl(210, 40%, 98%);
  --text-muted: hsl(215, 20%, 65%);
  
  --accent-primary: hsl(250, 100%, 75%);
  --accent-secondary: hsl(190, 100%, 60%);
  --gradient-accent: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  --gradient-hover: linear-gradient(135deg, hsl(250, 100%, 80%), hsl(190, 100%, 65%));
  
  --danger: hsl(350, 80%, 60%);
  --success: hsl(150, 80%, 45%);
  --warning: hsl(40, 90%, 60%);

  /* Shadows & Glows */
  --glow-accent: 0 0 20px hsla(250, 100%, 75%, 0.3);
  --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 15% 50%, hsla(250, 100%, 75%, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 85% 30%, hsla(190, 100%, 60%, 0.05) 0%, transparent 50%);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 1rem;
}

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

a:hover {
  color: var(--accent-primary);
}

p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Layout */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}

.sidebar-header {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-header h2 {
  margin: 0;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.75rem;
  font-weight: 800;
}

.sidebar-nav {
  padding: 1.5rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  border-radius: 8px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  background: hsla(210, 40%, 98%, 0.05);
  color: var(--text-main);
}

.nav-link.active {
  background: hsla(250, 100%, 75%, 0.1);
  color: var(--accent-primary);
  border-left: 3px solid var(--accent-primary);
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: #fff;
}

.main-content {
  flex: 1;
  padding: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Glassmorphism Components */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
  margin-bottom: 2rem;
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px -10px rgba(0,0,0,0.6), var(--glow-accent);
  border-color: hsla(250, 100%, 75%, 0.3);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #fff !important;
  box-shadow: 0 4px 15px hsla(250, 100%, 75%, 0.3);
}

.btn-primary:hover {
  background: var(--gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px hsla(250, 100%, 75%, 0.4);
}

.btn-secondary {
  background: hsla(210, 40%, 98%, 0.1);
  color: var(--text-main) !important;
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: hsla(210, 40%, 98%, 0.15);
  border-color: hsla(210, 40%, 98%, 0.3);
}

/* Data Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
}

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

th, td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

th {
  background: hsla(222, 47%, 9%, 0.5);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

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

tr:hover td {
  background: hsla(210, 40%, 98%, 0.02);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-owner {
  background: hsla(250, 100%, 75%, 0.15);
  color: var(--accent-primary);
  border: 1px solid hsla(250, 100%, 75%, 0.3);
}

.badge-admin {
  background: hsla(190, 100%, 60%, 0.15);
  color: var(--accent-secondary);
  border: 1px solid hsla(190, 100%, 60%, 0.3);
}

/* Utilities */
.text-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.cosmetics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.cosmetics-grant-form {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) minmax(10rem, 1fr) minmax(10rem, 1fr) auto;
  gap: 1rem;
  align-items: end;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.profile-card {
  min-width: 0;
}

.profile-definition-list {
  display: grid;
  gap: 1rem;
}

.profile-definition-list div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.profile-definition-list div:last-child {
  border-bottom: 0;
}

.profile-definition-list dt {
  color: var(--text-muted);
  font-weight: 600;
}

.profile-definition-list dd {
  color: var(--text-main);
  text-align: right;
  overflow-wrap: anywhere;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

input:focus,
textarea:focus,
select:focus {
  border-color: hsla(250, 100%, 75%, 0.65) !important;
  box-shadow: 0 0 0 3px hsla(250, 100%, 75%, 0.18);
}

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

  .cosmetics-grid,
  .profile-grid,
  .cosmetics-grant-form {
    grid-template-columns: 1fr;
  }

  .cosmetics-grant-form .btn {
    width: 100%;
  }

  .flex-between {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }
