/* ============================================
   TODOS.CSS - Reset y variables globales
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Arial, sans-serif;
}

/* Variables de color */
:root {
  --primary-green: #2d8b0c;
  --primary-green-dark: #1d6506;
  --primary-green-light: #3f9b20;
  --primary-green-login: #4e9d23;
  --bg-light: #f7f8f7;
  --border-color: #ddd;
  --text-dark: #2b2b2b;
  --text-muted: #777;
  --priority-high: #d62828;
  --priority-medium: #f0a000;
  --priority-low: #2d8b0c;
}

body {
  background: #e9ecef;
  color: var(--text-dark);
}

/* Botón primario compartido */
.btn-primary {
  background: linear-gradient(to bottom, #3f9b20, #1d6506);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 16px 25px;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
}

.btn-primary:hover {
  background: linear-gradient(to bottom, #2d8b0c, #155004);
}

/* Cards compartidas */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  border: 1px solid var(--border-color);
  box-shadow: 0 3px 10px rgba(0,0,0,.04);
}

/* Badges de prioridad */
.priority-high, .badge.high {
  color: var(--priority-high);
}

.priority-medium, .badge.medium {
  color: var(--priority-medium);
}

.priority-low, .badge.low {
  color: var(--priority-low);
}

/* Dots */
.dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 6px;
}

.dot.green { background: var(--primary-green); }
.dot.blue { background: #3498db; }
.dot.yellow { background: #f1b400; }
.dot.red { background: var(--priority-high); }

/* Circle icon */
.circle-icon {
  width: 42px;
  height: 42px;
  background: #edf5e8;
  color: var(--primary-green);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
}

/* Estructura APP (compartida por agenda, configura, menu) */
.app {
  max-width: 1400px;
  margin: auto;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0,0,0,.18);
}

/* Sidebar común */
.sidebar {
  background: linear-gradient(to bottom, #f8faf7 45%, #72ad35);
  padding: 25px 18px;
  border-right: 1px solid var(--border-color);
}

/* Menú común */
.menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #333;
  padding: 15px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 14px;
}

.menu a.active {
  background: #fff;
  color: var(--primary-green);
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  border-left: 5px solid var(--primary-green);
}

/* Topbar común */
.topbar {
  height: 95px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 35px;
  border-bottom: 1px solid var(--border-color);
}

.nav {
  display: flex;
  gap: 40px;
  align-items: center;
}

.nav a{
  text-decoration:none
}

.nav div {
  text-align: center;
  font-size: 13px;
  color: #555;
  padding: 18px 8px;
  border-bottom: 4px solid transparent;
}

.nav div.active {
  color: var(--primary-green);
  border-bottom: 4px solid var(--primary-green);
  font-weight: bold;
}

/* Usuario común */
.user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.user-icon {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  display: grid;
  place-items: center;
  color: var(--primary-green);
  font-size: 24px;
}

/* Tablas comunes */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead {
  background: #f8f8f8;
}

th, td {
  padding: 14px;
  text-align: left;
  border-bottom: 1px solid #e5e5e5;
}

/* Tags comunes */
.tag {
  background: #edf5e8;
  color: var(--primary-green);
  padding: 6px 10px;
  border-radius: 18px;
  margin-right: 5px;
  font-size: 12px;
}

/* Status comunes */
.status {
  padding: 6px 12px;
  border-radius: 18px;
  font-weight: bold;
  font-size: 12px;
}

.status.active {
  background: #edf5e8;
  color: var(--primary-green);
}

.status.inactive {
  background: #ffecec;
  color: var(--priority-high);
}

/* Avatar común */
.avatar {
  width: 34px;
  height: 34px;
  background: #edf5e8;
  color: var(--primary-green);
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-weight: bold;
  margin-right: 8px;
}

/* Switch común (toggle) */
.switch {
  position: relative;
  width: 52px;
  height: 28px;
}

.switch input {
  display: none;
}

.switch span {
  position: absolute;
  inset: 0;
  background: #d8d8d8;
  border-radius: 30px;
  cursor: pointer;
}

.switch span::before {
  content: "";
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: .3s;
}

.switch input:checked + span {
  background: var(--primary-green);
}

.switch input:checked + span::before {
  transform: translateX(24px);
}

/* ============================================
   CAJA CHICA (estilos específicos)
   ============================================ */

.main-content {
    padding: 20px;
}

.page-header {
    margin-bottom: 25px;
}

.page-header h1 {
    color: var(--text-dark);
    margin-bottom: 8px;
}

.page-header p {
    color: var(--primary-green);
}

.cards-grid {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.info-card {
    flex: 1;
    min-width: 280px;
}

.info-card-body {
    display: flex;
    align-items: center;
    gap: 15px;
}

.info-card-value {
    color: var(--primary-green);
    font-size: 26px;
    font-weight: 600;
}

.info-card-subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

.table-card {
    margin-top: 20px;
}

.table-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.table-header button {
    margin-left: auto;
}

.table-responsive {
    overflow-x: auto;
}

.badge-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    background: #f2f2f2;
    font-size: 14px;
}

.badge-success {
    color: var(--primary-green);
}

.badge-warning {
    color: var(--priority-medium);
}

.badge-danger {
    color: var(--priority-high);
}

.btn-success {
    background: #009929;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-danger {
    background: #b71c1c;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
}

/* Modales comunes */
#oscuro {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 100;
}

.emergentes {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 700px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 101;
}

.close-btn {
    float: right;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
}

.form-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
}

.form-card input,
.form-card select {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.close {
  border: none;
  background: #edf5e8;
  color: var(--primary-green);
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
}


/* Responsive común */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr !important;
  }
  
  .sidebar {
    display: none;
  }
  
  .topbar {
    height: auto;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
  }
  
  .nav {
    flex-wrap: wrap;
    justify-content: center;
  }
}