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

:root {
  --bg-start: #090d1a;
  --bg-end: #17223f;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-solid: #ffffff;
  --text-main: #dce5ff;
  --text-dark: #101828;
  --muted-dark: #475467;
  --primary: #5f8cff;
  --primary-hover: #4b77e5;
  --secondary: #55617d;
  --success: #16a34a;
  --danger: #ef4444;
  --border-soft: rgba(255, 255, 255, 0.14);
  --shadow-main: 0 14px 42px rgba(9, 13, 26, 0.24);
  --radius-lg: 20px;
  --radius-md: 12px;
  --transition: 0.22s ease;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text-main);
  min-height: 100vh;
  background: radial-gradient(circle at 20% -10%, #2b4279 0%, transparent 45%),
    radial-gradient(circle at 90% 0%, #5f8cff50 0%, transparent 42%),
    linear-gradient(140deg, var(--bg-start) 0%, var(--bg-end) 100%);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 26px 18px 42px;
}

.page-title,
h1,
h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
  letter-spacing: -0.02em;
}

.page-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin-bottom: 10px;
}

p {
  line-height: 1.65;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(10, 16, 34, 0.7);
  border-bottom: 1px solid var(--border-soft);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.badge {
  margin-left: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(95, 140, 255, 0.2);
  color: #bed0ff;
  border: 1px solid rgba(190, 208, 255, 0.5);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-main);
  padding: clamp(16px, 3vw, 22px);
  margin-top: 16px;
}

.center-kpi {
  text-align: center;
  margin-top: 10px;
}

.center-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.center-kpi-item {
  padding: 8px 10px;
  border: 1px solid rgba(190, 208, 255, 0.24);
  border-radius: 12px;
  background: rgba(16, 26, 52, 0.45);
}

.center-kpi-label {
  margin: 0;
  color: #c8d6ff;
}

.center-kpi-value {
  display: block;
  margin-top: 6px;
  font-family: "Sora", sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  color: #eef3ff;
}

.auth-page {
  display: grid;
  place-items: center;
}

.auth-container {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.hero {
  width: min(100%, 640px);
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(190, 208, 255, 0.4);
  background: linear-gradient(160deg, rgba(18, 28, 56, 0.92) 0%, rgba(19, 31, 62, 0.6) 100%);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.42);
  padding: clamp(20px, 4vw, 34px);
  animation: slide-up 0.5s ease both;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 8px;
}

.hero p {
  max-width: 52ch;
  margin-bottom: 22px;
  color: #d2dcff;
}

.hero-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  top: -120px;
  right: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(95, 140, 255, 0.9) 0%, transparent 62%);
  filter: blur(14px);
  animation: pulse 5.6s ease-in-out infinite;
}

.pending-hero {
  max-width: 560px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, var(--primary) 0%, #3f6ee0 100%);
  color: #f8fbff;
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  box-shadow: 0 10px 26px rgba(63, 110, 224, 0.4);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(63, 110, 224, 0.48);
}

.button.secondary {
  background: linear-gradient(180deg, #7384a8 0%, var(--secondary) 100%);
  box-shadow: none;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.project-form-container {
  animation: slide-up 0.25s ease both;
}

.project-form-container.hidden {
  display: none;
}

.tabs {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.tab-button {
  border: 1px solid rgba(190, 208, 255, 0.45);
  background: rgba(16, 26, 52, 0.6);
  color: #dce5ff;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  transition: all var(--transition);
}

.tab-button:hover {
  border-color: #8daeff;
  transform: translateY(-1px);
}

.tab-button.active {
  color: #0b1431;
  border-color: transparent;
  background: linear-gradient(180deg, #c8d8ff 0%, #94b3ff 100%);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.project-tile-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.project-tile-link:focus-visible {
  outline: none;
}

.project-tile-link:focus-visible .project-tile {
  border-color: #c8d8ff;
  box-shadow: 0 0 0 3px rgba(200, 216, 255, 0.35);
}

.project-tile {
  border: 1px solid rgba(190, 208, 255, 0.3);
  border-radius: var(--radius-md);
  background: rgba(16, 26, 52, 0.6);
  padding: 12px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.project-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(190, 208, 255, 0.62);
  box-shadow: 0 10px 24px rgba(10, 20, 40, 0.35);
}

.project-tile-head {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.project-tile-head h3 {
  margin: 0;
  font-size: 1rem;
  color: #eef3ff;
}

.project-date {
  font-size: 0.8rem;
  color: #afc0ec;
}

.project-meta {
  margin: 6px 0 0;
  display: grid;
  gap: 2px;
}

.meta-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #aac0f5;
}

.project-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 16px;
}

.project-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.project-divider {
  border: 0;
  border-top: 1px solid rgba(190, 208, 255, 0.24);
  margin: 16px 0;
}

.icon-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.complete-form {
  margin-bottom: 14px;
}

.complete-button {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 12px 28px rgba(220, 38, 38, 0.4);
}

.status-done-label {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
  font-weight: 700;
  text-align: center;
}

.floating-complete-form {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
}

.floating-complete-form .complete-button {
  min-width: 180px;
}

.icon-tab {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(190, 208, 255, 0.45);
  background: rgba(16, 26, 52, 0.7);
  color: #dce5ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.icon-tab svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-tab:hover {
  transform: translateY(-1px);
  border-color: #8daeff;
}

.icon-tab.active {
  color: #0b1431;
  border-color: transparent;
  background: linear-gradient(180deg, #c8d8ff 0%, #94b3ff 100%);
}

.form-inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 14px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  background: rgba(16, 26, 52, 0.5);
  border: 1px solid rgba(190, 208, 255, 0.25);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.history-item strong {
  color: #eef3ff;
}

.history-item span,
.history-item small {
  color: #bfd0f7;
}

.comment-item {
  white-space: pre-wrap;
}

label {
  color: #dbe5ff;
  font-size: 0.95rem;
}

input,
select,
textarea {
  margin-top: 7px;
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(165, 180, 252, 0.4);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-dark);
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(95, 140, 255, 0.2);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  color: #e4ebff;
}

th,
td {
  border-bottom: 1px solid rgba(201, 213, 255, 0.24);
  text-align: left;
  padding: 10px 8px;
  vertical-align: top;
}

thead th {
  font-family: "Sora", sans-serif;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #c8d6ff;
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.actions {
  display: grid;
  gap: 8px;
  min-width: 180px;
}

.actions form {
  display: grid;
  gap: 7px;
}

.error {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #ffd6d6;
  padding: 11px;
  border-radius: 10px;
}

.animate-rise {
  animation: slide-up 0.45s ease both;
}

.delay-1 {
  animation-delay: 0.1s;
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@media (max-width: 900px) {
  .container {
    padding: 18px 12px 28px;
  }

  .topbar {
    padding: 12px;
  }

  .card {
    border-radius: 16px;
  }

  .project-layout {
    grid-template-columns: 1fr;
  }

  .center-kpi-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-user {
    justify-content: space-between;
  }

  .topbar-actions {
    display: grid;
    gap: 8px;
  }

  .button {
    width: 100%;
  }

  .hero {
    padding: 18px 14px;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .form-grid {
    gap: 10px;
  }

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

  .form-inline {
    grid-template-columns: 1fr;
  }

  .floating-complete-form {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .floating-complete-form .complete-button {
    width: 100%;
  }
}
