.tareas-container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 32px 40px 50px;
  background: #f5f7fa;
  color: #263746;
  font-family: inherit;
  box-sizing: border-box;
}

.tareas-container * {
  box-sizing: border-box;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
}

.page-header-info {
  flex: 1;
  min-width: 0;
}

.page-title {
  margin: 0;
  color: #173f67;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
}

.page-subtitle {
  margin: 8px 0 0;
  color: #687b8c;
  font-size: 14px;
  line-height: 1.5;
}

.custom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 20px;
  background: #17466f;
  border: 1px solid #17466f;
  border-radius: 7px;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(23, 70, 111, .15);
  transition: all .2s ease;
}

.custom-btn:hover {
  background: #0f385c;
  border-color: #0f385c;
  color: #fff !important;
  transform: translateY(-1px);
}

.filters-card {
  margin-bottom: 28px;
  background: #fff;
  border: 1px solid #dce4eb;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(23, 61, 98, .05);
  overflow: hidden;
}

.filters-header {
  padding: 18px 22px;
  background: #fff;
  border-bottom: 1px solid #e6ecf1;
}

.filters-title-text {
  color: #173f67;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.filters-subtitle {
  margin-top: 4px;
  color: #7a8997;
  font-size: 12px;
  line-height: 1.4;
}

.filters-body {
  padding: 22px;
}

.filters-body form>div:first-child {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.filters-body form>div:first-child>div:nth-child(4) {
  grid-column: 1/-1;
}

.filters-body form>div:first-child>div:nth-child(4) .filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}

.form-label {
  display: block;
  margin-bottom: 7px;
  color: #34495e;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.form-select {
  display: block;
  width: 100%;
  height: 43px;
  padding: 8px 36px 8px 12px;
  background: #fff;
  border: 1px solid #cbd7e1;
  border-radius: 7px;
  color: #34495e;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  outline: none;
  appearance: auto;
}

.form-select:hover {
  border-color: #aebfce;
}

.form-select:focus {
  border-color: #17466f;
  box-shadow: 0 0 0 3px rgba(23, 70, 111, .1);
}

.clear-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 17px;
  background: #fff;
  border: 1px solid #cbd7e1;
  border-radius: 7px;
  color: #5c7082;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all .2s ease;
}

.clear-filter-btn:hover {
  background: #f3f6f8;
  border-color: #aebdca;
  color: #173f67;
}

.frentes-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.frente-item {
  margin: 0;
  padding: 0;
  background: #fff;
  border: 1px solid #d9e2e9;
  border-radius: 9px;
  box-shadow: 0 2px 7px rgba(23, 61, 98, .05);
  overflow: hidden;
}

.frente-button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 66px;
  margin: 0;
  padding: 13px 18px;
  background: #fff;
  border: 0;
  color: #173f67;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.frente-button:hover {
  background: #f8fafc;
}

.frente-button:focus {
  outline: none;
}

.frente-button:not(.collapsed) {
  background: #f5f8fb;
}

.frente-button::after {
  content: "";
  display: block;
  width: 9px;
  height: 9px;
  margin-left: 15px;
  border-right: 2px solid #668096;
  border-bottom: 2px solid #668096;
  transform: rotate(45deg);
  transition: transform .2s ease;
}

.frente-button:not(.collapsed)::after {
  transform: rotate(225deg);
}

.frente-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.frente-label {
  margin-bottom: 4px;
  color: #8a99a7;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}

.frente-name {
  display: block;
  overflow: hidden;
  color: #173f67;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frente-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 15px;
  margin-right: 5px;
  padding: 6px 11px;
  background: #fff8df;
  border: 1px solid #efdda5;
  border-radius: 20px;
  color: #896a00;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.frente-counter-number {
  color: #a87500;
  font-size: 13px;
  font-weight: 800;
}

.frente-counter-text {
  color: #896a00;
}

.accordion-collapse {
  overflow: hidden;
}

.accordion-body {
  padding: 0;
  background: #fff;
}

.task-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  background: #f7f9fb;
  border-bottom: 1px solid #e3e9ef;
}

.task-list-title {
  color: #173f67;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.task-list-description {
  margin-top: 3px;
  color: #7a8997;
  font-size: 12px;
  line-height: 1.4;
}

.task-total {
  flex-shrink: 0;
  padding: 6px 11px;
  background: #fff;
  border: 1px solid #d6e0e8;
  border-radius: 20px;
  color: #607385;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.task-total strong {
  color: #173f67;
  font-size: 13px;
}

.task-table-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.task-table {
  width: 100%;
  min-width: 980px;
  margin: 0;
  border-collapse: collapse;
  border-spacing: 0;
}

.task-table thead th {
  padding: 13px 15px;
  background: #fff;
  border-bottom: 2px solid #dfe6ec;
  color: #637789;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.3;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.task-table tbody td {
  padding: 15px;
  background: #fff;
  border-bottom: 1px solid #e7edf2;
  color: #34495e;
  font-size: 12px;
  line-height: 1.45;
  vertical-align: middle;
}

