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

:root {
  --primary: #4F46E5;
  --primary-dark: #3730A3;
  --bg: #0F0F1A;
  --surface: #1A1A2E;
  --surface2: #16213E;
  --text: #E2E8F0;
  --text-muted: #94A3B8;
  --border: #2D3748;
  --danger: #EF4444;
  --radius: 12px;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at top, #1a1a3e 0%, var(--bg) 70%);
  padding: 1rem;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

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

.login-logo {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary), #7C3AED);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 800; color: white;
  margin: 0 auto 1rem;
}

.login-header h1 { font-size: 1.75rem; font-weight: 700; }
.login-header p  { color: var(--text-muted); margin-top: .25rem; }

.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: .9rem;
}
.alert-error { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.3); color: #FCA5A5; }

.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .875rem; font-weight: 500;
                    color: var(--text-muted); margin-bottom: .5rem; }
.form-group input {
  width: 100%; padding: .75rem 1rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: 1rem;
  transition: border-color .2s;
}
.form-group input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.2);
}

.btn-login {
  width: 100%; padding: .875rem;
  background: linear-gradient(135deg, var(--primary), #7C3AED);
  color: white; border: none; border-radius: var(--radius);
  font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: opacity .2s, transform .1s;
  margin-top: .5rem;
}
.btn-login:hover  { opacity: .9; }
.btn-login:active { transform: scale(.98); }

.dashboard-page { min-height: 100vh; display: flex; flex-direction: column; }

.dashboard-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}

.header-left { display: flex; align-items: center; gap: 1rem; }
.header-left .logo {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), #7C3AED);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .9rem;
}
.header-left h1 { font-size: 1.25rem; font-weight: 600; }

.header-right { display: flex; align-items: center; gap: 1rem; }
.username { color: var(--text-muted); font-size: .9rem; }

.btn-logout {
  padding: .4rem .9rem;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); border-radius: 8px;
  text-decoration: none; font-size: .875rem;
  transition: all .2s;
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

.dashboard-main { padding: 2rem; max-width: 1100px; width: 100%; margin: 0 auto; }
.dashboard-main h2 { font-size: 1.1rem; color: var(--text-muted);
                      margin-bottom: 1.5rem; font-weight: 500; }

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

.app-card {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none; color: inherit;
  transition: all .2s;
  position: relative; overflow: hidden;
}
.app-card::before {
  content: ''; position: absolute;
  left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--card-color, var(--primary));
  border-radius: 2px 0 0 2px;
}
.app-card:hover {
  border-color: var(--card-color, var(--primary));
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,.3);
}

.app-icon { font-size: 2rem; flex-shrink: 0; }
.app-info { flex: 1; }
.app-info h3 { font-size: 1rem; font-weight: 600; }
.app-info p  { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }
.app-arrow   { color: var(--text-muted); font-size: 1.2rem; flex-shrink: 0; }

.empty-state {
  text-align: center; padding: 4rem 2rem;
  color: var(--text-muted); line-height: 1.8;
}

@media (max-width: 600px) {
  .dashboard-header { padding: 1rem; }
  .dashboard-main   { padding: 1rem; }
  .apps-grid        { grid-template-columns: 1fr; }
}
