/* ============================================================
   ESTILOS COMPARTIDOS - Planner y Admin
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:300,400,500,600,700&display=swap");

* {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: #f5f5f5;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #d4d4d4;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a3a3a3;
}

/* ============================================================
   INPUTS
   ============================================================ */
.input-shad {
  border: 1.5px solid #e5e5e5;
  background: white;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  width: 100%;
  transition: all 0.15s;
  outline: none;
  color: #171717;
  appearance: none;
  -webkit-appearance: none;
}
.input-shad:focus {
  border-color: #171717;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}
.input-shad::placeholder {
  color: #a3a3a3;
}

/* ============================================================
   BOTONES
   ============================================================ */
.btn-shad {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
}
.btn-shad-primary {
  background: #171717;
  color: white;
}
.btn-shad-primary:hover {
  background: #262626;
}
.btn-shad-primary:active {
  transform: scale(0.97);
}
.btn-shad-secondary {
  background: #f5f5f5;
  color: #171717;
  border: 1.5px solid #e5e5e5;
}
.btn-shad-secondary:hover {
  background: #e5e5e5;
}
.btn-shad-danger {
  background: #dc2626;
  color: white;
}
.btn-shad-danger:hover {
  background: #b91c1c;
}
.btn-shad-success {
  background: #22c55e;
  color: white;
}
.btn-shad-success:hover {
  background: #16a34a;
}
.btn-shad-sm {
  padding: 6px 14px;
  font-size: 12px;
  min-height: 32px;
  min-width: 32px;
}
.btn-shad-block {
  width: 100%;
  justify-content: center;
}

/* ============================================================
   CHECKBOX
   ============================================================ */
.checkbox-shad {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid #d4d4d4;
  background: white;
  cursor: pointer;
  transition: all 0.15s;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex-shrink: 0;
  min-width: 20px;
}
.checkbox-shad:checked {
  background: #000;
  border-color: #000;
}
.checkbox-shad:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 13px;
  font-weight: 700;
}
.checkbox-shad:hover {
  border-color: #a3a3a3;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 80px;
  right: 16px;
  left: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: #171717;
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  animation: toastIn 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast-success {
  border-left: 4px solid #22c55e;
}
.toast-error {
  border-left: 4px solid #ef4444;
}
.toast-warning {
  border-left: 4px solid #f59e0b;
}
.toast-info {
  border-left: 4px solid #3b82f6;
}
.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.toast-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  margin-left: auto;
  transition: color 0.15s;
  touch-action: manipulation;
  -webkit-touch-callout: none;
}
.toast-close:hover {
  color: white;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}
.toast-out {
  animation: toastOut 0.25s ease-in forwards;
}

/* ============================================================
   LOGIN
   ============================================================ */
.login-container {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  padding: 16px;
}
.login-card {
  background: white;
  padding: 32px 24px;
  border-radius: 16px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e5e5;
}
.login-card h1 {
  font-size: 28px;
  font-weight: 700;
  color: #171717;
  margin-bottom: 4px;
}
.login-card .subtitle {
  color: #737373;
  font-size: 14px;
  margin-bottom: 24px;
}
.login-card .input-shad {
  margin-bottom: 14px;
  font-size: 16px; /* Evita zoom en iOS */
  padding: 14px 16px;
}
.login-card .btn-shad {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
  padding: 14px;
  font-size: 16px;
}
.login-card .demo-info {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e5e5e5;
  text-align: center;
  font-size: 12px;
  color: #a3a3a3;
}
.login-card .demo-info strong {
  color: #171717;
}
.login-container.hidden {
  display: none;
}

/* ============================================================
   ADMIN PANEL - MEJORADO RESPONSIVE
   ============================================================ */
.admin-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 12px;
}
.admin-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid #e5e5e5;
}
.admin-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: #171717;
}
.admin-header .user-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #737373;
}
.admin-header .user-info .username {
  font-weight: 600;
  color: #171717;
}
.admin-header .user-info a,
.admin-header .user-info button {
  font-size: 13px;
}