.task-table tbody tr:last-child td {
  border-bottom: 0;
}

.task-row:hover td {
  background: #f8fbfd;
}

.task-column {
  width: 30%;
  min-width: 280px;
}

.related-column {
  width: 19%;
  min-width: 180px;
}

.date-column {
  width: 13%;
  min-width: 120px;
}

.status-column {
  width: 12%;
  min-width: 120px;
}

.responsible-column {
  width: 18%;
  min-width: 180px;
}

.action-column {
  width: 8%;
  min-width: 105px;
  text-align: center;
}

.task-main {
  max-width: 500px;
}

.task-title {
  margin-bottom: 5px;
  color: #173f67;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.task-description {
  color: #687b8c;
  font-size: 11px;
  line-height: 1.5;
}

.task-description-empty {
  color: #9aa7b3;
  font-style: italic;
}

.task-deadline {
  margin-top: 7px;
}

.deadline-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}

.deadline-success {
  background: #edf8f3;
  border: 1px solid #cfe9dc;
  color: #197a57;
}

.deadline-danger {
  background: #fff1f1;
  border: 1px solid #f0d0d0;
  color: #c74343;
}

.related-activity {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.related-content {
  min-width: 0;
}

.related-label {
  margin-bottom: 3px;
  color: #98a5b0;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.related-title {
  color: #34495e;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
}

.empty-value {
  color: #9aa7b3;
  font-size: 11px;
  font-style: italic;
}

.date-info {
  white-space: nowrap;
}

.date-main {
  color: #34495e;
  font-size: 12px;
  font-weight: 700;
}

.date-time {
  margin-top: 2px;
  color: #8c9aa6;
  font-size: 11px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  min-width: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-success {
  background: #edf8f3;
  border: 1px solid #cfe9dc;
  color: #197a57;
}

.status-warning {
  background: #fff8e5;
  border: 1px solid #f0dfae;
  color: #9b6b00;
}

.status-danger {
  background: #fff1f1;
  border: 1px solid #f0d0d0;
  color: #c74343;
}

.status-secondary {
  background: #f1f4f6;
  border: 1px solid #dde3e8;
  color: #697987;
}

.responsible-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.responsible-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.responsible-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  min-width: 29px;
  background: #edf3f8;
  border: 1px solid #d8e4ed;
  border-radius: 50%;
  color: #17466f;
  font-size: 10px;
  font-weight: 800;
}

.responsible-name {
  color: #536779;
  font-size: 11px;
  line-height: 1.35;
}

.task-detail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 33px;
  padding: 7px 11px;
  background: #f0f5f9;
  border: 1px solid #d5e1ea;
  border-radius: 6px;
  color: #17466f;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: all .2s ease;
}

.task-detail-btn:hover {
  background: #17466f;
  border-color: #17466f;
  color: #fff;
}

.front-empty {
  padding: 30px 20px;
  color: #8998a5;
  font-size: 12px;
  text-align: center;
}

.empty-state-card {
  padding: 55px 25px;
  background: #fff;
  border: 1px solid #dce4eb;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(23, 61, 98, .05);
}

.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 15px;
  background: #fff8df;
  border: 1px solid #efdda5;
  border-radius: 50%;
  color: #a87500;
  font-size: 20px;
}

.empty-state-card h5 {
  margin: 0 0 7px;
  color: #173f67;
  font-size: 18px;
  font-weight: 700;
}

.empty-state-card p {
  margin: 0 0 18px;
  color: #718096;
  font-size: 13px;
}

.pagination-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
}

.pagination-info {
  color: #8998a5;
  font-size: 12px;
}

.pagination-info strong {
  color: #34495e;
}

.pagination-buttons {
  display: flex;
  gap: 8px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 35px;
  padding: 7px 13px;
  background: #fff;
  border: 1px solid #d4dee7;
  border-radius: 6px;
  color: #17466f;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s ease;
}

.pagination-btn:hover {
  background: #f1f6fa;
  border-color: #b9cad8;
  color: #17466f;
}

