﻿:root {
  --green-900: #1f4d3a;
  --green-700: #2f6e55;
  --green-500: #4aa47a;
  --green-200: #cfeedd;
  --green-100: #e7f6ef;
  --pink-200: #f3c8da;
  --pink-100: #f9e6ef;
  --ink: #1f2a24;
  --muted: #5c6b62;
  --bg: #f7fbf8;
  --card: #ffffff;
  --shadow: 0 10px 30px rgba(31, 77, 58, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #f4fff9 0%, #f7fbf8 45%, #fff6fa 100%);
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: "Playfair Display", "Georgia", serif;
  margin: 0 0 0.6rem 0;
  color: var(--green-900);
}

a {
  color: inherit;
  text-decoration: none;
}

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #e7f6ef 0%, #ffffff 60%);
  border-right: 1px solid #d8eee3;
  padding: 2rem 1.5rem;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.sidebar .brand img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: var(--shadow);
}

.sidebar .brand span {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--green-900);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.nav a {
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav a.active,
.nav a:hover {
  background: var(--green-100);
  color: var(--green-900);
}

.nav a .tag {
  background: var(--pink-100);
  color: #a02b61;
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}

.main {
  flex: 1;
  padding: 2.5rem 3rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.topbar .welcome {
  max-width: 520px;
}

.topbar .meta {
  text-align: right;
  color: var(--muted);
  font-size: 0.95rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--card);
  padding: 1.4rem;
  border-radius: 18px;
  box-shadow: var(--shadow);
  border: 1px solid #edf5f0;
}

.card h3 {
  margin-bottom: 0.4rem;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.section {
  background: var(--card);
  border-radius: 18px;
  padding: 1.8rem;
  box-shadow: var(--shadow);
  border: 1px solid #edf5f0;
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.badge {
  background: var(--pink-100);
  color: #8c2855;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

form .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid #cfe6da;
  background: #fdfefc;
  font-size: 0.95rem;
  font-family: inherit;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(74, 164, 122, 0.15);
}

.button {
  background: linear-gradient(120deg, var(--green-700), var(--green-500));
  color: #fff;
  border: none;
  padding: 0.75rem 1.4rem;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button.secondary {
  background: #fff;
  color: var(--green-900);
  border: 1px solid var(--green-200);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(31, 77, 58, 0.2);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table th,
.table td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid #eef3ef;
}

.table th {
  color: var(--green-900);
  font-weight: 700;
}

.alert {
  padding: 0.75rem 1rem;
  background: #fff4f8;
  color: #8c2855;
  border: 1px solid #f3c8da;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.success {
  padding: 0.75rem 1rem;
  background: #e7f6ef;
  color: var(--green-900);
  border: 1px solid #bfe6d1;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.login {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 100vh;
}

.login .hero {
  background: linear-gradient(135deg, rgba(47, 110, 85, 0.88), rgba(74, 164, 122, 0.7)), url("../../../TA1.png") center/cover no-repeat;
  color: #fff;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login .hero h1 {
  color: #fff;
}

.login .panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: #ffffff;
}

.login .panel form {
  width: 100%;
  max-width: 380px;
}

.login .panel .logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.login .panel .logo img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.footer-note {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 1.5rem;
}

/* Responsivo base */
img {
  max-width: 100%;
  height: auto;
}

/* Tablas responsivas */
.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
}

/* Formularios responsivos */
form .grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

@media (max-width: 980px) {
  .app {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }

  .main {
    padding: 2rem;
  }

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

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .sidebar {
    padding: 1.25rem;
  }

  .main {
    padding: 1.5rem 1.25rem;
  }

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

  .section {
    padding: 1.25rem;
  }

  .table th,
  .table td {
    padding: 0.6rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 520px) {
  .sidebar .brand {
    justify-content: center;
  }

  .nav a {
    justify-content: center;
    font-size: 0.95rem;
  }

  .button {
    width: 100%;
  }

  .login .hero {
    padding: 2rem 1.25rem;
  }

  .login .panel {
    padding: 2rem 1.25rem;
  }
}