.admin-form {
  background: white;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-form .form-group {
  width: 100%;
}
.admin-form .form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #737373;
  margin-bottom: 4px;
}
.admin-form .form-group .input-shad {
  margin-bottom: 0;
  font-size: 16px;
}
.admin-form .checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.admin-form .checkbox-group label {
  font-size: 14px;
  color: #737373;
  cursor: pointer;
}
.admin-form .btn-shad {
  width: 100%;
  justify-content: center;
  padding: 14px;
  font-size: 15px;
}

.admin-table-wrapper {
  overflow-x: auto;
  margin: 0 -4px;
  padding: 0 4px;
}
.admin-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e5e5;
  font-size: 13px;
}
.admin-table th {
  background: #fafafa;
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: #737373;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e5e5e5;
}
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f5f5f5;
  color: #171717;
  vertical-align: middle;
}
.admin-table tr:last-child td {
  border-bottom: none;
}
.admin-table .actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.admin-table .badge-admin {
  background: #fef2f2;
  color: #dc2626;
  font-size: 10px;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 600;
}
.admin-table .badge-user {
  background: #f5f5f5;
  color: #737373;
  font-size: 10px;
  padding: 2px 10px;
  border-radius: 20px;
}
.admin-table .btn-shad-sm {
  font-size: 11px;
  padding: 4px 10px;
  min-height: 28px;
  min-width: 28px;
}

/* Modal reset password */
.modal-reset {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal-reset.active {
  display: flex;
}
.modal-reset .modal-content {
  background: white;
  padding: 24px 20px;
  border-radius: 16px;
  max-width: 400px;
  width: 100%;
  margin: auto;
}
.modal-reset .modal-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}
.modal-reset .modal-content p {
  font-size: 14px;
  color: #737373;
  margin-bottom: 16px;
}
.modal-reset .modal-content .input-shad {
  font-size: 16px;
  padding: 14px 16px;
}
.modal-reset .modal-content .actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.modal-reset .modal-content .actions .btn-shad {
  width: 100%;
  justify-content: center;
  padding: 14px;
}

/* ============================================================
   RESPONSIVE - BREAKPOINTS
   ============================================================ */

/* Tablets y pantallas medianas */
@media (min-width: 640px) {
  .admin-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 28px;
  }
  .admin-header h1 {
    font-size: 24px;
  }
  .admin-form {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 20px 24px;
    gap: 12px;
  }
  .admin-form .form-group {
    flex: 1;
    min-width: 150px;
  }
  .admin-form .btn-shad {
    width: auto;
    flex-shrink: 0;
    padding: 10px 20px;
  }
  .admin-table {
    min-width: auto;
    font-size: 14px;
  }
  .admin-table th,
  .admin-table td {
    padding: 12px 16px;
  }
  .modal-reset .modal-content .actions {
    flex-direction: row;
  }
  .modal-reset .modal-content .actions .btn-shad {
    width: auto;
    flex: 1;
  }
  .toast-container {
    right: 24px;
    left: auto;
    max-width: 380px;
    bottom: 80px;
  }
}

/* Escritorio */
@media (min-width: 1024px) {
  .admin-container {
    padding: 24px 20px;
  }
  .admin-header h1 {
    font-size: 28px;
  }
  .login-card {
    padding: 40px;
  }
}

/* ============================================================
   UTILIDADES RESPONSIVE ADICIONALES
   ============================================================ */

/* Ocultar en móvil */
.hide-mobile {
  display: none;
}
@media (min-width: 640px) {
  .hide-mobile {
    display: inline;
  }
}

/* Mostrar en móvil */
.show-mobile {
  display: inline;
}
@media (min-width: 640px) {
  .show-mobile {
    display: none;
  }
}

/* Texto responsivo */
.text-responsive {
  font-size: 14px;
}
@media (min-width: 640px) {
  .text-responsive {
    font-size: 16px;
  }
}

/* Grid responsive */
.grid-responsive {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 480px) {
  .grid-responsive {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 768px) {
  .grid-responsive {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* Stack responsive para botones */
.stack-mobile {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
@media (min-width: 640px) {
  .stack-mobile {
    flex-direction: row;
    gap: 12px;
  }
}