@media(max-width:1100px) {
  .tareas-container {
    padding: 28px 28px 40px;
  }

  .page-title {
    font-size: 29px;
  }

  .filters-body form>div:first-child {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters-body form>div:first-child>div:nth-child(4) {
    grid-column: 1/-1;
  }

  .task-table {
    min-width: 980px;
  }
}

@media(max-width:768px) {
  .tareas-container {
    padding: 22px 18px 35px;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 24px;
  }

  .page-header .custom-btn {
    width: 100%;
  }

  .page-title {
    font-size: 27px;
  }

  .page-subtitle {
    font-size: 13px;
  }

  .filters-card {
    margin-bottom: 20px;
  }

  .filters-header {
    padding: 16px 18px;
  }

  .filters-body {
    padding: 18px;
  }

  .filters-body form>div:first-child {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .filters-body form>div:first-child>div:nth-child(4) {
    width: 100%;
  }

  .filter-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }

  .filter-actions .custom-btn,
  .filter-actions .clear-filter-btn {
    width: 100%;
  }

  .frentes-accordion {
    gap: 10px;
  }

  .frente-button {
    min-height: 60px;
    padding: 11px 13px;
  }

  .frente-name {
    font-size: 14px;
  }

  .frente-counter {
    margin-left: 8px;
    margin-right: 5px;
    padding: 6px 9px;
  }

  .frente-button::after {
    width: 8px;
    height: 8px;
    margin-left: 8px;
  }

  .task-list-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
    padding: 14px 16px;
  }

  .task-list-description {
    display: none;
  }

  .task-total {
    align-self: flex-start;
  }

  .task-table-wrapper {
    width: 100%;
    overflow-x: auto;
  }

  .task-table {
    width: 980px;
    min-width: 980px;
  }

  .pagination-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .pagination-info {
    text-align: center;
  }

  .pagination-buttons {
    justify-content: center;
  }
}

@media(max-width:576px) {
  .tareas-container {
    padding: 18px 12px 30px;
  }

  .page-title {
    font-size: 24px;
  }

  .page-subtitle {
    font-size: 12px;
  }

  .filters-header {
    padding: 14px 15px;
  }

  .filters-body {
    padding: 15px;
  }

  .filters-title-text {
    font-size: 14px;
  }

  .filters-subtitle {
    font-size: 11px;
  }

  .frente-button {
    min-height: 56px;
    padding: 10px 11px;
  }

  .frente-label {
    font-size: 8px;
  }

  .frente-name {
    font-size: 13px;
  }

  .frente-counter {
    margin-left: 5px;
    padding: 5px 8px;
  }

  .frente-counter-text {
    display: none;
  }

  .task-list-toolbar {
    padding: 13px;
  }

  .task-list-title {
    font-size: 13px;
  }

  .task-total {
    font-size: 10px;
  }

  .empty-state-card {
    padding: 40px 18px;
  }

  .pagination-buttons {
    width: 100%;
  }

  .pagination-btn {
    flex: 1;
  }
}

@media(max-width:400px) {
  .tareas-container {
    padding: 16px 10px 25px;
  }

  .page-title {
    font-size: 22px;
  }

  .page-subtitle {
    font-size: 11px;
  }

  .frente-name {
    font-size: 12px;
  }

  .frente-counter {
    padding: 4px 7px;
  }
}

/* Espaciado uniforme */
.form-group {
  margin-bottom: 1rem;
}

/* Inputs más cómodos */
.form-group input,
.form-group select,
.form-group textarea {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
  width: 100%;
}

/* Textarea más alto */
textarea {
  min-height: 120px;
}

/* ====== Tarjeta principal ====== */
.custom-card {
  border-radius: 15px;
  border: none;
}

/* ====== Encabezado ====== */
.custom-header {
  background-color: #173D62;
  color: #ffffff;
  font-weight: bold;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
  padding: 15px 20px;
}

/* ====== Labels ====== */
.form-label {
  color: #173D62;
  font-weight: 600;
}

/* ====== Campos ====== */
.form-group input,
.form-group select,
.form-group textarea {
  border-radius: 8px;
  border: 1px solid #ced4da;
  padding: 10px;
  transition: all 0.2s ease-in-out;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #173D62;
  box-shadow: 0 0 0 0.2rem rgba(23, 61, 98, 0.25);
  outline: none;
}

/* ====== Botón guardar ====== */
.custom-btn {
  background-color: #173D62;
  border-color: #173D62;
  transition: background-color 0.3s ease;
}

.custom-btn:hover {
  background-color: #12508c;
  border-color: #12508c;
}

/* ====== Responsividad ====== */

/* Tablets (≤ 992px) */
@media (max-width: 992px) {
  .custom-card {
    margin: 10px;
  }
  .custom-header h3 {
    font-size: 1.25rem;
  }
}

/* Móviles (≤ 768px) */
@media (max-width: 768px) {
  .custom-card {
    margin: 5px;
    border-radius: 10px;
  }

  .custom-header {
    padding: 10px 15px;
    font-size: 1rem;
    text-align: center;
  }

  .form-label {
    font-size: 0.9rem;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 0.9rem;
    padding: 8px;
  }

  .d-flex.justify-content-end {
    flex-direction: column;
    gap: 10px;
  }

  .d-flex.justify-content-end a,
  .d-flex.justify-content-end button {
    width: 100%;
  }
}

/* Extra pequeños (≤ 480px) */
@media (max-width: 480px) {
  .custom-header h3 {
    font-size: 1rem;
  }

  .form-label {
    font-size: 0.85rem;
  }

  .custom-btn {
    font-size: 0.9rem;
    padding: 8px;
  }
}
