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

:root {
  --bg: #f0f4f9;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --surface-3: #eef2f6;
  --text: #0f1d2e;
  --text-2: #3d5468;
  --muted: #7a92a6;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-light: rgba(37, 99, 235, 0.08);
  --danger: #dc2626;
  --border: #dde4ed;
  --border-2: #c5d1de;
  --shadow-xs: 0 1px 2px rgba(0, 20, 50, 0.05);
  --shadow-sm: 0 2px 8px rgba(0, 20, 50, 0.07), 0 1px 3px rgba(0, 20, 50, 0.04);
  --shadow: 0 4px 20px rgba(0, 20, 50, 0.09), 0 1px 4px rgba(0, 20, 50, 0.04);
  --shadow-lg: 0 24px 56px rgba(0, 20, 50, 0.18), 0 8px 20px rgba(0, 20, 50, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background:
    radial-gradient(ellipse 70% 50% at 0% 0%, rgba(37, 99, 235, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse 50% 55% at 100% 100%, rgba(99, 102, 241, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(37, 99, 235, 0.03) 0%, transparent 70%),
    var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* -- HEADER -- */

.dash-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 2rem;
  height: 58px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid rgba(221, 228, 237, 0.7);
  box-shadow: 0 1px 3px rgba(0, 20, 50, 0.04), 0 4px 12px rgba(0, 20, 50, 0.02);
  flex-shrink: 0;
}

.dash-brand {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  user-select: none;
}

.dash-brand-icon {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
  border-radius: 7px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.dash-header-spacer {
  flex: 1;
}

.dash-admin-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all var(--transition);
  margin-right: 0.5rem;
}

.dash-admin-link[hidden] {
  display: none;
}

.dash-admin-link:hover {
  background: var(--surface-3);
  color: var(--accent);
}

.dash-admin-link svg {
  flex-shrink: 0;
}

.dash-no-apps {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
  width: 100%;
}

.dash-user-wrap {
  position: relative;
}

.dash-avatar-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  transition: all var(--transition);
  font-family: inherit;
}

.dash-avatar-btn:hover {
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transform: scale(1.05);
}

.dash-user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  border: 1px solid rgba(221, 228, 237, 0.6);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 20, 50, 0.12), 0 2px 8px rgba(0, 20, 50, 0.04);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0.4rem;
  z-index: 150;
  animation: menu-appear 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes menu-appear {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dash-user-info {
  padding: 0.5rem 0.6rem 0.4rem;
  font-size: 0.78rem;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.dash-menu-section {
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}

.locale-switch {
  display: flex;
  background: var(--surface-3);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.locale-switch-btn {
  flex: 1;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  transition: all var(--transition);
}

.locale-switch-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-xs);
}

.locale-switch-btn:hover:not(.active) {
  color: var(--text-2);
}

.dash-menu-item {
  width: 100%;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  text-align: left;
  padding: 0.5rem 0.6rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.dash-menu-item:hover {
  background: var(--surface-3);
  color: var(--text);
}

/* -- MAIN -- */

.dash-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 2rem 2rem;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
}

.dash-hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.dash-hero h1 {
  margin: 0 0 0.3rem;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.dash-subtitle {
  margin: 0;
  font-size: 1rem;
  color: var(--text-2);
}

/* -- APP GRID -- */

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  width: 100%;
}

.app-tile {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1.5rem 1.4rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(221, 228, 237, 0.7);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
  cursor: pointer;
}

.app-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 20, 50, 0.12), 0 2px 8px rgba(0, 20, 50, 0.04);
  border-color: var(--border-2);
}

.app-tile:active {
  transform: translateY(-1px);
}

.app-tile-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.app-tile-icon svg {
  width: 26px;
  height: 26px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-tile-content {
  min-width: 0;
}

.app-tile-name {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.app-tile-desc {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.4;
}

/* -- SCROLLBAR -- */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(122, 146, 166, 0.3);
  border-radius: 10px;
}

::selection {
  background: rgba(37, 99, 235, 0.15);
  color: var(--text);
}

/* -- RESPONSIVE -- */

@media (max-width: 600px) {
  .dash-main {
    padding: 2rem 1rem 1.5rem;
  }

  .dash-hero h1 {
    font-size: 1.4rem;
  }

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

  .dash-header {
    padding: 0 1rem;
  }
}
