:root {
  --bg: #09090b;
  --bg-soft: rgba(255, 255, 255, 0.05);
  --bg-soft-2: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.1);
  --text: #ffffff;
  --text-soft: #a1a1aa;
  --text-muted: #71717a;
  --primary: #7c3aed;
  --primary-hover: #8b5cf6;
  --success: #34d399;
  --danger: #f87171;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(245, 158, 11, 0.2);
  --radius: 22px;
  --shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  position: relative;
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:focus,
textarea:focus {
  border-color: rgba(139, 92, 246, 0.6);
  background: rgba(255, 255, 255, 0.07);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.hidden {
  display: none !important;
}

.background-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.12), transparent 24%);
  z-index: 0;
}

.login-page,
.app-layout {
  position: relative;
  z-index: 1;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px;
}

.hero-section h1 {
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero-section p {
  max-width: 720px;
  color: var(--text-soft);
  font-size: 1.05rem;
  line-height: 1.8;
  margin: 20px 0 0;
}

.hero-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(139, 92, 246, 0.18);
  background: rgba(124, 58, 237, 0.12);
  color: #ddd6fe;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 34px;
}

.info-card,
.login-card,
.panel,
.stat-card,
.profile-box,
.security-box,
.mini-card,
.file-card,
.plan-card {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: var(--radius);
}

.info-card,
.panel,
.stat-card,
.plan-card,
.file-card {
  padding: 22px;
}

.info-card h3,
.panel h3,
.login-card h2,
.plan-card h4,
.file-card h4 {
  margin: 0;
}

.info-card p,
.panel p,
.profile-box span,
.security-box p,
.stat-card small,
.login-header p {
  color: var(--text-soft);
}

.login-card-wrapper {
  display: flex;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 470px;
  padding: 28px;
  box-shadow: var(--shadow);
  background: rgba(12, 12, 16, 0.85);
}

.login-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.icon-box {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  border-radius: 18px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  background: rgba(124, 58, 237, 0.12);
}

#loginForm {
  display: grid;
  gap: 12px;
}

#loginForm label {
  margin-top: 2px;
  font-size: 0.95rem;
  color: #d4d4d8;
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 60px;
}

.password-wrapper button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--text-soft);
  padding: 8px;
  border-radius: 10px;
}

.password-wrapper button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.primary-btn,
.outline-btn,
.nav-btn,
.danger-btn {
  border-radius: 18px;
  border: 1px solid transparent;
  transition: 0.2s ease;
}

.primary-btn {
  background: var(--primary);
  color: white;
  padding: 14px 18px;
  font-weight: 700;
  margin-top: 6px;
}

.primary-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.outline-btn {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: white;
  padding: 12px 16px;
}

.outline-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.danger-btn {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.25);
  color: #fecaca;
  padding: 10px 14px;
}

.error-box {
  margin-top: 10px;
  border-radius: 18px;
  padding: 14px 16px;
  font-size: 0.95rem;
  border: 1px solid rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
}

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px 1fr;
}

.sidebar {
  padding: 24px;
  border-right: 1px solid var(--border);
  background: rgba(12, 12, 16, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.sidebar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-box h2,
.profile-box strong {
  margin: 0;
}

.brand-box p,
.profile-box small {
  margin: 4px 0 0;
  color: var(--text-soft);
}

.profile-box,
.security-box {
  padding: 18px;
  margin-top: 22px;
}

.sidebar-nav {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.nav-btn {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  color: #d4d4d8;
  background: transparent;
  border-color: transparent;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.nav-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 14px 28px rgba(124, 58, 237, 0.24);
}

.content-area {
  padding: 28px;
}

.content-view {
  display: none;
}

.content-view.active-view {
  display: block;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 24px;
}

.section-header.single {
  justify-content: flex-start;
}

.section-header h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.8rem);
  letter-spacing: -0.03em;
}

.section-header p {
  margin: 8px 0 0;
  color: var(--text-soft);
}

.stats-grid,
.files-grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 24px;
}

.stat-card span {
  display: block;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.stat-card strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 2rem;
}

.dashboard-grid,
.planning-grid {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 18px;
}

.large-panel {
  min-width: 0;
}

.stack-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.plan-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.plan-meta,
.file-meta {
  color: var(--text-soft);
  font-size: 0.92rem;
  margin-top: 6px;
}

.plan-notes,
.file-meta-line {
  color: #d4d4d8;
  line-height: 1.65;
  margin-top: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.83rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: #f4f4f5;
}

.mini-card {
  padding: 16px;
}

.success-text {
  color: var(--success);
}

.search-input {
  max-width: 320px;
}

.files-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.file-open-btn {
  margin-top: 16px;
  width: 100%;
}

.admin-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

.form-actions,
.item-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-card {
  display: grid;
  gap: 12px;
}

@media (max-width: 1100px) {
  .login-page,
  .app-layout,
  .dashboard-grid,
  .planning-grid,
  .files-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .app-layout {
    min-height: auto;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-top {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .login-page {
    padding: 20px 16px 28px;
    gap: 22px;
  }

  .hero-cards {
    grid-template-columns: 1fr;
  }

  .content-area,
  .sidebar,
  .login-card {
    padding: 18px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-input {
    max-width: 100%;
  }

  .plan-card-top,
  .form-actions,
  .item-actions {
    flex-direction: column;
    align-items: stretch;
  }
}